@openparachute/notes-ui 0.1.6-rc.1 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/README.md +10 -10
  2. package/dist/.parachute/info +1 -1
  3. package/dist/assets/{Activity-emfYthZ3.js → Activity-B_Je-lCL.js} +1 -1
  4. package/dist/assets/{AddVault-D4Ms6ut5.js → AddVault-D0ySEVNg.js} +1 -1
  5. package/dist/assets/{AttachmentDropZone-CtLqer6a.js → AttachmentDropZone-CqhzolLE.js} +1 -1
  6. package/dist/assets/{Calendar-BjxwAlgU.js → Calendar-CoPaqJQB.js} +1 -1
  7. package/dist/assets/Import-CrWr1lWO.js +14 -0
  8. package/dist/assets/{NoteEditor-NUv70IvW.js → NoteEditor-D-bt-d63.js} +1 -1
  9. package/dist/assets/{NoteNew-CFht0Sz3.js → NoteNew-Dw7l1rjo.js} +1 -1
  10. package/dist/assets/{NoteRenderer-DgLW0CSH.js → NoteRenderer-uc1hZU0j.js} +1 -1
  11. package/dist/assets/{NoteView-BeIQL-yM.js → NoteView-CGGge5Bp.js} +2 -2
  12. package/dist/assets/{OAuthCallback-CtKETyZ3.js → OAuthCallback-D1ql8sDc.js} +1 -1
  13. package/dist/assets/{PinArchiveButtons-BqdHFy9s.js → PinArchiveButtons-DAjOG3J2.js} +1 -1
  14. package/dist/assets/{Settings-B8zw5w1x.js → Settings-DTa8sOyo.js} +1 -1
  15. package/dist/assets/{Tags-Bm39M6IW.js → Tags-F1LzSPLy.js} +1 -1
  16. package/dist/assets/{Today-LJ1VBKWk.js → Today-HA6so2M2.js} +1 -1
  17. package/dist/assets/{VaultGraph-CHeThQ7-.js → VaultGraph-XMhBSHMZ.js} +2 -2
  18. package/dist/assets/{Vaults-to8qLGsK.js → Vaults-N_zHHUue.js} +1 -1
  19. package/dist/assets/{index-B8ViFGIg.js → index-953EjlvE.js} +12 -12
  20. package/dist/assets/{react-force-graph-2d-BzkfkiHe.js → react-force-graph-2d-BhR6Ke_0.js} +1 -1
  21. package/dist/assets/{useAttachmentUploader-NHInAtE1.js → useAttachmentUploader-BQ3_bJ9p.js} +1 -1
  22. package/dist/index.html +1 -1
  23. package/dist/sw.js +1 -1
  24. package/package.json +2 -2
  25. package/dist/assets/Import-Sl3tzW7W.js +0 -12
@@ -1,4 +1,4 @@
1
- import{z as at,R as xo,r as bo}from"./index-B8ViFGIg.js";function wo(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function ko(e,n,r){return n=Eo(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e,n){return So(e)||wo(e,n)||ui(e,n)||Po()}function Ao(e){return Co(e)||Mo(e)||ui(e)||To()}function Co(e){if(Array.isArray(e))return gn(e)}function So(e){if(Array.isArray(e))return e}function Mo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ui(e,n){if(e){if(typeof e=="string")return gn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gn(e,n)}}function gn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function To(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ import{z as at,R as xo,r as bo}from"./index-953EjlvE.js";function wo(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n===0){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function ko(e,n,r){return n=Eo(n),n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Jn(e,n){return So(e)||wo(e,n)||ui(e,n)||Po()}function Ao(e){return Co(e)||Mo(e)||ui(e)||To()}function Co(e){if(Array.isArray(e))return gn(e)}function So(e){if(Array.isArray(e))return e}function Mo(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ui(e,n){if(e){if(typeof e=="string")return gn(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return gn(e,n)}}function gn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=new Array(n);r<n;r++)i[r]=e[r];return i}function To(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Po(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
3
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oo(e,n){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,n);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(e)}function Eo(e){var n=Oo(e,"string");return typeof n=="symbol"?n:String(n)}var zo=function(n,r){var i=new Set(r);return Object.assign.apply(Object,[{}].concat(Ao(Object.entries(n).filter(function(o){var a=Jn(o,1),s=a[0];return!i.has(s)}).map(function(o){var a=Jn(o,2),s=a[0],u=a[1];return ko({},s,u)}))))};function yn(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,i=Array(n);r<n;r++)i[r]=e[r];return i}function Ro(e){if(Array.isArray(e))return e}function No(e){if(Array.isArray(e))return yn(e)}function Io(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function $o(e,n){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,o,a,s,u=[],l=!0,f=!1;try{if(a=(r=r.call(e)).next,n!==0)for(;!(l=(i=a.call(r)).done)&&(u.push(i.value),u.length!==n);l=!0);}catch(h){f=!0,o=h}finally{try{if(!l&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(f)throw o}}return u}}function Do(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jo(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
@@ -1,4 +1,4 @@
1
- import{z as ne,t as oe,ae as Hf,Q as Kf,c as Jf,S as eu}from"./index-B8ViFGIg.js";const tu="image/png,image/jpeg,image/gif,image/webp,audio/wav,audio/mpeg,audio/mp4,audio/ogg,audio/webm,video/webm,.wav,.mp3,.m4a,.ogg,.webm,.png,.jpg,.jpeg,.gif,.webp";function dS({onPickFiles:r,label:e="Attach files…",className:t}){const i=ne.useRef(null);return oe.jsxs(oe.Fragment,{children:[oe.jsx("button",{type:"button",onClick:()=>{var n;return(n=i.current)==null?void 0:n.click()},className:t??"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",title:"Upload an attachment",children:e}),oe.jsx("input",{ref:i,type:"file",multiple:!0,accept:tu,className:"hidden",onChange:n=>{const s=Array.from(n.target.files??[]);s.length>0&&r(s),n.target.value=""}})]})}function pS({uploads:r,onCancel:e,onDismiss:t}){return r.length===0?null:oe.jsx("ul",{className:"space-y-2",children:r.map(i=>oe.jsxs("li",{className:"rounded-md border border-border bg-card/60 px-3 py-2 text-xs text-fg-muted",children:[oe.jsxs("div",{className:"flex items-center justify-between gap-2",children:[oe.jsx("span",{className:"truncate font-mono",title:i.filename,children:i.filename}),oe.jsx("span",{className:"shrink-0",children:iu(i)})]}),i.status==="uploading"?oe.jsx("div",{className:"mt-1 h-1 w-full overflow-hidden rounded bg-border/40",children:oe.jsx("div",{className:"h-full bg-accent transition-[width]",style:{width:`${Ma(i)}%`}})}):null,i.status==="error"&&i.error?oe.jsx("p",{className:"mt-1 text-red-400",children:i.error}):null,oe.jsx("div",{className:"mt-1 flex justify-end gap-2 text-xs",children:i.status==="uploading"||i.status==="linking"?oe.jsx("button",{type:"button",onClick:()=>e(i.id),className:"text-fg-dim hover:text-fg",children:"Cancel"}):oe.jsx("button",{type:"button",onClick:()=>t(i.id),className:"text-fg-dim hover:text-fg",children:"Dismiss"})})]},i.id))})}function Ma(r){return r.size===0?0:Math.min(100,Math.round(r.loaded/r.size*100))}function iu(r){switch(r.status){case"uploading":return`${Ma(r)}%`;case"linking":return"Linking…";case"done":return"Done";case"cancelled":return"Cancelled";case"error":return"Error"}}let Nn=[],ja=[];(()=>{let r="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<r.length;e++)(e%2?ja:Nn).push(t=t+r[e])})();function ru(r){if(r<768)return!1;for(let e=0,t=Nn.length;;){let i=e+t>>1;if(r<Nn[i])t=i;else if(r>=ja[i])e=i+1;else return!0;if(e==t)return!1}}function Xl(r){return r>=127462&&r<=127487}const Cl=8205;function nu(r,e,t=!0,i=!0){return(t?za:su)(r,e,i)}function za(r,e,t){if(e==r.length)return e;e&&La(r.charCodeAt(e))&&_a(r.charCodeAt(e-1))&&e--;let i=On(r,e);for(e+=Al(i);e<r.length;){let n=On(r,e);if(i==Cl||n==Cl||t&&ru(n))e+=Al(n),i=n;else if(Xl(n)){let s=0,l=e-2;for(;l>=0&&Xl(On(r,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function su(r,e,t){for(;e>0;){let i=za(r,e-2,t);if(i<e)return i;e--}return 0}function On(r,e){let t=r.charCodeAt(e);if(!_a(t)||e+1==r.length)return t;let i=r.charCodeAt(e+1);return La(i)?(t-55296<<10)+(i-56320)+65536:t}function La(r){return r>=56320&&r<57344}function _a(r){return r>=55296&&r<56320}function Al(r){return r<65536?1:2}class z{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Dt(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),Be.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Dt(this,e,t);let i=[];return this.decompose(e,t,i,0),Be.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new mi(this),s=new mi(e);for(let l=t,o=t;;){if(n.next(l),s.next(l),l=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(o+=n.value.length,n.done||o>=i)return!0}}iter(e=1){return new mi(this,e)}iterRange(e,t=this.length){return new Ya(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ea(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?z.empty:e.length<=32?new K(e):Be.from(K.split(e,[]))}}class K extends z{constructor(e,t=lu(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let s=0;;s++){let l=this.text[s],o=n+l.length;if((t?i:o)>=e)return new ou(n,o,i,l);n=o+1,i++}}decompose(e,t,i,n){let s=e<=0&&t>=this.length?this:new K(Rl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let l=i.pop(),o=mr(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new K(o,l.length+s.length));else{let a=o.length>>1;i.push(new K(o.slice(0,a)),new K(o.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof K))return super.replace(e,t,i);[e,t]=Dt(this,e,t);let n=mr(this.text,mr(i.text,Rl(this.text,0,e)),t),s=this.length+i.length-(t-e);return n.length<=32?new K(n,s):Be.from(K.split(n,[]),s)}sliceString(e,t=this.length,i=`
1
+ import{z as ne,t as oe,ae as Hf,Q as Kf,c as Jf,S as eu}from"./index-953EjlvE.js";const tu="image/png,image/jpeg,image/gif,image/webp,audio/wav,audio/mpeg,audio/mp4,audio/ogg,audio/webm,video/webm,.wav,.mp3,.m4a,.ogg,.webm,.png,.jpg,.jpeg,.gif,.webp";function dS({onPickFiles:r,label:e="Attach files…",className:t}){const i=ne.useRef(null);return oe.jsxs(oe.Fragment,{children:[oe.jsx("button",{type:"button",onClick:()=>{var n;return(n=i.current)==null?void 0:n.click()},className:t??"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",title:"Upload an attachment",children:e}),oe.jsx("input",{ref:i,type:"file",multiple:!0,accept:tu,className:"hidden",onChange:n=>{const s=Array.from(n.target.files??[]);s.length>0&&r(s),n.target.value=""}})]})}function pS({uploads:r,onCancel:e,onDismiss:t}){return r.length===0?null:oe.jsx("ul",{className:"space-y-2",children:r.map(i=>oe.jsxs("li",{className:"rounded-md border border-border bg-card/60 px-3 py-2 text-xs text-fg-muted",children:[oe.jsxs("div",{className:"flex items-center justify-between gap-2",children:[oe.jsx("span",{className:"truncate font-mono",title:i.filename,children:i.filename}),oe.jsx("span",{className:"shrink-0",children:iu(i)})]}),i.status==="uploading"?oe.jsx("div",{className:"mt-1 h-1 w-full overflow-hidden rounded bg-border/40",children:oe.jsx("div",{className:"h-full bg-accent transition-[width]",style:{width:`${Ma(i)}%`}})}):null,i.status==="error"&&i.error?oe.jsx("p",{className:"mt-1 text-red-400",children:i.error}):null,oe.jsx("div",{className:"mt-1 flex justify-end gap-2 text-xs",children:i.status==="uploading"||i.status==="linking"?oe.jsx("button",{type:"button",onClick:()=>e(i.id),className:"text-fg-dim hover:text-fg",children:"Cancel"}):oe.jsx("button",{type:"button",onClick:()=>t(i.id),className:"text-fg-dim hover:text-fg",children:"Dismiss"})})]},i.id))})}function Ma(r){return r.size===0?0:Math.min(100,Math.round(r.loaded/r.size*100))}function iu(r){switch(r.status){case"uploading":return`${Ma(r)}%`;case"linking":return"Linking…";case"done":return"Done";case"cancelled":return"Cancelled";case"error":return"Error"}}let Nn=[],ja=[];(()=>{let r="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<r.length;e++)(e%2?ja:Nn).push(t=t+r[e])})();function ru(r){if(r<768)return!1;for(let e=0,t=Nn.length;;){let i=e+t>>1;if(r<Nn[i])t=i;else if(r>=ja[i])e=i+1;else return!0;if(e==t)return!1}}function Xl(r){return r>=127462&&r<=127487}const Cl=8205;function nu(r,e,t=!0,i=!0){return(t?za:su)(r,e,i)}function za(r,e,t){if(e==r.length)return e;e&&La(r.charCodeAt(e))&&_a(r.charCodeAt(e-1))&&e--;let i=On(r,e);for(e+=Al(i);e<r.length;){let n=On(r,e);if(i==Cl||n==Cl||t&&ru(n))e+=Al(n),i=n;else if(Xl(n)){let s=0,l=e-2;for(;l>=0&&Xl(On(r,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function su(r,e,t){for(;e>0;){let i=za(r,e-2,t);if(i<e)return i;e--}return 0}function On(r,e){let t=r.charCodeAt(e);if(!_a(t)||e+1==r.length)return t;let i=r.charCodeAt(e+1);return La(i)?(t-55296<<10)+(i-56320)+65536:t}function La(r){return r>=56320&&r<57344}function _a(r){return r>=55296&&r<56320}function Al(r){return r<65536?1:2}class z{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Dt(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),Be.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Dt(this,e,t);let i=[];return this.decompose(e,t,i,0),Be.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),n=new mi(this),s=new mi(e);for(let l=t,o=t;;){if(n.next(l),s.next(l),l=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(o+=n.value.length,n.done||o>=i)return!0}}iter(e=1){return new mi(this,e)}iterRange(e,t=this.length){return new Ya(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ea(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?z.empty:e.length<=32?new K(e):Be.from(K.split(e,[]))}}class K extends z{constructor(e,t=lu(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let s=0;;s++){let l=this.text[s],o=n+l.length;if((t?i:o)>=e)return new ou(n,o,i,l);n=o+1,i++}}decompose(e,t,i,n){let s=e<=0&&t>=this.length?this:new K(Rl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let l=i.pop(),o=mr(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new K(o,l.length+s.length));else{let a=o.length>>1;i.push(new K(o.slice(0,a)),new K(o.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof K))return super.replace(e,t,i);[e,t]=Dt(this,e,t);let n=mr(this.text,mr(i.text,Rl(this.text,0,e)),t),s=this.length+i.length-(t-e);return n.length<=32?new K(n,s):Be.from(K.split(n,[]),s)}sliceString(e,t=this.length,i=`
2
2
  `){[e,t]=Dt(this,e,t);let n="";for(let s=0,l=0;s<=t&&l<this.text.length;l++){let o=this.text[l],a=s+o.length;s>e&&l&&(n+=i),e<a&&t>s&&(n+=o.slice(Math.max(0,e-s),t-s)),s=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let s of e)i.push(s),n+=s.length+1,i.length==32&&(t.push(new K(i,n)),i=[],n=-1);return n>-1&&t.push(new K(i,n)),t}}class Be extends z{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,n){for(let s=0;;s++){let l=this.children[s],o=n+l.length,a=i+l.lines-1;if((t?a:o)>=e)return l.lineInner(e,t,i,n);n=o+1,i=a+1}}decompose(e,t,i,n){for(let s=0,l=0;l<=t&&s<this.children.length;s++){let o=this.children[s],a=l+o.length;if(e<=a&&t>=l){let h=n&((l<=e?1:0)|(a>=t?2:0));l>=e&&a<=t&&!h?i.push(o):o.decompose(e-l,t-l,i,h)}l=a+1}}replace(e,t,i){if([e,t]=Dt(this,e,t),i.lines<this.lines)for(let n=0,s=0;n<this.children.length;n++){let l=this.children[n],o=s+l.length;if(e>=s&&t<=o){let a=l.replace(e-s,t-s,i),h=this.lines-l.lines+a.lines;if(a.lines<h>>4&&a.lines>h>>6){let c=this.children.slice();return c[n]=a,new Be(c,this.length-(t-e)+i.length)}return super.replace(s,o,a)}s=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
3
3
  `){[e,t]=Dt(this,e,t);let n="";for(let s=0,l=0;s<this.children.length&&l<=t;s++){let o=this.children[s],a=l+o.length;l>e&&s&&(n+=i),e<a&&t>l&&(n+=o.sliceString(e-l,t-l,i)),l=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Be))return 0;let i=0,[n,s,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==l||s==o)return i;let a=this.children[n],h=e.children[s];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let O of e)i+=O.lines;if(i<32){let O=[];for(let d of e)d.flatten(O);return new K(O,t)}let n=Math.max(32,i>>5),s=n<<1,l=n>>1,o=[],a=0,h=-1,c=[];function f(O){let d;if(O.lines>s&&O instanceof Be)for(let p of O.children)f(p);else O.lines>l&&(a>l||!a)?(u(),o.push(O)):O instanceof K&&a&&(d=c[c.length-1])instanceof K&&O.lines+d.lines<=32?(a+=O.lines,h+=O.length+1,c[c.length-1]=new K(d.text.concat(O.text),d.length+1+O.length)):(a+O.lines>n&&u(),a+=O.lines,h+=O.length+1,c.push(O))}function u(){a!=0&&(o.push(c.length==1?c[0]:Be.from(c,h)),h=-1,a=c.length=0)}for(let O of e)f(O);return u(),o.length==1?o[0]:new Be(o,t)}}z.empty=new K([""],0);function lu(r){let e=-1;for(let t of r)e+=t.length+1;return e}function mr(r,e,t=0,i=1e9){for(let n=0,s=0,l=!0;s<r.length&&n<=i;s++){let o=r[s],a=n+o.length;a>=t&&(a>i&&(o=o.slice(0,i-n)),n<t&&(o=o.slice(t-n)),l?(e[e.length-1]+=o,l=!1):e.push(o)),n=a+1}return e}function Rl(r,e,t){return mr(r,[""],e,t)}class mi{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof K?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],s=this.offsets[i],l=s>>1,o=n instanceof K?n.text.length:n.children.length;if(l==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
4
4
  `,this;e--}else if(n instanceof K){let a=n.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=n.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof K?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Ya{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new mi(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Ea{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(z.prototype[Symbol.iterator]=function(){return this.iter()},mi.prototype[Symbol.iterator]=Ya.prototype[Symbol.iterator]=Ea.prototype[Symbol.iterator]=function(){return this});let ou=class{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}};function Dt(r,e,t){return e=Math.max(0,Math.min(r.length,e)),[e,Math.max(e,Math.min(r.length,t))]}function he(r,e,t=!0,i=!0){return nu(r,e,t,i)}function au(r){return r>=56320&&r<57344}function hu(r){return r>=55296&&r<56320}function cu(r,e){let t=r.charCodeAt(e);if(!hu(t)||e+1==r.length)return t;let i=r.charCodeAt(e+1);return au(i)?(t-55296<<10)+(i-56320)+65536:t}function fu(r){return r<65536?1:2}const Un=/\r\n?|\n/;var Oe=(function(r){return r[r.Simple=0]="Simple",r[r.TrackDel=1]="TrackDel",r[r.TrackBefore=2]="TrackBefore",r[r.TrackAfter=3]="TrackAfter",r})(Oe||(Oe={}));class Ue{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,n=0;t<this.sections.length;){let s=this.sections[t++],l=this.sections[t++];l<0?(e(i,n,s),n+=s):n+=l,i+=s}}iterChangedRanges(e,t=!1){Fn(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];n<0?e.push(i,n):e.push(n,i)}return new Ue(e)}composeDesc(e){return this.empty?e:e.empty?this:Va(this,e)}mapDesc(e,t=!1){return e.empty?this:Hn(this,e,t)}mapPos(e,t=-1,i=Oe.Simple){let n=0,s=0;for(let l=0;l<this.sections.length;){let o=this.sections[l++],a=this.sections[l++],h=n+o;if(a<0){if(h>e)return s+(e-n);s+=o}else{if(i!=Oe.Simple&&h>=e&&(i==Oe.TrackDel&&n<e&&h>e||i==Oe.TrackBefore&&n<e||i==Oe.TrackAfter&&h>e))return null;if(h>e||h==e&&t<0&&!o)return e==n||t<0?s:s+a;s+=a}n=h}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let i=0,n=0;i<this.sections.length&&n<=t;){let s=this.sections[i++],l=this.sections[i++],o=n+s;if(l>=0&&n<=t&&o>=e)return n<e&&o>t?"cover":!0;n=o}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+i+(n>=0?":"+n:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Ue(e)}static create(e){return new Ue(e)}}class te extends Ue{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Fn(this,(t,i,n,s,l)=>e=e.replace(n,n+(i-t),l),!1),e}mapDesc(e,t=!1){return Hn(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,s=0;n<t.length;n+=2){let l=t[n],o=t[n+1];if(o>=0){t[n]=o,t[n+1]=l;let a=n>>1;for(;i.length<a;)i.push(z.empty);i.push(l?e.slice(s,s+l):z.empty)}s+=l}return new te(t,i)}compose(e){return this.empty?e:e.empty?this:Va(this,e,!0)}map(e,t=!1){return e.empty?this:Hn(this,e,t,!0)}iterChanges(e,t=!1){Fn(this,e,t)}get desc(){return Ue.create(this.sections)}filter(e){let t=[],i=[],n=[],s=new wi(this);e:for(let l=0,o=0;;){let a=l==e.length?1e9:e[l++];for(;o<a||o==a&&s.len==0;){if(s.done)break e;let c=Math.min(s.len,a-o);ae(n,c,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;ae(t,c,f),f>0&&Ot(i,t,s.text),s.forward(c),o+=c}let h=e[l++];for(;o<h;){if(s.done)break e;let c=Math.min(s.len,h-o);ae(t,c,-1),ae(n,c,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(c),o+=c}}return{changes:new te(t,i),filtered:Ue.create(n)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],n=this.sections[t+1];n<0?e.push(i):n==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let n=[],s=[],l=0,o=null;function a(c=!1){if(!c&&!n.length)return;l<t&&ae(n,t-l,-1);let f=new te(n,s);o=o?o.compose(f.map(o)):f,n=[],s=[],l=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof te){if(c.length!=t)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${t})`);a(),o=o?o.compose(c.map(o)):c}else{let{from:f,to:u=f,insert:O}=c;if(f>u||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let d=O?typeof O=="string"?z.of(O.split(i||Un)):O:z.empty,p=d.length;if(f==u&&p==0)return;f<l&&a(),f>l&&ae(n,f-l,-1),ae(n,u-f,p),Ot(s,n,d),l=u}}return h(e),a(!o),o}static empty(e){return new te(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;n<e.length;n++){let s=e[n];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((l,o)=>o&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length<n;)i.push(z.empty);i[n]=z.of(s.slice(1)),t.push(s[0],i[n].length)}}}return new te(t,i)}static createSet(e,t){return new te(e,t)}}function ae(r,e,t,i=!1){if(e==0&&t<=0)return;let n=r.length-2;n>=0&&t<=0&&t==r[n+1]?r[n]+=e:n>=0&&e==0&&r[n]==0?r[n+1]+=t:i?(r[n]+=e,r[n+1]+=t):r.push(e,t)}function Ot(r,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<r.length)r[r.length-1]=r[r.length-1].append(t);else{for(;r.length<i;)r.push(z.empty);r.push(t)}}function Fn(r,e,t){let i=r.inserted;for(let n=0,s=0,l=0;l<r.sections.length;){let o=r.sections[l++],a=r.sections[l++];if(a<0)n+=o,s+=o;else{let h=n,c=s,f=z.empty;for(;h+=o,c+=a,a&&i&&(f=f.append(i[l-2>>1])),!(t||l==r.sections.length||r.sections[l+1]<0);)o=r.sections[l++],a=r.sections[l++];e(n,h,s,c,f),n=h,s=c}}}function Hn(r,e,t,i=!1){let n=[],s=i?[]:null,l=new wi(r),o=new wi(e);for(let a=-1;;){if(l.done&&o.len||o.done&&l.len)throw new Error("Mismatched change set lengths");if(l.ins==-1&&o.ins==-1){let h=Math.min(l.len,o.len);ae(n,h,-1),l.forward(h),o.forward(h)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len<l.len||o.len==l.len&&!t))){let h=o.len;for(ae(n,o.ins,-1);h;){let c=Math.min(l.len,h);l.ins>=0&&a<l.i&&l.len<=c&&(ae(n,0,l.ins),s&&Ot(s,n,l.text),a=l.i),l.forward(c),h-=c}o.next()}else if(l.ins>=0){let h=0,c=l.len;for(;c;)if(o.ins==-1){let f=Math.min(c,o.len);h+=f,c-=f,o.forward(f)}else if(o.ins==0&&o.len<c)c-=o.len,o.next();else break;ae(n,h,a<l.i?l.ins:0),s&&a<l.i&&Ot(s,n,l.text),a=l.i,l.forward(l.len-c)}else{if(l.done&&o.done)return s?te.createSet(n,s):Ue.create(n);throw new Error("Mismatched change set lengths")}}}function Va(r,e,t=!1){let i=[],n=t?[]:null,s=new wi(r),l=new wi(e);for(let o=!1;;){if(s.done&&l.done)return n?te.createSet(i,n):Ue.create(i);if(s.ins==0)ae(i,s.len,0,o),s.next();else if(l.len==0&&!l.done)ae(i,0,l.ins,o),n&&Ot(n,i,l.text),l.next();else{if(s.done||l.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,l.len),h=i.length;if(s.ins==-1){let c=l.ins==-1?-1:l.off?0:l.ins;ae(i,a,c,o),n&&c&&Ot(n,i,l.text)}else l.ins==-1?(ae(i,s.off?0:s.len,a,o),n&&Ot(n,i,s.textBit(a))):(ae(i,s.off?0:s.len,l.off?0:l.ins,o),n&&!l.off&&Ot(n,i,l.text));o=(s.ins>a||l.ins>=0&&l.len>a)&&(o||i.length>h),s.forward2(a),l.forward(a)}}}}class wi{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?z.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?z.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class vt{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let i,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new vt(i,n,this.flags)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return k.range(e,t,void 0,void 0,i);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return k.range(this.anchor,n,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return k.range(e.anchor,e.head)}static create(e,t,i){return new vt(e,t,i)}}class k{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:k.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new k([this.main],0)}addRange(e,t=!0){return k.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,k.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new k(e.ranges.map(t=>vt.fromJSON(t)),e.main)}static single(e,t=e){return new k([k.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<e.length;n++){let s=e[n];if(s.empty?s.from<=i:s.from<i)return k.normalized(e.slice(),t);i=s.to}return new k(e,t)}static cursor(e,t=0,i,n){return vt.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i))|(n??16777215)<<6)}static range(e,t,i,n,s){let l=(i??16777215)<<6|(n==null?7:Math.min(6,n));return!s&&e!=t&&(s=t<e?1:-1),t<e?vt.create(t,e,48|l):vt.create(e,t,(s?s<0?8:16:0)|l)}static normalized(e,t=0){let i=e[t];e.sort((n,s)=>n.from-s.from),t=e.indexOf(i);for(let n=1;n<e.length;n++){let s=e[n],l=e[n-1];if(s.empty?s.from<=l.to:s.from<l.to){let o=l.from,a=Math.max(s.to,l.to);n<=t&&t--,e.splice(--n,2,s.anchor>s.head?k.range(a,o):k.range(o,a))}}return new k(e,t)}}function Wa(r,e){for(let t of r.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let qs=0;class X{constructor(e,t,i,n,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=qs++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new X(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Ds),!!e.static,e.enables)}of(e){return new Sr([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Sr(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Sr(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Ds(r,e){return r==e||r.length==e.length&&r.every((t,i)=>t===e[i])}class Sr{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=qs++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,s=this.id,l=e[s]>>1,o=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&c.push(e[f.id]);return{create(f){return f.values[l]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Kn(f,c)){let O=i(f);if(o?!Ml(O,f.values[l],n):!n(O,f.values[l]))return f.values[l]=O,1}return 0},reconfigure:(f,u)=>{let O,d=u.config.address[s];if(d!=null){let p=Tr(u,d);if(this.dependencies.every(m=>m instanceof X?u.facet(m)===f.facet(m):m instanceof lt?u.field(m,!1)==f.field(m,!1):!0)||(o?Ml(O=i(f),p,n):n(O=i(f),p)))return f.values[l]=p,0}else O=i(f);return f.values[l]=O,1}}}}function Ml(r,e,t){if(r.length!=e.length)return!1;for(let i=0;i<r.length;i++)if(!t(r[i],e[i]))return!1;return!0}function Kn(r,e){let t=!1;for(let i of e)Si(r,i)&1&&(t=!0);return t}function uu(r,e,t){let i=t.map(a=>r[a.id]),n=t.map(a=>a.type),s=i.filter(a=>!(a&1)),l=r[e.id]>>1;function o(a){let h=[];for(let c=0;c<i.length;c++){let f=Tr(a,i[c]);if(n[c]==2)for(let u of f)h.push(u);else h.push(f)}return e.combine(h)}return{create(a){for(let h of i)Si(a,h);return a.values[l]=o(a),1},update(a,h){if(!Kn(a,s))return 0;let c=o(a);return e.compare(c,a.values[l])?0:(a.values[l]=c,1)},reconfigure(a,h){let c=Kn(a,i),f=h.config.facets[e.id],u=h.facet(e);if(f&&!c&&Ds(t,f))return a.values[l]=u,0;let O=o(a);return e.compare(O,u)?(a.values[l]=u,0):(a.values[l]=O,1)}}}const Ji=X.define({static:!0});class lt{constructor(e,t,i,n,s){this.id=e,this.createF=t,this.updateF=i,this.compareF=n,this.spec=s,this.provides=void 0}static define(e){let t=new lt(qs++,e.create,e.update,e.compare||((i,n)=>i===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Ji).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,n)=>{let s=i.values[t],l=this.updateF(s,n);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,n)=>{let s=i.facet(Ji),l=n.facet(Ji),o;return(o=s.find(a=>a.field==this))&&o!=l.find(a=>a.field==this)?(i.values[t]=o.create(i),1):n.config.address[this.id]!=null?(i.values[t]=n.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Ji.of({field:this,create:e})]}get extension(){return this}}const $t={lowest:4,low:3,default:2,high:1,highest:0};function li(r){return e=>new Ba(e,r)}const Ei={highest:li($t.highest),high:li($t.high),default:li($t.default),low:li($t.low),lowest:li($t.lowest)};class Ba{constructor(e,t){this.inner=e,this.prec=t}}class Kr{of(e){return new Jn(this,e)}reconfigure(e){return Kr.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Jn{constructor(e,t){this.compartment=e,this.inner=t}}class vr{constructor(e,t,i,n,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let n=[],s=Object.create(null),l=new Map;for(let u of Ou(e,t,l))u instanceof lt?n.push(u):(s[u.facet.id]||(s[u.facet.id]=[])).push(u);let o=Object.create(null),a=[],h=[];for(let u of n)o[u.id]=h.length<<1,h.push(O=>u.slot(O));let c=i==null?void 0:i.config.facets;for(let u in s){let O=s[u],d=O[0].facet,p=c&&c[u]||[];if(O.every(m=>m.type==0))if(o[d.id]=a.length<<1|1,Ds(p,O))a.push(i.facet(d));else{let m=d.combine(O.map(S=>S.value));a.push(i&&d.compare(m,i.facet(d))?i.facet(d):m)}else{for(let m of O)m.type==0?(o[m.id]=a.length<<1|1,a.push(m.value)):(o[m.id]=h.length<<1,h.push(S=>m.dynamicSlot(S)));o[d.id]=h.length<<1,h.push(m=>uu(m,d,O))}}let f=h.map(u=>u(o));return new vr(e,l,f,o,a,s)}}function Ou(r,e,t){let i=[[],[],[],[],[]],n=new Map;function s(l,o){let a=n.get(l);if(a!=null){if(a<=o)return;let h=i[a].indexOf(l);h>-1&&i[a].splice(h,1),l instanceof Jn&&t.delete(l.compartment)}if(n.set(l,o),Array.isArray(l))for(let h of l)s(h,o);else if(l instanceof Jn){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(l.compartment)||l.inner;t.set(l.compartment,h),s(h,o)}else if(l instanceof Ba)s(l.inner,l.prec);else if(l instanceof lt)i[o].push(l),l.provides&&s(l.provides,o);else if(l instanceof Sr)i[o].push(l),l.facet.extensions&&s(l.facet.extensions,$t.default);else{let h=l.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(h,o)}}return s(r,$t.default),i.reduce((l,o)=>l.concat(o))}function Si(r,e){if(e&1)return 2;let t=e>>1,i=r.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;r.status[t]=4;let n=r.computeSlot(r,r.config.dynamicSlots[t]);return r.status[t]=2|n}function Tr(r,e){return e&1?r.config.staticValues[e>>1]:r.values[e>>1]}const qa=X.define(),es=X.define({combine:r=>r.some(e=>e),static:!0}),Da=X.define({combine:r=>r.length?r[0]:void 0,static:!0}),Ia=X.define(),Ga=X.define(),Na=X.define(),Ua=X.define({combine:r=>r.length?r[0]:!1});class ot{constructor(e,t){this.type=e,this.value=t}static define(){return new du}}class du{of(e){return new ot(this,e)}}class pu{constructor(e){this.map=e}of(e){return new I(this,e)}}class I{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new I(this.type,t)}is(e){return this.type==e}static define(e={}){return new pu(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let s=n.map(t);s&&i.push(s)}return i}}I.reconfigure=I.define();I.appendConfig=I.define();class ee{constructor(e,t,i,n,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&Wa(i,t.newLength),s.some(o=>o.type==ee.time)||(this.annotations=s.concat(ee.time.of(Date.now())))}static create(e,t,i,n,s,l){return new ee(e,t,i,n,s,l)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(ee.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ee.time=ot.define();ee.userEvent=ot.define();ee.addToHistory=ot.define();ee.remote=ot.define();function gu(r,e){let t=[];for(let i=0,n=0;;){let s,l;if(i<r.length&&(n==e.length||e[n]>=r[i]))s=r[i++],l=r[i++];else if(n<e.length)s=e[n++],l=e[n++];else return t;!t.length||t[t.length-1]<s?t.push(s,l):t[t.length-1]<l&&(t[t.length-1]=l)}}function Fa(r,e,t){var i;let n,s,l;return t?(n=e.changes,s=te.empty(e.changes.length),l=r.changes.compose(e.changes)):(n=e.changes.map(r.changes),s=r.changes.mapDesc(e.changes,!0),l=r.changes.compose(n)),{changes:l,selection:e.selection?e.selection.map(s):(i=r.selection)===null||i===void 0?void 0:i.map(n),effects:I.mapEffects(r.effects,n).concat(I.mapEffects(e.effects,s)),annotations:r.annotations.length?r.annotations.concat(e.annotations):e.annotations,scrollIntoView:r.scrollIntoView||e.scrollIntoView}}function ts(r,e,t){let i=e.selection,n=Yt(e.annotations);return e.userEvent&&(n=n.concat(ee.userEvent.of(e.userEvent))),{changes:e.changes instanceof te?e.changes:te.of(e.changes||[],t,r.facet(Da)),selection:i&&(i instanceof k?i:k.single(i.anchor,i.head)),effects:Yt(e.effects),annotations:n,scrollIntoView:!!e.scrollIntoView}}function Ha(r,e,t){let i=ts(r,e.length?e[0]:{},r.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let l=!!e[s].sequential;i=Fa(i,ts(r,e[s],l?i.changes.newLength:r.doc.length),l)}let n=ee.create(r,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return Su(t?mu(n):n)}function mu(r){let e=r.startState,t=!0;for(let n of e.facet(Ia)){let s=n(r);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:gu(t,s))}if(t!==!0){let n,s;if(t===!1)s=r.changes.invertedDesc,n=te.empty(e.doc.length);else{let l=r.changes.filter(t);n=l.changes,s=l.filtered.mapDesc(l.changes).invertedDesc}r=ee.create(e,n,r.selection&&r.selection.map(s),I.mapEffects(r.effects,s),r.annotations,r.scrollIntoView)}let i=e.facet(Ga);for(let n=i.length-1;n>=0;n--){let s=i[n](r);s instanceof ee?r=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ee?r=s[0]:r=Ha(e,Yt(s),!1)}return r}function Su(r){let e=r.startState,t=e.facet(Na),i=r;for(let n=t.length-1;n>=0;n--){let s=t[n](r);s&&Object.keys(s).length&&(i=Fa(i,ts(e,s,r.changes.newLength),!0))}return i==r?r:ee.create(e,r.changes,r.selection,i.effects,i.annotations,i.scrollIntoView)}const Qu=[];function Yt(r){return r==null?Qu:Array.isArray(r)?r:[r]}var tt=(function(r){return r[r.Word=0]="Word",r[r.Space=1]="Space",r[r.Other=2]="Other",r})(tt||(tt={}));const ku=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let is;try{is=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function bu(r){if(is)return is.test(r);for(let e=0;e<r.length;e++){let t=r[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||ku.test(t)))return!0}return!1}function yu(r){return e=>{if(!/\S/.test(e))return tt.Space;if(bu(e))return tt.Word;for(let t=0;t<r.length;t++)if(e.indexOf(r[t])>-1)return tt.Word;return tt.Other}}class _{constructor(e,t,i,n,s,l){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let o=0;o<this.config.dynamicSlots.length;o++)Si(this,o<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Si(this,i),Tr(this,i)}update(...e){return Ha(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:n}=t;for(let o of e.effects)o.is(Kr.reconfigure)?(t&&(n=new Map,t.compartments.forEach((a,h)=>n.set(h,a)),t=null),n.set(o.value.compartment,o.value.extension)):o.is(I.reconfigure)?(t=null,i=o.value):o.is(I.appendConfig)&&(t=null,i=Yt(i).concat(o.value));let s;t?s=e.startState.values.slice():(t=vr.resolve(i,n,this),s=new _(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let l=e.startState.facet(es)?e.newSelection:e.newSelection.asSingle();new _(t,e.newDoc,l,s,(o,a)=>a.update(o,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:k.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),s=[i.range],l=Yt(i.effects);for(let o=1;o<t.ranges.length;o++){let a=e(t.ranges[o]),h=this.changes(a.changes),c=h.map(n);for(let u=0;u<o;u++)s[u]=s[u].map(c);let f=n.mapDesc(h,!0);s.push(a.range.map(f)),n=n.compose(c),l=I.mapEffects(l,c).concat(I.mapEffects(Yt(a.effects),f))}return{changes:n,selection:k.create(s,t.mainIndex),effects:l}}changes(e=[]){return e instanceof te?e:te.of(e,this.doc.length,this.facet(_.lineSeparator))}toText(e){return z.of(e.split(this.facet(_.lineSeparator)||Un))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Si(this,t),Tr(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let n=e[i];n instanceof lt&&this.config.address[n.id]!=null&&(t[i]=n.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i){for(let s in i)if(Object.prototype.hasOwnProperty.call(e,s)){let l=i[s],o=e[s];n.push(l.init(a=>l.spec.fromJSON(o,a)))}}return _.create({doc:e.doc,selection:k.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=vr.resolve(e.extensions||[],new Map),i=e.doc instanceof z?e.doc:z.of((e.doc||"").split(t.staticFacet(_.lineSeparator)||Un)),n=e.selection?e.selection instanceof k?e.selection:k.single(e.selection.anchor,e.selection.head):k.single(0);return Wa(n,i.length),t.staticFacet(es)||(n=n.asSingle()),new _(t,i,n,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(_.tabSize)}get lineBreak(){return this.facet(_.lineSeparator)||`
package/dist/index.html CHANGED
@@ -19,7 +19,7 @@
19
19
  } catch (e) {}
20
20
  })();
21
21
  </script>
22
- <script type="module" crossorigin src="./assets/index-B8ViFGIg.js"></script>
22
+ <script type="module" crossorigin src="./assets/index-953EjlvE.js"></script>
23
23
  <link rel="stylesheet" crossorigin href="./assets/index-By5JSkFz.css">
24
24
  <link rel="manifest" href="./manifest.webmanifest"></head>
25
25
  <body>
package/dist/sw.js CHANGED
@@ -1 +1 @@
1
- if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let a={};const o=e=>i(e,r),t={module:{uri:r},exports:a,require:o};s[r]=Promise.all(n.map(e=>t[e]||o(e))).then(e=>(l(...e),a))}}define(["./workbox-b9acee4e"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"},{url:"index.html",revision:"5321e90fc0b2cabed94a95d286d1aa13"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"assets/workbox-window.prod.es5-BBnX5xw4.js",revision:null},{url:"assets/useAttachmentUploader-NHInAtE1.js",revision:null},{url:"assets/react-force-graph-2d-BzkfkiHe.js",revision:null},{url:"assets/index-By5JSkFz.css",revision:null},{url:"assets/index-B8ViFGIg.js",revision:null},{url:"assets/dates-BGZoWpL2.js",revision:null},{url:"assets/Vaults-to8qLGsK.js",revision:null},{url:"assets/VaultGraph-CHeThQ7-.js",revision:null},{url:"assets/Today-LJ1VBKWk.js",revision:null},{url:"assets/Tags-Bm39M6IW.js",revision:null},{url:"assets/Settings-B8zw5w1x.js",revision:null},{url:"assets/PinArchiveButtons-BqdHFy9s.js",revision:null},{url:"assets/OAuthCallback-CtKETyZ3.js",revision:null},{url:"assets/NoteView-BeIQL-yM.js",revision:null},{url:"assets/NoteRenderer-DgLW0CSH.js",revision:null},{url:"assets/NoteNew-CFht0Sz3.js",revision:null},{url:"assets/NoteEditor-NUv70IvW.js",revision:null},{url:"assets/Import-Sl3tzW7W.js",revision:null},{url:"assets/Calendar-BjxwAlgU.js",revision:null},{url:"assets/AttachmentDropZone-CtLqer6a.js",revision:null},{url:"assets/AddVault-D4Ms6ut5.js",revision:null},{url:"assets/Activity-emfYthZ3.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/notes/index.html"),{denylist:[/^\/api\//,/^\/oauth\//,/^\/\.well-known\//]})),e.registerRoute(/^https:\/\/fonts\.(googleapis|gstatic)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts",plugins:[new e.ExpirationPlugin({maxEntries:30,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")});
1
+ if(!self.define){let e,s={};const i=(i,n)=>(i=new URL(i+".js",n).href,s[i]||new Promise(s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()}).then(()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e}));self.define=(n,l)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(s[r])return;let o={};const a=e=>i(e,r),t={module:{uri:r},exports:o,require:a};s[r]=Promise.all(n.map(e=>t[e]||a(e))).then(e=>(l(...e),o))}}define(["./workbox-b9acee4e"],function(e){"use strict";self.addEventListener("message",e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()}),e.precacheAndRoute([{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"},{url:"index.html",revision:"be4e7042fed0f40e7620c4bc3f6803e5"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"assets/workbox-window.prod.es5-BBnX5xw4.js",revision:null},{url:"assets/useAttachmentUploader-BQ3_bJ9p.js",revision:null},{url:"assets/react-force-graph-2d-BhR6Ke_0.js",revision:null},{url:"assets/index-By5JSkFz.css",revision:null},{url:"assets/index-953EjlvE.js",revision:null},{url:"assets/dates-BGZoWpL2.js",revision:null},{url:"assets/Vaults-N_zHHUue.js",revision:null},{url:"assets/VaultGraph-XMhBSHMZ.js",revision:null},{url:"assets/Today-HA6so2M2.js",revision:null},{url:"assets/Tags-F1LzSPLy.js",revision:null},{url:"assets/Settings-DTa8sOyo.js",revision:null},{url:"assets/PinArchiveButtons-DAjOG3J2.js",revision:null},{url:"assets/OAuthCallback-D1ql8sDc.js",revision:null},{url:"assets/NoteView-CGGge5Bp.js",revision:null},{url:"assets/NoteRenderer-uc1hZU0j.js",revision:null},{url:"assets/NoteNew-Dw7l1rjo.js",revision:null},{url:"assets/NoteEditor-D-bt-d63.js",revision:null},{url:"assets/Import-CrWr1lWO.js",revision:null},{url:"assets/Calendar-CoPaqJQB.js",revision:null},{url:"assets/AttachmentDropZone-CqhzolLE.js",revision:null},{url:"assets/AddVault-D0ySEVNg.js",revision:null},{url:"assets/Activity-B_Je-lCL.js",revision:null},{url:"apple-touch-icon-180x180.png",revision:"dd71bb172b849f6328130ba825ae606d"},{url:"favicon.ico",revision:"01d978be2c7b93a7348d91107b5bf8ad"},{url:"icon.svg",revision:"899549fbb9d379c3b78ab012abe72061"},{url:"maskable-icon-512x512.png",revision:"e0d671a48eed68b28f8e7ded8a86ef88"},{url:"pwa-192x192.png",revision:"ec3f52a07bade7b8a295997c236dac75"},{url:"pwa-512x512.png",revision:"ebdabf19d41be24e3f47062e89399c09"},{url:"pwa-64x64.png",revision:"52bb73fe0f7c4274aa55047dc0d5479d"},{url:"manifest.webmanifest",revision:"4e69789fa00f6df17850c3426d2041a9"}],{}),e.cleanupOutdatedCaches(),e.registerRoute(new e.NavigationRoute(e.createHandlerBoundToURL("/notes/index.html"),{denylist:[/^\/api\//,/^\/oauth\//,/^\/\.well-known\//]})),e.registerRoute(/^https:\/\/fonts\.(googleapis|gstatic)\.com\/.*/i,new e.StaleWhileRevalidate({cacheName:"google-fonts",plugins:[new e.ExpirationPlugin({maxEntries:30,maxAgeSeconds:2592e3}),new e.CacheableResponsePlugin({statuses:[0,200]})]}),"GET")});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openparachute/notes-ui",
3
- "version": "0.1.6-rc.1",
3
+ "version": "0.1.6",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Parachute Notes UI bundle \u2014 the SPA installed under parachute-surface as the canonical first app. No daemon, no module surface; just the built dist/.",
@@ -31,7 +31,7 @@
31
31
  "@codemirror/state": "^6.6.0",
32
32
  "@codemirror/view": "^6.41.1",
33
33
  "@lezer/highlight": "^1.2.3",
34
- "@openparachute/surface-client": "^0.1.0-rc.4",
34
+ "@openparachute/surface-client": "^0.1.0",
35
35
  "@tanstack/react-query": "^5",
36
36
  "highlight.js": "^11.11.1",
37
37
  "idb": "^8.0.3",
@@ -1,12 +0,0 @@
1
- import{m as kt,r as Ht,f as Gt,h as Vt,V as Kt,i as Tt,af as Yt,G as Xt,W as $t,ab as qt,z as gt,t as H,N as Jt,L as Qt}from"./index-B8ViFGIg.js";import{A as te}from"./AttachmentDropZone-CtLqer6a.js";function ee(E){return E.length===0?"unknown":E.some(Dt)?"obsidian-zip":E.some(At)?"loose-markdown":"unknown"}function Dt(E){return E.name.toLowerCase().endsWith(".zip")}function At(E){const D=E.name.toLowerCase();return D.endsWith(".md")||D.endsWith(".markdown")}const jt=/^---\r?\n/;function re(E){if(!jt.test(E))return{data:{},content:E};const D=E.replace(jt,""),o=D.search(/\r?\n---\r?\n|\r?\n---$/);if(o===-1)return{data:{},content:E};const k=D.slice(0,o),u=D.slice(o).replace(/^\r?\n---\r?\n?/,"");return{data:ne(k),content:u}}function ne(E){const D=E.split(/\r?\n/),o={};let k=0;for(;k<D.length;){const u=D[k]??"";if(u.trim()===""||u.trimStart().startsWith("#")){k++;continue}const i=u.match(/^([\w][\w.-]*)\s*:\s*(.*)$/);if(!i){k++;continue}const s=i[1],r=(i[2]??"").trim();if(r===""){const c=se(D,k+1);if(c!=null&&c.line.trimStart().startsWith("- ")){const{items:b,consumed:v}=ie(D,k+1,c.indent);o[s]=b,k=k+1+v}else o[s]="",k++}else o[s]=It(r),k++}return o}function ie(E,D,o){const k=[];let u=D;for(;u<E.length;){const i=E[u]??"";if(i.trim()===""){u++;continue}const s=Pt(i);if(s<o||!i.slice(s).startsWith("- "))break;const r=i.slice(s+2).trim();k.push(It(r)),u++}return{items:k,consumed:u-D}}function se(E,D){for(let o=D;o<E.length;o++){const k=E[o]??"";if(k.trim()!=="")return{line:k,indent:Pt(k)}}return null}function Pt(E){let D=0;for(;D<E.length&&E[D]===" ";)D++;return D}function It(E){if(E.length===0)return"";if(E.startsWith("[")&&E.endsWith("]")){const D=E.slice(1,-1).trim();return D===""?[]:ae(D).map(o=>It(o.trim()))}if(E.startsWith('"')&&E.endsWith('"')&&E.length>=2)return E.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\");if(E.startsWith("'")&&E.endsWith("'")&&E.length>=2)return E.slice(1,-1).replace(/''/g,"'");if(E==="true")return!0;if(E==="false")return!1;if(E==="null"||E==="~")return null;if(/^-?\d+(\.\d+)?$/.test(E)){const D=Number(E);return Number.isFinite(D)?D:E}return E}function ae(E){const D=[];let o=0,k=null,u=0;for(let i=0;i<E.length;i++){const s=E[i];if(k){s===k&&(k=null);continue}if(s==='"'||s==="'"){k=s;continue}s==="["?o++:s==="]"?o--:s===","&&o===0&&(D.push(E.slice(u,i)),u=i+1)}return D.push(E.slice(u)),D}function Ft(E){const{sourcePath:D,raw:o}=E,{data:k,content:u}=re(o),i=oe(k,D),s=St(k,"id"),r=St(k,"created_at")??St(k,"createdAt"),c=ce(k,u),b={};for(const[g,_]of Object.entries(k))g==="id"||g==="path"||g==="tags"||g==="created_at"||g==="createdAt"||(b[g]=_);const v={sourcePath:D,path:i,content:u,tags:c,metadata:b};return s&&(v.id=s),r&&(v.createdAt=r),v}function oe(E,D){const o=St(E,"path");return Rt(o||le(D))}function St(E,D){const o=E[D];if(typeof o=="string"&&o.trim()!=="")return o.trim()}function le(E){return E.replace(/\.(md|markdown)$/i,"")}function Rt(E){return E.replace(/\\/g,"/").replace(/\/+/g,"/").replace(/^\/+|\/+$/g,"")}const ue=/(?:^|\s)#([a-zA-Z][\w-]*)/g;function ce(E,D){const o=new Set,k=E.tags;if(Array.isArray(k))for(const u of k){const i=Ct(u);i&&o.add(i)}else if(typeof k=="string")for(const u of k.split(/[,\s]+/)){const i=Ct(u);i&&o.add(i)}for(const u of D.matchAll(ue)){const i=Ct(u[1]??"");i&&o.add(i)}return[...o]}function Ct(E){if(typeof E!="string")return typeof E=="number"||typeof E=="boolean"?String(E).toLowerCase():null;const D=E.trim().replace(/^#/,"").toLowerCase();return!D||!/^[a-z0-9_/-]+$/.test(D)?null:D}function he(E){return typeof E.text=="function"?E.text():new Promise((D,o)=>{const k=new FileReader;k.onload=()=>D(k.result),k.onerror=()=>o(k.error??new Error("FileReader failed")),k.readAsText(E)})}async function de(E){const D=[],o=[];for(const k of E){if(!At(k)){o.push({sourcePath:k.name,reason:"Not a markdown file (.md / .markdown) — skipped."});continue}try{const u=await he(k),i=k.webkitRelativePath||k.name,s=Ft({sourcePath:i,raw:u});D.push(s)}catch(u){o.push({sourcePath:k.name,reason:u instanceof Error?u.message:String(u)})}}return{format:"loose-markdown",notes:D,errors:o,tags:fe(D)}}function fe(E){const D=new Set;for(const o of E)for(const k of o.tags)D.add(k);return[...D].sort()}function xt(E){throw new Error('Could not dynamically require "'+E+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Et={exports:{}};/*!
2
-
3
- JSZip v3.10.1 - A JavaScript class for generating and reading zip files
4
- <http://stuartk.com/jszip>
5
-
6
- (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
7
- Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
8
-
9
- JSZip uses the library pako released under the MIT license :
10
- https://github.com/nodeca/pako/blob/main/LICENSE
11
- */var Bt;function pe(){return Bt||(Bt=1,(function(E,D){(function(o){E.exports=o()})(function(){return(function o(k,u,i){function s(b,v){if(!u[b]){if(!k[b]){var g=typeof xt=="function"&&xt;if(!v&&g)return g(b,!0);if(r)return r(b,!0);var _=new Error("Cannot find module '"+b+"'");throw _.code="MODULE_NOT_FOUND",_}var a=u[b]={exports:{}};k[b][0].call(a.exports,function(p){var n=k[b][1][p];return s(n||p)},a,a.exports,o,k,u,i)}return u[b].exports}for(var r=typeof xt=="function"&&xt,c=0;c<i.length;c++)s(i[c]);return s})({1:[function(o,k,u){var i=o("./utils"),s=o("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";u.encode=function(c){for(var b,v,g,_,a,p,n,d=[],l=0,m=c.length,w=m,z=i.getTypeOf(c)!=="string";l<c.length;)w=m-l,g=z?(b=c[l++],v=l<m?c[l++]:0,l<m?c[l++]:0):(b=c.charCodeAt(l++),v=l<m?c.charCodeAt(l++):0,l<m?c.charCodeAt(l++):0),_=b>>2,a=(3&b)<<4|v>>4,p=1<w?(15&v)<<2|g>>6:64,n=2<w?63&g:64,d.push(r.charAt(_)+r.charAt(a)+r.charAt(p)+r.charAt(n));return d.join("")},u.decode=function(c){var b,v,g,_,a,p,n=0,d=0,l="data:";if(c.substr(0,l.length)===l)throw new Error("Invalid base64 input, it looks like a data url.");var m,w=3*(c=c.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(c.charAt(c.length-1)===r.charAt(64)&&w--,c.charAt(c.length-2)===r.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(m=s.uint8array?new Uint8Array(0|w):new Array(0|w);n<c.length;)b=r.indexOf(c.charAt(n++))<<2|(_=r.indexOf(c.charAt(n++)))>>4,v=(15&_)<<4|(a=r.indexOf(c.charAt(n++)))>>2,g=(3&a)<<6|(p=r.indexOf(c.charAt(n++))),m[d++]=b,a!==64&&(m[d++]=v),p!==64&&(m[d++]=g);return m}},{"./support":30,"./utils":32}],2:[function(o,k,u){var i=o("./external"),s=o("./stream/DataWorker"),r=o("./stream/Crc32Probe"),c=o("./stream/DataLengthProbe");function b(v,g,_,a,p){this.compressedSize=v,this.uncompressedSize=g,this.crc32=_,this.compression=a,this.compressedContent=p}b.prototype={getContentWorker:function(){var v=new s(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new c("data_length")),g=this;return v.on("end",function(){if(this.streamInfo.data_length!==g.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new s(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},b.createWorkerFrom=function(v,g,_){return v.pipe(new r).pipe(new c("uncompressedSize")).pipe(g.compressWorker(_)).pipe(new c("compressedSize")).withStreamInfo("compression",g)},k.exports=b},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(o,k,u){var i=o("./stream/GenericWorker");u.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},u.DEFLATE=o("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(o,k,u){var i=o("./utils"),s=(function(){for(var r,c=[],b=0;b<256;b++){r=b;for(var v=0;v<8;v++)r=1&r?3988292384^r>>>1:r>>>1;c[b]=r}return c})();k.exports=function(r,c){return r!==void 0&&r.length?i.getTypeOf(r)!=="string"?(function(b,v,g,_){var a=s,p=_+g;b^=-1;for(var n=_;n<p;n++)b=b>>>8^a[255&(b^v[n])];return-1^b})(0|c,r,r.length,0):(function(b,v,g,_){var a=s,p=_+g;b^=-1;for(var n=_;n<p;n++)b=b>>>8^a[255&(b^v.charCodeAt(n))];return-1^b})(0|c,r,r.length,0):0}},{"./utils":32}],5:[function(o,k,u){u.base64=!1,u.binary=!1,u.dir=!1,u.createFolders=!0,u.date=null,u.compression=null,u.compressionOptions=null,u.comment=null,u.unixPermissions=null,u.dosPermissions=null},{}],6:[function(o,k,u){var i=null;i=typeof Promise<"u"?Promise:o("lie"),k.exports={Promise:i}},{lie:37}],7:[function(o,k,u){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=o("pako"),r=o("./utils"),c=o("./stream/GenericWorker"),b=i?"uint8array":"array";function v(g,_){c.call(this,"FlateWorker/"+g),this._pako=null,this._pakoAction=g,this._pakoOptions=_,this.meta={}}u.magic="\b\0",r.inherits(v,c),v.prototype.processChunk=function(g){this.meta=g.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(b,g.data),!1)},v.prototype.flush=function(){c.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){c.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var g=this;this._pako.onData=function(_){g.push({data:_,meta:g.meta})}},u.compressWorker=function(g){return new v("Deflate",g)},u.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(o,k,u){function i(a,p){var n,d="";for(n=0;n<p;n++)d+=String.fromCharCode(255&a),a>>>=8;return d}function s(a,p,n,d,l,m){var w,z,S=a.file,P=a.compression,j=m!==b.utf8encode,W=r.transformTo("string",m(S.name)),O=r.transformTo("string",b.utf8encode(S.name)),G=S.comment,J=r.transformTo("string",m(G)),y=r.transformTo("string",b.utf8encode(G)),R=O.length!==S.name.length,e=y.length!==G.length,T="",tt="",L="",et=S.dir,Z=S.date,Q={crc32:0,compressedSize:0,uncompressedSize:0};p&&!n||(Q.crc32=a.crc32,Q.compressedSize=a.compressedSize,Q.uncompressedSize=a.uncompressedSize);var I=0;p&&(I|=8),j||!R&&!e||(I|=2048);var A=0,q=0;et&&(A|=16),l==="UNIX"?(q=798,A|=(function(K,at){var ct=K;return K||(ct=at?16893:33204),(65535&ct)<<16})(S.unixPermissions,et)):(q=20,A|=(function(K){return 63&(K||0)})(S.dosPermissions)),w=Z.getUTCHours(),w<<=6,w|=Z.getUTCMinutes(),w<<=5,w|=Z.getUTCSeconds()/2,z=Z.getUTCFullYear()-1980,z<<=4,z|=Z.getUTCMonth()+1,z<<=5,z|=Z.getUTCDate(),R&&(tt=i(1,1)+i(v(W),4)+O,T+="up"+i(tt.length,2)+tt),e&&(L=i(1,1)+i(v(J),4)+y,T+="uc"+i(L.length,2)+L);var Y="";return Y+=`
12
- \0`,Y+=i(I,2),Y+=P.magic,Y+=i(w,2),Y+=i(z,2),Y+=i(Q.crc32,4),Y+=i(Q.compressedSize,4),Y+=i(Q.uncompressedSize,4),Y+=i(W.length,2),Y+=i(T.length,2),{fileRecord:g.LOCAL_FILE_HEADER+Y+W+T,dirRecord:g.CENTRAL_FILE_HEADER+i(q,2)+Y+i(J.length,2)+"\0\0\0\0"+i(A,4)+i(d,4)+W+T+J}}var r=o("../utils"),c=o("../stream/GenericWorker"),b=o("../utf8"),v=o("../crc32"),g=o("../signature");function _(a,p,n,d){c.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=n,this.encodeFileName=d,this.streamFiles=a,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(_,c),_.prototype.push=function(a){var p=a.meta.percent||0,n=this.entriesCount,d=this._sources.length;this.accumulate?this.contentBuffer.push(a):(this.bytesWritten+=a.data.length,c.prototype.push.call(this,{data:a.data,meta:{currentFile:this.currentFile,percent:n?(p+100*(n-d-1))/n:100}}))},_.prototype.openedSource=function(a){this.currentSourceOffset=this.bytesWritten,this.currentFile=a.file.name;var p=this.streamFiles&&!a.file.dir;if(p){var n=s(a,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},_.prototype.closedSource=function(a){this.accumulate=!1;var p=this.streamFiles&&!a.file.dir,n=s(a,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),p)this.push({data:(function(d){return g.DATA_DESCRIPTOR+i(d.crc32,4)+i(d.compressedSize,4)+i(d.uncompressedSize,4)})(a),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},_.prototype.flush=function(){for(var a=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var n=this.bytesWritten-a,d=(function(l,m,w,z,S){var P=r.transformTo("string",S(z));return g.CENTRAL_DIRECTORY_END+"\0\0\0\0"+i(l,2)+i(l,2)+i(m,4)+i(w,4)+i(P.length,2)+P})(this.dirRecords.length,n,a,this.zipComment,this.encodeFileName);this.push({data:d,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(a){this._sources.push(a);var p=this;return a.on("data",function(n){p.processChunk(n)}),a.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),a.on("error",function(n){p.error(n)}),this},_.prototype.resume=function(){return!!c.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},_.prototype.error=function(a){var p=this._sources;if(!c.prototype.error.call(this,a))return!1;for(var n=0;n<p.length;n++)try{p[n].error(a)}catch{}return!0},_.prototype.lock=function(){c.prototype.lock.call(this);for(var a=this._sources,p=0;p<a.length;p++)a[p].lock()},k.exports=_},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(o,k,u){var i=o("../compressions"),s=o("./ZipFileWorker");u.generateWorker=function(r,c,b){var v=new s(c.streamFiles,b,c.platform,c.encodeFileName),g=0;try{r.forEach(function(_,a){g++;var p=(function(m,w){var z=m||w,S=i[z];if(!S)throw new Error(z+" is not a valid compression method !");return S})(a.options.compression,c.compression),n=a.options.compressionOptions||c.compressionOptions||{},d=a.dir,l=a.date;a._compressWorker(p,n).withStreamInfo("file",{name:_,dir:d,date:l,comment:a.comment||"",unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions}).pipe(v)}),v.entriesCount=g}catch(_){v.error(_)}return v}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(o,k,u){function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new i;for(var r in this)typeof this[r]!="function"&&(s[r]=this[r]);return s}}(i.prototype=o("./object")).loadAsync=o("./load"),i.support=o("./support"),i.defaults=o("./defaults"),i.version="3.10.1",i.loadAsync=function(s,r){return new i().loadAsync(s,r)},i.external=o("./external"),k.exports=i},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(o,k,u){var i=o("./utils"),s=o("./external"),r=o("./utf8"),c=o("./zipEntries"),b=o("./stream/Crc32Probe"),v=o("./nodejsUtils");function g(_){return new s.Promise(function(a,p){var n=_.decompressed.getContentWorker().pipe(new b);n.on("error",function(d){p(d)}).on("end",function(){n.streamInfo.crc32!==_.decompressed.crc32?p(new Error("Corrupted zip : CRC32 mismatch")):a()}).resume()})}k.exports=function(_,a){var p=this;return a=i.extend(a||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),v.isNode&&v.isStream(_)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",_,!0,a.optimizedBinaryString,a.base64).then(function(n){var d=new c(a);return d.load(n),d}).then(function(n){var d=[s.Promise.resolve(n)],l=n.files;if(a.checkCRC32)for(var m=0;m<l.length;m++)d.push(g(l[m]));return s.Promise.all(d)}).then(function(n){for(var d=n.shift(),l=d.files,m=0;m<l.length;m++){var w=l[m],z=w.fileNameStr,S=i.resolve(w.fileNameStr);p.file(S,w.decompressed,{binary:!0,optimizedBinaryString:!0,date:w.date,dir:w.dir,comment:w.fileCommentStr.length?w.fileCommentStr:null,unixPermissions:w.unixPermissions,dosPermissions:w.dosPermissions,createFolders:a.createFolders}),w.dir||(p.file(S).unsafeOriginalName=z)}return d.zipComment.length&&(p.comment=d.zipComment),p})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(o,k,u){var i=o("../utils"),s=o("../stream/GenericWorker");function r(c,b){s.call(this,"Nodejs stream input adapter for "+c),this._upstreamEnded=!1,this._bindStream(b)}i.inherits(r,s),r.prototype._bindStream=function(c){var b=this;(this._stream=c).pause(),c.on("data",function(v){b.push({data:v,meta:{percent:0}})}).on("error",function(v){b.isPaused?this.generatedError=v:b.error(v)}).on("end",function(){b.isPaused?b._upstreamEnded=!0:b.end()})},r.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},k.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(o,k,u){var i=o("readable-stream").Readable;function s(r,c,b){i.call(this,c),this._helper=r;var v=this;r.on("data",function(g,_){v.push(g)||v._helper.pause(),b&&b(_)}).on("error",function(g){v.emit("error",g)}).on("end",function(){v.push(null)})}o("../utils").inherits(s,i),s.prototype._read=function(){this._helper.resume()},k.exports=s},{"../utils":32,"readable-stream":16}],14:[function(o,k,u){k.exports={isNode:typeof Buffer<"u",newBufferFrom:function(i,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(i,s);if(typeof i=="number")throw new Error('The "data" argument must not be a number');return new Buffer(i,s)},allocBuffer:function(i){if(Buffer.alloc)return Buffer.alloc(i);var s=new Buffer(i);return s.fill(0),s},isBuffer:function(i){return Buffer.isBuffer(i)},isStream:function(i){return i&&typeof i.on=="function"&&typeof i.pause=="function"&&typeof i.resume=="function"}}},{}],15:[function(o,k,u){function i(S,P,j){var W,O=r.getTypeOf(P),G=r.extend(j||{},v);G.date=G.date||new Date,G.compression!==null&&(G.compression=G.compression.toUpperCase()),typeof G.unixPermissions=="string"&&(G.unixPermissions=parseInt(G.unixPermissions,8)),G.unixPermissions&&16384&G.unixPermissions&&(G.dir=!0),G.dosPermissions&&16&G.dosPermissions&&(G.dir=!0),G.dir&&(S=l(S)),G.createFolders&&(W=d(S))&&m.call(this,W,!0);var J=O==="string"&&G.binary===!1&&G.base64===!1;j&&j.binary!==void 0||(G.binary=!J),(P instanceof g&&P.uncompressedSize===0||G.dir||!P||P.length===0)&&(G.base64=!1,G.binary=!0,P="",G.compression="STORE",O="string");var y=null;y=P instanceof g||P instanceof c?P:p.isNode&&p.isStream(P)?new n(S,P):r.prepareContent(S,P,G.binary,G.optimizedBinaryString,G.base64);var R=new _(S,y,G);this.files[S]=R}var s=o("./utf8"),r=o("./utils"),c=o("./stream/GenericWorker"),b=o("./stream/StreamHelper"),v=o("./defaults"),g=o("./compressedObject"),_=o("./zipObject"),a=o("./generate"),p=o("./nodejsUtils"),n=o("./nodejs/NodejsStreamInputAdapter"),d=function(S){S.slice(-1)==="/"&&(S=S.substring(0,S.length-1));var P=S.lastIndexOf("/");return 0<P?S.substring(0,P):""},l=function(S){return S.slice(-1)!=="/"&&(S+="/"),S},m=function(S,P){return P=P!==void 0?P:v.createFolders,S=l(S),this.files[S]||i.call(this,S,null,{dir:!0,createFolders:P}),this.files[S]};function w(S){return Object.prototype.toString.call(S)==="[object RegExp]"}var z={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(S){var P,j,W;for(P in this.files)W=this.files[P],(j=P.slice(this.root.length,P.length))&&P.slice(0,this.root.length)===this.root&&S(j,W)},filter:function(S){var P=[];return this.forEach(function(j,W){S(j,W)&&P.push(W)}),P},file:function(S,P,j){if(arguments.length!==1)return S=this.root+S,i.call(this,S,P,j),this;if(w(S)){var W=S;return this.filter(function(G,J){return!J.dir&&W.test(G)})}var O=this.files[this.root+S];return O&&!O.dir?O:null},folder:function(S){if(!S)return this;if(w(S))return this.filter(function(O,G){return G.dir&&S.test(O)});var P=this.root+S,j=m.call(this,P),W=this.clone();return W.root=j.name,W},remove:function(S){S=this.root+S;var P=this.files[S];if(P||(S.slice(-1)!=="/"&&(S+="/"),P=this.files[S]),P&&!P.dir)delete this.files[S];else for(var j=this.filter(function(O,G){return G.name.slice(0,S.length)===S}),W=0;W<j.length;W++)delete this.files[j[W].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(S){var P,j={};try{if((j=r.extend(S||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=j.type.toLowerCase(),j.compression=j.compression.toUpperCase(),j.type==="binarystring"&&(j.type="string"),!j.type)throw new Error("No output type specified.");r.checkSupport(j.type),j.platform!=="darwin"&&j.platform!=="freebsd"&&j.platform!=="linux"&&j.platform!=="sunos"||(j.platform="UNIX"),j.platform==="win32"&&(j.platform="DOS");var W=j.comment||this.comment||"";P=a.generateWorker(this,j,W)}catch(O){(P=new c("error")).error(O)}return new b(P,j.type||"string",j.mimeType)},generateAsync:function(S,P){return this.generateInternalStream(S).accumulate(P)},generateNodeStream:function(S,P){return(S=S||{}).type||(S.type="nodebuffer"),this.generateInternalStream(S).toNodejsStream(P)}};k.exports=z},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(o,k,u){k.exports=o("stream")},{stream:void 0}],17:[function(o,k,u){var i=o("./DataReader");function s(r){i.call(this,r);for(var c=0;c<this.data.length;c++)r[c]=255&r[c]}o("../utils").inherits(s,i),s.prototype.byteAt=function(r){return this.data[this.zero+r]},s.prototype.lastIndexOfSignature=function(r){for(var c=r.charCodeAt(0),b=r.charCodeAt(1),v=r.charCodeAt(2),g=r.charCodeAt(3),_=this.length-4;0<=_;--_)if(this.data[_]===c&&this.data[_+1]===b&&this.data[_+2]===v&&this.data[_+3]===g)return _-this.zero;return-1},s.prototype.readAndCheckSignature=function(r){var c=r.charCodeAt(0),b=r.charCodeAt(1),v=r.charCodeAt(2),g=r.charCodeAt(3),_=this.readData(4);return c===_[0]&&b===_[1]&&v===_[2]&&g===_[3]},s.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},k.exports=s},{"../utils":32,"./DataReader":18}],18:[function(o,k,u){var i=o("../utils");function s(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var c,b=0;for(this.checkOffset(r),c=this.index+r-1;c>=this.index;c--)b=(b<<8)+this.byteAt(c);return this.index+=r,b},readString:function(r){return i.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},k.exports=s},{"../utils":32}],19:[function(o,k,u){var i=o("./Uint8ArrayReader");function s(r){i.call(this,r)}o("../utils").inherits(s,i),s.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},k.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(o,k,u){var i=o("./DataReader");function s(r){i.call(this,r)}o("../utils").inherits(s,i),s.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},s.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},s.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},s.prototype.readData=function(r){this.checkOffset(r);var c=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},k.exports=s},{"../utils":32,"./DataReader":18}],21:[function(o,k,u){var i=o("./ArrayReader");function s(r){i.call(this,r)}o("../utils").inherits(s,i),s.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var c=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,c},k.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(o,k,u){var i=o("../utils"),s=o("../support"),r=o("./ArrayReader"),c=o("./StringReader"),b=o("./NodeBufferReader"),v=o("./Uint8ArrayReader");k.exports=function(g){var _=i.getTypeOf(g);return i.checkSupport(_),_!=="string"||s.uint8array?_==="nodebuffer"?new b(g):s.uint8array?new v(i.transformTo("uint8array",g)):new r(i.transformTo("array",g)):new c(g)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(o,k,u){u.LOCAL_FILE_HEADER="PK",u.CENTRAL_FILE_HEADER="PK",u.CENTRAL_DIRECTORY_END="PK",u.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",u.ZIP64_CENTRAL_DIRECTORY_END="PK",u.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(o,k,u){var i=o("./GenericWorker"),s=o("../utils");function r(c){i.call(this,"ConvertWorker to "+c),this.destType=c}s.inherits(r,i),r.prototype.processChunk=function(c){this.push({data:s.transformTo(this.destType,c.data),meta:c.meta})},k.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(o,k,u){var i=o("./GenericWorker"),s=o("../crc32");function r(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}o("../utils").inherits(r,i),r.prototype.processChunk=function(c){this.streamInfo.crc32=s(c.data,this.streamInfo.crc32||0),this.push(c)},k.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(o,k,u){var i=o("../utils"),s=o("./GenericWorker");function r(c){s.call(this,"DataLengthProbe for "+c),this.propName=c,this.withStreamInfo(c,0)}i.inherits(r,s),r.prototype.processChunk=function(c){if(c){var b=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=b+c.data.length}s.prototype.processChunk.call(this,c)},k.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(o,k,u){var i=o("../utils"),s=o("./GenericWorker");function r(c){s.call(this,"DataWorker");var b=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,c.then(function(v){b.dataIsReady=!0,b.data=v,b.max=v&&v.length||0,b.type=i.getTypeOf(v),b.isPaused||b._tickAndRepeat()},function(v){b.error(v)})}i.inherits(r,s),r.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var c=null,b=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":c=this.data.substring(this.index,b);break;case"uint8array":c=this.data.subarray(this.index,b);break;case"array":case"nodebuffer":c=this.data.slice(this.index,b)}return this.index=b,this.push({data:c,meta:{percent:this.max?this.index/this.max*100:0}})},k.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(o,k,u){function i(s){this.name=s||"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}i.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,r){return this._listeners[s].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,r){if(this._listeners[s])for(var c=0;c<this._listeners[s].length;c++)this._listeners[s][c].call(this,r)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var r=this;return s.on("data",function(c){r.processChunk(c)}),s.on("end",function(){r.end()}),s.on("error",function(c){r.error(c)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,r){return this.extraStreamInfo[s]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},k.exports=i},{}],29:[function(o,k,u){var i=o("../utils"),s=o("./ConvertWorker"),r=o("./GenericWorker"),c=o("../base64"),b=o("../support"),v=o("../external"),g=null;if(b.nodestream)try{g=o("../nodejs/NodejsStreamOutputAdapter")}catch{}function _(p,n){return new v.Promise(function(d,l){var m=[],w=p._internalType,z=p._outputType,S=p._mimeType;p.on("data",function(P,j){m.push(P),n&&n(j)}).on("error",function(P){m=[],l(P)}).on("end",function(){try{var P=(function(j,W,O){switch(j){case"blob":return i.newBlob(i.transformTo("arraybuffer",W),O);case"base64":return c.encode(W);default:return i.transformTo(j,W)}})(z,(function(j,W){var O,G=0,J=null,y=0;for(O=0;O<W.length;O++)y+=W[O].length;switch(j){case"string":return W.join("");case"array":return Array.prototype.concat.apply([],W);case"uint8array":for(J=new Uint8Array(y),O=0;O<W.length;O++)J.set(W[O],G),G+=W[O].length;return J;case"nodebuffer":return Buffer.concat(W);default:throw new Error("concat : unsupported type '"+j+"'")}})(w,m),S);d(P)}catch(j){l(j)}m=[]}).resume()})}function a(p,n,d){var l=n;switch(n){case"blob":case"arraybuffer":l="uint8array";break;case"base64":l="string"}try{this._internalType=l,this._outputType=n,this._mimeType=d,i.checkSupport(l),this._worker=p.pipe(new s(l)),p.lock()}catch(m){this._worker=new r("error"),this._worker.error(m)}}a.prototype={accumulate:function(p){return _(this,p)},on:function(p,n){var d=this;return p==="data"?this._worker.on(p,function(l){n.call(d,l.data,l.meta)}):this._worker.on(p,function(){i.delay(n,arguments,d)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(i.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new g(this,{objectMode:this._outputType!=="nodebuffer"},p)}},k.exports=a},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(o,k,u){if(u.base64=!0,u.array=!0,u.string=!0,u.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",u.nodebuffer=typeof Buffer<"u",u.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")u.blob=!1;else{var i=new ArrayBuffer(0);try{u.blob=new Blob([i],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(i),u.blob=s.getBlob("application/zip").size===0}catch{u.blob=!1}}}try{u.nodestream=!!o("readable-stream").Readable}catch{u.nodestream=!1}},{"readable-stream":16}],31:[function(o,k,u){for(var i=o("./utils"),s=o("./support"),r=o("./nodejsUtils"),c=o("./stream/GenericWorker"),b=new Array(256),v=0;v<256;v++)b[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;b[254]=b[254]=1;function g(){c.call(this,"utf-8 decode"),this.leftOver=null}function _(){c.call(this,"utf-8 encode")}u.utf8encode=function(a){return s.nodebuffer?r.newBufferFrom(a,"utf-8"):(function(p){var n,d,l,m,w,z=p.length,S=0;for(m=0;m<z;m++)(64512&(d=p.charCodeAt(m)))==55296&&m+1<z&&(64512&(l=p.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(l-56320),m++),S+=d<128?1:d<2048?2:d<65536?3:4;for(n=s.uint8array?new Uint8Array(S):new Array(S),m=w=0;w<S;m++)(64512&(d=p.charCodeAt(m)))==55296&&m+1<z&&(64512&(l=p.charCodeAt(m+1)))==56320&&(d=65536+(d-55296<<10)+(l-56320),m++),d<128?n[w++]=d:(d<2048?n[w++]=192|d>>>6:(d<65536?n[w++]=224|d>>>12:(n[w++]=240|d>>>18,n[w++]=128|d>>>12&63),n[w++]=128|d>>>6&63),n[w++]=128|63&d);return n})(a)},u.utf8decode=function(a){return s.nodebuffer?i.transformTo("nodebuffer",a).toString("utf-8"):(function(p){var n,d,l,m,w=p.length,z=new Array(2*w);for(n=d=0;n<w;)if((l=p[n++])<128)z[d++]=l;else if(4<(m=b[l]))z[d++]=65533,n+=m-1;else{for(l&=m===2?31:m===3?15:7;1<m&&n<w;)l=l<<6|63&p[n++],m--;1<m?z[d++]=65533:l<65536?z[d++]=l:(l-=65536,z[d++]=55296|l>>10&1023,z[d++]=56320|1023&l)}return z.length!==d&&(z.subarray?z=z.subarray(0,d):z.length=d),i.applyFromCharCode(z)})(a=i.transformTo(s.uint8array?"uint8array":"array",a))},i.inherits(g,c),g.prototype.processChunk=function(a){var p=i.transformTo(s.uint8array?"uint8array":"array",a.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var n=p;(p=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),p.set(n,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var d=(function(m,w){var z;for((w=w||m.length)>m.length&&(w=m.length),z=w-1;0<=z&&(192&m[z])==128;)z--;return z<0||z===0?w:z+b[m[z]]>w?z:w})(p),l=p;d!==p.length&&(s.uint8array?(l=p.subarray(0,d),this.leftOver=p.subarray(d,p.length)):(l=p.slice(0,d),this.leftOver=p.slice(d,p.length))),this.push({data:u.utf8decode(l),meta:a.meta})},g.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:u.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},u.Utf8DecodeWorker=g,i.inherits(_,c),_.prototype.processChunk=function(a){this.push({data:u.utf8encode(a.data),meta:a.meta})},u.Utf8EncodeWorker=_},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(o,k,u){var i=o("./support"),s=o("./base64"),r=o("./nodejsUtils"),c=o("./external");function b(n){return n}function v(n,d){for(var l=0;l<n.length;++l)d[l]=255&n.charCodeAt(l);return d}o("setimmediate"),u.newBlob=function(n,d){u.checkSupport("blob");try{return new Blob([n],{type:d})}catch{try{var l=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return l.append(n),l.getBlob(d)}catch{throw new Error("Bug : can't construct the Blob.")}}};var g={stringifyByChunk:function(n,d,l){var m=[],w=0,z=n.length;if(z<=l)return String.fromCharCode.apply(null,n);for(;w<z;)d==="array"||d==="nodebuffer"?m.push(String.fromCharCode.apply(null,n.slice(w,Math.min(w+l,z)))):m.push(String.fromCharCode.apply(null,n.subarray(w,Math.min(w+l,z)))),w+=l;return m.join("")},stringifyByChar:function(n){for(var d="",l=0;l<n.length;l++)d+=String.fromCharCode(n[l]);return d},applyCanBeUsed:{uint8array:(function(){try{return i.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return i.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function _(n){var d=65536,l=u.getTypeOf(n),m=!0;if(l==="uint8array"?m=g.applyCanBeUsed.uint8array:l==="nodebuffer"&&(m=g.applyCanBeUsed.nodebuffer),m)for(;1<d;)try{return g.stringifyByChunk(n,l,d)}catch{d=Math.floor(d/2)}return g.stringifyByChar(n)}function a(n,d){for(var l=0;l<n.length;l++)d[l]=n[l];return d}u.applyFromCharCode=_;var p={};p.string={string:b,array:function(n){return v(n,new Array(n.length))},arraybuffer:function(n){return p.string.uint8array(n).buffer},uint8array:function(n){return v(n,new Uint8Array(n.length))},nodebuffer:function(n){return v(n,r.allocBuffer(n.length))}},p.array={string:_,array:b,arraybuffer:function(n){return new Uint8Array(n).buffer},uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(n)}},p.arraybuffer={string:function(n){return _(new Uint8Array(n))},array:function(n){return a(new Uint8Array(n),new Array(n.byteLength))},arraybuffer:b,uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(new Uint8Array(n))}},p.uint8array={string:_,array:function(n){return a(n,new Array(n.length))},arraybuffer:function(n){return n.buffer},uint8array:b,nodebuffer:function(n){return r.newBufferFrom(n)}},p.nodebuffer={string:_,array:function(n){return a(n,new Array(n.length))},arraybuffer:function(n){return p.nodebuffer.uint8array(n).buffer},uint8array:function(n){return a(n,new Uint8Array(n.length))},nodebuffer:b},u.transformTo=function(n,d){if(d=d||"",!n)return d;u.checkSupport(n);var l=u.getTypeOf(d);return p[l][n](d)},u.resolve=function(n){for(var d=n.split("/"),l=[],m=0;m<d.length;m++){var w=d[m];w==="."||w===""&&m!==0&&m!==d.length-1||(w===".."?l.pop():l.push(w))}return l.join("/")},u.getTypeOf=function(n){return typeof n=="string"?"string":Object.prototype.toString.call(n)==="[object Array]"?"array":i.nodebuffer&&r.isBuffer(n)?"nodebuffer":i.uint8array&&n instanceof Uint8Array?"uint8array":i.arraybuffer&&n instanceof ArrayBuffer?"arraybuffer":void 0},u.checkSupport=function(n){if(!i[n.toLowerCase()])throw new Error(n+" is not supported by this platform")},u.MAX_VALUE_16BITS=65535,u.MAX_VALUE_32BITS=-1,u.pretty=function(n){var d,l,m="";for(l=0;l<(n||"").length;l++)m+="\\x"+((d=n.charCodeAt(l))<16?"0":"")+d.toString(16).toUpperCase();return m},u.delay=function(n,d,l){setImmediate(function(){n.apply(l||null,d||[])})},u.inherits=function(n,d){function l(){}l.prototype=d.prototype,n.prototype=new l},u.extend=function(){var n,d,l={};for(n=0;n<arguments.length;n++)for(d in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],d)&&l[d]===void 0&&(l[d]=arguments[n][d]);return l},u.prepareContent=function(n,d,l,m,w){return c.Promise.resolve(d).then(function(z){return i.blob&&(z instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(z))!==-1)&&typeof FileReader<"u"?new c.Promise(function(S,P){var j=new FileReader;j.onload=function(W){S(W.target.result)},j.onerror=function(W){P(W.target.error)},j.readAsArrayBuffer(z)}):z}).then(function(z){var S=u.getTypeOf(z);return S?(S==="arraybuffer"?z=u.transformTo("uint8array",z):S==="string"&&(w?z=s.decode(z):l&&m!==!0&&(z=(function(P){return v(P,i.uint8array?new Uint8Array(P.length):new Array(P.length))})(z))),z):c.Promise.reject(new Error("Can't read the data of '"+n+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(o,k,u){var i=o("./reader/readerFor"),s=o("./utils"),r=o("./signature"),c=o("./zipEntry"),b=o("./support");function v(g){this.files=[],this.loadOptions=g}v.prototype={checkSignature:function(g){if(!this.reader.readAndCheckSignature(g)){this.reader.index-=4;var _=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(_)+", expected "+s.pretty(g)+")")}},isSignature:function(g,_){var a=this.reader.index;this.reader.setIndex(g);var p=this.reader.readString(4)===_;return this.reader.setIndex(a),p},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var g=this.reader.readData(this.zipCommentLength),_=b.uint8array?"uint8array":"array",a=s.transformTo(_,g);this.zipComment=this.loadOptions.decodeFileName(a)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var g,_,a,p=this.zip64EndOfCentralSize-44;0<p;)g=this.reader.readInt(2),_=this.reader.readInt(4),a=this.reader.readData(_),this.zip64ExtensibleData[g]={id:g,length:_,value:a}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var g,_;for(g=0;g<this.files.length;g++)_=this.files[g],this.reader.setIndex(_.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),_.readLocalPart(this.reader),_.handleUTF8(),_.processAttributes()},readCentralDir:function(){var g;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(g=new c({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(g);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var g=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(g<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(g);var _=g;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(g=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(g),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var a=this.centralDirOffset+this.centralDirSize;this.zip64&&(a+=20,a+=12+this.zip64EndOfCentralSize);var p=_-a;if(0<p)this.isSignature(_,r.CENTRAL_FILE_HEADER)||(this.reader.zero=p);else if(p<0)throw new Error("Corrupted zip: missing "+Math.abs(p)+" bytes.")},prepareReader:function(g){this.reader=i(g)},load:function(g){this.prepareReader(g),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},k.exports=v},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(o,k,u){var i=o("./reader/readerFor"),s=o("./utils"),r=o("./compressedObject"),c=o("./crc32"),b=o("./utf8"),v=o("./compressions"),g=o("./support");function _(a,p){this.options=a,this.loadOptions=p}_.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(a){var p,n;if(a.skip(22),this.fileNameLength=a.readInt(2),n=a.readInt(2),this.fileName=a.readData(this.fileNameLength),a.skip(n),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((p=(function(d){for(var l in v)if(Object.prototype.hasOwnProperty.call(v,l)&&v[l].magic===d)return v[l];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,p,a.readData(this.compressedSize))},readCentralPart:function(a){this.versionMadeBy=a.readInt(2),a.skip(2),this.bitFlag=a.readInt(2),this.compressionMethod=a.readString(2),this.date=a.readDate(),this.crc32=a.readInt(4),this.compressedSize=a.readInt(4),this.uncompressedSize=a.readInt(4);var p=a.readInt(2);if(this.extraFieldsLength=a.readInt(2),this.fileCommentLength=a.readInt(2),this.diskNumberStart=a.readInt(2),this.internalFileAttributes=a.readInt(2),this.externalFileAttributes=a.readInt(4),this.localHeaderOffset=a.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");a.skip(p),this.readExtraFields(a),this.parseZIP64ExtraField(a),this.fileComment=a.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var a=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),a==0&&(this.dosPermissions=63&this.externalFileAttributes),a==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var a=i(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=a.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=a.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=a.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=a.readInt(4))}},readExtraFields:function(a){var p,n,d,l=a.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});a.index+4<l;)p=a.readInt(2),n=a.readInt(2),d=a.readData(n),this.extraFields[p]={id:p,length:n,value:d};a.setIndex(l)},handleUTF8:function(){var a=g.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=b.utf8decode(this.fileName),this.fileCommentStr=b.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var n=s.transformTo(a,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var d=this.findExtraFieldUnicodeComment();if(d!==null)this.fileCommentStr=d;else{var l=s.transformTo(a,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(l)}}},findExtraFieldUnicodePath:function(){var a=this.extraFields[28789];if(a){var p=i(a.value);return p.readInt(1)!==1||c(this.fileName)!==p.readInt(4)?null:b.utf8decode(p.readData(a.length-5))}return null},findExtraFieldUnicodeComment:function(){var a=this.extraFields[25461];if(a){var p=i(a.value);return p.readInt(1)!==1||c(this.fileComment)!==p.readInt(4)?null:b.utf8decode(p.readData(a.length-5))}return null}},k.exports=_},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(o,k,u){function i(p,n,d){this.name=p,this.dir=d.dir,this.date=d.date,this.comment=d.comment,this.unixPermissions=d.unixPermissions,this.dosPermissions=d.dosPermissions,this._data=n,this._dataBinary=d.binary,this.options={compression:d.compression,compressionOptions:d.compressionOptions}}var s=o("./stream/StreamHelper"),r=o("./stream/DataWorker"),c=o("./utf8"),b=o("./compressedObject"),v=o("./stream/GenericWorker");i.prototype={internalStream:function(p){var n=null,d="string";try{if(!p)throw new Error("No output type specified.");var l=(d=p.toLowerCase())==="string"||d==="text";d!=="binarystring"&&d!=="text"||(d="string"),n=this._decompressWorker();var m=!this._dataBinary;m&&!l&&(n=n.pipe(new c.Utf8EncodeWorker)),!m&&l&&(n=n.pipe(new c.Utf8DecodeWorker))}catch(w){(n=new v("error")).error(w)}return new s(n,d,"")},async:function(p,n){return this.internalStream(p).accumulate(n)},nodeStream:function(p,n){return this.internalStream(p||"nodebuffer").toNodejsStream(n)},_compressWorker:function(p,n){if(this._data instanceof b&&this._data.compression.magic===p.magic)return this._data.getCompressedWorker();var d=this._decompressWorker();return this._dataBinary||(d=d.pipe(new c.Utf8EncodeWorker)),b.createWorkerFrom(d,p,n)},_decompressWorker:function(){return this._data instanceof b?this._data.getContentWorker():this._data instanceof v?this._data:new r(this._data)}};for(var g=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],_=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},a=0;a<g.length;a++)i.prototype[g[a]]=_;k.exports=i},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(o,k,u){(function(i){var s,r,c=i.MutationObserver||i.WebKitMutationObserver;if(c){var b=0,v=new c(p),g=i.document.createTextNode("");v.observe(g,{characterData:!0}),s=function(){g.data=b=++b%2}}else if(i.setImmediate||i.MessageChannel===void 0)s="document"in i&&"onreadystatechange"in i.document.createElement("script")?function(){var n=i.document.createElement("script");n.onreadystatechange=function(){p(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},i.document.documentElement.appendChild(n)}:function(){setTimeout(p,0)};else{var _=new i.MessageChannel;_.port1.onmessage=p,s=function(){_.port2.postMessage(0)}}var a=[];function p(){var n,d;r=!0;for(var l=a.length;l;){for(d=a,a=[],n=-1;++n<l;)d[n]();l=a.length}r=!1}k.exports=function(n){a.push(n)!==1||r||s()}}).call(this,typeof kt<"u"?kt:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(o,k,u){var i=o("immediate");function s(){}var r={},c=["REJECTED"],b=["FULFILLED"],v=["PENDING"];function g(l){if(typeof l!="function")throw new TypeError("resolver must be a function");this.state=v,this.queue=[],this.outcome=void 0,l!==s&&n(this,l)}function _(l,m,w){this.promise=l,typeof m=="function"&&(this.onFulfilled=m,this.callFulfilled=this.otherCallFulfilled),typeof w=="function"&&(this.onRejected=w,this.callRejected=this.otherCallRejected)}function a(l,m,w){i(function(){var z;try{z=m(w)}catch(S){return r.reject(l,S)}z===l?r.reject(l,new TypeError("Cannot resolve promise with itself")):r.resolve(l,z)})}function p(l){var m=l&&l.then;if(l&&(typeof l=="object"||typeof l=="function")&&typeof m=="function")return function(){m.apply(l,arguments)}}function n(l,m){var w=!1;function z(j){w||(w=!0,r.reject(l,j))}function S(j){w||(w=!0,r.resolve(l,j))}var P=d(function(){m(S,z)});P.status==="error"&&z(P.value)}function d(l,m){var w={};try{w.value=l(m),w.status="success"}catch(z){w.status="error",w.value=z}return w}(k.exports=g).prototype.finally=function(l){if(typeof l!="function")return this;var m=this.constructor;return this.then(function(w){return m.resolve(l()).then(function(){return w})},function(w){return m.resolve(l()).then(function(){throw w})})},g.prototype.catch=function(l){return this.then(null,l)},g.prototype.then=function(l,m){if(typeof l!="function"&&this.state===b||typeof m!="function"&&this.state===c)return this;var w=new this.constructor(s);return this.state!==v?a(w,this.state===b?l:m,this.outcome):this.queue.push(new _(w,l,m)),w},_.prototype.callFulfilled=function(l){r.resolve(this.promise,l)},_.prototype.otherCallFulfilled=function(l){a(this.promise,this.onFulfilled,l)},_.prototype.callRejected=function(l){r.reject(this.promise,l)},_.prototype.otherCallRejected=function(l){a(this.promise,this.onRejected,l)},r.resolve=function(l,m){var w=d(p,m);if(w.status==="error")return r.reject(l,w.value);var z=w.value;if(z)n(l,z);else{l.state=b,l.outcome=m;for(var S=-1,P=l.queue.length;++S<P;)l.queue[S].callFulfilled(m)}return l},r.reject=function(l,m){l.state=c,l.outcome=m;for(var w=-1,z=l.queue.length;++w<z;)l.queue[w].callRejected(m);return l},g.resolve=function(l){return l instanceof this?l:r.resolve(new this(s),l)},g.reject=function(l){var m=new this(s);return r.reject(m,l)},g.all=function(l){var m=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=l.length,z=!1;if(!w)return this.resolve([]);for(var S=new Array(w),P=0,j=-1,W=new this(s);++j<w;)O(l[j],j);return W;function O(G,J){m.resolve(G).then(function(y){S[J]=y,++P!==w||z||(z=!0,r.resolve(W,S))},function(y){z||(z=!0,r.reject(W,y))})}},g.race=function(l){var m=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=l.length,z=!1;if(!w)return this.resolve([]);for(var S=-1,P=new this(s);++S<w;)j=l[S],m.resolve(j).then(function(W){z||(z=!0,r.resolve(P,W))},function(W){z||(z=!0,r.reject(P,W))});var j;return P}},{immediate:36}],38:[function(o,k,u){var i={};(0,o("./lib/utils/common").assign)(i,o("./lib/deflate"),o("./lib/inflate"),o("./lib/zlib/constants")),k.exports=i},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(o,k,u){var i=o("./zlib/deflate"),s=o("./utils/common"),r=o("./utils/strings"),c=o("./zlib/messages"),b=o("./zlib/zstream"),v=Object.prototype.toString,g=0,_=-1,a=0,p=8;function n(l){if(!(this instanceof n))return new n(l);this.options=s.assign({level:_,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:a,to:""},l||{});var m=this.options;m.raw&&0<m.windowBits?m.windowBits=-m.windowBits:m.gzip&&0<m.windowBits&&m.windowBits<16&&(m.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var w=i.deflateInit2(this.strm,m.level,m.method,m.windowBits,m.memLevel,m.strategy);if(w!==g)throw new Error(c[w]);if(m.header&&i.deflateSetHeader(this.strm,m.header),m.dictionary){var z;if(z=typeof m.dictionary=="string"?r.string2buf(m.dictionary):v.call(m.dictionary)==="[object ArrayBuffer]"?new Uint8Array(m.dictionary):m.dictionary,(w=i.deflateSetDictionary(this.strm,z))!==g)throw new Error(c[w]);this._dict_set=!0}}function d(l,m){var w=new n(m);if(w.push(l,!0),w.err)throw w.msg||c[w.err];return w.result}n.prototype.push=function(l,m){var w,z,S=this.strm,P=this.options.chunkSize;if(this.ended)return!1;z=m===~~m?m:m===!0?4:0,typeof l=="string"?S.input=r.string2buf(l):v.call(l)==="[object ArrayBuffer]"?S.input=new Uint8Array(l):S.input=l,S.next_in=0,S.avail_in=S.input.length;do{if(S.avail_out===0&&(S.output=new s.Buf8(P),S.next_out=0,S.avail_out=P),(w=i.deflate(S,z))!==1&&w!==g)return this.onEnd(w),!(this.ended=!0);S.avail_out!==0&&(S.avail_in!==0||z!==4&&z!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(s.shrinkBuf(S.output,S.next_out))):this.onData(s.shrinkBuf(S.output,S.next_out)))}while((0<S.avail_in||S.avail_out===0)&&w!==1);return z===4?(w=i.deflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===g):z!==2||(this.onEnd(g),!(S.avail_out=0))},n.prototype.onData=function(l){this.chunks.push(l)},n.prototype.onEnd=function(l){l===g&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=l,this.msg=this.strm.msg},u.Deflate=n,u.deflate=d,u.deflateRaw=function(l,m){return(m=m||{}).raw=!0,d(l,m)},u.gzip=function(l,m){return(m=m||{}).gzip=!0,d(l,m)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(o,k,u){var i=o("./zlib/inflate"),s=o("./utils/common"),r=o("./utils/strings"),c=o("./zlib/constants"),b=o("./zlib/messages"),v=o("./zlib/zstream"),g=o("./zlib/gzheader"),_=Object.prototype.toString;function a(n){if(!(this instanceof a))return new a(n);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},n||{});var d=this.options;d.raw&&0<=d.windowBits&&d.windowBits<16&&(d.windowBits=-d.windowBits,d.windowBits===0&&(d.windowBits=-15)),!(0<=d.windowBits&&d.windowBits<16)||n&&n.windowBits||(d.windowBits+=32),15<d.windowBits&&d.windowBits<48&&(15&d.windowBits)==0&&(d.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v,this.strm.avail_out=0;var l=i.inflateInit2(this.strm,d.windowBits);if(l!==c.Z_OK)throw new Error(b[l]);this.header=new g,i.inflateGetHeader(this.strm,this.header)}function p(n,d){var l=new a(d);if(l.push(n,!0),l.err)throw l.msg||b[l.err];return l.result}a.prototype.push=function(n,d){var l,m,w,z,S,P,j=this.strm,W=this.options.chunkSize,O=this.options.dictionary,G=!1;if(this.ended)return!1;m=d===~~d?d:d===!0?c.Z_FINISH:c.Z_NO_FLUSH,typeof n=="string"?j.input=r.binstring2buf(n):_.call(n)==="[object ArrayBuffer]"?j.input=new Uint8Array(n):j.input=n,j.next_in=0,j.avail_in=j.input.length;do{if(j.avail_out===0&&(j.output=new s.Buf8(W),j.next_out=0,j.avail_out=W),(l=i.inflate(j,c.Z_NO_FLUSH))===c.Z_NEED_DICT&&O&&(P=typeof O=="string"?r.string2buf(O):_.call(O)==="[object ArrayBuffer]"?new Uint8Array(O):O,l=i.inflateSetDictionary(this.strm,P)),l===c.Z_BUF_ERROR&&G===!0&&(l=c.Z_OK,G=!1),l!==c.Z_STREAM_END&&l!==c.Z_OK)return this.onEnd(l),!(this.ended=!0);j.next_out&&(j.avail_out!==0&&l!==c.Z_STREAM_END&&(j.avail_in!==0||m!==c.Z_FINISH&&m!==c.Z_SYNC_FLUSH)||(this.options.to==="string"?(w=r.utf8border(j.output,j.next_out),z=j.next_out-w,S=r.buf2string(j.output,w),j.next_out=z,j.avail_out=W-z,z&&s.arraySet(j.output,j.output,w,z,0),this.onData(S)):this.onData(s.shrinkBuf(j.output,j.next_out)))),j.avail_in===0&&j.avail_out===0&&(G=!0)}while((0<j.avail_in||j.avail_out===0)&&l!==c.Z_STREAM_END);return l===c.Z_STREAM_END&&(m=c.Z_FINISH),m===c.Z_FINISH?(l=i.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===c.Z_OK):m!==c.Z_SYNC_FLUSH||(this.onEnd(c.Z_OK),!(j.avail_out=0))},a.prototype.onData=function(n){this.chunks.push(n)},a.prototype.onEnd=function(n){n===c.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg},u.Inflate=a,u.inflate=p,u.inflateRaw=function(n,d){return(d=d||{}).raw=!0,p(n,d)},u.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(o,k,u){var i=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";u.assign=function(c){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var v=b.shift();if(v){if(typeof v!="object")throw new TypeError(v+"must be non-object");for(var g in v)v.hasOwnProperty(g)&&(c[g]=v[g])}}return c},u.shrinkBuf=function(c,b){return c.length===b?c:c.subarray?c.subarray(0,b):(c.length=b,c)};var s={arraySet:function(c,b,v,g,_){if(b.subarray&&c.subarray)c.set(b.subarray(v,v+g),_);else for(var a=0;a<g;a++)c[_+a]=b[v+a]},flattenChunks:function(c){var b,v,g,_,a,p;for(b=g=0,v=c.length;b<v;b++)g+=c[b].length;for(p=new Uint8Array(g),b=_=0,v=c.length;b<v;b++)a=c[b],p.set(a,_),_+=a.length;return p}},r={arraySet:function(c,b,v,g,_){for(var a=0;a<g;a++)c[_+a]=b[v+a]},flattenChunks:function(c){return[].concat.apply([],c)}};u.setTyped=function(c){c?(u.Buf8=Uint8Array,u.Buf16=Uint16Array,u.Buf32=Int32Array,u.assign(u,s)):(u.Buf8=Array,u.Buf16=Array,u.Buf32=Array,u.assign(u,r))},u.setTyped(i)},{}],42:[function(o,k,u){var i=o("./common"),s=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var c=new i.Buf8(256),b=0;b<256;b++)c[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;function v(g,_){if(_<65537&&(g.subarray&&r||!g.subarray&&s))return String.fromCharCode.apply(null,i.shrinkBuf(g,_));for(var a="",p=0;p<_;p++)a+=String.fromCharCode(g[p]);return a}c[254]=c[254]=1,u.string2buf=function(g){var _,a,p,n,d,l=g.length,m=0;for(n=0;n<l;n++)(64512&(a=g.charCodeAt(n)))==55296&&n+1<l&&(64512&(p=g.charCodeAt(n+1)))==56320&&(a=65536+(a-55296<<10)+(p-56320),n++),m+=a<128?1:a<2048?2:a<65536?3:4;for(_=new i.Buf8(m),n=d=0;d<m;n++)(64512&(a=g.charCodeAt(n)))==55296&&n+1<l&&(64512&(p=g.charCodeAt(n+1)))==56320&&(a=65536+(a-55296<<10)+(p-56320),n++),a<128?_[d++]=a:(a<2048?_[d++]=192|a>>>6:(a<65536?_[d++]=224|a>>>12:(_[d++]=240|a>>>18,_[d++]=128|a>>>12&63),_[d++]=128|a>>>6&63),_[d++]=128|63&a);return _},u.buf2binstring=function(g){return v(g,g.length)},u.binstring2buf=function(g){for(var _=new i.Buf8(g.length),a=0,p=_.length;a<p;a++)_[a]=g.charCodeAt(a);return _},u.buf2string=function(g,_){var a,p,n,d,l=_||g.length,m=new Array(2*l);for(a=p=0;a<l;)if((n=g[a++])<128)m[p++]=n;else if(4<(d=c[n]))m[p++]=65533,a+=d-1;else{for(n&=d===2?31:d===3?15:7;1<d&&a<l;)n=n<<6|63&g[a++],d--;1<d?m[p++]=65533:n<65536?m[p++]=n:(n-=65536,m[p++]=55296|n>>10&1023,m[p++]=56320|1023&n)}return v(m,p)},u.utf8border=function(g,_){var a;for((_=_||g.length)>g.length&&(_=g.length),a=_-1;0<=a&&(192&g[a])==128;)a--;return a<0||a===0?_:a+c[g[a]]>_?a:_}},{"./common":41}],43:[function(o,k,u){k.exports=function(i,s,r,c){for(var b=65535&i|0,v=i>>>16&65535|0,g=0;r!==0;){for(r-=g=2e3<r?2e3:r;v=v+(b=b+s[c++]|0)|0,--g;);b%=65521,v%=65521}return b|v<<16|0}},{}],44:[function(o,k,u){k.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(o,k,u){var i=(function(){for(var s,r=[],c=0;c<256;c++){s=c;for(var b=0;b<8;b++)s=1&s?3988292384^s>>>1:s>>>1;r[c]=s}return r})();k.exports=function(s,r,c,b){var v=i,g=b+c;s^=-1;for(var _=b;_<g;_++)s=s>>>8^v[255&(s^r[_])];return-1^s}},{}],46:[function(o,k,u){var i,s=o("../utils/common"),r=o("./trees"),c=o("./adler32"),b=o("./crc32"),v=o("./messages"),g=0,_=4,a=0,p=-2,n=-1,d=4,l=2,m=8,w=9,z=286,S=30,P=19,j=2*z+1,W=15,O=3,G=258,J=G+O+1,y=42,R=113,e=1,T=2,tt=3,L=4;function et(t,B){return t.msg=v[B],B}function Z(t){return(t<<1)-(4<t?9:0)}function Q(t){for(var B=t.length;0<=--B;)t[B]=0}function I(t){var B=t.state,N=B.pending;N>t.avail_out&&(N=t.avail_out),N!==0&&(s.arraySet(t.output,B.pending_buf,B.pending_out,N,t.next_out),t.next_out+=N,B.pending_out+=N,t.total_out+=N,t.avail_out-=N,B.pending-=N,B.pending===0&&(B.pending_out=0))}function A(t,B){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,B),t.block_start=t.strstart,I(t.strm)}function q(t,B){t.pending_buf[t.pending++]=B}function Y(t,B){t.pending_buf[t.pending++]=B>>>8&255,t.pending_buf[t.pending++]=255&B}function K(t,B){var N,f,h=t.max_chain_length,x=t.strstart,F=t.prev_length,U=t.nice_match,C=t.strstart>t.w_size-J?t.strstart-(t.w_size-J):0,M=t.window,X=t.w_mask,V=t.prev,$=t.strstart+G,st=M[x+F-1],nt=M[x+F];t.prev_length>=t.good_match&&(h>>=2),U>t.lookahead&&(U=t.lookahead);do if(M[(N=B)+F]===nt&&M[N+F-1]===st&&M[N]===M[x]&&M[++N]===M[x+1]){x+=2,N++;do;while(M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&M[++x]===M[++N]&&x<$);if(f=G-($-x),x=$-G,F<f){if(t.match_start=B,U<=(F=f))break;st=M[x+F-1],nt=M[x+F]}}while((B=V[B&X])>C&&--h!=0);return F<=t.lookahead?F:t.lookahead}function at(t){var B,N,f,h,x,F,U,C,M,X,V=t.w_size;do{if(h=t.window_size-t.lookahead-t.strstart,t.strstart>=V+(V-J)){for(s.arraySet(t.window,t.window,V,V,0),t.match_start-=V,t.strstart-=V,t.block_start-=V,B=N=t.hash_size;f=t.head[--B],t.head[B]=V<=f?f-V:0,--N;);for(B=N=V;f=t.prev[--B],t.prev[B]=V<=f?f-V:0,--N;);h+=V}if(t.strm.avail_in===0)break;if(F=t.strm,U=t.window,C=t.strstart+t.lookahead,M=h,X=void 0,X=F.avail_in,M<X&&(X=M),N=X===0?0:(F.avail_in-=X,s.arraySet(U,F.input,F.next_in,X,C),F.state.wrap===1?F.adler=c(F.adler,U,X,C):F.state.wrap===2&&(F.adler=b(F.adler,U,X,C)),F.next_in+=X,F.total_in+=X,X),t.lookahead+=N,t.lookahead+t.insert>=O)for(x=t.strstart-t.insert,t.ins_h=t.window[x],t.ins_h=(t.ins_h<<t.hash_shift^t.window[x+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[x+O-1])&t.hash_mask,t.prev[x&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=x,x++,t.insert--,!(t.lookahead+t.insert<O)););}while(t.lookahead<J&&t.strm.avail_in!==0)}function ct(t,B){for(var N,f;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&B===g)return e;if(t.lookahead===0)break}if(N=0,t.lookahead>=O&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,N=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),N!==0&&t.strstart-N<=t.w_size-J&&(t.match_length=K(t,N)),t.match_length>=O)if(f=r._tr_tally(t,t.strstart-t.match_start,t.match_length-O),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=O){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,N=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,--t.match_length!=0;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else f=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(f&&(A(t,!1),t.strm.avail_out===0))return e}return t.insert=t.strstart<O-1?t.strstart:O-1,B===_?(A(t,!0),t.strm.avail_out===0?tt:L):t.last_lit&&(A(t,!1),t.strm.avail_out===0)?e:T}function rt(t,B){for(var N,f,h;;){if(t.lookahead<J){if(at(t),t.lookahead<J&&B===g)return e;if(t.lookahead===0)break}if(N=0,t.lookahead>=O&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,N=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=O-1,N!==0&&t.prev_length<t.max_lazy_match&&t.strstart-N<=t.w_size-J&&(t.match_length=K(t,N),t.match_length<=5&&(t.strategy===1||t.match_length===O&&4096<t.strstart-t.match_start)&&(t.match_length=O-1)),t.prev_length>=O&&t.match_length<=t.prev_length){for(h=t.strstart+t.lookahead-O,f=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-O),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=h&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+O-1])&t.hash_mask,N=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),--t.prev_length!=0;);if(t.match_available=0,t.match_length=O-1,t.strstart++,f&&(A(t,!1),t.strm.avail_out===0))return e}else if(t.match_available){if((f=r._tr_tally(t,0,t.window[t.strstart-1]))&&A(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return e}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(f=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<O-1?t.strstart:O-1,B===_?(A(t,!0),t.strm.avail_out===0?tt:L):t.last_lit&&(A(t,!1),t.strm.avail_out===0)?e:T}function it(t,B,N,f,h){this.good_length=t,this.max_lazy=B,this.nice_length=N,this.max_chain=f,this.func=h}function ut(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=m,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*j),this.dyn_dtree=new s.Buf16(2*(2*S+1)),this.bl_tree=new s.Buf16(2*(2*P+1)),Q(this.dyn_ltree),Q(this.dyn_dtree),Q(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(W+1),this.heap=new s.Buf16(2*z+1),Q(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*z+1),Q(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ot(t){var B;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=l,(B=t.state).pending=0,B.pending_out=0,B.wrap<0&&(B.wrap=-B.wrap),B.status=B.wrap?y:R,t.adler=B.wrap===2?0:1,B.last_flush=g,r._tr_init(B),a):et(t,p)}function ft(t){var B=ot(t);return B===a&&(function(N){N.window_size=2*N.w_size,Q(N.head),N.max_lazy_match=i[N.level].max_lazy,N.good_match=i[N.level].good_length,N.nice_match=i[N.level].nice_length,N.max_chain_length=i[N.level].max_chain,N.strstart=0,N.block_start=0,N.lookahead=0,N.insert=0,N.match_length=N.prev_length=O-1,N.match_available=0,N.ins_h=0})(t.state),B}function dt(t,B,N,f,h,x){if(!t)return p;var F=1;if(B===n&&(B=6),f<0?(F=0,f=-f):15<f&&(F=2,f-=16),h<1||w<h||N!==m||f<8||15<f||B<0||9<B||x<0||d<x)return et(t,p);f===8&&(f=9);var U=new ut;return(t.state=U).strm=t,U.wrap=F,U.gzhead=null,U.w_bits=f,U.w_size=1<<U.w_bits,U.w_mask=U.w_size-1,U.hash_bits=h+7,U.hash_size=1<<U.hash_bits,U.hash_mask=U.hash_size-1,U.hash_shift=~~((U.hash_bits+O-1)/O),U.window=new s.Buf8(2*U.w_size),U.head=new s.Buf16(U.hash_size),U.prev=new s.Buf16(U.w_size),U.lit_bufsize=1<<h+6,U.pending_buf_size=4*U.lit_bufsize,U.pending_buf=new s.Buf8(U.pending_buf_size),U.d_buf=1*U.lit_bufsize,U.l_buf=3*U.lit_bufsize,U.level=B,U.strategy=x,U.method=N,ft(t)}i=[new it(0,0,0,0,function(t,B){var N=65535;for(N>t.pending_buf_size-5&&(N=t.pending_buf_size-5);;){if(t.lookahead<=1){if(at(t),t.lookahead===0&&B===g)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var f=t.block_start+N;if((t.strstart===0||t.strstart>=f)&&(t.lookahead=t.strstart-f,t.strstart=f,A(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-J&&(A(t,!1),t.strm.avail_out===0))return e}return t.insert=0,B===_?(A(t,!0),t.strm.avail_out===0?tt:L):(t.strstart>t.block_start&&(A(t,!1),t.strm.avail_out),e)}),new it(4,4,8,4,ct),new it(4,5,16,8,ct),new it(4,6,32,32,ct),new it(4,4,16,16,rt),new it(8,16,32,32,rt),new it(8,16,128,128,rt),new it(8,32,128,256,rt),new it(32,128,258,1024,rt),new it(32,258,258,4096,rt)],u.deflateInit=function(t,B){return dt(t,B,m,15,8,0)},u.deflateInit2=dt,u.deflateReset=ft,u.deflateResetKeep=ot,u.deflateSetHeader=function(t,B){return t&&t.state?t.state.wrap!==2?p:(t.state.gzhead=B,a):p},u.deflate=function(t,B){var N,f,h,x;if(!t||!t.state||5<B||B<0)return t?et(t,p):p;if(f=t.state,!t.output||!t.input&&t.avail_in!==0||f.status===666&&B!==_)return et(t,t.avail_out===0?-5:p);if(f.strm=t,N=f.last_flush,f.last_flush=B,f.status===y)if(f.wrap===2)t.adler=0,q(f,31),q(f,139),q(f,8),f.gzhead?(q(f,(f.gzhead.text?1:0)+(f.gzhead.hcrc?2:0)+(f.gzhead.extra?4:0)+(f.gzhead.name?8:0)+(f.gzhead.comment?16:0)),q(f,255&f.gzhead.time),q(f,f.gzhead.time>>8&255),q(f,f.gzhead.time>>16&255),q(f,f.gzhead.time>>24&255),q(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),q(f,255&f.gzhead.os),f.gzhead.extra&&f.gzhead.extra.length&&(q(f,255&f.gzhead.extra.length),q(f,f.gzhead.extra.length>>8&255)),f.gzhead.hcrc&&(t.adler=b(t.adler,f.pending_buf,f.pending,0)),f.gzindex=0,f.status=69):(q(f,0),q(f,0),q(f,0),q(f,0),q(f,0),q(f,f.level===9?2:2<=f.strategy||f.level<2?4:0),q(f,3),f.status=R);else{var F=m+(f.w_bits-8<<4)<<8;F|=(2<=f.strategy||f.level<2?0:f.level<6?1:f.level===6?2:3)<<6,f.strstart!==0&&(F|=32),F+=31-F%31,f.status=R,Y(f,F),f.strstart!==0&&(Y(f,t.adler>>>16),Y(f,65535&t.adler)),t.adler=1}if(f.status===69)if(f.gzhead.extra){for(h=f.pending;f.gzindex<(65535&f.gzhead.extra.length)&&(f.pending!==f.pending_buf_size||(f.gzhead.hcrc&&f.pending>h&&(t.adler=b(t.adler,f.pending_buf,f.pending-h,h)),I(t),h=f.pending,f.pending!==f.pending_buf_size));)q(f,255&f.gzhead.extra[f.gzindex]),f.gzindex++;f.gzhead.hcrc&&f.pending>h&&(t.adler=b(t.adler,f.pending_buf,f.pending-h,h)),f.gzindex===f.gzhead.extra.length&&(f.gzindex=0,f.status=73)}else f.status=73;if(f.status===73)if(f.gzhead.name){h=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>h&&(t.adler=b(t.adler,f.pending_buf,f.pending-h,h)),I(t),h=f.pending,f.pending===f.pending_buf_size)){x=1;break}x=f.gzindex<f.gzhead.name.length?255&f.gzhead.name.charCodeAt(f.gzindex++):0,q(f,x)}while(x!==0);f.gzhead.hcrc&&f.pending>h&&(t.adler=b(t.adler,f.pending_buf,f.pending-h,h)),x===0&&(f.gzindex=0,f.status=91)}else f.status=91;if(f.status===91)if(f.gzhead.comment){h=f.pending;do{if(f.pending===f.pending_buf_size&&(f.gzhead.hcrc&&f.pending>h&&(t.adler=b(t.adler,f.pending_buf,f.pending-h,h)),I(t),h=f.pending,f.pending===f.pending_buf_size)){x=1;break}x=f.gzindex<f.gzhead.comment.length?255&f.gzhead.comment.charCodeAt(f.gzindex++):0,q(f,x)}while(x!==0);f.gzhead.hcrc&&f.pending>h&&(t.adler=b(t.adler,f.pending_buf,f.pending-h,h)),x===0&&(f.status=103)}else f.status=103;if(f.status===103&&(f.gzhead.hcrc?(f.pending+2>f.pending_buf_size&&I(t),f.pending+2<=f.pending_buf_size&&(q(f,255&t.adler),q(f,t.adler>>8&255),t.adler=0,f.status=R)):f.status=R),f.pending!==0){if(I(t),t.avail_out===0)return f.last_flush=-1,a}else if(t.avail_in===0&&Z(B)<=Z(N)&&B!==_)return et(t,-5);if(f.status===666&&t.avail_in!==0)return et(t,-5);if(t.avail_in!==0||f.lookahead!==0||B!==g&&f.status!==666){var U=f.strategy===2?(function(C,M){for(var X;;){if(C.lookahead===0&&(at(C),C.lookahead===0)){if(M===g)return e;break}if(C.match_length=0,X=r._tr_tally(C,0,C.window[C.strstart]),C.lookahead--,C.strstart++,X&&(A(C,!1),C.strm.avail_out===0))return e}return C.insert=0,M===_?(A(C,!0),C.strm.avail_out===0?tt:L):C.last_lit&&(A(C,!1),C.strm.avail_out===0)?e:T})(f,B):f.strategy===3?(function(C,M){for(var X,V,$,st,nt=C.window;;){if(C.lookahead<=G){if(at(C),C.lookahead<=G&&M===g)return e;if(C.lookahead===0)break}if(C.match_length=0,C.lookahead>=O&&0<C.strstart&&(V=nt[$=C.strstart-1])===nt[++$]&&V===nt[++$]&&V===nt[++$]){st=C.strstart+G;do;while(V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&V===nt[++$]&&$<st);C.match_length=G-(st-$),C.match_length>C.lookahead&&(C.match_length=C.lookahead)}if(C.match_length>=O?(X=r._tr_tally(C,1,C.match_length-O),C.lookahead-=C.match_length,C.strstart+=C.match_length,C.match_length=0):(X=r._tr_tally(C,0,C.window[C.strstart]),C.lookahead--,C.strstart++),X&&(A(C,!1),C.strm.avail_out===0))return e}return C.insert=0,M===_?(A(C,!0),C.strm.avail_out===0?tt:L):C.last_lit&&(A(C,!1),C.strm.avail_out===0)?e:T})(f,B):i[f.level].func(f,B);if(U!==tt&&U!==L||(f.status=666),U===e||U===tt)return t.avail_out===0&&(f.last_flush=-1),a;if(U===T&&(B===1?r._tr_align(f):B!==5&&(r._tr_stored_block(f,0,0,!1),B===3&&(Q(f.head),f.lookahead===0&&(f.strstart=0,f.block_start=0,f.insert=0))),I(t),t.avail_out===0))return f.last_flush=-1,a}return B!==_?a:f.wrap<=0?1:(f.wrap===2?(q(f,255&t.adler),q(f,t.adler>>8&255),q(f,t.adler>>16&255),q(f,t.adler>>24&255),q(f,255&t.total_in),q(f,t.total_in>>8&255),q(f,t.total_in>>16&255),q(f,t.total_in>>24&255)):(Y(f,t.adler>>>16),Y(f,65535&t.adler)),I(t),0<f.wrap&&(f.wrap=-f.wrap),f.pending!==0?a:1)},u.deflateEnd=function(t){var B;return t&&t.state?(B=t.state.status)!==y&&B!==69&&B!==73&&B!==91&&B!==103&&B!==R&&B!==666?et(t,p):(t.state=null,B===R?et(t,-3):a):p},u.deflateSetDictionary=function(t,B){var N,f,h,x,F,U,C,M,X=B.length;if(!t||!t.state||(x=(N=t.state).wrap)===2||x===1&&N.status!==y||N.lookahead)return p;for(x===1&&(t.adler=c(t.adler,B,X,0)),N.wrap=0,X>=N.w_size&&(x===0&&(Q(N.head),N.strstart=0,N.block_start=0,N.insert=0),M=new s.Buf8(N.w_size),s.arraySet(M,B,X-N.w_size,N.w_size,0),B=M,X=N.w_size),F=t.avail_in,U=t.next_in,C=t.input,t.avail_in=X,t.next_in=0,t.input=B,at(N);N.lookahead>=O;){for(f=N.strstart,h=N.lookahead-(O-1);N.ins_h=(N.ins_h<<N.hash_shift^N.window[f+O-1])&N.hash_mask,N.prev[f&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=f,f++,--h;);N.strstart=f,N.lookahead=O-1,at(N)}return N.strstart+=N.lookahead,N.block_start=N.strstart,N.insert=N.lookahead,N.lookahead=0,N.match_length=N.prev_length=O-1,N.match_available=0,t.next_in=U,t.input=C,t.avail_in=F,N.wrap=x,a},u.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(o,k,u){k.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(o,k,u){k.exports=function(i,s){var r,c,b,v,g,_,a,p,n,d,l,m,w,z,S,P,j,W,O,G,J,y,R,e,T;r=i.state,c=i.next_in,e=i.input,b=c+(i.avail_in-5),v=i.next_out,T=i.output,g=v-(s-i.avail_out),_=v+(i.avail_out-257),a=r.dmax,p=r.wsize,n=r.whave,d=r.wnext,l=r.window,m=r.hold,w=r.bits,z=r.lencode,S=r.distcode,P=(1<<r.lenbits)-1,j=(1<<r.distbits)-1;t:do{w<15&&(m+=e[c++]<<w,w+=8,m+=e[c++]<<w,w+=8),W=z[m&P];e:for(;;){if(m>>>=O=W>>>24,w-=O,(O=W>>>16&255)===0)T[v++]=65535&W;else{if(!(16&O)){if((64&O)==0){W=z[(65535&W)+(m&(1<<O)-1)];continue e}if(32&O){r.mode=12;break t}i.msg="invalid literal/length code",r.mode=30;break t}G=65535&W,(O&=15)&&(w<O&&(m+=e[c++]<<w,w+=8),G+=m&(1<<O)-1,m>>>=O,w-=O),w<15&&(m+=e[c++]<<w,w+=8,m+=e[c++]<<w,w+=8),W=S[m&j];r:for(;;){if(m>>>=O=W>>>24,w-=O,!(16&(O=W>>>16&255))){if((64&O)==0){W=S[(65535&W)+(m&(1<<O)-1)];continue r}i.msg="invalid distance code",r.mode=30;break t}if(J=65535&W,w<(O&=15)&&(m+=e[c++]<<w,(w+=8)<O&&(m+=e[c++]<<w,w+=8)),a<(J+=m&(1<<O)-1)){i.msg="invalid distance too far back",r.mode=30;break t}if(m>>>=O,w-=O,(O=v-g)<J){if(n<(O=J-O)&&r.sane){i.msg="invalid distance too far back",r.mode=30;break t}if(R=l,(y=0)===d){if(y+=p-O,O<G){for(G-=O;T[v++]=l[y++],--O;);y=v-J,R=T}}else if(d<O){if(y+=p+d-O,(O-=d)<G){for(G-=O;T[v++]=l[y++],--O;);if(y=0,d<G){for(G-=O=d;T[v++]=l[y++],--O;);y=v-J,R=T}}}else if(y+=d-O,O<G){for(G-=O;T[v++]=l[y++],--O;);y=v-J,R=T}for(;2<G;)T[v++]=R[y++],T[v++]=R[y++],T[v++]=R[y++],G-=3;G&&(T[v++]=R[y++],1<G&&(T[v++]=R[y++]))}else{for(y=v-J;T[v++]=T[y++],T[v++]=T[y++],T[v++]=T[y++],2<(G-=3););G&&(T[v++]=T[y++],1<G&&(T[v++]=T[y++]))}break}}break}}while(c<b&&v<_);c-=G=w>>3,m&=(1<<(w-=G<<3))-1,i.next_in=c,i.next_out=v,i.avail_in=c<b?b-c+5:5-(c-b),i.avail_out=v<_?_-v+257:257-(v-_),r.hold=m,r.bits=w}},{}],49:[function(o,k,u){var i=o("../utils/common"),s=o("./adler32"),r=o("./crc32"),c=o("./inffast"),b=o("./inftrees"),v=1,g=2,_=0,a=-2,p=1,n=852,d=592;function l(y){return(y>>>24&255)+(y>>>8&65280)+((65280&y)<<8)+((255&y)<<24)}function m(){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 i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(y){var R;return y&&y.state?(R=y.state,y.total_in=y.total_out=R.total=0,y.msg="",R.wrap&&(y.adler=1&R.wrap),R.mode=p,R.last=0,R.havedict=0,R.dmax=32768,R.head=null,R.hold=0,R.bits=0,R.lencode=R.lendyn=new i.Buf32(n),R.distcode=R.distdyn=new i.Buf32(d),R.sane=1,R.back=-1,_):a}function z(y){var R;return y&&y.state?((R=y.state).wsize=0,R.whave=0,R.wnext=0,w(y)):a}function S(y,R){var e,T;return y&&y.state?(T=y.state,R<0?(e=0,R=-R):(e=1+(R>>4),R<48&&(R&=15)),R&&(R<8||15<R)?a:(T.window!==null&&T.wbits!==R&&(T.window=null),T.wrap=e,T.wbits=R,z(y))):a}function P(y,R){var e,T;return y?(T=new m,(y.state=T).window=null,(e=S(y,R))!==_&&(y.state=null),e):a}var j,W,O=!0;function G(y){if(O){var R;for(j=new i.Buf32(512),W=new i.Buf32(32),R=0;R<144;)y.lens[R++]=8;for(;R<256;)y.lens[R++]=9;for(;R<280;)y.lens[R++]=7;for(;R<288;)y.lens[R++]=8;for(b(v,y.lens,0,288,j,0,y.work,{bits:9}),R=0;R<32;)y.lens[R++]=5;b(g,y.lens,0,32,W,0,y.work,{bits:5}),O=!1}y.lencode=j,y.lenbits=9,y.distcode=W,y.distbits=5}function J(y,R,e,T){var tt,L=y.state;return L.window===null&&(L.wsize=1<<L.wbits,L.wnext=0,L.whave=0,L.window=new i.Buf8(L.wsize)),T>=L.wsize?(i.arraySet(L.window,R,e-L.wsize,L.wsize,0),L.wnext=0,L.whave=L.wsize):(T<(tt=L.wsize-L.wnext)&&(tt=T),i.arraySet(L.window,R,e-T,tt,L.wnext),(T-=tt)?(i.arraySet(L.window,R,e-T,T,0),L.wnext=T,L.whave=L.wsize):(L.wnext+=tt,L.wnext===L.wsize&&(L.wnext=0),L.whave<L.wsize&&(L.whave+=tt))),0}u.inflateReset=z,u.inflateReset2=S,u.inflateResetKeep=w,u.inflateInit=function(y){return P(y,15)},u.inflateInit2=P,u.inflate=function(y,R){var e,T,tt,L,et,Z,Q,I,A,q,Y,K,at,ct,rt,it,ut,ot,ft,dt,t,B,N,f,h=0,x=new i.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!y||!y.state||!y.output||!y.input&&y.avail_in!==0)return a;(e=y.state).mode===12&&(e.mode=13),et=y.next_out,tt=y.output,Q=y.avail_out,L=y.next_in,T=y.input,Z=y.avail_in,I=e.hold,A=e.bits,q=Z,Y=Q,B=_;t:for(;;)switch(e.mode){case p:if(e.wrap===0){e.mode=13;break}for(;A<16;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if(2&e.wrap&&I===35615){x[e.check=0]=255&I,x[1]=I>>>8&255,e.check=r(e.check,x,2,0),A=I=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&I)<<8)+(I>>8))%31){y.msg="incorrect header check",e.mode=30;break}if((15&I)!=8){y.msg="unknown compression method",e.mode=30;break}if(A-=4,t=8+(15&(I>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){y.msg="invalid window size",e.mode=30;break}e.dmax=1<<t,y.adler=e.check=1,e.mode=512&I?10:12,A=I=0;break;case 2:for(;A<16;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if(e.flags=I,(255&e.flags)!=8){y.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){y.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=I>>8&1),512&e.flags&&(x[0]=255&I,x[1]=I>>>8&255,e.check=r(e.check,x,2,0)),A=I=0,e.mode=3;case 3:for(;A<32;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}e.head&&(e.head.time=I),512&e.flags&&(x[0]=255&I,x[1]=I>>>8&255,x[2]=I>>>16&255,x[3]=I>>>24&255,e.check=r(e.check,x,4,0)),A=I=0,e.mode=4;case 4:for(;A<16;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}e.head&&(e.head.xflags=255&I,e.head.os=I>>8),512&e.flags&&(x[0]=255&I,x[1]=I>>>8&255,e.check=r(e.check,x,2,0)),A=I=0,e.mode=5;case 5:if(1024&e.flags){for(;A<16;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}e.length=I,e.head&&(e.head.extra_len=I),512&e.flags&&(x[0]=255&I,x[1]=I>>>8&255,e.check=r(e.check,x,2,0)),A=I=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(Z<(K=e.length)&&(K=Z),K&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),i.arraySet(e.head.extra,T,L,K,t)),512&e.flags&&(e.check=r(e.check,T,K,L)),Z-=K,L+=K,e.length-=K),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(Z===0)break t;for(K=0;t=T[L+K++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&K<Z;);if(512&e.flags&&(e.check=r(e.check,T,K,L)),Z-=K,L+=K,t)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(Z===0)break t;for(K=0;t=T[L+K++],e.head&&t&&e.length<65536&&(e.head.comment+=String.fromCharCode(t)),t&&K<Z;);if(512&e.flags&&(e.check=r(e.check,T,K,L)),Z-=K,L+=K,t)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;A<16;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if(I!==(65535&e.check)){y.msg="header crc mismatch",e.mode=30;break}A=I=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),y.adler=e.check=0,e.mode=12;break;case 10:for(;A<32;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}y.adler=e.check=l(I),A=I=0,e.mode=11;case 11:if(e.havedict===0)return y.next_out=et,y.avail_out=Q,y.next_in=L,y.avail_in=Z,e.hold=I,e.bits=A,2;y.adler=e.check=1,e.mode=12;case 12:if(R===5||R===6)break t;case 13:if(e.last){I>>>=7&A,A-=7&A,e.mode=27;break}for(;A<3;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}switch(e.last=1&I,A-=1,3&(I>>>=1)){case 0:e.mode=14;break;case 1:if(G(e),e.mode=20,R!==6)break;I>>>=2,A-=2;break t;case 2:e.mode=17;break;case 3:y.msg="invalid block type",e.mode=30}I>>>=2,A-=2;break;case 14:for(I>>>=7&A,A-=7&A;A<32;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if((65535&I)!=(I>>>16^65535)){y.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&I,A=I=0,e.mode=15,R===6)break t;case 15:e.mode=16;case 16:if(K=e.length){if(Z<K&&(K=Z),Q<K&&(K=Q),K===0)break t;i.arraySet(tt,T,L,K,et),Z-=K,L+=K,Q-=K,et+=K,e.length-=K;break}e.mode=12;break;case 17:for(;A<14;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if(e.nlen=257+(31&I),I>>>=5,A-=5,e.ndist=1+(31&I),I>>>=5,A-=5,e.ncode=4+(15&I),I>>>=4,A-=4,286<e.nlen||30<e.ndist){y.msg="too many length or distance symbols",e.mode=30;break}e.have=0,e.mode=18;case 18:for(;e.have<e.ncode;){for(;A<3;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}e.lens[F[e.have++]]=7&I,I>>>=3,A-=3}for(;e.have<19;)e.lens[F[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,N={bits:e.lenbits},B=b(0,e.lens,0,19,e.lencode,0,e.work,N),e.lenbits=N.bits,B){y.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;it=(h=e.lencode[I&(1<<e.lenbits)-1])>>>16&255,ut=65535&h,!((rt=h>>>24)<=A);){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if(ut<16)I>>>=rt,A-=rt,e.lens[e.have++]=ut;else{if(ut===16){for(f=rt+2;A<f;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if(I>>>=rt,A-=rt,e.have===0){y.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],K=3+(3&I),I>>>=2,A-=2}else if(ut===17){for(f=rt+3;A<f;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}A-=rt,t=0,K=3+(7&(I>>>=rt)),I>>>=3,A-=3}else{for(f=rt+7;A<f;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}A-=rt,t=0,K=11+(127&(I>>>=rt)),I>>>=7,A-=7}if(e.have+K>e.nlen+e.ndist){y.msg="invalid bit length repeat",e.mode=30;break}for(;K--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){y.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,N={bits:e.lenbits},B=b(v,e.lens,0,e.nlen,e.lencode,0,e.work,N),e.lenbits=N.bits,B){y.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,N={bits:e.distbits},B=b(g,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,N),e.distbits=N.bits,B){y.msg="invalid distances set",e.mode=30;break}if(e.mode=20,R===6)break t;case 20:e.mode=21;case 21:if(6<=Z&&258<=Q){y.next_out=et,y.avail_out=Q,y.next_in=L,y.avail_in=Z,e.hold=I,e.bits=A,c(y,Y),et=y.next_out,tt=y.output,Q=y.avail_out,L=y.next_in,T=y.input,Z=y.avail_in,I=e.hold,A=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;it=(h=e.lencode[I&(1<<e.lenbits)-1])>>>16&255,ut=65535&h,!((rt=h>>>24)<=A);){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if(it&&(240&it)==0){for(ot=rt,ft=it,dt=ut;it=(h=e.lencode[dt+((I&(1<<ot+ft)-1)>>ot)])>>>16&255,ut=65535&h,!(ot+(rt=h>>>24)<=A);){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}I>>>=ot,A-=ot,e.back+=ot}if(I>>>=rt,A-=rt,e.back+=rt,e.length=ut,it===0){e.mode=26;break}if(32&it){e.back=-1,e.mode=12;break}if(64&it){y.msg="invalid literal/length code",e.mode=30;break}e.extra=15&it,e.mode=22;case 22:if(e.extra){for(f=e.extra;A<f;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}e.length+=I&(1<<e.extra)-1,I>>>=e.extra,A-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;it=(h=e.distcode[I&(1<<e.distbits)-1])>>>16&255,ut=65535&h,!((rt=h>>>24)<=A);){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if((240&it)==0){for(ot=rt,ft=it,dt=ut;it=(h=e.distcode[dt+((I&(1<<ot+ft)-1)>>ot)])>>>16&255,ut=65535&h,!(ot+(rt=h>>>24)<=A);){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}I>>>=ot,A-=ot,e.back+=ot}if(I>>>=rt,A-=rt,e.back+=rt,64&it){y.msg="invalid distance code",e.mode=30;break}e.offset=ut,e.extra=15&it,e.mode=24;case 24:if(e.extra){for(f=e.extra;A<f;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}e.offset+=I&(1<<e.extra)-1,I>>>=e.extra,A-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){y.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if(Q===0)break t;if(K=Y-Q,e.offset>K){if((K=e.offset-K)>e.whave&&e.sane){y.msg="invalid distance too far back",e.mode=30;break}at=K>e.wnext?(K-=e.wnext,e.wsize-K):e.wnext-K,K>e.length&&(K=e.length),ct=e.window}else ct=tt,at=et-e.offset,K=e.length;for(Q<K&&(K=Q),Q-=K,e.length-=K;tt[et++]=ct[at++],--K;);e.length===0&&(e.mode=21);break;case 26:if(Q===0)break t;tt[et++]=e.length,Q--,e.mode=21;break;case 27:if(e.wrap){for(;A<32;){if(Z===0)break t;Z--,I|=T[L++]<<A,A+=8}if(Y-=Q,y.total_out+=Y,e.total+=Y,Y&&(y.adler=e.check=e.flags?r(e.check,tt,Y,et-Y):s(e.check,tt,Y,et-Y)),Y=Q,(e.flags?I:l(I))!==e.check){y.msg="incorrect data check",e.mode=30;break}A=I=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;A<32;){if(Z===0)break t;Z--,I+=T[L++]<<A,A+=8}if(I!==(4294967295&e.total)){y.msg="incorrect length check",e.mode=30;break}A=I=0}e.mode=29;case 29:B=1;break t;case 30:B=-3;break t;case 31:return-4;case 32:default:return a}return y.next_out=et,y.avail_out=Q,y.next_in=L,y.avail_in=Z,e.hold=I,e.bits=A,(e.wsize||Y!==y.avail_out&&e.mode<30&&(e.mode<27||R!==4))&&J(y,y.output,y.next_out,Y-y.avail_out)?(e.mode=31,-4):(q-=y.avail_in,Y-=y.avail_out,y.total_in+=q,y.total_out+=Y,e.total+=Y,e.wrap&&Y&&(y.adler=e.check=e.flags?r(e.check,tt,Y,y.next_out-Y):s(e.check,tt,Y,y.next_out-Y)),y.data_type=e.bits+(e.last?64:0)+(e.mode===12?128:0)+(e.mode===20||e.mode===15?256:0),(q==0&&Y===0||R===4)&&B===_&&(B=-5),B)},u.inflateEnd=function(y){if(!y||!y.state)return a;var R=y.state;return R.window&&(R.window=null),y.state=null,_},u.inflateGetHeader=function(y,R){var e;return y&&y.state?(2&(e=y.state).wrap)==0?a:((e.head=R).done=!1,_):a},u.inflateSetDictionary=function(y,R){var e,T=R.length;return y&&y.state?(e=y.state).wrap!==0&&e.mode!==11?a:e.mode===11&&s(1,R,T,0)!==e.check?-3:J(y,R,T,T)?(e.mode=31,-4):(e.havedict=1,_):a},u.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(o,k,u){var i=o("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],c=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],b=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];k.exports=function(v,g,_,a,p,n,d,l){var m,w,z,S,P,j,W,O,G,J=l.bits,y=0,R=0,e=0,T=0,tt=0,L=0,et=0,Z=0,Q=0,I=0,A=null,q=0,Y=new i.Buf16(16),K=new i.Buf16(16),at=null,ct=0;for(y=0;y<=15;y++)Y[y]=0;for(R=0;R<a;R++)Y[g[_+R]]++;for(tt=J,T=15;1<=T&&Y[T]===0;T--);if(T<tt&&(tt=T),T===0)return p[n++]=20971520,p[n++]=20971520,l.bits=1,0;for(e=1;e<T&&Y[e]===0;e++);for(tt<e&&(tt=e),y=Z=1;y<=15;y++)if(Z<<=1,(Z-=Y[y])<0)return-1;if(0<Z&&(v===0||T!==1))return-1;for(K[1]=0,y=1;y<15;y++)K[y+1]=K[y]+Y[y];for(R=0;R<a;R++)g[_+R]!==0&&(d[K[g[_+R]]++]=R);if(j=v===0?(A=at=d,19):v===1?(A=s,q-=257,at=r,ct-=257,256):(A=c,at=b,-1),y=e,P=n,et=R=I=0,z=-1,S=(Q=1<<(L=tt))-1,v===1&&852<Q||v===2&&592<Q)return 1;for(;;){for(W=y-et,G=d[R]<j?(O=0,d[R]):d[R]>j?(O=at[ct+d[R]],A[q+d[R]]):(O=96,0),m=1<<y-et,e=w=1<<L;p[P+(I>>et)+(w-=m)]=W<<24|O<<16|G|0,w!==0;);for(m=1<<y-1;I&m;)m>>=1;if(m!==0?(I&=m-1,I+=m):I=0,R++,--Y[y]==0){if(y===T)break;y=g[_+d[R]]}if(tt<y&&(I&S)!==z){for(et===0&&(et=tt),P+=e,Z=1<<(L=y-et);L+et<T&&!((Z-=Y[L+et])<=0);)L++,Z<<=1;if(Q+=1<<L,v===1&&852<Q||v===2&&592<Q)return 1;p[z=I&S]=tt<<24|L<<16|P-n|0}}return I!==0&&(p[P+I]=y-et<<24|64<<16|0),l.bits=tt,0}},{"../utils/common":41}],51:[function(o,k,u){k.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(o,k,u){var i=o("../utils/common"),s=0,r=1;function c(h){for(var x=h.length;0<=--x;)h[x]=0}var b=0,v=29,g=256,_=g+1+v,a=30,p=19,n=2*_+1,d=15,l=16,m=7,w=256,z=16,S=17,P=18,j=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],W=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],O=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],G=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],J=new Array(2*(_+2));c(J);var y=new Array(2*a);c(y);var R=new Array(512);c(R);var e=new Array(256);c(e);var T=new Array(v);c(T);var tt,L,et,Z=new Array(a);function Q(h,x,F,U,C){this.static_tree=h,this.extra_bits=x,this.extra_base=F,this.elems=U,this.max_length=C,this.has_stree=h&&h.length}function I(h,x){this.dyn_tree=h,this.max_code=0,this.stat_desc=x}function A(h){return h<256?R[h]:R[256+(h>>>7)]}function q(h,x){h.pending_buf[h.pending++]=255&x,h.pending_buf[h.pending++]=x>>>8&255}function Y(h,x,F){h.bi_valid>l-F?(h.bi_buf|=x<<h.bi_valid&65535,q(h,h.bi_buf),h.bi_buf=x>>l-h.bi_valid,h.bi_valid+=F-l):(h.bi_buf|=x<<h.bi_valid&65535,h.bi_valid+=F)}function K(h,x,F){Y(h,F[2*x],F[2*x+1])}function at(h,x){for(var F=0;F|=1&h,h>>>=1,F<<=1,0<--x;);return F>>>1}function ct(h,x,F){var U,C,M=new Array(d+1),X=0;for(U=1;U<=d;U++)M[U]=X=X+F[U-1]<<1;for(C=0;C<=x;C++){var V=h[2*C+1];V!==0&&(h[2*C]=at(M[V]++,V))}}function rt(h){var x;for(x=0;x<_;x++)h.dyn_ltree[2*x]=0;for(x=0;x<a;x++)h.dyn_dtree[2*x]=0;for(x=0;x<p;x++)h.bl_tree[2*x]=0;h.dyn_ltree[2*w]=1,h.opt_len=h.static_len=0,h.last_lit=h.matches=0}function it(h){8<h.bi_valid?q(h,h.bi_buf):0<h.bi_valid&&(h.pending_buf[h.pending++]=h.bi_buf),h.bi_buf=0,h.bi_valid=0}function ut(h,x,F,U){var C=2*x,M=2*F;return h[C]<h[M]||h[C]===h[M]&&U[x]<=U[F]}function ot(h,x,F){for(var U=h.heap[F],C=F<<1;C<=h.heap_len&&(C<h.heap_len&&ut(x,h.heap[C+1],h.heap[C],h.depth)&&C++,!ut(x,U,h.heap[C],h.depth));)h.heap[F]=h.heap[C],F=C,C<<=1;h.heap[F]=U}function ft(h,x,F){var U,C,M,X,V=0;if(h.last_lit!==0)for(;U=h.pending_buf[h.d_buf+2*V]<<8|h.pending_buf[h.d_buf+2*V+1],C=h.pending_buf[h.l_buf+V],V++,U===0?K(h,C,x):(K(h,(M=e[C])+g+1,x),(X=j[M])!==0&&Y(h,C-=T[M],X),K(h,M=A(--U),F),(X=W[M])!==0&&Y(h,U-=Z[M],X)),V<h.last_lit;);K(h,w,x)}function dt(h,x){var F,U,C,M=x.dyn_tree,X=x.stat_desc.static_tree,V=x.stat_desc.has_stree,$=x.stat_desc.elems,st=-1;for(h.heap_len=0,h.heap_max=n,F=0;F<$;F++)M[2*F]!==0?(h.heap[++h.heap_len]=st=F,h.depth[F]=0):M[2*F+1]=0;for(;h.heap_len<2;)M[2*(C=h.heap[++h.heap_len]=st<2?++st:0)]=1,h.depth[C]=0,h.opt_len--,V&&(h.static_len-=X[2*C+1]);for(x.max_code=st,F=h.heap_len>>1;1<=F;F--)ot(h,M,F);for(C=$;F=h.heap[1],h.heap[1]=h.heap[h.heap_len--],ot(h,M,1),U=h.heap[1],h.heap[--h.heap_max]=F,h.heap[--h.heap_max]=U,M[2*C]=M[2*F]+M[2*U],h.depth[C]=(h.depth[F]>=h.depth[U]?h.depth[F]:h.depth[U])+1,M[2*F+1]=M[2*U+1]=C,h.heap[1]=C++,ot(h,M,1),2<=h.heap_len;);h.heap[--h.heap_max]=h.heap[1],(function(nt,ht){var _t,pt,bt,lt,yt,zt,mt=ht.dyn_tree,Nt=ht.max_code,Wt=ht.stat_desc.static_tree,Zt=ht.stat_desc.has_stree,Mt=ht.stat_desc.extra_bits,Ot=ht.stat_desc.extra_base,vt=ht.stat_desc.max_length,wt=0;for(lt=0;lt<=d;lt++)nt.bl_count[lt]=0;for(mt[2*nt.heap[nt.heap_max]+1]=0,_t=nt.heap_max+1;_t<n;_t++)vt<(lt=mt[2*mt[2*(pt=nt.heap[_t])+1]+1]+1)&&(lt=vt,wt++),mt[2*pt+1]=lt,Nt<pt||(nt.bl_count[lt]++,yt=0,Ot<=pt&&(yt=Mt[pt-Ot]),zt=mt[2*pt],nt.opt_len+=zt*(lt+yt),Zt&&(nt.static_len+=zt*(Wt[2*pt+1]+yt)));if(wt!==0){do{for(lt=vt-1;nt.bl_count[lt]===0;)lt--;nt.bl_count[lt]--,nt.bl_count[lt+1]+=2,nt.bl_count[vt]--,wt-=2}while(0<wt);for(lt=vt;lt!==0;lt--)for(pt=nt.bl_count[lt];pt!==0;)Nt<(bt=nt.heap[--_t])||(mt[2*bt+1]!==lt&&(nt.opt_len+=(lt-mt[2*bt+1])*mt[2*bt],mt[2*bt+1]=lt),pt--)}})(h,x),ct(M,st,h.bl_count)}function t(h,x,F){var U,C,M=-1,X=x[1],V=0,$=7,st=4;for(X===0&&($=138,st=3),x[2*(F+1)+1]=65535,U=0;U<=F;U++)C=X,X=x[2*(U+1)+1],++V<$&&C===X||(V<st?h.bl_tree[2*C]+=V:C!==0?(C!==M&&h.bl_tree[2*C]++,h.bl_tree[2*z]++):V<=10?h.bl_tree[2*S]++:h.bl_tree[2*P]++,M=C,st=(V=0)===X?($=138,3):C===X?($=6,3):($=7,4))}function B(h,x,F){var U,C,M=-1,X=x[1],V=0,$=7,st=4;for(X===0&&($=138,st=3),U=0;U<=F;U++)if(C=X,X=x[2*(U+1)+1],!(++V<$&&C===X)){if(V<st)for(;K(h,C,h.bl_tree),--V!=0;);else C!==0?(C!==M&&(K(h,C,h.bl_tree),V--),K(h,z,h.bl_tree),Y(h,V-3,2)):V<=10?(K(h,S,h.bl_tree),Y(h,V-3,3)):(K(h,P,h.bl_tree),Y(h,V-11,7));M=C,st=(V=0)===X?($=138,3):C===X?($=6,3):($=7,4)}}c(Z);var N=!1;function f(h,x,F,U){Y(h,(b<<1)+(U?1:0),3),(function(C,M,X,V){it(C),q(C,X),q(C,~X),i.arraySet(C.pending_buf,C.window,M,X,C.pending),C.pending+=X})(h,x,F)}u._tr_init=function(h){N||((function(){var x,F,U,C,M,X=new Array(d+1);for(C=U=0;C<v-1;C++)for(T[C]=U,x=0;x<1<<j[C];x++)e[U++]=C;for(e[U-1]=C,C=M=0;C<16;C++)for(Z[C]=M,x=0;x<1<<W[C];x++)R[M++]=C;for(M>>=7;C<a;C++)for(Z[C]=M<<7,x=0;x<1<<W[C]-7;x++)R[256+M++]=C;for(F=0;F<=d;F++)X[F]=0;for(x=0;x<=143;)J[2*x+1]=8,x++,X[8]++;for(;x<=255;)J[2*x+1]=9,x++,X[9]++;for(;x<=279;)J[2*x+1]=7,x++,X[7]++;for(;x<=287;)J[2*x+1]=8,x++,X[8]++;for(ct(J,_+1,X),x=0;x<a;x++)y[2*x+1]=5,y[2*x]=at(x,5);tt=new Q(J,j,g+1,_,d),L=new Q(y,W,0,a,d),et=new Q(new Array(0),O,0,p,m)})(),N=!0),h.l_desc=new I(h.dyn_ltree,tt),h.d_desc=new I(h.dyn_dtree,L),h.bl_desc=new I(h.bl_tree,et),h.bi_buf=0,h.bi_valid=0,rt(h)},u._tr_stored_block=f,u._tr_flush_block=function(h,x,F,U){var C,M,X=0;0<h.level?(h.strm.data_type===2&&(h.strm.data_type=(function(V){var $,st=4093624447;for($=0;$<=31;$++,st>>>=1)if(1&st&&V.dyn_ltree[2*$]!==0)return s;if(V.dyn_ltree[18]!==0||V.dyn_ltree[20]!==0||V.dyn_ltree[26]!==0)return r;for($=32;$<g;$++)if(V.dyn_ltree[2*$]!==0)return r;return s})(h)),dt(h,h.l_desc),dt(h,h.d_desc),X=(function(V){var $;for(t(V,V.dyn_ltree,V.l_desc.max_code),t(V,V.dyn_dtree,V.d_desc.max_code),dt(V,V.bl_desc),$=p-1;3<=$&&V.bl_tree[2*G[$]+1]===0;$--);return V.opt_len+=3*($+1)+5+5+4,$})(h),C=h.opt_len+3+7>>>3,(M=h.static_len+3+7>>>3)<=C&&(C=M)):C=M=F+5,F+4<=C&&x!==-1?f(h,x,F,U):h.strategy===4||M===C?(Y(h,2+(U?1:0),3),ft(h,J,y)):(Y(h,4+(U?1:0),3),(function(V,$,st,nt){var ht;for(Y(V,$-257,5),Y(V,st-1,5),Y(V,nt-4,4),ht=0;ht<nt;ht++)Y(V,V.bl_tree[2*G[ht]+1],3);B(V,V.dyn_ltree,$-1),B(V,V.dyn_dtree,st-1)})(h,h.l_desc.max_code+1,h.d_desc.max_code+1,X+1),ft(h,h.dyn_ltree,h.dyn_dtree)),rt(h),U&&it(h)},u._tr_tally=function(h,x,F){return h.pending_buf[h.d_buf+2*h.last_lit]=x>>>8&255,h.pending_buf[h.d_buf+2*h.last_lit+1]=255&x,h.pending_buf[h.l_buf+h.last_lit]=255&F,h.last_lit++,x===0?h.dyn_ltree[2*F]++:(h.matches++,x--,h.dyn_ltree[2*(e[F]+g+1)]++,h.dyn_dtree[2*A(x)]++),h.last_lit===h.lit_bufsize-1},u._tr_align=function(h){Y(h,2,3),K(h,w,J),(function(x){x.bi_valid===16?(q(x,x.bi_buf),x.bi_buf=0,x.bi_valid=0):8<=x.bi_valid&&(x.pending_buf[x.pending++]=255&x.bi_buf,x.bi_buf>>=8,x.bi_valid-=8)})(h)}},{"../utils/common":41}],53:[function(o,k,u){k.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(o,k,u){(function(i){(function(s,r){if(!s.setImmediate){var c,b,v,g,_=1,a={},p=!1,n=s.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(s);d=d&&d.setTimeout?d:s,c={}.toString.call(s.process)==="[object process]"?function(z){process.nextTick(function(){m(z)})}:(function(){if(s.postMessage&&!s.importScripts){var z=!0,S=s.onmessage;return s.onmessage=function(){z=!1},s.postMessage("","*"),s.onmessage=S,z}})()?(g="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",w,!1):s.attachEvent("onmessage",w),function(z){s.postMessage(g+z,"*")}):s.MessageChannel?((v=new MessageChannel).port1.onmessage=function(z){m(z.data)},function(z){v.port2.postMessage(z)}):n&&"onreadystatechange"in n.createElement("script")?(b=n.documentElement,function(z){var S=n.createElement("script");S.onreadystatechange=function(){m(z),S.onreadystatechange=null,b.removeChild(S),S=null},b.appendChild(S)}):function(z){setTimeout(m,0,z)},d.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var S=new Array(arguments.length-1),P=0;P<S.length;P++)S[P]=arguments[P+1];var j={callback:z,args:S};return a[_]=j,c(_),_++},d.clearImmediate=l}function l(z){delete a[z]}function m(z){if(p)setTimeout(m,0,z);else{var S=a[z];if(S){p=!0;try{(function(P){var j=P.callback,W=P.args;switch(W.length){case 0:j();break;case 1:j(W[0]);break;case 2:j(W[0],W[1]);break;case 3:j(W[0],W[1],W[2]);break;default:j.apply(r,W)}})(S)}finally{l(z),p=!1}}}}function w(z){z.source===s&&typeof z.data=="string"&&z.data.indexOf(g)===0&&m(+z.data.slice(g.length))}})(typeof self>"u"?i===void 0?this:i:self)}).call(this,typeof kt<"u"?kt:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Et)),Et.exports}var me=pe();const ge=Ht(me);async function _e(E){let D;try{D=await ge.loadAsync(E)}catch(i){return{format:"obsidian-zip",notes:[],errors:[{sourcePath:E.name,reason:`Could not read zip: ${i instanceof Error?i.message:String(i)}`}],tags:[]}}const o=[],k=[],u=[];D.forEach((i,s)=>{u.push({path:i,obj:s})}),u.sort((i,s)=>i.path.localeCompare(s.path));for(const{path:i,obj:s}of u)if(!s.dir&&!Ut(i)&&Lt(i))try{const r=await s.async("string"),c=be(i,u),b=Ft({sourcePath:c,raw:r});o.push(b)}catch(r){k.push({sourcePath:i,reason:r instanceof Error?r.message:String(r)})}return{format:"obsidian-zip",notes:o,errors:k,tags:ve(o)}}function Ut(E){return E.split("/").some(o=>o===".obsidian"||o===".trash"||o==="__MACOSX")}function Lt(E){const D=E.toLowerCase();return D.endsWith(".md")||D.endsWith(".markdown")}function be(E,D){const o=E.split("/")[0];if(!o)return E;let k=o;for(const u of D){if(Ut(u.path)||!Lt(u.path))continue;if(u.path.split("/")[0]!==k){k=null;break}}return k&&E.startsWith(`${k}/`)?E.slice(k.length+1):E}function ve(E){const D=new Set;for(const o of E)for(const k of o.tags)D.add(k);return[...D].sort()}const ye=5,we=500;async function ke(E){const{client:D,notes:o,onProgress:k,signal:u}=E,i=Math.max(1,E.concurrency??ye),s=[];let r=0,c=0,b=!1;const v=o.map(Ee);async function g(){for(;;){if(u!=null&&u.aborted||b)return;const d=r++;if(d>=o.length)return;const l=o[d],m=v[d],w=await xe(D,l,m,u);s[d]=w,c++,w.status==="errored"&&w.reason.startsWith("auth:")&&(b=!0),k==null||k({done:c,total:o.length})}}const _=Array.from({length:Math.min(i,o.length)},()=>g());await Promise.all(_);for(let d=0;d<o.length;d++)s[d]||(s[d]={status:"errored",sourcePath:o[d].sourcePath,reason:b?"Skipped — vault session ended before this note was reached.":"Skipped — import was cancelled."});let a=0,p=0,n=0;for(const d of s)d.status==="created"?a++:d.status==="skipped"?p++:n++;return{created:a,skipped:p,errored:n,outcomes:s}}async function xe(E,D,o,k){try{const u=await Se(E,o,k);return{status:"created",sourcePath:D.sourcePath,noteId:u.id}}catch(u){return u instanceof Gt||u instanceof Vt?{status:"skipped",sourcePath:D.sourcePath,reason:u.message||"Already exists in vault"}:u instanceof Kt?{status:"errored",sourcePath:D.sourcePath,reason:`auth: ${u.message}`}:u instanceof Tt?{status:"errored",sourcePath:D.sourcePath,reason:`vault unreachable (${u.status}): ${u.message}`}:{status:"errored",sourcePath:D.sourcePath,reason:u instanceof Error?u.message:String(u)}}}async function Se(E,D,o){const k={};o&&(k.signal=o);try{return await E.createNote(D,k)}catch(u){if(!ze(u)||o!=null&&o.aborted)throw u;return await Ce(we,o),await E.createNote(D,k)}}function ze(E){return E instanceof Tt}function Ce(E,D){return new Promise(o=>{const k=setTimeout(()=>{D==null||D.removeEventListener("abort",u),o()},E),u=()=>{clearTimeout(k),o()};D&&D.addEventListener("abort",u,{once:!0})})}function Ee(E){const D={content:E.content};E.path&&(D.path=E.path),E.tags.length>0&&(D.tags=E.tags),Object.keys(E.metadata).length>0&&(D.metadata=E.metadata);const o=D;return E.id&&(o.id=E.id),E.createdAt&&(o.created_at=E.createdAt),D}function Te(){const E=Yt(_=>_.getActiveVault()),D=Xt(),o=$t(),k=qt(_=>_.push),[u,i]=gt.useState({kind:"pick"}),s=gt.useRef(null),r=gt.useRef(null);if(!E)return H.jsx(Jt,{to:"/",replace:!0});const c=gt.useCallback(async _=>{if(_.length===0)return;i({kind:"parsing"});const a=ee(_);try{let p;if(a==="obsidian-zip"){const n=_.find(Dt);if(!n){k("No zip file found in selection","error"),i({kind:"pick"});return}p=await _e(n)}else a==="loose-markdown"?p=await de(_.filter(At)):p={format:a,notes:[],errors:_.map(n=>({sourcePath:n.name,reason:"Unrecognized format (expected .zip, .md, or .markdown)."})),tags:[]};i({kind:"review",parsed:p})}catch(p){k(p instanceof Error?p.message:"Parse failed","error"),i({kind:"pick"})}},[k]),b=gt.useCallback(async()=>{if(u.kind!=="review")return;if(!D){k("Vault session unavailable — reconnect first","error");return}const _=new AbortController;r.current=_,i({kind:"importing",parsed:u.parsed,progress:{done:0,total:u.parsed.notes.length}});const a=await ke({client:D,notes:u.parsed.notes,signal:_.signal,onProgress:p=>{i(n=>n.kind==="importing"?{...n,progress:p}:n)}});r.current=null,i({kind:"done",report:a,parsed:u.parsed})},[u,D,k]),v=gt.useCallback(()=>{var _;(_=r.current)==null||_.abort()},[]),g=gt.useCallback(()=>{i({kind:"pick"}),s.current&&(s.current.value="")},[]);return H.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-7 md:px-6 md:py-10",children:[H.jsx("nav",{className:"mb-4 text-sm text-fg-dim",children:H.jsx(Qt,{to:"/",className:"hover:text-accent",children:"← All notes"})}),H.jsxs("header",{className:"mb-6",children:[H.jsxs("h1",{className:"font-serif text-2xl tracking-tight md:text-3xl",children:["Import notes into ",H.jsx("span",{className:"text-accent",children:E.name})]}),H.jsx("p",{className:"mt-2 text-sm text-fg-muted",children:"Upload an Obsidian vault zip or drop in loose markdown files. Everything is parsed in your browser and previewed before any note lands in the vault."})]}),u.kind==="pick"||u.kind==="parsing"?H.jsx(Ae,{parsing:u.kind==="parsing",onFiles:c,inputRef:s}):null,u.kind==="review"?H.jsx(Ie,{parsed:u.parsed,onConfirm:b,onBack:g}):null,u.kind==="importing"?H.jsx(Ne,{progress:u.progress,onCancel:v}):null,u.kind==="done"?H.jsx(Oe,{report:u.report,parsed:u.parsed,onAnother:g,onHome:()=>o("/")}):null]})}function Ae({parsing:E,onFiles:D,inputRef:o}){const k=u=>{const i=Array.from(u.target.files??[]);i.length>0&&D(i)};return H.jsx("section",{children:H.jsx(te,{onDropFiles:D,className:"rounded-md border border-border bg-card",hint:"zip or markdown",children:H.jsxs("div",{className:"flex min-h-[40vh] flex-col items-center justify-center gap-4 p-8 text-center",children:[H.jsx("p",{className:"font-serif text-lg",children:E?"Reading files…":"Drop a file here"}),H.jsx("p",{className:"text-sm text-fg-dim",children:"Accepts an Obsidian vault `.zip`, or one or more `.md` / `.markdown` files."}),H.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3",children:[H.jsxs("label",{className:"inline-flex min-h-11 cursor-pointer items-center rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover",children:[E?"Reading…":"Choose files",H.jsx("input",{ref:o,type:"file",className:"sr-only",accept:".zip,.md,.markdown",multiple:!0,disabled:E,onChange:k})]}),H.jsx("span",{className:"text-xs text-fg-dim",children:"— or drag and drop above"})]}),H.jsxs("details",{className:"mt-2 text-left text-xs text-fg-dim",children:[H.jsx("summary",{className:"cursor-pointer text-fg-muted hover:text-accent",children:"What about other tools?"}),H.jsxs("p",{className:"mt-2 max-w-md",children:["Notion CSV/JSON, Roam, Logseq, and Apple Notes exports are on the roadmap. For now, the CLI path"," ",H.jsx("code",{className:"rounded bg-bg/60 px-1 font-mono",children:"parachute-vault import <path>"})," ","handles broader formats — or paste the contents into Claude and ask it to add the notes via MCP."]})]})]})})})}function Ie({parsed:E,onConfirm:D,onBack:o}){const{notes:k,errors:u,tags:i}=E,s=k.length,r=s>0,c=gt.useMemo(()=>k.slice(0,8),[k]),b=gt.useMemo(()=>i.slice(0,12),[i]);return H.jsxs("section",{className:"space-y-6",children:[H.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[H.jsx("h2",{className:"font-serif text-lg",children:"Dry run"}),H.jsxs("p",{className:"mt-1 text-sm text-fg-muted",children:["Detected format: ",H.jsx(je,{format:E.format}),"."," ",H.jsx("strong",{className:"text-fg",children:s})," ",s===1?"note":"notes"," will be created."," ",u.length>0?H.jsxs("span",{className:"text-fg-dim",children:[u.length," file(s) couldn't be parsed."]}):null]}),i.length>0?H.jsxs("p",{className:"mt-2 text-sm text-fg-muted",children:[H.jsx("span",{className:"text-xs uppercase tracking-wider text-fg-dim",children:"Tags found"})," ",b.map(v=>H.jsxs("span",{className:"ml-1 inline-block rounded bg-bg/60 px-1.5 py-0.5 font-mono text-xs text-fg",children:["#",v]},v)),i.length>b.length?H.jsxs("span",{className:"ml-2 text-fg-dim",children:["+",i.length-b.length," more"]}):null]}):null]}),c.length>0?H.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[H.jsxs("h3",{className:"mb-2 text-xs uppercase tracking-wider text-fg-dim",children:["Preview (",c.length," of ",s,")"]}),H.jsx("ul",{className:"space-y-1.5 font-mono text-xs",children:c.map(v=>H.jsxs("li",{className:"flex items-center justify-between gap-3",children:[H.jsx("span",{className:"truncate text-fg",children:v.path||v.sourcePath}),H.jsx("span",{className:"shrink-0 text-fg-dim",children:v.tags.length>0?`${v.tags.length} tag${v.tags.length===1?"":"s"}`:""})]},v.sourcePath))})]}):null,u.length>0?H.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[H.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[u.length," file(s) skipped during parse"]}),H.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:u.map(v=>H.jsxs("li",{className:"flex flex-col gap-0.5",children:[H.jsx("span",{className:"font-mono text-fg",children:v.sourcePath}),H.jsx("span",{className:"text-fg-dim",children:v.reason})]},v.sourcePath))})]}):null,H.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[H.jsx("button",{type:"button",onClick:o,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Choose different files"}),H.jsxs("button",{type:"button",onClick:D,disabled:!r,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover disabled:opacity-40",children:["Run import (",s," ",s===1?"note":"notes",")"]})]})]})}function Ne({progress:E,onCancel:D}){const o=E.total===0?0:Math.round(E.done/E.total*100);return H.jsxs("section",{className:"space-y-4 rounded-md border border-border bg-card p-6",children:[H.jsx("h2",{className:"font-serif text-lg",children:"Importing…"}),H.jsxs("p",{className:"text-sm text-fg-muted",children:[E.done," / ",E.total," notes processed."]}),H.jsx("div",{className:"h-2 w-full overflow-hidden rounded bg-bg/60",role:"progressbar",tabIndex:0,"aria-label":"Import progress","aria-valuenow":E.done,"aria-valuemin":0,"aria-valuemax":E.total,children:H.jsx("div",{className:"h-full bg-accent transition-all",style:{width:`${o}%`}})}),H.jsx("div",{className:"flex justify-end",children:H.jsx("button",{type:"button",onClick:D,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Cancel"})})]})}function Oe({report:E,parsed:D,onAnother:o,onHome:k}){const u=E.outcomes.filter(s=>s.status==="errored"),i=E.outcomes.filter(s=>s.status==="skipped");return H.jsxs("section",{className:"space-y-6",children:[H.jsxs("div",{className:"rounded-md border border-border bg-card p-4",children:[H.jsx("h2",{className:"font-serif text-lg",children:"Import complete"}),H.jsxs("ul",{className:"mt-3 space-y-1 text-sm",children:[H.jsxs("li",{children:[H.jsx("span",{className:"text-accent",children:E.created})," created"]}),H.jsxs("li",{children:[H.jsx("span",{className:"text-fg-muted",children:E.skipped})," skipped (already in vault)"]}),H.jsxs("li",{children:[H.jsx("span",{className:E.errored>0?"text-red-400":"text-fg-muted",children:E.errored})," ","errored"]})]}),D.errors.length>0?H.jsxs("p",{className:"mt-2 text-xs text-fg-dim",children:["(Plus ",D.errors.length," file(s) skipped at the parse stage — see above.)"]}):null]}),i.length>0?H.jsxs("details",{className:"rounded-md border border-border bg-card p-4",children:[H.jsxs("summary",{className:"cursor-pointer text-sm text-fg-muted hover:text-accent",children:[i.length," skipped — vault already had a matching note"]}),H.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:i.map(s=>H.jsxs("li",{className:"flex flex-col gap-0.5",children:[H.jsx("span",{className:"font-mono text-fg",children:s.sourcePath}),H.jsx("span",{className:"text-fg-dim",children:s.status==="skipped"?s.reason:""})]},`s-${s.sourcePath}`))})]}):null,u.length>0?H.jsxs("details",{className:"rounded-md border border-red-500/30 bg-red-500/5 p-4",open:!0,children:[H.jsxs("summary",{className:"cursor-pointer text-sm font-medium text-red-400",children:[u.length," errored"]}),H.jsx("ul",{className:"mt-3 space-y-1 text-xs",children:u.map(s=>H.jsxs("li",{className:"flex flex-col gap-0.5",children:[H.jsx("span",{className:"font-mono text-fg",children:s.sourcePath}),H.jsx("span",{className:"text-fg-dim",children:s.status==="errored"?s.reason:""})]},`e-${s.sourcePath}`))})]}):null,H.jsxs("div",{className:"flex flex-wrap items-center justify-end gap-3",children:[H.jsx("button",{type:"button",onClick:o,className:"min-h-11 rounded-md border border-border bg-card px-3 py-1.5 text-sm text-fg-muted hover:text-accent",children:"Run another import"}),H.jsx("button",{type:"button",onClick:k,className:"min-h-11 rounded-md bg-accent px-4 py-1.5 text-sm font-medium text-white hover:bg-accent-hover",children:"Back to vault"})]})]})}function je({format:E}){const D=E==="obsidian-zip"?"Obsidian vault (zip)":E==="loose-markdown"?"loose markdown":"unknown";return H.jsx("span",{className:"rounded bg-bg/60 px-1.5 py-0.5 font-mono text-xs text-fg",children:D})}export{Te as Import};