@promptowl/contextnest-community 1.26.0 → 1.27.0
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.
- package/API.md +34 -1
- package/CONFIGURATION.md +32 -1
- package/dist/{chunk-TRSGPS27.js → chunk-H3W72HN3.js} +28 -0
- package/dist/{chunk-DGPTJXIV.js → chunk-MB52DWWP.js} +4 -4
- package/dist/{chunk-IEAWRHMV.js → chunk-NFFUZF2B.js} +23 -2
- package/dist/{chunk-PICUHQEM.js → chunk-O3JEI33N.js} +2 -2
- package/dist/{chunk-SWA5M5XX.js → chunk-QMQDWRHN.js} +128 -22
- package/dist/{chunk-I5EDEZBQ.js → chunk-RXCVXG34.js} +1 -1
- package/dist/{chunk-2QOJE7A5.js → chunk-SE5U4J4T.js} +4 -4
- package/dist/{chunk-RPGFHESR.js → chunk-VHEMGQ3I.js} +1 -1
- package/dist/{chunk-M6PGYMBD.js → chunk-VRLAP4HB.js} +33 -15
- package/dist/{engine-QNMFDIBV.js → engine-HLYQLP5T.js} +3 -3
- package/dist/{external-edit-service-4MEGPT4D.js → external-edit-service-3DFQ4EZZ.js} +4 -4
- package/dist/{grants-service-24GLUBY4.js → grants-service-WICV4Y2J.js} +2 -2
- package/dist/index.js +804 -304
- package/dist/{invited-user-AM6A3WGO.js → invited-user-XEBX6BM4.js} +3 -3
- package/dist/{review-service-2EWN7WWO.js → review-service-GB43UQVH.js} +7 -7
- package/dist/{stewardship-service-TDZUC2Q6.js → stewardship-service-KDBPWRZI.js} +4 -4
- package/dist/{version-service-C3JTZLJH.js → version-service-JYHFPSYP.js} +8 -4
- package/dist/web3/assets/{ActivityTracePage-DzwWIjjx.js → ActivityTracePage-CkRoyIc-.js} +1 -1
- package/dist/web3/assets/AgentDocsPage-BTRXmliv.js +1 -0
- package/dist/web3/assets/CollaboratorManager-CqJIkvs-.js +1 -0
- package/dist/web3/assets/CollaboratorsTab-JcO1P-qm.js +1 -0
- package/dist/web3/assets/DocumentEditor-D1GLeeEP.js +36 -0
- package/dist/web3/assets/DocumentsTab-BAgSxTX1.js +6 -0
- package/dist/web3/assets/ExternalEditsTab-DuuTXZap.js +1 -0
- package/dist/web3/assets/{MarkdownEditor-CKh4WSn-.js → MarkdownEditor-BELFww9q.js} +116 -126
- package/dist/web3/assets/{NestPageHeader-Cizo8nUi.js → NestPageHeader-Bbje2ncY.js} +1 -1
- package/dist/web3/assets/NestView-D4OMXPQ7.js +73 -0
- package/dist/web3/assets/OverviewTab-FIDGjR3Q.js +6 -0
- package/dist/web3/assets/{PersonCombobox-BKI7dff4.js → PersonCombobox-D52m_jhc.js} +1 -1
- package/dist/web3/assets/{ReviewActions-CS8JXgXF.js → ReviewActions-DYqBcWlv.js} +2 -2
- package/dist/web3/assets/ReviewTab-DoxfygOb.js +1 -0
- package/dist/web3/assets/StewardsTab-CFsYjbEn.js +1 -0
- package/dist/web3/assets/{SubmitForReviewModal-Biq3m79i.js → SubmitForReviewModal-AW2OLNAE.js} +1 -1
- package/dist/web3/assets/{alert-dialog-BvF3NFr7.js → alert-dialog-p-fBLSWx.js} +2 -2
- package/dist/web3/assets/{arrow-left-CWIsv-sG.js → arrow-left-CiErCCTG.js} +1 -1
- package/dist/web3/assets/{backlinks-Cqcn7n1J.js → backlinks-DaVSYvhV.js} +2 -2
- package/dist/web3/assets/{boxes-ClbgQqG2.js → boxes-VWrCCMzW.js} +1 -1
- package/dist/web3/assets/{chevron-left-CK_ZPFm9.js → chevron-left-CsD8gZwL.js} +1 -1
- package/dist/web3/assets/{circle-check-Bw_aTXiH.js → circle-check-BBCXd9LI.js} +1 -1
- package/dist/web3/assets/{circle-x-DkIG68H7.js → circle-x-C9LsnORQ.js} +1 -1
- package/dist/web3/assets/{code-xml-BlR7EN6l.js → code-xml-BaoV7HiQ.js} +1 -1
- package/dist/web3/assets/{corner-down-right-DSVxK3tf.js → corner-down-right-DgiTXrtw.js} +1 -1
- package/dist/web3/assets/{count-skeleton-DToLM74B.js → count-skeleton-CnEE4uF-.js} +1 -1
- package/dist/web3/assets/{earth-BXhVPvCR.js → earth-BmMbVt9k.js} +1 -1
- package/dist/web3/assets/{file-exclamation-point-BevGZgtj.js → file-exclamation-point-qJeca9-A.js} +1 -1
- package/dist/web3/assets/{folder-input-m8UBV4fA.js → folder-input-D7R93LJ6.js} +1 -1
- package/dist/web3/assets/index-DNmWTxN7.css +1 -0
- package/dist/web3/assets/index-DvuUIUP6.js +451 -0
- package/dist/web3/assets/{page-DzKwP5Ds.js → page-BJQuaTRW.js} +2 -2
- package/dist/web3/assets/{page-B6pkc9cd.js → page-Bb8xGOPQ.js} +2 -2
- package/dist/web3/assets/{page-Deq6IKiN.js → page-BtM-qDzr.js} +2 -2
- package/dist/web3/assets/{page-DPY01SOj.js → page-Bxd0EG25.js} +1 -1
- package/dist/web3/assets/page-C3QCO6IR.js +1 -0
- package/dist/web3/assets/{page-CptuAPJc.js → page-CfoR0khy.js} +2 -2
- package/dist/web3/assets/page-D7Zr5tAI.js +1 -0
- package/dist/web3/assets/{page-Dwbp4Seu.js → page-DATSlHCW.js} +2 -2
- package/dist/web3/assets/page-DTjPQizZ.js +45 -0
- package/dist/web3/assets/{page-Bgy9Ng9p.js → page-DspptlWr.js} +1 -1
- package/dist/web3/assets/{page-Dh57L0RG.js → page-I6vAFJOj.js} +4 -4
- package/dist/web3/assets/page-QxI4Ud2s.js +9 -0
- package/dist/web3/assets/{page-BJrFCKXB.js → page-YcNNg-dX.js} +1 -1
- package/dist/web3/assets/page-kM7eO5Kj.js +1 -0
- package/dist/web3/assets/{page-title-DVq4qvMR.js → page-title-Dn5jANiU.js} +1 -1
- package/dist/web3/assets/{play-CXhS6Pgq.js → play-B2k_Ix-L.js} +1 -1
- package/dist/web3/assets/{send-DdfwnIrj.js → send-DPNxv3As.js} +1 -1
- package/dist/web3/assets/{settings-DKX0Q4gO.js → settings-DZjq-OQA.js} +1 -1
- package/dist/web3/assets/{share-2-CxmXRt58.js → share-2-C-OnE2ru.js} +1 -1
- package/dist/web3/assets/{tag-DeYC_mRv.js → tag-CwJl7FdI.js} +1 -1
- package/dist/web3/assets/{trash-2-B0HyPTnI.js → trash-2-aljmIff4.js} +1 -1
- package/dist/web3/assets/{user-plus-Ckm_Isyc.js → user-plus-DPerZexX.js} +1 -1
- package/dist/web3/assets/{zap-D2ifcnYb.js → zap-CHZtiN7P.js} +1 -1
- package/dist/web3/index.html +2 -2
- package/package.json +6 -2
- package/dist/web3/assets/AgentDocsPage-ixP2UdAE.js +0 -1
- package/dist/web3/assets/CollaboratorManager-C9VAXZ0h.js +0 -1
- package/dist/web3/assets/CollaboratorsTab-tq4ZTexH.js +0 -1
- package/dist/web3/assets/DocumentEditor-C2CP2fiE.js +0 -36
- package/dist/web3/assets/DocumentsTab-Mh7KxUoB.js +0 -6
- package/dist/web3/assets/ExternalEditsTab-B_CWKXZ_.js +0 -1
- package/dist/web3/assets/NestView-EW-sraEb.js +0 -73
- package/dist/web3/assets/OverviewTab-CjidsMX_.js +0 -6
- package/dist/web3/assets/ReviewTab-CwVrXzw5.js +0 -1
- package/dist/web3/assets/StewardsTab-C-iP6gnh.js +0 -1
- package/dist/web3/assets/index-BOVYgMvj.js +0 -29
- package/dist/web3/assets/index-DVnaYqj9.css +0 -1
- package/dist/web3/assets/index-WYDmEOfO.js +0 -404
- package/dist/web3/assets/page-C2zoxumw.js +0 -1
- package/dist/web3/assets/page-CJWO06dN.js +0 -1
- package/dist/web3/assets/page-Dea2SblF.js +0 -9
- package/dist/web3/assets/page-Dfjg8p7Z.js +0 -1
- package/dist/web3/assets/page-YxjrE5b5.js +0 -45
- package/dist/web3/assets/x-mNtADYHc.js +0 -6
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import{c as gt,r as ne,S as Ut,dx as Qt,dy as er,dz as tr,j as s,B as he,D as Je,G as Qe,H as et,J as tt,K as ht,aD as Lt,aI as ft,d3 as rr,dA as nr,aj as sr,dB as $e,cZ as ir,dC as ar,w as or,L as Oe,N as mt,I as Ye,M as pt,dD as lr,dl as cr,db as dr,_ as Ve,l as Ae,u as Mt,c6 as Pe,c7 as ur,c9 as hr,c8 as fr,ca as Ue,aa as mr,dE as pr,b7 as Xe,b4 as lt,dF as He,T as gr,$ as xr,av as vr,bU as jt,E as _r,au as Nt,bK as St,ah as br,F as Ct,U as At,f as ct,i as Se,ak as yr,c3 as Et,dG as wr,dH as kr,dI as jr,dJ as Nr,dK as Sr,dL as Cr,C as Ar,dM as Er,dt as zr}from"./index-DvuUIUP6.js";import{E as zt}from"./earth-BmMbVt9k.js";import{C as It,n as qe,R as Ir,D as Dr}from"./count-skeleton-CnEE4uF-.js";import{P as Rr}from"./page-title-Dn5jANiU.js";import{A as Or,a as Fr,b as Tr,c as Br,d as Pr,e as Ur,f as Lr,g as Mr}from"./alert-dialog-p-fBLSWx.js";import{F as Fe,A as dt}from"./folder-input-D7R93LJ6.js";import{T as Be}from"./trash-2-aljmIff4.js";import{C as Wr}from"./circle-check-BBCXd9LI.js";/**
|
|
2
|
+
* @license lucide-react v0.577.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const Zr=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h2",key:"tvwodi"}],["path",{d:"M20 8v11a2 2 0 0 1-2 2h-2",key:"1gkqxj"}],["path",{d:"m9 15 3-3 3 3",key:"1pd0qc"}],["path",{d:"M12 12v9",key:"192myk"}]],$r=gt("archive-restore",Zr);/**
|
|
7
|
+
* @license lucide-react v0.577.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Hr=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],qr=gt("bookmark",Hr);/**
|
|
12
|
+
* @license lucide-react v0.577.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const Gr=[["path",{d:"M9 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v.5",key:"1dkoa9"}],["path",{d:"M12 10v4h4",key:"1czhmt"}],["path",{d:"m12 14 1.535-1.605a5 5 0 0 1 8 1.5",key:"lvuxfi"}],["path",{d:"M22 22v-4h-4",key:"1ewp4q"}],["path",{d:"m22 18-1.535 1.605a5 5 0 0 1-8-1.5",key:"14ync0"}]],Kr=gt("folder-sync",Gr),Dt=typeof window<"u"?window.location.origin:"http://localhost:3838";function Yr({nests:M,onManageKeys:V}){const[m,C]=ne.useState(!1),{authenticated:v,authMode:c}=Ut(),a=c==="open",r=v&&!a,{nestCount:o,documentCount:_}=Qt(M),y=er(Dt),g=tr(Dt,a);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border bg-gradient-to-br from-blue-50 to-indigo-50 p-4 dark:from-slate-900 dark:to-slate-900/40 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary",children:s.jsx(zt,{className:"h-5 w-5"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Your whole brain"}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:[o," ",o===1?"nest":"nests"," ·"," ",_.toLocaleString()," ",_===1?"document":"documents"," — connect an AI to all of it at once."]})]})]}),s.jsxs(he,{className:"shrink-0",onClick:()=>C(!0),children:[s.jsx(zt,{className:"mr-2 h-4 w-4"}),"Connect all my nests"]})]}),s.jsx(Je,{open:m,onOpenChange:C,children:s.jsxs(Qe,{className:"max-w-lg",children:[s.jsxs(et,{children:[s.jsx(tt,{children:"Connect all my nests"}),s.jsx(ht,{children:"One connection your AI reads every nest through — it picks the right one for each question."})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Server (MCP) endpoint"}),s.jsxs("div",{className:"flex items-center gap-2 rounded-md border bg-muted/40 p-2",children:[s.jsx("code",{className:"min-w-0 flex-1 truncate text-xs",children:y}),s.jsx(he,{variant:"ghost",size:"sm","aria-label":"Copy endpoint",onClick:()=>ft(y,"Endpoint copied"),children:s.jsx(Lt,{className:"h-3.5 w-3.5"})})]})]}),r&&s.jsxs("div",{children:[s.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Your API key"}),s.jsxs("div",{className:"flex flex-col gap-2 rounded-md border bg-muted/40 p-2.5 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("p",{className:"flex items-start gap-2 text-xs text-muted-foreground",children:[s.jsx(rr,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),s.jsx("span",{children:"Paste in the key you already use — any of your keys works here and on every nest. Need a new one?"})]}),V&&s.jsx(he,{variant:"outline",size:"sm",className:"shrink-0",onClick:()=>{C(!1),V()},children:"Manage API keys"})]})]}),s.jsxs("div",{children:[s.jsx("p",{className:"mb-1.5 text-xs font-medium text-muted-foreground",children:"Or paste this into your AI"}),s.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap break-words rounded-md border bg-muted/40 p-3 text-[11px] leading-relaxed",children:g}),s.jsxs(he,{variant:"outline",size:"sm",className:"mt-2",onClick:()=>ft(g,"Prompt copied"),children:[s.jsx(nr,{className:"mr-1.5 h-3.5 w-3.5"}),'Copy "chat with all my nests"']})]}),s.jsxs("div",{className:"flex items-start gap-2 rounded-md border border-emerald-200 bg-emerald-50 p-2.5 text-xs text-emerald-900 dark:border-emerald-900/50 dark:bg-emerald-950/40 dark:text-emerald-200",children:[s.jsx(sr,{className:"mt-0.5 h-3.5 w-3.5 shrink-0"}),s.jsx("span",{children:"Search and list across all nests at once, or target a specific nest. Create, update, delete, move, and submit for review — just name the nest. Approval and sharing stay in each nest's Connect panel."})]})]})]})})]})}const Le="mine";function Rt(M){return M.is_owner??(M.permission??"owner")==="owner"}function Vr(M,V){switch(V){case"mine":return!M.discovered;case"owned":return Rt(M);case"shared":return!Rt(M)&&!M.discovered;case"org":return M.visibility==="org";case"public":return M.visibility==="public";default:return!0}}function Xr(M){return M!=="unsynced"}function Jr(M,V,m){if(V!=="all"&&V!=="mine"&&V!=="unsynced")return[];const C=m.trim().toLowerCase();return C?M.filter(v=>v.label.toLowerCase().includes(C)||v.name.toLowerCase().includes(C)):M}const Qr=["mine","owned","shared","synced","unsynced"];function en(M){return Qr.includes(M)?M:Le}function tn(M,V,m){const C=V.trim().toLowerCase();return[...C?M.filter(c=>(c.name??"").toLowerCase().includes(C)):M].sort((c,a)=>m==="name"?String(c.name??"").localeCompare(String(a.name??"")):String(a.archived_at??"").localeCompare(String(c.archived_at??"")))}function Wt(M){return new Set((M??[]).filter(V=>V.kind==="nest_invite").map(V=>V.nest_id))}function Ge(M){throw new Error('Could not dynamically require "'+M+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ut={exports:{}};/*!
|
|
17
|
+
|
|
18
|
+
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
19
|
+
<http://stuartk.com/jszip>
|
|
20
|
+
|
|
21
|
+
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
22
|
+
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
|
23
|
+
|
|
24
|
+
JSZip uses the library pako released under the MIT license :
|
|
25
|
+
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
26
|
+
*/var Ot;function rn(){return Ot||(Ot=1,(function(M,V){(function(m){M.exports=m()})(function(){return(function m(C,v,c){function a(_,y){if(!v[_]){if(!C[_]){var g=typeof Ge=="function"&&Ge;if(!y&&g)return g(_,!0);if(r)return r(_,!0);var b=new Error("Cannot find module '"+_+"'");throw b.code="MODULE_NOT_FOUND",b}var i=v[_]={exports:{}};C[_][0].call(i.exports,function(u){var n=C[_][1][u];return a(n||u)},i,i.exports,m,C,v,c)}return v[_].exports}for(var r=typeof Ge=="function"&&Ge,o=0;o<c.length;o++)a(c[o]);return a})({1:[function(m,C,v){var c=m("./utils"),a=m("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";v.encode=function(o){for(var _,y,g,b,i,u,n,h=[],l=0,x=o.length,w=x,S=c.getTypeOf(o)!=="string";l<o.length;)w=x-l,g=S?(_=o[l++],y=l<x?o[l++]:0,l<x?o[l++]:0):(_=o.charCodeAt(l++),y=l<x?o.charCodeAt(l++):0,l<x?o.charCodeAt(l++):0),b=_>>2,i=(3&_)<<4|y>>4,u=1<w?(15&y)<<2|g>>6:64,n=2<w?63&g:64,h.push(r.charAt(b)+r.charAt(i)+r.charAt(u)+r.charAt(n));return h.join("")},v.decode=function(o){var _,y,g,b,i,u,n=0,h=0,l="data:";if(o.substr(0,l.length)===l)throw new Error("Invalid base64 input, it looks like a data url.");var x,w=3*(o=o.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(o.charAt(o.length-1)===r.charAt(64)&&w--,o.charAt(o.length-2)===r.charAt(64)&&w--,w%1!=0)throw new Error("Invalid base64 input, bad content length.");for(x=a.uint8array?new Uint8Array(0|w):new Array(0|w);n<o.length;)_=r.indexOf(o.charAt(n++))<<2|(b=r.indexOf(o.charAt(n++)))>>4,y=(15&b)<<4|(i=r.indexOf(o.charAt(n++)))>>2,g=(3&i)<<6|(u=r.indexOf(o.charAt(n++))),x[h++]=_,i!==64&&(x[h++]=y),u!==64&&(x[h++]=g);return x}},{"./support":30,"./utils":32}],2:[function(m,C,v){var c=m("./external"),a=m("./stream/DataWorker"),r=m("./stream/Crc32Probe"),o=m("./stream/DataLengthProbe");function _(y,g,b,i,u){this.compressedSize=y,this.uncompressedSize=g,this.crc32=b,this.compression=i,this.compressedContent=u}_.prototype={getContentWorker:function(){var y=new a(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),g=this;return y.on("end",function(){if(this.streamInfo.data_length!==g.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new a(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},_.createWorkerFrom=function(y,g,b){return y.pipe(new r).pipe(new o("uncompressedSize")).pipe(g.compressWorker(b)).pipe(new o("compressedSize")).withStreamInfo("compression",g)},C.exports=_},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(m,C,v){var c=m("./stream/GenericWorker");v.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},v.DEFLATE=m("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(m,C,v){var c=m("./utils"),a=(function(){for(var r,o=[],_=0;_<256;_++){r=_;for(var y=0;y<8;y++)r=1&r?3988292384^r>>>1:r>>>1;o[_]=r}return o})();C.exports=function(r,o){return r!==void 0&&r.length?c.getTypeOf(r)!=="string"?(function(_,y,g,b){var i=a,u=b+g;_^=-1;for(var n=b;n<u;n++)_=_>>>8^i[255&(_^y[n])];return-1^_})(0|o,r,r.length,0):(function(_,y,g,b){var i=a,u=b+g;_^=-1;for(var n=b;n<u;n++)_=_>>>8^i[255&(_^y.charCodeAt(n))];return-1^_})(0|o,r,r.length,0):0}},{"./utils":32}],5:[function(m,C,v){v.base64=!1,v.binary=!1,v.dir=!1,v.createFolders=!0,v.date=null,v.compression=null,v.compressionOptions=null,v.comment=null,v.unixPermissions=null,v.dosPermissions=null},{}],6:[function(m,C,v){var c=null;c=typeof Promise<"u"?Promise:m("lie"),C.exports={Promise:c}},{lie:37}],7:[function(m,C,v){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",a=m("pako"),r=m("./utils"),o=m("./stream/GenericWorker"),_=c?"uint8array":"array";function y(g,b){o.call(this,"FlateWorker/"+g),this._pako=null,this._pakoAction=g,this._pakoOptions=b,this.meta={}}v.magic="\b\0",r.inherits(y,o),y.prototype.processChunk=function(g){this.meta=g.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(_,g.data),!1)},y.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var g=this;this._pako.onData=function(b){g.push({data:b,meta:g.meta})}},v.compressWorker=function(g){return new y("Deflate",g)},v.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(m,C,v){function c(i,u){var n,h="";for(n=0;n<u;n++)h+=String.fromCharCode(255&i),i>>>=8;return h}function a(i,u,n,h,l,x){var w,S,N=i.file,B=i.compression,F=x!==_.utf8encode,W=r.transformTo("string",x(N.name)),R=r.transformTo("string",_.utf8encode(N.name)),H=N.comment,ee=r.transformTo("string",x(H)),f=r.transformTo("string",_.utf8encode(H)),z=R.length!==N.name.length,t=f.length!==H.length,O="",J="",U="",ae=N.dir,Z=N.date,se={crc32:0,compressedSize:0,uncompressedSize:0};u&&!n||(se.crc32=i.crc32,se.compressedSize=i.compressedSize,se.uncompressedSize=i.uncompressedSize);var I=0;u&&(I|=8),F||!z&&!t||(I|=2048);var E=0,te=0;ae&&(E|=16),l==="UNIX"?(te=798,E|=(function(G,fe){var ge=G;return G||(ge=fe?16893:33204),(65535&ge)<<16})(N.unixPermissions,ae)):(te=20,E|=(function(G){return 63&(G||0)})(N.dosPermissions)),w=Z.getUTCHours(),w<<=6,w|=Z.getUTCMinutes(),w<<=5,w|=Z.getUTCSeconds()/2,S=Z.getUTCFullYear()-1980,S<<=4,S|=Z.getUTCMonth()+1,S<<=5,S|=Z.getUTCDate(),z&&(J=c(1,1)+c(y(W),4)+R,O+="up"+c(J.length,2)+J),t&&(U=c(1,1)+c(y(ee),4)+f,O+="uc"+c(U.length,2)+U);var Y="";return Y+=`
|
|
27
|
+
\0`,Y+=c(I,2),Y+=B.magic,Y+=c(w,2),Y+=c(S,2),Y+=c(se.crc32,4),Y+=c(se.compressedSize,4),Y+=c(se.uncompressedSize,4),Y+=c(W.length,2),Y+=c(O.length,2),{fileRecord:g.LOCAL_FILE_HEADER+Y+W+O,dirRecord:g.CENTRAL_FILE_HEADER+c(te,2)+Y+c(ee.length,2)+"\0\0\0\0"+c(E,4)+c(h,4)+W+O+ee}}var r=m("../utils"),o=m("../stream/GenericWorker"),_=m("../utf8"),y=m("../crc32"),g=m("../signature");function b(i,u,n,h){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=u,this.zipPlatform=n,this.encodeFileName=h,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(b,o),b.prototype.push=function(i){var u=i.meta.percent||0,n=this.entriesCount,h=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,o.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:n?(u+100*(n-h-1))/n:100}}))},b.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var u=this.streamFiles&&!i.file.dir;if(u){var n=a(i,u,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},b.prototype.closedSource=function(i){this.accumulate=!1;var u=this.streamFiles&&!i.file.dir,n=a(i,u,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),u)this.push({data:(function(h){return g.DATA_DESCRIPTOR+c(h.crc32,4)+c(h.compressedSize,4)+c(h.uncompressedSize,4)})(i),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},b.prototype.flush=function(){for(var i=this.bytesWritten,u=0;u<this.dirRecords.length;u++)this.push({data:this.dirRecords[u],meta:{percent:100}});var n=this.bytesWritten-i,h=(function(l,x,w,S,N){var B=r.transformTo("string",N(S));return g.CENTRAL_DIRECTORY_END+"\0\0\0\0"+c(l,2)+c(l,2)+c(x,4)+c(w,4)+c(B.length,2)+B})(this.dirRecords.length,n,i,this.zipComment,this.encodeFileName);this.push({data:h,meta:{percent:100}})},b.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},b.prototype.registerPrevious=function(i){this._sources.push(i);var u=this;return i.on("data",function(n){u.processChunk(n)}),i.on("end",function(){u.closedSource(u.previous.streamInfo),u._sources.length?u.prepareNextSource():u.end()}),i.on("error",function(n){u.error(n)}),this},b.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},b.prototype.error=function(i){var u=this._sources;if(!o.prototype.error.call(this,i))return!1;for(var n=0;n<u.length;n++)try{u[n].error(i)}catch{}return!0},b.prototype.lock=function(){o.prototype.lock.call(this);for(var i=this._sources,u=0;u<i.length;u++)i[u].lock()},C.exports=b},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(m,C,v){var c=m("../compressions"),a=m("./ZipFileWorker");v.generateWorker=function(r,o,_){var y=new a(o.streamFiles,_,o.platform,o.encodeFileName),g=0;try{r.forEach(function(b,i){g++;var u=(function(x,w){var S=x||w,N=c[S];if(!N)throw new Error(S+" is not a valid compression method !");return N})(i.options.compression,o.compression),n=i.options.compressionOptions||o.compressionOptions||{},h=i.dir,l=i.date;i._compressWorker(u,n).withStreamInfo("file",{name:b,dir:h,date:l,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(y)}),y.entriesCount=g}catch(b){y.error(b)}return y}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(m,C,v){function c(){if(!(this instanceof c))return new c;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 a=new c;for(var r in this)typeof this[r]!="function"&&(a[r]=this[r]);return a}}(c.prototype=m("./object")).loadAsync=m("./load"),c.support=m("./support"),c.defaults=m("./defaults"),c.version="3.10.1",c.loadAsync=function(a,r){return new c().loadAsync(a,r)},c.external=m("./external"),C.exports=c},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(m,C,v){var c=m("./utils"),a=m("./external"),r=m("./utf8"),o=m("./zipEntries"),_=m("./stream/Crc32Probe"),y=m("./nodejsUtils");function g(b){return new a.Promise(function(i,u){var n=b.decompressed.getContentWorker().pipe(new _);n.on("error",function(h){u(h)}).on("end",function(){n.streamInfo.crc32!==b.decompressed.crc32?u(new Error("Corrupted zip : CRC32 mismatch")):i()}).resume()})}C.exports=function(b,i){var u=this;return i=c.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),y.isNode&&y.isStream(b)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):c.prepareContent("the loaded zip file",b,!0,i.optimizedBinaryString,i.base64).then(function(n){var h=new o(i);return h.load(n),h}).then(function(n){var h=[a.Promise.resolve(n)],l=n.files;if(i.checkCRC32)for(var x=0;x<l.length;x++)h.push(g(l[x]));return a.Promise.all(h)}).then(function(n){for(var h=n.shift(),l=h.files,x=0;x<l.length;x++){var w=l[x],S=w.fileNameStr,N=c.resolve(w.fileNameStr);u.file(N,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:i.createFolders}),w.dir||(u.file(N).unsafeOriginalName=S)}return h.zipComment.length&&(u.comment=h.zipComment),u})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(m,C,v){var c=m("../utils"),a=m("../stream/GenericWorker");function r(o,_){a.call(this,"Nodejs stream input adapter for "+o),this._upstreamEnded=!1,this._bindStream(_)}c.inherits(r,a),r.prototype._bindStream=function(o){var _=this;(this._stream=o).pause(),o.on("data",function(y){_.push({data:y,meta:{percent:0}})}).on("error",function(y){_.isPaused?this.generatedError=y:_.error(y)}).on("end",function(){_.isPaused?_._upstreamEnded=!0:_.end()})},r.prototype.pause=function(){return!!a.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},C.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(m,C,v){var c=m("readable-stream").Readable;function a(r,o,_){c.call(this,o),this._helper=r;var y=this;r.on("data",function(g,b){y.push(g)||y._helper.pause(),_&&_(b)}).on("error",function(g){y.emit("error",g)}).on("end",function(){y.push(null)})}m("../utils").inherits(a,c),a.prototype._read=function(){this._helper.resume()},C.exports=a},{"../utils":32,"readable-stream":16}],14:[function(m,C,v){C.exports={isNode:typeof Buffer<"u",newBufferFrom:function(c,a){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(c,a);if(typeof c=="number")throw new Error('The "data" argument must not be a number');return new Buffer(c,a)},allocBuffer:function(c){if(Buffer.alloc)return Buffer.alloc(c);var a=new Buffer(c);return a.fill(0),a},isBuffer:function(c){return Buffer.isBuffer(c)},isStream:function(c){return c&&typeof c.on=="function"&&typeof c.pause=="function"&&typeof c.resume=="function"}}},{}],15:[function(m,C,v){function c(N,B,F){var W,R=r.getTypeOf(B),H=r.extend(F||{},y);H.date=H.date||new Date,H.compression!==null&&(H.compression=H.compression.toUpperCase()),typeof H.unixPermissions=="string"&&(H.unixPermissions=parseInt(H.unixPermissions,8)),H.unixPermissions&&16384&H.unixPermissions&&(H.dir=!0),H.dosPermissions&&16&H.dosPermissions&&(H.dir=!0),H.dir&&(N=l(N)),H.createFolders&&(W=h(N))&&x.call(this,W,!0);var ee=R==="string"&&H.binary===!1&&H.base64===!1;F&&F.binary!==void 0||(H.binary=!ee),(B instanceof g&&B.uncompressedSize===0||H.dir||!B||B.length===0)&&(H.base64=!1,H.binary=!0,B="",H.compression="STORE",R="string");var f=null;f=B instanceof g||B instanceof o?B:u.isNode&&u.isStream(B)?new n(N,B):r.prepareContent(N,B,H.binary,H.optimizedBinaryString,H.base64);var z=new b(N,f,H);this.files[N]=z}var a=m("./utf8"),r=m("./utils"),o=m("./stream/GenericWorker"),_=m("./stream/StreamHelper"),y=m("./defaults"),g=m("./compressedObject"),b=m("./zipObject"),i=m("./generate"),u=m("./nodejsUtils"),n=m("./nodejs/NodejsStreamInputAdapter"),h=function(N){N.slice(-1)==="/"&&(N=N.substring(0,N.length-1));var B=N.lastIndexOf("/");return 0<B?N.substring(0,B):""},l=function(N){return N.slice(-1)!=="/"&&(N+="/"),N},x=function(N,B){return B=B!==void 0?B:y.createFolders,N=l(N),this.files[N]||c.call(this,N,null,{dir:!0,createFolders:B}),this.files[N]};function w(N){return Object.prototype.toString.call(N)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(N){var B,F,W;for(B in this.files)W=this.files[B],(F=B.slice(this.root.length,B.length))&&B.slice(0,this.root.length)===this.root&&N(F,W)},filter:function(N){var B=[];return this.forEach(function(F,W){N(F,W)&&B.push(W)}),B},file:function(N,B,F){if(arguments.length!==1)return N=this.root+N,c.call(this,N,B,F),this;if(w(N)){var W=N;return this.filter(function(H,ee){return!ee.dir&&W.test(H)})}var R=this.files[this.root+N];return R&&!R.dir?R:null},folder:function(N){if(!N)return this;if(w(N))return this.filter(function(R,H){return H.dir&&N.test(R)});var B=this.root+N,F=x.call(this,B),W=this.clone();return W.root=F.name,W},remove:function(N){N=this.root+N;var B=this.files[N];if(B||(N.slice(-1)!=="/"&&(N+="/"),B=this.files[N]),B&&!B.dir)delete this.files[N];else for(var F=this.filter(function(R,H){return H.name.slice(0,N.length)===N}),W=0;W<F.length;W++)delete this.files[F[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(N){var B,F={};try{if((F=r.extend(N||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=F.type.toLowerCase(),F.compression=F.compression.toUpperCase(),F.type==="binarystring"&&(F.type="string"),!F.type)throw new Error("No output type specified.");r.checkSupport(F.type),F.platform!=="darwin"&&F.platform!=="freebsd"&&F.platform!=="linux"&&F.platform!=="sunos"||(F.platform="UNIX"),F.platform==="win32"&&(F.platform="DOS");var W=F.comment||this.comment||"";B=i.generateWorker(this,F,W)}catch(R){(B=new o("error")).error(R)}return new _(B,F.type||"string",F.mimeType)},generateAsync:function(N,B){return this.generateInternalStream(N).accumulate(B)},generateNodeStream:function(N,B){return(N=N||{}).type||(N.type="nodebuffer"),this.generateInternalStream(N).toNodejsStream(B)}};C.exports=S},{"./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(m,C,v){C.exports=m("stream")},{stream:void 0}],17:[function(m,C,v){var c=m("./DataReader");function a(r){c.call(this,r);for(var o=0;o<this.data.length;o++)r[o]=255&r[o]}m("../utils").inherits(a,c),a.prototype.byteAt=function(r){return this.data[this.zero+r]},a.prototype.lastIndexOfSignature=function(r){for(var o=r.charCodeAt(0),_=r.charCodeAt(1),y=r.charCodeAt(2),g=r.charCodeAt(3),b=this.length-4;0<=b;--b)if(this.data[b]===o&&this.data[b+1]===_&&this.data[b+2]===y&&this.data[b+3]===g)return b-this.zero;return-1},a.prototype.readAndCheckSignature=function(r){var o=r.charCodeAt(0),_=r.charCodeAt(1),y=r.charCodeAt(2),g=r.charCodeAt(3),b=this.readData(4);return o===b[0]&&_===b[1]&&y===b[2]&&g===b[3]},a.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var o=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,o},C.exports=a},{"../utils":32,"./DataReader":18}],18:[function(m,C,v){var c=m("../utils");function a(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}a.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 o,_=0;for(this.checkOffset(r),o=this.index+r-1;o>=this.index;o--)_=(_<<8)+this.byteAt(o);return this.index+=r,_},readString:function(r){return c.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))}},C.exports=a},{"../utils":32}],19:[function(m,C,v){var c=m("./Uint8ArrayReader");function a(r){c.call(this,r)}m("../utils").inherits(a,c),a.prototype.readData=function(r){this.checkOffset(r);var o=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,o},C.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(m,C,v){var c=m("./DataReader");function a(r){c.call(this,r)}m("../utils").inherits(a,c),a.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},a.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},a.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},a.prototype.readData=function(r){this.checkOffset(r);var o=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,o},C.exports=a},{"../utils":32,"./DataReader":18}],21:[function(m,C,v){var c=m("./ArrayReader");function a(r){c.call(this,r)}m("../utils").inherits(a,c),a.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var o=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,o},C.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(m,C,v){var c=m("../utils"),a=m("../support"),r=m("./ArrayReader"),o=m("./StringReader"),_=m("./NodeBufferReader"),y=m("./Uint8ArrayReader");C.exports=function(g){var b=c.getTypeOf(g);return c.checkSupport(b),b!=="string"||a.uint8array?b==="nodebuffer"?new _(g):a.uint8array?new y(c.transformTo("uint8array",g)):new r(c.transformTo("array",g)):new o(g)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(m,C,v){v.LOCAL_FILE_HEADER="PK",v.CENTRAL_FILE_HEADER="PK",v.CENTRAL_DIRECTORY_END="PK",v.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",v.ZIP64_CENTRAL_DIRECTORY_END="PK",v.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(m,C,v){var c=m("./GenericWorker"),a=m("../utils");function r(o){c.call(this,"ConvertWorker to "+o),this.destType=o}a.inherits(r,c),r.prototype.processChunk=function(o){this.push({data:a.transformTo(this.destType,o.data),meta:o.meta})},C.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(m,C,v){var c=m("./GenericWorker"),a=m("../crc32");function r(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}m("../utils").inherits(r,c),r.prototype.processChunk=function(o){this.streamInfo.crc32=a(o.data,this.streamInfo.crc32||0),this.push(o)},C.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(m,C,v){var c=m("../utils"),a=m("./GenericWorker");function r(o){a.call(this,"DataLengthProbe for "+o),this.propName=o,this.withStreamInfo(o,0)}c.inherits(r,a),r.prototype.processChunk=function(o){if(o){var _=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=_+o.data.length}a.prototype.processChunk.call(this,o)},C.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(m,C,v){var c=m("../utils"),a=m("./GenericWorker");function r(o){a.call(this,"DataWorker");var _=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,o.then(function(y){_.dataIsReady=!0,_.data=y,_.max=y&&y.length||0,_.type=c.getTypeOf(y),_.isPaused||_._tickAndRepeat()},function(y){_.error(y)})}c.inherits(r,a),r.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var o=null,_=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":o=this.data.substring(this.index,_);break;case"uint8array":o=this.data.subarray(this.index,_);break;case"array":case"nodebuffer":o=this.data.slice(this.index,_)}return this.index=_,this.push({data:o,meta:{percent:this.max?this.index/this.max*100:0}})},C.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(m,C,v){function c(a){this.name=a||"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}c.prototype={push:function(a){this.emit("data",a)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(a){this.emit("error",a)}return!0},error:function(a){return!this.isFinished&&(this.isPaused?this.generatedError=a:(this.isFinished=!0,this.emit("error",a),this.previous&&this.previous.error(a),this.cleanUp()),!0)},on:function(a,r){return this._listeners[a].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(a,r){if(this._listeners[a])for(var o=0;o<this._listeners[a].length;o++)this._listeners[a][o].call(this,r)},pipe:function(a){return a.registerPrevious(this)},registerPrevious:function(a){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=a.streamInfo,this.mergeStreamInfo(),this.previous=a;var r=this;return a.on("data",function(o){r.processChunk(o)}),a.on("end",function(){r.end()}),a.on("error",function(o){r.error(o)}),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 a=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),a=!0),this.previous&&this.previous.resume(),!a},flush:function(){},processChunk:function(a){this.push(a)},withStreamInfo:function(a,r){return this.extraStreamInfo[a]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var a in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,a)&&(this.streamInfo[a]=this.extraStreamInfo[a])},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 a="Worker "+this.name;return this.previous?this.previous+" -> "+a:a}},C.exports=c},{}],29:[function(m,C,v){var c=m("../utils"),a=m("./ConvertWorker"),r=m("./GenericWorker"),o=m("../base64"),_=m("../support"),y=m("../external"),g=null;if(_.nodestream)try{g=m("../nodejs/NodejsStreamOutputAdapter")}catch{}function b(u,n){return new y.Promise(function(h,l){var x=[],w=u._internalType,S=u._outputType,N=u._mimeType;u.on("data",function(B,F){x.push(B),n&&n(F)}).on("error",function(B){x=[],l(B)}).on("end",function(){try{var B=(function(F,W,R){switch(F){case"blob":return c.newBlob(c.transformTo("arraybuffer",W),R);case"base64":return o.encode(W);default:return c.transformTo(F,W)}})(S,(function(F,W){var R,H=0,ee=null,f=0;for(R=0;R<W.length;R++)f+=W[R].length;switch(F){case"string":return W.join("");case"array":return Array.prototype.concat.apply([],W);case"uint8array":for(ee=new Uint8Array(f),R=0;R<W.length;R++)ee.set(W[R],H),H+=W[R].length;return ee;case"nodebuffer":return Buffer.concat(W);default:throw new Error("concat : unsupported type '"+F+"'")}})(w,x),N);h(B)}catch(F){l(F)}x=[]}).resume()})}function i(u,n,h){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=h,c.checkSupport(l),this._worker=u.pipe(new a(l)),u.lock()}catch(x){this._worker=new r("error"),this._worker.error(x)}}i.prototype={accumulate:function(u){return b(this,u)},on:function(u,n){var h=this;return u==="data"?this._worker.on(u,function(l){n.call(h,l.data,l.meta)}):this._worker.on(u,function(){c.delay(n,arguments,h)}),this},resume:function(){return c.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(u){if(c.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new g(this,{objectMode:this._outputType!=="nodebuffer"},u)}},C.exports=i},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(m,C,v){if(v.base64=!0,v.array=!0,v.string=!0,v.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",v.nodebuffer=typeof Buffer<"u",v.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")v.blob=!1;else{var c=new ArrayBuffer(0);try{v.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(c),v.blob=a.getBlob("application/zip").size===0}catch{v.blob=!1}}}try{v.nodestream=!!m("readable-stream").Readable}catch{v.nodestream=!1}},{"readable-stream":16}],31:[function(m,C,v){for(var c=m("./utils"),a=m("./support"),r=m("./nodejsUtils"),o=m("./stream/GenericWorker"),_=new Array(256),y=0;y<256;y++)_[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;_[254]=_[254]=1;function g(){o.call(this,"utf-8 decode"),this.leftOver=null}function b(){o.call(this,"utf-8 encode")}v.utf8encode=function(i){return a.nodebuffer?r.newBufferFrom(i,"utf-8"):(function(u){var n,h,l,x,w,S=u.length,N=0;for(x=0;x<S;x++)(64512&(h=u.charCodeAt(x)))==55296&&x+1<S&&(64512&(l=u.charCodeAt(x+1)))==56320&&(h=65536+(h-55296<<10)+(l-56320),x++),N+=h<128?1:h<2048?2:h<65536?3:4;for(n=a.uint8array?new Uint8Array(N):new Array(N),x=w=0;w<N;x++)(64512&(h=u.charCodeAt(x)))==55296&&x+1<S&&(64512&(l=u.charCodeAt(x+1)))==56320&&(h=65536+(h-55296<<10)+(l-56320),x++),h<128?n[w++]=h:(h<2048?n[w++]=192|h>>>6:(h<65536?n[w++]=224|h>>>12:(n[w++]=240|h>>>18,n[w++]=128|h>>>12&63),n[w++]=128|h>>>6&63),n[w++]=128|63&h);return n})(i)},v.utf8decode=function(i){return a.nodebuffer?c.transformTo("nodebuffer",i).toString("utf-8"):(function(u){var n,h,l,x,w=u.length,S=new Array(2*w);for(n=h=0;n<w;)if((l=u[n++])<128)S[h++]=l;else if(4<(x=_[l]))S[h++]=65533,n+=x-1;else{for(l&=x===2?31:x===3?15:7;1<x&&n<w;)l=l<<6|63&u[n++],x--;1<x?S[h++]=65533:l<65536?S[h++]=l:(l-=65536,S[h++]=55296|l>>10&1023,S[h++]=56320|1023&l)}return S.length!==h&&(S.subarray?S=S.subarray(0,h):S.length=h),c.applyFromCharCode(S)})(i=c.transformTo(a.uint8array?"uint8array":"array",i))},c.inherits(g,o),g.prototype.processChunk=function(i){var u=c.transformTo(a.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var n=u;(u=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),u.set(n,this.leftOver.length)}else u=this.leftOver.concat(u);this.leftOver=null}var h=(function(x,w){var S;for((w=w||x.length)>x.length&&(w=x.length),S=w-1;0<=S&&(192&x[S])==128;)S--;return S<0||S===0?w:S+_[x[S]]>w?S:w})(u),l=u;h!==u.length&&(a.uint8array?(l=u.subarray(0,h),this.leftOver=u.subarray(h,u.length)):(l=u.slice(0,h),this.leftOver=u.slice(h,u.length))),this.push({data:v.utf8decode(l),meta:i.meta})},g.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:v.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},v.Utf8DecodeWorker=g,c.inherits(b,o),b.prototype.processChunk=function(i){this.push({data:v.utf8encode(i.data),meta:i.meta})},v.Utf8EncodeWorker=b},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(m,C,v){var c=m("./support"),a=m("./base64"),r=m("./nodejsUtils"),o=m("./external");function _(n){return n}function y(n,h){for(var l=0;l<n.length;++l)h[l]=255&n.charCodeAt(l);return h}m("setimmediate"),v.newBlob=function(n,h){v.checkSupport("blob");try{return new Blob([n],{type:h})}catch{try{var l=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return l.append(n),l.getBlob(h)}catch{throw new Error("Bug : can't construct the Blob.")}}};var g={stringifyByChunk:function(n,h,l){var x=[],w=0,S=n.length;if(S<=l)return String.fromCharCode.apply(null,n);for(;w<S;)h==="array"||h==="nodebuffer"?x.push(String.fromCharCode.apply(null,n.slice(w,Math.min(w+l,S)))):x.push(String.fromCharCode.apply(null,n.subarray(w,Math.min(w+l,S)))),w+=l;return x.join("")},stringifyByChar:function(n){for(var h="",l=0;l<n.length;l++)h+=String.fromCharCode(n[l]);return h},applyCanBeUsed:{uint8array:(function(){try{return c.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return c.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function b(n){var h=65536,l=v.getTypeOf(n),x=!0;if(l==="uint8array"?x=g.applyCanBeUsed.uint8array:l==="nodebuffer"&&(x=g.applyCanBeUsed.nodebuffer),x)for(;1<h;)try{return g.stringifyByChunk(n,l,h)}catch{h=Math.floor(h/2)}return g.stringifyByChar(n)}function i(n,h){for(var l=0;l<n.length;l++)h[l]=n[l];return h}v.applyFromCharCode=b;var u={};u.string={string:_,array:function(n){return y(n,new Array(n.length))},arraybuffer:function(n){return u.string.uint8array(n).buffer},uint8array:function(n){return y(n,new Uint8Array(n.length))},nodebuffer:function(n){return y(n,r.allocBuffer(n.length))}},u.array={string:b,array:_,arraybuffer:function(n){return new Uint8Array(n).buffer},uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(n)}},u.arraybuffer={string:function(n){return b(new Uint8Array(n))},array:function(n){return i(new Uint8Array(n),new Array(n.byteLength))},arraybuffer:_,uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(new Uint8Array(n))}},u.uint8array={string:b,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return n.buffer},uint8array:_,nodebuffer:function(n){return r.newBufferFrom(n)}},u.nodebuffer={string:b,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return u.nodebuffer.uint8array(n).buffer},uint8array:function(n){return i(n,new Uint8Array(n.length))},nodebuffer:_},v.transformTo=function(n,h){if(h=h||"",!n)return h;v.checkSupport(n);var l=v.getTypeOf(h);return u[l][n](h)},v.resolve=function(n){for(var h=n.split("/"),l=[],x=0;x<h.length;x++){var w=h[x];w==="."||w===""&&x!==0&&x!==h.length-1||(w===".."?l.pop():l.push(w))}return l.join("/")},v.getTypeOf=function(n){return typeof n=="string"?"string":Object.prototype.toString.call(n)==="[object Array]"?"array":c.nodebuffer&&r.isBuffer(n)?"nodebuffer":c.uint8array&&n instanceof Uint8Array?"uint8array":c.arraybuffer&&n instanceof ArrayBuffer?"arraybuffer":void 0},v.checkSupport=function(n){if(!c[n.toLowerCase()])throw new Error(n+" is not supported by this platform")},v.MAX_VALUE_16BITS=65535,v.MAX_VALUE_32BITS=-1,v.pretty=function(n){var h,l,x="";for(l=0;l<(n||"").length;l++)x+="\\x"+((h=n.charCodeAt(l))<16?"0":"")+h.toString(16).toUpperCase();return x},v.delay=function(n,h,l){setImmediate(function(){n.apply(l||null,h||[])})},v.inherits=function(n,h){function l(){}l.prototype=h.prototype,n.prototype=new l},v.extend=function(){var n,h,l={};for(n=0;n<arguments.length;n++)for(h in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],h)&&l[h]===void 0&&(l[h]=arguments[n][h]);return l},v.prepareContent=function(n,h,l,x,w){return o.Promise.resolve(h).then(function(S){return c.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new o.Promise(function(N,B){var F=new FileReader;F.onload=function(W){N(W.target.result)},F.onerror=function(W){B(W.target.error)},F.readAsArrayBuffer(S)}):S}).then(function(S){var N=v.getTypeOf(S);return N?(N==="arraybuffer"?S=v.transformTo("uint8array",S):N==="string"&&(w?S=a.decode(S):l&&x!==!0&&(S=(function(B){return y(B,c.uint8array?new Uint8Array(B.length):new Array(B.length))})(S))),S):o.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(m,C,v){var c=m("./reader/readerFor"),a=m("./utils"),r=m("./signature"),o=m("./zipEntry"),_=m("./support");function y(g){this.files=[],this.loadOptions=g}y.prototype={checkSignature:function(g){if(!this.reader.readAndCheckSignature(g)){this.reader.index-=4;var b=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(b)+", expected "+a.pretty(g)+")")}},isSignature:function(g,b){var i=this.reader.index;this.reader.setIndex(g);var u=this.reader.readString(4)===b;return this.reader.setIndex(i),u},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",i=a.transformTo(b,g);this.zipComment=this.loadOptions.decodeFileName(i)},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,b,i,u=this.zip64EndOfCentralSize-44;0<u;)g=this.reader.readInt(2),b=this.reader.readInt(4),i=this.reader.readData(b),this.zip64ExtensibleData[g]={id:g,length:b,value:i}},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,b;for(g=0;g<this.files.length;g++)b=this.files[g],this.reader.setIndex(b.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),b.readLocalPart(this.reader),b.handleUTF8(),b.processAttributes()},readCentralDir:function(){var g;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(g=new o({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 b=g;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.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 i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var u=b-i;if(0<u)this.isSignature(b,r.CENTRAL_FILE_HEADER)||(this.reader.zero=u);else if(u<0)throw new Error("Corrupted zip: missing "+Math.abs(u)+" bytes.")},prepareReader:function(g){this.reader=c(g)},load:function(g){this.prepareReader(g),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},C.exports=y},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(m,C,v){var c=m("./reader/readerFor"),a=m("./utils"),r=m("./compressedObject"),o=m("./crc32"),_=m("./utf8"),y=m("./compressions"),g=m("./support");function b(i,u){this.options=i,this.loadOptions=u}b.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(i){var u,n;if(i.skip(22),this.fileNameLength=i.readInt(2),n=i.readInt(2),this.fileName=i.readData(this.fileNameLength),i.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((u=(function(h){for(var l in y)if(Object.prototype.hasOwnProperty.call(y,l)&&y[l].magic===h)return y[l];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,u,i.readData(this.compressedSize))},readCentralPart:function(i){this.versionMadeBy=i.readInt(2),i.skip(2),this.bitFlag=i.readInt(2),this.compressionMethod=i.readString(2),this.date=i.readDate(),this.crc32=i.readInt(4),this.compressedSize=i.readInt(4),this.uncompressedSize=i.readInt(4);var u=i.readInt(2);if(this.extraFieldsLength=i.readInt(2),this.fileCommentLength=i.readInt(2),this.diskNumberStart=i.readInt(2),this.internalFileAttributes=i.readInt(2),this.externalFileAttributes=i.readInt(4),this.localHeaderOffset=i.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");i.skip(u),this.readExtraFields(i),this.parseZIP64ExtraField(i),this.fileComment=i.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var i=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=c(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var u,n,h,l=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4<l;)u=i.readInt(2),n=i.readInt(2),h=i.readData(n),this.extraFields[u]={id:u,length:n,value:h};i.setIndex(l)},handleUTF8:function(){var i=g.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=_.utf8decode(this.fileName),this.fileCommentStr=_.utf8decode(this.fileComment);else{var u=this.findExtraFieldUnicodePath();if(u!==null)this.fileNameStr=u;else{var n=a.transformTo(i,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var h=this.findExtraFieldUnicodeComment();if(h!==null)this.fileCommentStr=h;else{var l=a.transformTo(i,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(l)}}},findExtraFieldUnicodePath:function(){var i=this.extraFields[28789];if(i){var u=c(i.value);return u.readInt(1)!==1||o(this.fileName)!==u.readInt(4)?null:_.utf8decode(u.readData(i.length-5))}return null},findExtraFieldUnicodeComment:function(){var i=this.extraFields[25461];if(i){var u=c(i.value);return u.readInt(1)!==1||o(this.fileComment)!==u.readInt(4)?null:_.utf8decode(u.readData(i.length-5))}return null}},C.exports=b},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(m,C,v){function c(u,n,h){this.name=u,this.dir=h.dir,this.date=h.date,this.comment=h.comment,this.unixPermissions=h.unixPermissions,this.dosPermissions=h.dosPermissions,this._data=n,this._dataBinary=h.binary,this.options={compression:h.compression,compressionOptions:h.compressionOptions}}var a=m("./stream/StreamHelper"),r=m("./stream/DataWorker"),o=m("./utf8"),_=m("./compressedObject"),y=m("./stream/GenericWorker");c.prototype={internalStream:function(u){var n=null,h="string";try{if(!u)throw new Error("No output type specified.");var l=(h=u.toLowerCase())==="string"||h==="text";h!=="binarystring"&&h!=="text"||(h="string"),n=this._decompressWorker();var x=!this._dataBinary;x&&!l&&(n=n.pipe(new o.Utf8EncodeWorker)),!x&&l&&(n=n.pipe(new o.Utf8DecodeWorker))}catch(w){(n=new y("error")).error(w)}return new a(n,h,"")},async:function(u,n){return this.internalStream(u).accumulate(n)},nodeStream:function(u,n){return this.internalStream(u||"nodebuffer").toNodejsStream(n)},_compressWorker:function(u,n){if(this._data instanceof _&&this._data.compression.magic===u.magic)return this._data.getCompressedWorker();var h=this._decompressWorker();return this._dataBinary||(h=h.pipe(new o.Utf8EncodeWorker)),_.createWorkerFrom(h,u,n)},_decompressWorker:function(){return this._data instanceof _?this._data.getContentWorker():this._data instanceof y?this._data:new r(this._data)}};for(var g=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],b=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},i=0;i<g.length;i++)c.prototype[g[i]]=b;C.exports=c},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(m,C,v){(function(c){var a,r,o=c.MutationObserver||c.WebKitMutationObserver;if(o){var _=0,y=new o(u),g=c.document.createTextNode("");y.observe(g,{characterData:!0}),a=function(){g.data=_=++_%2}}else if(c.setImmediate||c.MessageChannel===void 0)a="document"in c&&"onreadystatechange"in c.document.createElement("script")?function(){var n=c.document.createElement("script");n.onreadystatechange=function(){u(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},c.document.documentElement.appendChild(n)}:function(){setTimeout(u,0)};else{var b=new c.MessageChannel;b.port1.onmessage=u,a=function(){b.port2.postMessage(0)}}var i=[];function u(){var n,h;r=!0;for(var l=i.length;l;){for(h=i,i=[],n=-1;++n<l;)h[n]();l=i.length}r=!1}C.exports=function(n){i.push(n)!==1||r||a()}}).call(this,typeof $e<"u"?$e:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(m,C,v){var c=m("immediate");function a(){}var r={},o=["REJECTED"],_=["FULFILLED"],y=["PENDING"];function g(l){if(typeof l!="function")throw new TypeError("resolver must be a function");this.state=y,this.queue=[],this.outcome=void 0,l!==a&&n(this,l)}function b(l,x,w){this.promise=l,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof w=="function"&&(this.onRejected=w,this.callRejected=this.otherCallRejected)}function i(l,x,w){c(function(){var S;try{S=x(w)}catch(N){return r.reject(l,N)}S===l?r.reject(l,new TypeError("Cannot resolve promise with itself")):r.resolve(l,S)})}function u(l){var x=l&&l.then;if(l&&(typeof l=="object"||typeof l=="function")&&typeof x=="function")return function(){x.apply(l,arguments)}}function n(l,x){var w=!1;function S(F){w||(w=!0,r.reject(l,F))}function N(F){w||(w=!0,r.resolve(l,F))}var B=h(function(){x(N,S)});B.status==="error"&&S(B.value)}function h(l,x){var w={};try{w.value=l(x),w.status="success"}catch(S){w.status="error",w.value=S}return w}(C.exports=g).prototype.finally=function(l){if(typeof l!="function")return this;var x=this.constructor;return this.then(function(w){return x.resolve(l()).then(function(){return w})},function(w){return x.resolve(l()).then(function(){throw w})})},g.prototype.catch=function(l){return this.then(null,l)},g.prototype.then=function(l,x){if(typeof l!="function"&&this.state===_||typeof x!="function"&&this.state===o)return this;var w=new this.constructor(a);return this.state!==y?i(w,this.state===_?l:x,this.outcome):this.queue.push(new b(w,l,x)),w},b.prototype.callFulfilled=function(l){r.resolve(this.promise,l)},b.prototype.otherCallFulfilled=function(l){i(this.promise,this.onFulfilled,l)},b.prototype.callRejected=function(l){r.reject(this.promise,l)},b.prototype.otherCallRejected=function(l){i(this.promise,this.onRejected,l)},r.resolve=function(l,x){var w=h(u,x);if(w.status==="error")return r.reject(l,w.value);var S=w.value;if(S)n(l,S);else{l.state=_,l.outcome=x;for(var N=-1,B=l.queue.length;++N<B;)l.queue[N].callFulfilled(x)}return l},r.reject=function(l,x){l.state=o,l.outcome=x;for(var w=-1,S=l.queue.length;++w<S;)l.queue[w].callRejected(x);return l},g.resolve=function(l){return l instanceof this?l:r.resolve(new this(a),l)},g.reject=function(l){var x=new this(a);return r.reject(x,l)},g.all=function(l){var x=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=l.length,S=!1;if(!w)return this.resolve([]);for(var N=new Array(w),B=0,F=-1,W=new this(a);++F<w;)R(l[F],F);return W;function R(H,ee){x.resolve(H).then(function(f){N[ee]=f,++B!==w||S||(S=!0,r.resolve(W,N))},function(f){S||(S=!0,r.reject(W,f))})}},g.race=function(l){var x=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var w=l.length,S=!1;if(!w)return this.resolve([]);for(var N=-1,B=new this(a);++N<w;)F=l[N],x.resolve(F).then(function(W){S||(S=!0,r.resolve(B,W))},function(W){S||(S=!0,r.reject(B,W))});var F;return B}},{immediate:36}],38:[function(m,C,v){var c={};(0,m("./lib/utils/common").assign)(c,m("./lib/deflate"),m("./lib/inflate"),m("./lib/zlib/constants")),C.exports=c},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(m,C,v){var c=m("./zlib/deflate"),a=m("./utils/common"),r=m("./utils/strings"),o=m("./zlib/messages"),_=m("./zlib/zstream"),y=Object.prototype.toString,g=0,b=-1,i=0,u=8;function n(l){if(!(this instanceof n))return new n(l);this.options=a.assign({level:b,method:u,chunkSize:16384,windowBits:15,memLevel:8,strategy:i,to:""},l||{});var x=this.options;x.raw&&0<x.windowBits?x.windowBits=-x.windowBits:x.gzip&&0<x.windowBits&&x.windowBits<16&&(x.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new _,this.strm.avail_out=0;var w=c.deflateInit2(this.strm,x.level,x.method,x.windowBits,x.memLevel,x.strategy);if(w!==g)throw new Error(o[w]);if(x.header&&c.deflateSetHeader(this.strm,x.header),x.dictionary){var S;if(S=typeof x.dictionary=="string"?r.string2buf(x.dictionary):y.call(x.dictionary)==="[object ArrayBuffer]"?new Uint8Array(x.dictionary):x.dictionary,(w=c.deflateSetDictionary(this.strm,S))!==g)throw new Error(o[w]);this._dict_set=!0}}function h(l,x){var w=new n(x);if(w.push(l,!0),w.err)throw w.msg||o[w.err];return w.result}n.prototype.push=function(l,x){var w,S,N=this.strm,B=this.options.chunkSize;if(this.ended)return!1;S=x===~~x?x:x===!0?4:0,typeof l=="string"?N.input=r.string2buf(l):y.call(l)==="[object ArrayBuffer]"?N.input=new Uint8Array(l):N.input=l,N.next_in=0,N.avail_in=N.input.length;do{if(N.avail_out===0&&(N.output=new a.Buf8(B),N.next_out=0,N.avail_out=B),(w=c.deflate(N,S))!==1&&w!==g)return this.onEnd(w),!(this.ended=!0);N.avail_out!==0&&(N.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(a.shrinkBuf(N.output,N.next_out))):this.onData(a.shrinkBuf(N.output,N.next_out)))}while((0<N.avail_in||N.avail_out===0)&&w!==1);return S===4?(w=c.deflateEnd(this.strm),this.onEnd(w),this.ended=!0,w===g):S!==2||(this.onEnd(g),!(N.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=a.flattenChunks(this.chunks)),this.chunks=[],this.err=l,this.msg=this.strm.msg},v.Deflate=n,v.deflate=h,v.deflateRaw=function(l,x){return(x=x||{}).raw=!0,h(l,x)},v.gzip=function(l,x){return(x=x||{}).gzip=!0,h(l,x)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(m,C,v){var c=m("./zlib/inflate"),a=m("./utils/common"),r=m("./utils/strings"),o=m("./zlib/constants"),_=m("./zlib/messages"),y=m("./zlib/zstream"),g=m("./zlib/gzheader"),b=Object.prototype.toString;function i(n){if(!(this instanceof i))return new i(n);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},n||{});var h=this.options;h.raw&&0<=h.windowBits&&h.windowBits<16&&(h.windowBits=-h.windowBits,h.windowBits===0&&(h.windowBits=-15)),!(0<=h.windowBits&&h.windowBits<16)||n&&n.windowBits||(h.windowBits+=32),15<h.windowBits&&h.windowBits<48&&(15&h.windowBits)==0&&(h.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new y,this.strm.avail_out=0;var l=c.inflateInit2(this.strm,h.windowBits);if(l!==o.Z_OK)throw new Error(_[l]);this.header=new g,c.inflateGetHeader(this.strm,this.header)}function u(n,h){var l=new i(h);if(l.push(n,!0),l.err)throw l.msg||_[l.err];return l.result}i.prototype.push=function(n,h){var l,x,w,S,N,B,F=this.strm,W=this.options.chunkSize,R=this.options.dictionary,H=!1;if(this.ended)return!1;x=h===~~h?h:h===!0?o.Z_FINISH:o.Z_NO_FLUSH,typeof n=="string"?F.input=r.binstring2buf(n):b.call(n)==="[object ArrayBuffer]"?F.input=new Uint8Array(n):F.input=n,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new a.Buf8(W),F.next_out=0,F.avail_out=W),(l=c.inflate(F,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&R&&(B=typeof R=="string"?r.string2buf(R):b.call(R)==="[object ArrayBuffer]"?new Uint8Array(R):R,l=c.inflateSetDictionary(this.strm,B)),l===o.Z_BUF_ERROR&&H===!0&&(l=o.Z_OK,H=!1),l!==o.Z_STREAM_END&&l!==o.Z_OK)return this.onEnd(l),!(this.ended=!0);F.next_out&&(F.avail_out!==0&&l!==o.Z_STREAM_END&&(F.avail_in!==0||x!==o.Z_FINISH&&x!==o.Z_SYNC_FLUSH)||(this.options.to==="string"?(w=r.utf8border(F.output,F.next_out),S=F.next_out-w,N=r.buf2string(F.output,w),F.next_out=S,F.avail_out=W-S,S&&a.arraySet(F.output,F.output,w,S,0),this.onData(N)):this.onData(a.shrinkBuf(F.output,F.next_out)))),F.avail_in===0&&F.avail_out===0&&(H=!0)}while((0<F.avail_in||F.avail_out===0)&&l!==o.Z_STREAM_END);return l===o.Z_STREAM_END&&(x=o.Z_FINISH),x===o.Z_FINISH?(l=c.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===o.Z_OK):x!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(F.avail_out=0))},i.prototype.onData=function(n){this.chunks.push(n)},i.prototype.onEnd=function(n){n===o.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg},v.Inflate=i,v.inflate=u,v.inflateRaw=function(n,h){return(h=h||{}).raw=!0,u(n,h)},v.ungzip=u},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(m,C,v){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";v.assign=function(o){for(var _=Array.prototype.slice.call(arguments,1);_.length;){var y=_.shift();if(y){if(typeof y!="object")throw new TypeError(y+"must be non-object");for(var g in y)y.hasOwnProperty(g)&&(o[g]=y[g])}}return o},v.shrinkBuf=function(o,_){return o.length===_?o:o.subarray?o.subarray(0,_):(o.length=_,o)};var a={arraySet:function(o,_,y,g,b){if(_.subarray&&o.subarray)o.set(_.subarray(y,y+g),b);else for(var i=0;i<g;i++)o[b+i]=_[y+i]},flattenChunks:function(o){var _,y,g,b,i,u;for(_=g=0,y=o.length;_<y;_++)g+=o[_].length;for(u=new Uint8Array(g),_=b=0,y=o.length;_<y;_++)i=o[_],u.set(i,b),b+=i.length;return u}},r={arraySet:function(o,_,y,g,b){for(var i=0;i<g;i++)o[b+i]=_[y+i]},flattenChunks:function(o){return[].concat.apply([],o)}};v.setTyped=function(o){o?(v.Buf8=Uint8Array,v.Buf16=Uint16Array,v.Buf32=Int32Array,v.assign(v,a)):(v.Buf8=Array,v.Buf16=Array,v.Buf32=Array,v.assign(v,r))},v.setTyped(c)},{}],42:[function(m,C,v){var c=m("./common"),a=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var o=new c.Buf8(256),_=0;_<256;_++)o[_]=252<=_?6:248<=_?5:240<=_?4:224<=_?3:192<=_?2:1;function y(g,b){if(b<65537&&(g.subarray&&r||!g.subarray&&a))return String.fromCharCode.apply(null,c.shrinkBuf(g,b));for(var i="",u=0;u<b;u++)i+=String.fromCharCode(g[u]);return i}o[254]=o[254]=1,v.string2buf=function(g){var b,i,u,n,h,l=g.length,x=0;for(n=0;n<l;n++)(64512&(i=g.charCodeAt(n)))==55296&&n+1<l&&(64512&(u=g.charCodeAt(n+1)))==56320&&(i=65536+(i-55296<<10)+(u-56320),n++),x+=i<128?1:i<2048?2:i<65536?3:4;for(b=new c.Buf8(x),n=h=0;h<x;n++)(64512&(i=g.charCodeAt(n)))==55296&&n+1<l&&(64512&(u=g.charCodeAt(n+1)))==56320&&(i=65536+(i-55296<<10)+(u-56320),n++),i<128?b[h++]=i:(i<2048?b[h++]=192|i>>>6:(i<65536?b[h++]=224|i>>>12:(b[h++]=240|i>>>18,b[h++]=128|i>>>12&63),b[h++]=128|i>>>6&63),b[h++]=128|63&i);return b},v.buf2binstring=function(g){return y(g,g.length)},v.binstring2buf=function(g){for(var b=new c.Buf8(g.length),i=0,u=b.length;i<u;i++)b[i]=g.charCodeAt(i);return b},v.buf2string=function(g,b){var i,u,n,h,l=b||g.length,x=new Array(2*l);for(i=u=0;i<l;)if((n=g[i++])<128)x[u++]=n;else if(4<(h=o[n]))x[u++]=65533,i+=h-1;else{for(n&=h===2?31:h===3?15:7;1<h&&i<l;)n=n<<6|63&g[i++],h--;1<h?x[u++]=65533:n<65536?x[u++]=n:(n-=65536,x[u++]=55296|n>>10&1023,x[u++]=56320|1023&n)}return y(x,u)},v.utf8border=function(g,b){var i;for((b=b||g.length)>g.length&&(b=g.length),i=b-1;0<=i&&(192&g[i])==128;)i--;return i<0||i===0?b:i+o[g[i]]>b?i:b}},{"./common":41}],43:[function(m,C,v){C.exports=function(c,a,r,o){for(var _=65535&c|0,y=c>>>16&65535|0,g=0;r!==0;){for(r-=g=2e3<r?2e3:r;y=y+(_=_+a[o++]|0)|0,--g;);_%=65521,y%=65521}return _|y<<16|0}},{}],44:[function(m,C,v){C.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(m,C,v){var c=(function(){for(var a,r=[],o=0;o<256;o++){a=o;for(var _=0;_<8;_++)a=1&a?3988292384^a>>>1:a>>>1;r[o]=a}return r})();C.exports=function(a,r,o,_){var y=c,g=_+o;a^=-1;for(var b=_;b<g;b++)a=a>>>8^y[255&(a^r[b])];return-1^a}},{}],46:[function(m,C,v){var c,a=m("../utils/common"),r=m("./trees"),o=m("./adler32"),_=m("./crc32"),y=m("./messages"),g=0,b=4,i=0,u=-2,n=-1,h=4,l=2,x=8,w=9,S=286,N=30,B=19,F=2*S+1,W=15,R=3,H=258,ee=H+R+1,f=42,z=113,t=1,O=2,J=3,U=4;function ae(e,T){return e.msg=y[T],T}function Z(e){return(e<<1)-(4<e?9:0)}function se(e){for(var T=e.length;0<=--T;)e[T]=0}function I(e){var T=e.state,D=T.pending;D>e.avail_out&&(D=e.avail_out),D!==0&&(a.arraySet(e.output,T.pending_buf,T.pending_out,D,e.next_out),e.next_out+=D,T.pending_out+=D,e.total_out+=D,e.avail_out-=D,T.pending-=D,T.pending===0&&(T.pending_out=0))}function E(e,T){r._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,T),e.block_start=e.strstart,I(e.strm)}function te(e,T){e.pending_buf[e.pending++]=T}function Y(e,T){e.pending_buf[e.pending++]=T>>>8&255,e.pending_buf[e.pending++]=255&T}function G(e,T){var D,p,d=e.max_chain_length,k=e.strstart,P=e.prev_length,L=e.nice_match,A=e.strstart>e.w_size-ee?e.strstart-(e.w_size-ee):0,$=e.window,K=e.w_mask,q=e.prev,re=e.strstart+H,de=$[k+P-1],oe=$[k+P];e.prev_length>=e.good_match&&(d>>=2),L>e.lookahead&&(L=e.lookahead);do if($[(D=T)+P]===oe&&$[D+P-1]===de&&$[D]===$[k]&&$[++D]===$[k+1]){k+=2,D++;do;while($[++k]===$[++D]&&$[++k]===$[++D]&&$[++k]===$[++D]&&$[++k]===$[++D]&&$[++k]===$[++D]&&$[++k]===$[++D]&&$[++k]===$[++D]&&$[++k]===$[++D]&&k<re);if(p=H-(re-k),k=re-H,P<p){if(e.match_start=T,L<=(P=p))break;de=$[k+P-1],oe=$[k+P]}}while((T=q[T&K])>A&&--d!=0);return P<=e.lookahead?P:e.lookahead}function fe(e){var T,D,p,d,k,P,L,A,$,K,q=e.w_size;do{if(d=e.window_size-e.lookahead-e.strstart,e.strstart>=q+(q-ee)){for(a.arraySet(e.window,e.window,q,q,0),e.match_start-=q,e.strstart-=q,e.block_start-=q,T=D=e.hash_size;p=e.head[--T],e.head[T]=q<=p?p-q:0,--D;);for(T=D=q;p=e.prev[--T],e.prev[T]=q<=p?p-q:0,--D;);d+=q}if(e.strm.avail_in===0)break;if(P=e.strm,L=e.window,A=e.strstart+e.lookahead,$=d,K=void 0,K=P.avail_in,$<K&&(K=$),D=K===0?0:(P.avail_in-=K,a.arraySet(L,P.input,P.next_in,K,A),P.state.wrap===1?P.adler=o(P.adler,L,K,A):P.state.wrap===2&&(P.adler=_(P.adler,L,K,A)),P.next_in+=K,P.total_in+=K,K),e.lookahead+=D,e.lookahead+e.insert>=R)for(k=e.strstart-e.insert,e.ins_h=e.window[k],e.ins_h=(e.ins_h<<e.hash_shift^e.window[k+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[k+R-1])&e.hash_mask,e.prev[k&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=k,k++,e.insert--,!(e.lookahead+e.insert<R)););}while(e.lookahead<ee&&e.strm.avail_in!==0)}function ge(e,T){for(var D,p;;){if(e.lookahead<ee){if(fe(e),e.lookahead<ee&&T===g)return t;if(e.lookahead===0)break}if(D=0,e.lookahead>=R&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,D=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),D!==0&&e.strstart-D<=e.w_size-ee&&(e.match_length=G(e,D)),e.match_length>=R)if(p=r._tr_tally(e,e.strstart-e.match_start,e.match_length-R),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=R){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,D=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,--e.match_length!=0;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else p=r._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(p&&(E(e,!1),e.strm.avail_out===0))return t}return e.insert=e.strstart<R-1?e.strstart:R-1,T===b?(E(e,!0),e.strm.avail_out===0?J:U):e.last_lit&&(E(e,!1),e.strm.avail_out===0)?t:O}function ie(e,T){for(var D,p,d;;){if(e.lookahead<ee){if(fe(e),e.lookahead<ee&&T===g)return t;if(e.lookahead===0)break}if(D=0,e.lookahead>=R&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,D=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=R-1,D!==0&&e.prev_length<e.max_lazy_match&&e.strstart-D<=e.w_size-ee&&(e.match_length=G(e,D),e.match_length<=5&&(e.strategy===1||e.match_length===R&&4096<e.strstart-e.match_start)&&(e.match_length=R-1)),e.prev_length>=R&&e.match_length<=e.prev_length){for(d=e.strstart+e.lookahead-R,p=r._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-R),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=d&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+R-1])&e.hash_mask,D=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),--e.prev_length!=0;);if(e.match_available=0,e.match_length=R-1,e.strstart++,p&&(E(e,!1),e.strm.avail_out===0))return t}else if(e.match_available){if((p=r._tr_tally(e,0,e.window[e.strstart-1]))&&E(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return t}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(p=r._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<R-1?e.strstart:R-1,T===b?(E(e,!0),e.strm.avail_out===0?J:U):e.last_lit&&(E(e,!1),e.strm.avail_out===0)?t:O}function ce(e,T,D,p,d){this.good_length=e,this.max_lazy=T,this.nice_length=D,this.max_chain=p,this.func=d}function me(){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=x,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(2*F),this.dyn_dtree=new a.Buf16(2*(2*N+1)),this.bl_tree=new a.Buf16(2*(2*B+1)),se(this.dyn_ltree),se(this.dyn_dtree),se(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(W+1),this.heap=new a.Buf16(2*S+1),se(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(2*S+1),se(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 ue(e){var T;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=l,(T=e.state).pending=0,T.pending_out=0,T.wrap<0&&(T.wrap=-T.wrap),T.status=T.wrap?f:z,e.adler=T.wrap===2?0:1,T.last_flush=g,r._tr_init(T),i):ae(e,u)}function be(e){var T=ue(e);return T===i&&(function(D){D.window_size=2*D.w_size,se(D.head),D.max_lazy_match=c[D.level].max_lazy,D.good_match=c[D.level].good_length,D.nice_match=c[D.level].nice_length,D.max_chain_length=c[D.level].max_chain,D.strstart=0,D.block_start=0,D.lookahead=0,D.insert=0,D.match_length=D.prev_length=R-1,D.match_available=0,D.ins_h=0})(e.state),T}function ke(e,T,D,p,d,k){if(!e)return u;var P=1;if(T===n&&(T=6),p<0?(P=0,p=-p):15<p&&(P=2,p-=16),d<1||w<d||D!==x||p<8||15<p||T<0||9<T||k<0||h<k)return ae(e,u);p===8&&(p=9);var L=new me;return(e.state=L).strm=e,L.wrap=P,L.gzhead=null,L.w_bits=p,L.w_size=1<<L.w_bits,L.w_mask=L.w_size-1,L.hash_bits=d+7,L.hash_size=1<<L.hash_bits,L.hash_mask=L.hash_size-1,L.hash_shift=~~((L.hash_bits+R-1)/R),L.window=new a.Buf8(2*L.w_size),L.head=new a.Buf16(L.hash_size),L.prev=new a.Buf16(L.w_size),L.lit_bufsize=1<<d+6,L.pending_buf_size=4*L.lit_bufsize,L.pending_buf=new a.Buf8(L.pending_buf_size),L.d_buf=1*L.lit_bufsize,L.l_buf=3*L.lit_bufsize,L.level=T,L.strategy=k,L.method=D,be(e)}c=[new ce(0,0,0,0,function(e,T){var D=65535;for(D>e.pending_buf_size-5&&(D=e.pending_buf_size-5);;){if(e.lookahead<=1){if(fe(e),e.lookahead===0&&T===g)return t;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var p=e.block_start+D;if((e.strstart===0||e.strstart>=p)&&(e.lookahead=e.strstart-p,e.strstart=p,E(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-ee&&(E(e,!1),e.strm.avail_out===0))return t}return e.insert=0,T===b?(E(e,!0),e.strm.avail_out===0?J:U):(e.strstart>e.block_start&&(E(e,!1),e.strm.avail_out),t)}),new ce(4,4,8,4,ge),new ce(4,5,16,8,ge),new ce(4,6,32,32,ge),new ce(4,4,16,16,ie),new ce(8,16,32,32,ie),new ce(8,16,128,128,ie),new ce(8,32,128,256,ie),new ce(32,128,258,1024,ie),new ce(32,258,258,4096,ie)],v.deflateInit=function(e,T){return ke(e,T,x,15,8,0)},v.deflateInit2=ke,v.deflateReset=be,v.deflateResetKeep=ue,v.deflateSetHeader=function(e,T){return e&&e.state?e.state.wrap!==2?u:(e.state.gzhead=T,i):u},v.deflate=function(e,T){var D,p,d,k;if(!e||!e.state||5<T||T<0)return e?ae(e,u):u;if(p=e.state,!e.output||!e.input&&e.avail_in!==0||p.status===666&&T!==b)return ae(e,e.avail_out===0?-5:u);if(p.strm=e,D=p.last_flush,p.last_flush=T,p.status===f)if(p.wrap===2)e.adler=0,te(p,31),te(p,139),te(p,8),p.gzhead?(te(p,(p.gzhead.text?1:0)+(p.gzhead.hcrc?2:0)+(p.gzhead.extra?4:0)+(p.gzhead.name?8:0)+(p.gzhead.comment?16:0)),te(p,255&p.gzhead.time),te(p,p.gzhead.time>>8&255),te(p,p.gzhead.time>>16&255),te(p,p.gzhead.time>>24&255),te(p,p.level===9?2:2<=p.strategy||p.level<2?4:0),te(p,255&p.gzhead.os),p.gzhead.extra&&p.gzhead.extra.length&&(te(p,255&p.gzhead.extra.length),te(p,p.gzhead.extra.length>>8&255)),p.gzhead.hcrc&&(e.adler=_(e.adler,p.pending_buf,p.pending,0)),p.gzindex=0,p.status=69):(te(p,0),te(p,0),te(p,0),te(p,0),te(p,0),te(p,p.level===9?2:2<=p.strategy||p.level<2?4:0),te(p,3),p.status=z);else{var P=x+(p.w_bits-8<<4)<<8;P|=(2<=p.strategy||p.level<2?0:p.level<6?1:p.level===6?2:3)<<6,p.strstart!==0&&(P|=32),P+=31-P%31,p.status=z,Y(p,P),p.strstart!==0&&(Y(p,e.adler>>>16),Y(p,65535&e.adler)),e.adler=1}if(p.status===69)if(p.gzhead.extra){for(d=p.pending;p.gzindex<(65535&p.gzhead.extra.length)&&(p.pending!==p.pending_buf_size||(p.gzhead.hcrc&&p.pending>d&&(e.adler=_(e.adler,p.pending_buf,p.pending-d,d)),I(e),d=p.pending,p.pending!==p.pending_buf_size));)te(p,255&p.gzhead.extra[p.gzindex]),p.gzindex++;p.gzhead.hcrc&&p.pending>d&&(e.adler=_(e.adler,p.pending_buf,p.pending-d,d)),p.gzindex===p.gzhead.extra.length&&(p.gzindex=0,p.status=73)}else p.status=73;if(p.status===73)if(p.gzhead.name){d=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>d&&(e.adler=_(e.adler,p.pending_buf,p.pending-d,d)),I(e),d=p.pending,p.pending===p.pending_buf_size)){k=1;break}k=p.gzindex<p.gzhead.name.length?255&p.gzhead.name.charCodeAt(p.gzindex++):0,te(p,k)}while(k!==0);p.gzhead.hcrc&&p.pending>d&&(e.adler=_(e.adler,p.pending_buf,p.pending-d,d)),k===0&&(p.gzindex=0,p.status=91)}else p.status=91;if(p.status===91)if(p.gzhead.comment){d=p.pending;do{if(p.pending===p.pending_buf_size&&(p.gzhead.hcrc&&p.pending>d&&(e.adler=_(e.adler,p.pending_buf,p.pending-d,d)),I(e),d=p.pending,p.pending===p.pending_buf_size)){k=1;break}k=p.gzindex<p.gzhead.comment.length?255&p.gzhead.comment.charCodeAt(p.gzindex++):0,te(p,k)}while(k!==0);p.gzhead.hcrc&&p.pending>d&&(e.adler=_(e.adler,p.pending_buf,p.pending-d,d)),k===0&&(p.status=103)}else p.status=103;if(p.status===103&&(p.gzhead.hcrc?(p.pending+2>p.pending_buf_size&&I(e),p.pending+2<=p.pending_buf_size&&(te(p,255&e.adler),te(p,e.adler>>8&255),e.adler=0,p.status=z)):p.status=z),p.pending!==0){if(I(e),e.avail_out===0)return p.last_flush=-1,i}else if(e.avail_in===0&&Z(T)<=Z(D)&&T!==b)return ae(e,-5);if(p.status===666&&e.avail_in!==0)return ae(e,-5);if(e.avail_in!==0||p.lookahead!==0||T!==g&&p.status!==666){var L=p.strategy===2?(function(A,$){for(var K;;){if(A.lookahead===0&&(fe(A),A.lookahead===0)){if($===g)return t;break}if(A.match_length=0,K=r._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,K&&(E(A,!1),A.strm.avail_out===0))return t}return A.insert=0,$===b?(E(A,!0),A.strm.avail_out===0?J:U):A.last_lit&&(E(A,!1),A.strm.avail_out===0)?t:O})(p,T):p.strategy===3?(function(A,$){for(var K,q,re,de,oe=A.window;;){if(A.lookahead<=H){if(fe(A),A.lookahead<=H&&$===g)return t;if(A.lookahead===0)break}if(A.match_length=0,A.lookahead>=R&&0<A.strstart&&(q=oe[re=A.strstart-1])===oe[++re]&&q===oe[++re]&&q===oe[++re]){de=A.strstart+H;do;while(q===oe[++re]&&q===oe[++re]&&q===oe[++re]&&q===oe[++re]&&q===oe[++re]&&q===oe[++re]&&q===oe[++re]&&q===oe[++re]&&re<de);A.match_length=H-(de-re),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=R?(K=r._tr_tally(A,1,A.match_length-R),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(K=r._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),K&&(E(A,!1),A.strm.avail_out===0))return t}return A.insert=0,$===b?(E(A,!0),A.strm.avail_out===0?J:U):A.last_lit&&(E(A,!1),A.strm.avail_out===0)?t:O})(p,T):c[p.level].func(p,T);if(L!==J&&L!==U||(p.status=666),L===t||L===J)return e.avail_out===0&&(p.last_flush=-1),i;if(L===O&&(T===1?r._tr_align(p):T!==5&&(r._tr_stored_block(p,0,0,!1),T===3&&(se(p.head),p.lookahead===0&&(p.strstart=0,p.block_start=0,p.insert=0))),I(e),e.avail_out===0))return p.last_flush=-1,i}return T!==b?i:p.wrap<=0?1:(p.wrap===2?(te(p,255&e.adler),te(p,e.adler>>8&255),te(p,e.adler>>16&255),te(p,e.adler>>24&255),te(p,255&e.total_in),te(p,e.total_in>>8&255),te(p,e.total_in>>16&255),te(p,e.total_in>>24&255)):(Y(p,e.adler>>>16),Y(p,65535&e.adler)),I(e),0<p.wrap&&(p.wrap=-p.wrap),p.pending!==0?i:1)},v.deflateEnd=function(e){var T;return e&&e.state?(T=e.state.status)!==f&&T!==69&&T!==73&&T!==91&&T!==103&&T!==z&&T!==666?ae(e,u):(e.state=null,T===z?ae(e,-3):i):u},v.deflateSetDictionary=function(e,T){var D,p,d,k,P,L,A,$,K=T.length;if(!e||!e.state||(k=(D=e.state).wrap)===2||k===1&&D.status!==f||D.lookahead)return u;for(k===1&&(e.adler=o(e.adler,T,K,0)),D.wrap=0,K>=D.w_size&&(k===0&&(se(D.head),D.strstart=0,D.block_start=0,D.insert=0),$=new a.Buf8(D.w_size),a.arraySet($,T,K-D.w_size,D.w_size,0),T=$,K=D.w_size),P=e.avail_in,L=e.next_in,A=e.input,e.avail_in=K,e.next_in=0,e.input=T,fe(D);D.lookahead>=R;){for(p=D.strstart,d=D.lookahead-(R-1);D.ins_h=(D.ins_h<<D.hash_shift^D.window[p+R-1])&D.hash_mask,D.prev[p&D.w_mask]=D.head[D.ins_h],D.head[D.ins_h]=p,p++,--d;);D.strstart=p,D.lookahead=R-1,fe(D)}return D.strstart+=D.lookahead,D.block_start=D.strstart,D.insert=D.lookahead,D.lookahead=0,D.match_length=D.prev_length=R-1,D.match_available=0,e.next_in=L,e.input=A,e.avail_in=P,D.wrap=k,i},v.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(m,C,v){C.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(m,C,v){C.exports=function(c,a){var r,o,_,y,g,b,i,u,n,h,l,x,w,S,N,B,F,W,R,H,ee,f,z,t,O;r=c.state,o=c.next_in,t=c.input,_=o+(c.avail_in-5),y=c.next_out,O=c.output,g=y-(a-c.avail_out),b=y+(c.avail_out-257),i=r.dmax,u=r.wsize,n=r.whave,h=r.wnext,l=r.window,x=r.hold,w=r.bits,S=r.lencode,N=r.distcode,B=(1<<r.lenbits)-1,F=(1<<r.distbits)-1;e:do{w<15&&(x+=t[o++]<<w,w+=8,x+=t[o++]<<w,w+=8),W=S[x&B];t:for(;;){if(x>>>=R=W>>>24,w-=R,(R=W>>>16&255)===0)O[y++]=65535&W;else{if(!(16&R)){if((64&R)==0){W=S[(65535&W)+(x&(1<<R)-1)];continue t}if(32&R){r.mode=12;break e}c.msg="invalid literal/length code",r.mode=30;break e}H=65535&W,(R&=15)&&(w<R&&(x+=t[o++]<<w,w+=8),H+=x&(1<<R)-1,x>>>=R,w-=R),w<15&&(x+=t[o++]<<w,w+=8,x+=t[o++]<<w,w+=8),W=N[x&F];r:for(;;){if(x>>>=R=W>>>24,w-=R,!(16&(R=W>>>16&255))){if((64&R)==0){W=N[(65535&W)+(x&(1<<R)-1)];continue r}c.msg="invalid distance code",r.mode=30;break e}if(ee=65535&W,w<(R&=15)&&(x+=t[o++]<<w,(w+=8)<R&&(x+=t[o++]<<w,w+=8)),i<(ee+=x&(1<<R)-1)){c.msg="invalid distance too far back",r.mode=30;break e}if(x>>>=R,w-=R,(R=y-g)<ee){if(n<(R=ee-R)&&r.sane){c.msg="invalid distance too far back",r.mode=30;break e}if(z=l,(f=0)===h){if(f+=u-R,R<H){for(H-=R;O[y++]=l[f++],--R;);f=y-ee,z=O}}else if(h<R){if(f+=u+h-R,(R-=h)<H){for(H-=R;O[y++]=l[f++],--R;);if(f=0,h<H){for(H-=R=h;O[y++]=l[f++],--R;);f=y-ee,z=O}}}else if(f+=h-R,R<H){for(H-=R;O[y++]=l[f++],--R;);f=y-ee,z=O}for(;2<H;)O[y++]=z[f++],O[y++]=z[f++],O[y++]=z[f++],H-=3;H&&(O[y++]=z[f++],1<H&&(O[y++]=z[f++]))}else{for(f=y-ee;O[y++]=O[f++],O[y++]=O[f++],O[y++]=O[f++],2<(H-=3););H&&(O[y++]=O[f++],1<H&&(O[y++]=O[f++]))}break}}break}}while(o<_&&y<b);o-=H=w>>3,x&=(1<<(w-=H<<3))-1,c.next_in=o,c.next_out=y,c.avail_in=o<_?_-o+5:5-(o-_),c.avail_out=y<b?b-y+257:257-(y-b),r.hold=x,r.bits=w}},{}],49:[function(m,C,v){var c=m("../utils/common"),a=m("./adler32"),r=m("./crc32"),o=m("./inffast"),_=m("./inftrees"),y=1,g=2,b=0,i=-2,u=1,n=852,h=592;function l(f){return(f>>>24&255)+(f>>>8&65280)+((65280&f)<<8)+((255&f)<<24)}function x(){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 c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function w(f){var z;return f&&f.state?(z=f.state,f.total_in=f.total_out=z.total=0,f.msg="",z.wrap&&(f.adler=1&z.wrap),z.mode=u,z.last=0,z.havedict=0,z.dmax=32768,z.head=null,z.hold=0,z.bits=0,z.lencode=z.lendyn=new c.Buf32(n),z.distcode=z.distdyn=new c.Buf32(h),z.sane=1,z.back=-1,b):i}function S(f){var z;return f&&f.state?((z=f.state).wsize=0,z.whave=0,z.wnext=0,w(f)):i}function N(f,z){var t,O;return f&&f.state?(O=f.state,z<0?(t=0,z=-z):(t=1+(z>>4),z<48&&(z&=15)),z&&(z<8||15<z)?i:(O.window!==null&&O.wbits!==z&&(O.window=null),O.wrap=t,O.wbits=z,S(f))):i}function B(f,z){var t,O;return f?(O=new x,(f.state=O).window=null,(t=N(f,z))!==b&&(f.state=null),t):i}var F,W,R=!0;function H(f){if(R){var z;for(F=new c.Buf32(512),W=new c.Buf32(32),z=0;z<144;)f.lens[z++]=8;for(;z<256;)f.lens[z++]=9;for(;z<280;)f.lens[z++]=7;for(;z<288;)f.lens[z++]=8;for(_(y,f.lens,0,288,F,0,f.work,{bits:9}),z=0;z<32;)f.lens[z++]=5;_(g,f.lens,0,32,W,0,f.work,{bits:5}),R=!1}f.lencode=F,f.lenbits=9,f.distcode=W,f.distbits=5}function ee(f,z,t,O){var J,U=f.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new c.Buf8(U.wsize)),O>=U.wsize?(c.arraySet(U.window,z,t-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(O<(J=U.wsize-U.wnext)&&(J=O),c.arraySet(U.window,z,t-O,J,U.wnext),(O-=J)?(c.arraySet(U.window,z,t-O,O,0),U.wnext=O,U.whave=U.wsize):(U.wnext+=J,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=J))),0}v.inflateReset=S,v.inflateReset2=N,v.inflateResetKeep=w,v.inflateInit=function(f){return B(f,15)},v.inflateInit2=B,v.inflate=function(f,z){var t,O,J,U,ae,Z,se,I,E,te,Y,G,fe,ge,ie,ce,me,ue,be,ke,e,T,D,p,d=0,k=new c.Buf8(4),P=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!f||!f.state||!f.output||!f.input&&f.avail_in!==0)return i;(t=f.state).mode===12&&(t.mode=13),ae=f.next_out,J=f.output,se=f.avail_out,U=f.next_in,O=f.input,Z=f.avail_in,I=t.hold,E=t.bits,te=Z,Y=se,T=b;e:for(;;)switch(t.mode){case u:if(t.wrap===0){t.mode=13;break}for(;E<16;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if(2&t.wrap&&I===35615){k[t.check=0]=255&I,k[1]=I>>>8&255,t.check=r(t.check,k,2,0),E=I=0,t.mode=2;break}if(t.flags=0,t.head&&(t.head.done=!1),!(1&t.wrap)||(((255&I)<<8)+(I>>8))%31){f.msg="incorrect header check",t.mode=30;break}if((15&I)!=8){f.msg="unknown compression method",t.mode=30;break}if(E-=4,e=8+(15&(I>>>=4)),t.wbits===0)t.wbits=e;else if(e>t.wbits){f.msg="invalid window size",t.mode=30;break}t.dmax=1<<e,f.adler=t.check=1,t.mode=512&I?10:12,E=I=0;break;case 2:for(;E<16;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if(t.flags=I,(255&t.flags)!=8){f.msg="unknown compression method",t.mode=30;break}if(57344&t.flags){f.msg="unknown header flags set",t.mode=30;break}t.head&&(t.head.text=I>>8&1),512&t.flags&&(k[0]=255&I,k[1]=I>>>8&255,t.check=r(t.check,k,2,0)),E=I=0,t.mode=3;case 3:for(;E<32;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}t.head&&(t.head.time=I),512&t.flags&&(k[0]=255&I,k[1]=I>>>8&255,k[2]=I>>>16&255,k[3]=I>>>24&255,t.check=r(t.check,k,4,0)),E=I=0,t.mode=4;case 4:for(;E<16;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}t.head&&(t.head.xflags=255&I,t.head.os=I>>8),512&t.flags&&(k[0]=255&I,k[1]=I>>>8&255,t.check=r(t.check,k,2,0)),E=I=0,t.mode=5;case 5:if(1024&t.flags){for(;E<16;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}t.length=I,t.head&&(t.head.extra_len=I),512&t.flags&&(k[0]=255&I,k[1]=I>>>8&255,t.check=r(t.check,k,2,0)),E=I=0}else t.head&&(t.head.extra=null);t.mode=6;case 6:if(1024&t.flags&&(Z<(G=t.length)&&(G=Z),G&&(t.head&&(e=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Array(t.head.extra_len)),c.arraySet(t.head.extra,O,U,G,e)),512&t.flags&&(t.check=r(t.check,O,G,U)),Z-=G,U+=G,t.length-=G),t.length))break e;t.length=0,t.mode=7;case 7:if(2048&t.flags){if(Z===0)break e;for(G=0;e=O[U+G++],t.head&&e&&t.length<65536&&(t.head.name+=String.fromCharCode(e)),e&&G<Z;);if(512&t.flags&&(t.check=r(t.check,O,G,U)),Z-=G,U+=G,e)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=8;case 8:if(4096&t.flags){if(Z===0)break e;for(G=0;e=O[U+G++],t.head&&e&&t.length<65536&&(t.head.comment+=String.fromCharCode(e)),e&&G<Z;);if(512&t.flags&&(t.check=r(t.check,O,G,U)),Z-=G,U+=G,e)break e}else t.head&&(t.head.comment=null);t.mode=9;case 9:if(512&t.flags){for(;E<16;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if(I!==(65535&t.check)){f.msg="header crc mismatch",t.mode=30;break}E=I=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),f.adler=t.check=0,t.mode=12;break;case 10:for(;E<32;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}f.adler=t.check=l(I),E=I=0,t.mode=11;case 11:if(t.havedict===0)return f.next_out=ae,f.avail_out=se,f.next_in=U,f.avail_in=Z,t.hold=I,t.bits=E,2;f.adler=t.check=1,t.mode=12;case 12:if(z===5||z===6)break e;case 13:if(t.last){I>>>=7&E,E-=7&E,t.mode=27;break}for(;E<3;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}switch(t.last=1&I,E-=1,3&(I>>>=1)){case 0:t.mode=14;break;case 1:if(H(t),t.mode=20,z!==6)break;I>>>=2,E-=2;break e;case 2:t.mode=17;break;case 3:f.msg="invalid block type",t.mode=30}I>>>=2,E-=2;break;case 14:for(I>>>=7&E,E-=7&E;E<32;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if((65535&I)!=(I>>>16^65535)){f.msg="invalid stored block lengths",t.mode=30;break}if(t.length=65535&I,E=I=0,t.mode=15,z===6)break e;case 15:t.mode=16;case 16:if(G=t.length){if(Z<G&&(G=Z),se<G&&(G=se),G===0)break e;c.arraySet(J,O,U,G,ae),Z-=G,U+=G,se-=G,ae+=G,t.length-=G;break}t.mode=12;break;case 17:for(;E<14;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if(t.nlen=257+(31&I),I>>>=5,E-=5,t.ndist=1+(31&I),I>>>=5,E-=5,t.ncode=4+(15&I),I>>>=4,E-=4,286<t.nlen||30<t.ndist){f.msg="too many length or distance symbols",t.mode=30;break}t.have=0,t.mode=18;case 18:for(;t.have<t.ncode;){for(;E<3;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}t.lens[P[t.have++]]=7&I,I>>>=3,E-=3}for(;t.have<19;)t.lens[P[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,D={bits:t.lenbits},T=_(0,t.lens,0,19,t.lencode,0,t.work,D),t.lenbits=D.bits,T){f.msg="invalid code lengths set",t.mode=30;break}t.have=0,t.mode=19;case 19:for(;t.have<t.nlen+t.ndist;){for(;ce=(d=t.lencode[I&(1<<t.lenbits)-1])>>>16&255,me=65535&d,!((ie=d>>>24)<=E);){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if(me<16)I>>>=ie,E-=ie,t.lens[t.have++]=me;else{if(me===16){for(p=ie+2;E<p;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if(I>>>=ie,E-=ie,t.have===0){f.msg="invalid bit length repeat",t.mode=30;break}e=t.lens[t.have-1],G=3+(3&I),I>>>=2,E-=2}else if(me===17){for(p=ie+3;E<p;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}E-=ie,e=0,G=3+(7&(I>>>=ie)),I>>>=3,E-=3}else{for(p=ie+7;E<p;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}E-=ie,e=0,G=11+(127&(I>>>=ie)),I>>>=7,E-=7}if(t.have+G>t.nlen+t.ndist){f.msg="invalid bit length repeat",t.mode=30;break}for(;G--;)t.lens[t.have++]=e}}if(t.mode===30)break;if(t.lens[256]===0){f.msg="invalid code -- missing end-of-block",t.mode=30;break}if(t.lenbits=9,D={bits:t.lenbits},T=_(y,t.lens,0,t.nlen,t.lencode,0,t.work,D),t.lenbits=D.bits,T){f.msg="invalid literal/lengths set",t.mode=30;break}if(t.distbits=6,t.distcode=t.distdyn,D={bits:t.distbits},T=_(g,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,D),t.distbits=D.bits,T){f.msg="invalid distances set",t.mode=30;break}if(t.mode=20,z===6)break e;case 20:t.mode=21;case 21:if(6<=Z&&258<=se){f.next_out=ae,f.avail_out=se,f.next_in=U,f.avail_in=Z,t.hold=I,t.bits=E,o(f,Y),ae=f.next_out,J=f.output,se=f.avail_out,U=f.next_in,O=f.input,Z=f.avail_in,I=t.hold,E=t.bits,t.mode===12&&(t.back=-1);break}for(t.back=0;ce=(d=t.lencode[I&(1<<t.lenbits)-1])>>>16&255,me=65535&d,!((ie=d>>>24)<=E);){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if(ce&&(240&ce)==0){for(ue=ie,be=ce,ke=me;ce=(d=t.lencode[ke+((I&(1<<ue+be)-1)>>ue)])>>>16&255,me=65535&d,!(ue+(ie=d>>>24)<=E);){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}I>>>=ue,E-=ue,t.back+=ue}if(I>>>=ie,E-=ie,t.back+=ie,t.length=me,ce===0){t.mode=26;break}if(32&ce){t.back=-1,t.mode=12;break}if(64&ce){f.msg="invalid literal/length code",t.mode=30;break}t.extra=15&ce,t.mode=22;case 22:if(t.extra){for(p=t.extra;E<p;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}t.length+=I&(1<<t.extra)-1,I>>>=t.extra,E-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=23;case 23:for(;ce=(d=t.distcode[I&(1<<t.distbits)-1])>>>16&255,me=65535&d,!((ie=d>>>24)<=E);){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if((240&ce)==0){for(ue=ie,be=ce,ke=me;ce=(d=t.distcode[ke+((I&(1<<ue+be)-1)>>ue)])>>>16&255,me=65535&d,!(ue+(ie=d>>>24)<=E);){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}I>>>=ue,E-=ue,t.back+=ue}if(I>>>=ie,E-=ie,t.back+=ie,64&ce){f.msg="invalid distance code",t.mode=30;break}t.offset=me,t.extra=15&ce,t.mode=24;case 24:if(t.extra){for(p=t.extra;E<p;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}t.offset+=I&(1<<t.extra)-1,I>>>=t.extra,E-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){f.msg="invalid distance too far back",t.mode=30;break}t.mode=25;case 25:if(se===0)break e;if(G=Y-se,t.offset>G){if((G=t.offset-G)>t.whave&&t.sane){f.msg="invalid distance too far back",t.mode=30;break}fe=G>t.wnext?(G-=t.wnext,t.wsize-G):t.wnext-G,G>t.length&&(G=t.length),ge=t.window}else ge=J,fe=ae-t.offset,G=t.length;for(se<G&&(G=se),se-=G,t.length-=G;J[ae++]=ge[fe++],--G;);t.length===0&&(t.mode=21);break;case 26:if(se===0)break e;J[ae++]=t.length,se--,t.mode=21;break;case 27:if(t.wrap){for(;E<32;){if(Z===0)break e;Z--,I|=O[U++]<<E,E+=8}if(Y-=se,f.total_out+=Y,t.total+=Y,Y&&(f.adler=t.check=t.flags?r(t.check,J,Y,ae-Y):a(t.check,J,Y,ae-Y)),Y=se,(t.flags?I:l(I))!==t.check){f.msg="incorrect data check",t.mode=30;break}E=I=0}t.mode=28;case 28:if(t.wrap&&t.flags){for(;E<32;){if(Z===0)break e;Z--,I+=O[U++]<<E,E+=8}if(I!==(4294967295&t.total)){f.msg="incorrect length check",t.mode=30;break}E=I=0}t.mode=29;case 29:T=1;break e;case 30:T=-3;break e;case 31:return-4;case 32:default:return i}return f.next_out=ae,f.avail_out=se,f.next_in=U,f.avail_in=Z,t.hold=I,t.bits=E,(t.wsize||Y!==f.avail_out&&t.mode<30&&(t.mode<27||z!==4))&&ee(f,f.output,f.next_out,Y-f.avail_out)?(t.mode=31,-4):(te-=f.avail_in,Y-=f.avail_out,f.total_in+=te,f.total_out+=Y,t.total+=Y,t.wrap&&Y&&(f.adler=t.check=t.flags?r(t.check,J,Y,f.next_out-Y):a(t.check,J,Y,f.next_out-Y)),f.data_type=t.bits+(t.last?64:0)+(t.mode===12?128:0)+(t.mode===20||t.mode===15?256:0),(te==0&&Y===0||z===4)&&T===b&&(T=-5),T)},v.inflateEnd=function(f){if(!f||!f.state)return i;var z=f.state;return z.window&&(z.window=null),f.state=null,b},v.inflateGetHeader=function(f,z){var t;return f&&f.state?(2&(t=f.state).wrap)==0?i:((t.head=z).done=!1,b):i},v.inflateSetDictionary=function(f,z){var t,O=z.length;return f&&f.state?(t=f.state).wrap!==0&&t.mode!==11?i:t.mode===11&&a(1,z,O,0)!==t.check?-3:ee(f,z,O,O)?(t.mode=31,-4):(t.havedict=1,b):i},v.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(m,C,v){var c=m("../utils/common"),a=[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],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],_=[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];C.exports=function(y,g,b,i,u,n,h,l){var x,w,S,N,B,F,W,R,H,ee=l.bits,f=0,z=0,t=0,O=0,J=0,U=0,ae=0,Z=0,se=0,I=0,E=null,te=0,Y=new c.Buf16(16),G=new c.Buf16(16),fe=null,ge=0;for(f=0;f<=15;f++)Y[f]=0;for(z=0;z<i;z++)Y[g[b+z]]++;for(J=ee,O=15;1<=O&&Y[O]===0;O--);if(O<J&&(J=O),O===0)return u[n++]=20971520,u[n++]=20971520,l.bits=1,0;for(t=1;t<O&&Y[t]===0;t++);for(J<t&&(J=t),f=Z=1;f<=15;f++)if(Z<<=1,(Z-=Y[f])<0)return-1;if(0<Z&&(y===0||O!==1))return-1;for(G[1]=0,f=1;f<15;f++)G[f+1]=G[f]+Y[f];for(z=0;z<i;z++)g[b+z]!==0&&(h[G[g[b+z]]++]=z);if(F=y===0?(E=fe=h,19):y===1?(E=a,te-=257,fe=r,ge-=257,256):(E=o,fe=_,-1),f=t,B=n,ae=z=I=0,S=-1,N=(se=1<<(U=J))-1,y===1&&852<se||y===2&&592<se)return 1;for(;;){for(W=f-ae,H=h[z]<F?(R=0,h[z]):h[z]>F?(R=fe[ge+h[z]],E[te+h[z]]):(R=96,0),x=1<<f-ae,t=w=1<<U;u[B+(I>>ae)+(w-=x)]=W<<24|R<<16|H|0,w!==0;);for(x=1<<f-1;I&x;)x>>=1;if(x!==0?(I&=x-1,I+=x):I=0,z++,--Y[f]==0){if(f===O)break;f=g[b+h[z]]}if(J<f&&(I&N)!==S){for(ae===0&&(ae=J),B+=t,Z=1<<(U=f-ae);U+ae<O&&!((Z-=Y[U+ae])<=0);)U++,Z<<=1;if(se+=1<<U,y===1&&852<se||y===2&&592<se)return 1;u[S=I&N]=J<<24|U<<16|B-n|0}}return I!==0&&(u[B+I]=f-ae<<24|64<<16|0),l.bits=J,0}},{"../utils/common":41}],51:[function(m,C,v){C.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(m,C,v){var c=m("../utils/common"),a=0,r=1;function o(d){for(var k=d.length;0<=--k;)d[k]=0}var _=0,y=29,g=256,b=g+1+y,i=30,u=19,n=2*b+1,h=15,l=16,x=7,w=256,S=16,N=17,B=18,F=[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],R=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ee=new Array(2*(b+2));o(ee);var f=new Array(2*i);o(f);var z=new Array(512);o(z);var t=new Array(256);o(t);var O=new Array(y);o(O);var J,U,ae,Z=new Array(i);function se(d,k,P,L,A){this.static_tree=d,this.extra_bits=k,this.extra_base=P,this.elems=L,this.max_length=A,this.has_stree=d&&d.length}function I(d,k){this.dyn_tree=d,this.max_code=0,this.stat_desc=k}function E(d){return d<256?z[d]:z[256+(d>>>7)]}function te(d,k){d.pending_buf[d.pending++]=255&k,d.pending_buf[d.pending++]=k>>>8&255}function Y(d,k,P){d.bi_valid>l-P?(d.bi_buf|=k<<d.bi_valid&65535,te(d,d.bi_buf),d.bi_buf=k>>l-d.bi_valid,d.bi_valid+=P-l):(d.bi_buf|=k<<d.bi_valid&65535,d.bi_valid+=P)}function G(d,k,P){Y(d,P[2*k],P[2*k+1])}function fe(d,k){for(var P=0;P|=1&d,d>>>=1,P<<=1,0<--k;);return P>>>1}function ge(d,k,P){var L,A,$=new Array(h+1),K=0;for(L=1;L<=h;L++)$[L]=K=K+P[L-1]<<1;for(A=0;A<=k;A++){var q=d[2*A+1];q!==0&&(d[2*A]=fe($[q]++,q))}}function ie(d){var k;for(k=0;k<b;k++)d.dyn_ltree[2*k]=0;for(k=0;k<i;k++)d.dyn_dtree[2*k]=0;for(k=0;k<u;k++)d.bl_tree[2*k]=0;d.dyn_ltree[2*w]=1,d.opt_len=d.static_len=0,d.last_lit=d.matches=0}function ce(d){8<d.bi_valid?te(d,d.bi_buf):0<d.bi_valid&&(d.pending_buf[d.pending++]=d.bi_buf),d.bi_buf=0,d.bi_valid=0}function me(d,k,P,L){var A=2*k,$=2*P;return d[A]<d[$]||d[A]===d[$]&&L[k]<=L[P]}function ue(d,k,P){for(var L=d.heap[P],A=P<<1;A<=d.heap_len&&(A<d.heap_len&&me(k,d.heap[A+1],d.heap[A],d.depth)&&A++,!me(k,L,d.heap[A],d.depth));)d.heap[P]=d.heap[A],P=A,A<<=1;d.heap[P]=L}function be(d,k,P){var L,A,$,K,q=0;if(d.last_lit!==0)for(;L=d.pending_buf[d.d_buf+2*q]<<8|d.pending_buf[d.d_buf+2*q+1],A=d.pending_buf[d.l_buf+q],q++,L===0?G(d,A,k):(G(d,($=t[A])+g+1,k),(K=F[$])!==0&&Y(d,A-=O[$],K),G(d,$=E(--L),P),(K=W[$])!==0&&Y(d,L-=Z[$],K)),q<d.last_lit;);G(d,w,k)}function ke(d,k){var P,L,A,$=k.dyn_tree,K=k.stat_desc.static_tree,q=k.stat_desc.has_stree,re=k.stat_desc.elems,de=-1;for(d.heap_len=0,d.heap_max=n,P=0;P<re;P++)$[2*P]!==0?(d.heap[++d.heap_len]=de=P,d.depth[P]=0):$[2*P+1]=0;for(;d.heap_len<2;)$[2*(A=d.heap[++d.heap_len]=de<2?++de:0)]=1,d.depth[A]=0,d.opt_len--,q&&(d.static_len-=K[2*A+1]);for(k.max_code=de,P=d.heap_len>>1;1<=P;P--)ue(d,$,P);for(A=re;P=d.heap[1],d.heap[1]=d.heap[d.heap_len--],ue(d,$,1),L=d.heap[1],d.heap[--d.heap_max]=P,d.heap[--d.heap_max]=L,$[2*A]=$[2*P]+$[2*L],d.depth[A]=(d.depth[P]>=d.depth[L]?d.depth[P]:d.depth[L])+1,$[2*P+1]=$[2*L+1]=A,d.heap[1]=A++,ue(d,$,1),2<=d.heap_len;);d.heap[--d.heap_max]=d.heap[1],(function(oe,xe){var Ce,ye,Ne,le,je,De,ve=xe.dyn_tree,Me=xe.max_code,st=xe.stat_desc.static_tree,it=xe.stat_desc.has_stree,at=xe.stat_desc.extra_bits,We=xe.stat_desc.extra_base,Ee=xe.stat_desc.max_length,ze=0;for(le=0;le<=h;le++)oe.bl_count[le]=0;for(ve[2*oe.heap[oe.heap_max]+1]=0,Ce=oe.heap_max+1;Ce<n;Ce++)Ee<(le=ve[2*ve[2*(ye=oe.heap[Ce])+1]+1]+1)&&(le=Ee,ze++),ve[2*ye+1]=le,Me<ye||(oe.bl_count[le]++,je=0,We<=ye&&(je=at[ye-We]),De=ve[2*ye],oe.opt_len+=De*(le+je),it&&(oe.static_len+=De*(st[2*ye+1]+je)));if(ze!==0){do{for(le=Ee-1;oe.bl_count[le]===0;)le--;oe.bl_count[le]--,oe.bl_count[le+1]+=2,oe.bl_count[Ee]--,ze-=2}while(0<ze);for(le=Ee;le!==0;le--)for(ye=oe.bl_count[le];ye!==0;)Me<(Ne=oe.heap[--Ce])||(ve[2*Ne+1]!==le&&(oe.opt_len+=(le-ve[2*Ne+1])*ve[2*Ne],ve[2*Ne+1]=le),ye--)}})(d,k),ge($,de,d.bl_count)}function e(d,k,P){var L,A,$=-1,K=k[1],q=0,re=7,de=4;for(K===0&&(re=138,de=3),k[2*(P+1)+1]=65535,L=0;L<=P;L++)A=K,K=k[2*(L+1)+1],++q<re&&A===K||(q<de?d.bl_tree[2*A]+=q:A!==0?(A!==$&&d.bl_tree[2*A]++,d.bl_tree[2*S]++):q<=10?d.bl_tree[2*N]++:d.bl_tree[2*B]++,$=A,de=(q=0)===K?(re=138,3):A===K?(re=6,3):(re=7,4))}function T(d,k,P){var L,A,$=-1,K=k[1],q=0,re=7,de=4;for(K===0&&(re=138,de=3),L=0;L<=P;L++)if(A=K,K=k[2*(L+1)+1],!(++q<re&&A===K)){if(q<de)for(;G(d,A,d.bl_tree),--q!=0;);else A!==0?(A!==$&&(G(d,A,d.bl_tree),q--),G(d,S,d.bl_tree),Y(d,q-3,2)):q<=10?(G(d,N,d.bl_tree),Y(d,q-3,3)):(G(d,B,d.bl_tree),Y(d,q-11,7));$=A,de=(q=0)===K?(re=138,3):A===K?(re=6,3):(re=7,4)}}o(Z);var D=!1;function p(d,k,P,L){Y(d,(_<<1)+(L?1:0),3),(function(A,$,K,q){ce(A),te(A,K),te(A,~K),c.arraySet(A.pending_buf,A.window,$,K,A.pending),A.pending+=K})(d,k,P)}v._tr_init=function(d){D||((function(){var k,P,L,A,$,K=new Array(h+1);for(A=L=0;A<y-1;A++)for(O[A]=L,k=0;k<1<<F[A];k++)t[L++]=A;for(t[L-1]=A,A=$=0;A<16;A++)for(Z[A]=$,k=0;k<1<<W[A];k++)z[$++]=A;for($>>=7;A<i;A++)for(Z[A]=$<<7,k=0;k<1<<W[A]-7;k++)z[256+$++]=A;for(P=0;P<=h;P++)K[P]=0;for(k=0;k<=143;)ee[2*k+1]=8,k++,K[8]++;for(;k<=255;)ee[2*k+1]=9,k++,K[9]++;for(;k<=279;)ee[2*k+1]=7,k++,K[7]++;for(;k<=287;)ee[2*k+1]=8,k++,K[8]++;for(ge(ee,b+1,K),k=0;k<i;k++)f[2*k+1]=5,f[2*k]=fe(k,5);J=new se(ee,F,g+1,b,h),U=new se(f,W,0,i,h),ae=new se(new Array(0),R,0,u,x)})(),D=!0),d.l_desc=new I(d.dyn_ltree,J),d.d_desc=new I(d.dyn_dtree,U),d.bl_desc=new I(d.bl_tree,ae),d.bi_buf=0,d.bi_valid=0,ie(d)},v._tr_stored_block=p,v._tr_flush_block=function(d,k,P,L){var A,$,K=0;0<d.level?(d.strm.data_type===2&&(d.strm.data_type=(function(q){var re,de=4093624447;for(re=0;re<=31;re++,de>>>=1)if(1&de&&q.dyn_ltree[2*re]!==0)return a;if(q.dyn_ltree[18]!==0||q.dyn_ltree[20]!==0||q.dyn_ltree[26]!==0)return r;for(re=32;re<g;re++)if(q.dyn_ltree[2*re]!==0)return r;return a})(d)),ke(d,d.l_desc),ke(d,d.d_desc),K=(function(q){var re;for(e(q,q.dyn_ltree,q.l_desc.max_code),e(q,q.dyn_dtree,q.d_desc.max_code),ke(q,q.bl_desc),re=u-1;3<=re&&q.bl_tree[2*H[re]+1]===0;re--);return q.opt_len+=3*(re+1)+5+5+4,re})(d),A=d.opt_len+3+7>>>3,($=d.static_len+3+7>>>3)<=A&&(A=$)):A=$=P+5,P+4<=A&&k!==-1?p(d,k,P,L):d.strategy===4||$===A?(Y(d,2+(L?1:0),3),be(d,ee,f)):(Y(d,4+(L?1:0),3),(function(q,re,de,oe){var xe;for(Y(q,re-257,5),Y(q,de-1,5),Y(q,oe-4,4),xe=0;xe<oe;xe++)Y(q,q.bl_tree[2*H[xe]+1],3);T(q,q.dyn_ltree,re-1),T(q,q.dyn_dtree,de-1)})(d,d.l_desc.max_code+1,d.d_desc.max_code+1,K+1),be(d,d.dyn_ltree,d.dyn_dtree)),ie(d),L&&ce(d)},v._tr_tally=function(d,k,P){return d.pending_buf[d.d_buf+2*d.last_lit]=k>>>8&255,d.pending_buf[d.d_buf+2*d.last_lit+1]=255&k,d.pending_buf[d.l_buf+d.last_lit]=255&P,d.last_lit++,k===0?d.dyn_ltree[2*P]++:(d.matches++,k--,d.dyn_ltree[2*(t[P]+g+1)]++,d.dyn_dtree[2*E(k)]++),d.last_lit===d.lit_bufsize-1},v._tr_align=function(d){Y(d,2,3),G(d,w,ee),(function(k){k.bi_valid===16?(te(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):8<=k.bi_valid&&(k.pending_buf[k.pending++]=255&k.bi_buf,k.bi_buf>>=8,k.bi_valid-=8)})(d)}},{"../utils/common":41}],53:[function(m,C,v){C.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(m,C,v){(function(c){(function(a,r){if(!a.setImmediate){var o,_,y,g,b=1,i={},u=!1,n=a.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(a);h=h&&h.setTimeout?h:a,o={}.toString.call(a.process)==="[object process]"?function(S){process.nextTick(function(){x(S)})}:(function(){if(a.postMessage&&!a.importScripts){var S=!0,N=a.onmessage;return a.onmessage=function(){S=!1},a.postMessage("","*"),a.onmessage=N,S}})()?(g="setImmediate$"+Math.random()+"$",a.addEventListener?a.addEventListener("message",w,!1):a.attachEvent("onmessage",w),function(S){a.postMessage(g+S,"*")}):a.MessageChannel?((y=new MessageChannel).port1.onmessage=function(S){x(S.data)},function(S){y.port2.postMessage(S)}):n&&"onreadystatechange"in n.createElement("script")?(_=n.documentElement,function(S){var N=n.createElement("script");N.onreadystatechange=function(){x(S),N.onreadystatechange=null,_.removeChild(N),N=null},_.appendChild(N)}):function(S){setTimeout(x,0,S)},h.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var N=new Array(arguments.length-1),B=0;B<N.length;B++)N[B]=arguments[B+1];var F={callback:S,args:N};return i[b]=F,o(b),b++},h.clearImmediate=l}function l(S){delete i[S]}function x(S){if(u)setTimeout(x,0,S);else{var N=i[S];if(N){u=!0;try{(function(B){var F=B.callback,W=B.args;switch(W.length){case 0:F();break;case 1:F(W[0]);break;case 2:F(W[0],W[1]);break;case 3:F(W[0],W[1],W[2]);break;default:F.apply(r,W)}})(N)}finally{l(S),u=!1}}}}function w(S){S.source===a&&typeof S.data=="string"&&S.data.indexOf(g)===0&&x(+S.data.slice(g.length))}})(typeof self>"u"?c===void 0?this:c:self)}).call(this,typeof $e<"u"?$e:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(ut)),ut.exports}var nn=rn();const sn=ir(nn);function an(M,V){const m=M.replace(/\r\n/g,`
|
|
28
|
+
`),C=r=>/^---\n[\s\S]*?\n---\n/.test(r);if(!m.startsWith("---")||!m.includes(`
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
`))return[{path:V,content:M}];const v=[];for(const r of m.split(`
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
`))C(r)||v.length===0?v.push(r):v[v.length-1]+=`
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
${r}`;if(v.length<2)return[{path:V,content:M}];const c=(r,o)=>{var y,g;return(((g=(y=r.match(new RegExp(`^${o}:\\s*(.*)$`,"m")))==null?void 0:y[1])==null?void 0:g.trim())??"").replace(/^"(.*)"$/,"$1").trim()},a=new Map;return v.map((r,o)=>{var i;const _=((i=r.match(/^---\n([\s\S]*?)\n---\n/))==null?void 0:i[1])??"";let y=(c(_,"id")||c(_,"title")||`document-${o+1}`).trim();y=y.replace(/\.md$/i,"");const g=(a.get(y)??0)+1;return a.set(y,g),{path:`${g>1?`${y}-${g}`:y}.md`,content:r}})}function on(M,V=[]){let m=[];function C(c,a){const r=ne.createContext(a);r.displayName=c+"Context";const o=m.length;m=[...m,a];const _=g=>{var l;const{scope:b,children:i,...u}=g,n=((l=b==null?void 0:b[M])==null?void 0:l[o])||r,h=ne.useMemo(()=>u,Object.values(u));return s.jsx(n.Provider,{value:h,children:i})};_.displayName=c+"Provider";function y(g,b){var n;const i=((n=b==null?void 0:b[M])==null?void 0:n[o])||r,u=ne.useContext(i);if(u)return u;if(a!==void 0)return a;throw new Error(`\`${g}\` must be used within \`${c}\``)}return[_,y]}const v=()=>{const c=m.map(a=>ne.createContext(a));return function(r){const o=(r==null?void 0:r[M])||c;return ne.useMemo(()=>({[`__scope${M}`]:{...r,[M]:o}}),[r,o])}};return v.scopeName=M,[C,ln(v,...V)]}function ln(...M){const V=M[0];if(M.length===1)return V;const m=()=>{const C=M.map(v=>({useScope:v(),scopeName:v.scopeName}));return function(c){const a=C.reduce((r,{useScope:o,scopeName:_})=>{const g=o(c)[`__scope${_}`];return{...r,...g}},{});return ne.useMemo(()=>({[`__scope${V.scopeName}`]:a}),[a])}};return m.scopeName=V.scopeName,m}var cn=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zt=cn.reduce((M,V)=>{const m=ar(`Primitive.${V}`),C=ne.forwardRef((v,c)=>{const{asChild:a,...r}=v,o=a?m:V;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),s.jsx(o,{...r,ref:c})});return C.displayName=`Primitive.${V}`,{...M,[V]:C}},{}),xt="Progress",vt=100,[dn]=on(xt),[un,hn]=dn(xt),$t=ne.forwardRef((M,V)=>{const{__scopeProgress:m,value:C=null,max:v,getValueLabel:c=fn,...a}=M;(v||v===0)&&!Ft(v)&&console.error(mn(`${v}`,"Progress"));const r=Ft(v)?v:vt;C!==null&&!Tt(C,r)&&console.error(pn(`${C}`,"Progress"));const o=Tt(C,r)?C:null,_=rt(o)?c(o,r):void 0;return s.jsx(un,{scope:m,value:o,max:r,children:s.jsx(Zt.div,{"aria-valuemax":r,"aria-valuemin":0,"aria-valuenow":rt(o)?o:void 0,"aria-valuetext":_,role:"progressbar","data-state":Gt(o,r),"data-value":o??void 0,"data-max":r,...a,ref:V})})});$t.displayName=xt;var Ht="ProgressIndicator",qt=ne.forwardRef((M,V)=>{const{__scopeProgress:m,...C}=M,v=hn(Ht,m);return s.jsx(Zt.div,{"data-state":Gt(v.value,v.max),"data-value":v.value??void 0,"data-max":v.max,...C,ref:V})});qt.displayName=Ht;function fn(M,V){return`${Math.round(M/V*100)}%`}function Gt(M,V){return M==null?"indeterminate":M===V?"complete":"loading"}function rt(M){return typeof M=="number"}function Ft(M){return rt(M)&&!isNaN(M)&&M>0}function Tt(M,V){return rt(M)&&!isNaN(M)&&M<=V&&M>=0}function mn(M,V){return`Invalid prop \`max\` of value \`${M}\` supplied to \`${V}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${vt}\`.`}function pn(M,V){return`Invalid prop \`value\` of value \`${M}\` supplied to \`${V}\`. The \`value\` prop must be:
|
|
41
|
+
- a positive number
|
|
42
|
+
- less than the value passed to \`max\` (or ${vt} if no \`max\` prop is set)
|
|
43
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
|
44
|
+
|
|
45
|
+
Defaulting to \`null\`.`}var Kt=$t,gn=qt;const Yt=ne.forwardRef(({className:M,value:V,...m},C)=>s.jsx(Kt,{ref:C,className:or("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",M),...m,children:s.jsx(gn,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(V||0)}%)`}})}));Yt.displayName=Kt.displayName;const nt=/\.(md|markdown|ya?ml|txt|json)$/i;function _t(M){return M===".versions"||M===".context"?!1:M.startsWith(".")||M==="node_modules"||M==="_suggestions"}const xn=new Set(["INDEX.MD","CONTEXT.MD","CLAUDE.MD","GEMINI.MD","AGENTS.MD","QWEN.MD","README.MD"]);function vn(M){return M.filter(V=>{const m=V.path.split("/"),C=m[m.length-1];return!C.endsWith(".md")||xn.has(C.toUpperCase())?!1:!m.some(v=>v.startsWith(".")||v==="node_modules")}).length}async function Vt(M,V,m=32){const C=[];for(let v=0;v<M.length;v+=m)C.push(...await Promise.all(M.slice(v,v+m).map(V)));return C}async function _n(M,V,m){const C=[],v=async(c,a)=>{const r=[];for await(const o of c.values()){const _=a?`${a}/${o.name}`:o.name;o.kind==="directory"?_t(o.name)||r.push({handle:o,rel:_}):nt.test(o.name)&&C.push({handle:o,rel:_})}await Promise.all(r.map(o=>v(o.handle,o.rel)))};await v(M,V),m.push(...await Vt(C,async({handle:c,rel:a})=>({path:a,content:await(await c.getFile()).text()})))}async function bn(M,V){const m=await sn.loadAsync(M);for(const C of Object.values(m.files)){if(C.dir)continue;const v=C.name.split("/");v.some(_t)||!nt.test(v[v.length-1])||V.push({path:C.name,content:await C.async("string")})}}async function yn(M){const V=[];for(const m of Array.from(M)){const C=m.webkitRelativePath.split("/");C.shift();const v=C.join("/");!v||C.some(_t)||!nt.test(m.name)||V.push({file:m,rel:v})}return Vt(V,async({file:m,rel:C})=>({path:C,content:await m.text()}))}function wn({isOpen:M,onClose:V,onImported:m}){const[C,v]=ne.useState("folder"),[c,a]=ne.useState(""),[r,o]=ne.useState(null),[_,y]=ne.useState(""),[g,b]=ne.useState(!1),[i,u]=ne.useState(!1),[n,h]=ne.useState(null),[l,x]=ne.useState(null),w=ne.useRef(null),S=ne.useRef(null),N=()=>{v("folder"),a(""),o(null),y(""),x(null),b(!1),u(!1),h(null)},B=f=>{f!==C&&(v(f),o(null),a(""),x(null))},F=()=>{i||(N(),V())},W=async()=>{var t;x(null);const f=window.showDirectoryPicker;if(typeof f!="function"){(t=w.current)==null||t.click();return}let z;try{z=await f()}catch(O){if((O==null?void 0:O.name)==="AbortError")return;console.error("[ImportFolderModal] showDirectoryPicker failed",O),x("Couldn't open that folder");return}b(!0);try{const O=[];await _n(z,"",O),a(z.name),o(O),y(J=>J||z.name)}catch(O){console.error("[ImportFolderModal] scan failed",O),x("Couldn't read that folder")}finally{b(!1)}},R=async f=>{const z=f.target.files;if(!(!z||!z.length)){b(!0),x(null);try{const t=z[0].webkitRelativePath.split("/")[0]||"Imported",O=await yn(z);a(t),o(O),y(J=>J||t)}catch(t){console.error("[ImportFolderModal] scan failed",t),x("Couldn't read that folder")}finally{b(!1),f.target.value=""}}},H=async f=>{const z=f.target.files?Array.from(f.target.files):[];if(z.length){b(!0),x(null);try{const t=[];let O="Imported";for(const J of z)if(J.name.toLowerCase().endsWith(".zip"))await bn(J,t),O=J.name.replace(/\.zip$/i,"")||O;else if(/\.(md|markdown)$/i.test(J.name))for(const U of an(await J.text(),J.name))t.push(U);else nt.test(J.name)&&t.push({path:J.name,content:await J.text()});a(O),o(t),y(J=>J||O)}catch(t){console.error("[ImportFolderModal] file read failed",t),x("Couldn't read that selection")}finally{b(!1),f.target.value=""}}},ee=async()=>{if(r){u(!0),h(null),x(null);try{const{rejected:f}=await lr(_.trim()||c,r,(z,t)=>h({done:z,total:t}));if(m(),f.length){u(!1),h(null),x(`Imported, but ${f.length} file${f.length===1?"":"s"} could not be read or ${f.length===1?"was":"were"} too large: ${f.slice(0,5).join(", ")}`+(f.length>5?`, and ${f.length-5} more`:""));return}F()}catch(f){console.error("[ImportFolderModal] import failed",f),x((f==null?void 0:f.message)||"Import failed"),u(!1),h(null)}}};return s.jsx(Je,{open:M,onOpenChange:f=>!f&&F(),children:s.jsxs(Qe,{className:"sm:max-w-[480px]",children:[s.jsx(et,{children:s.jsxs(tt,{className:"flex items-center gap-2",children:[s.jsx(Fe,{className:"h-5 w-5"}),"Import into a new nest"]})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Import a folder from your computer, or a nest ",s.jsx("code",{children:".zip"})," (or markdown files) exported from another host. Files are uploaded into a new nest — your originals are left untouched."]}),s.jsx("input",{ref:f=>{w.current=f,f&&(f.setAttribute("webkitdirectory",""),f.setAttribute("directory",""))},type:"file",multiple:!0,className:"hidden",onChange:R}),s.jsx("input",{ref:S,type:"file",multiple:!0,accept:".zip,.md,.markdown,.yaml,.yml,.txt,.json",className:"hidden",onChange:H}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"flex gap-2",role:"radiogroup","aria-label":"Import source",children:[{id:"folder",label:"Folder"},{id:"file",label:"File / .zip"}].map(f=>s.jsxs("label",{className:`flex flex-1 items-center gap-2 rounded-md border px-3 py-2 text-sm cursor-pointer transition-colors ${C===f.id?"border-primary bg-primary/5 text-foreground":"border-border text-muted-foreground hover:bg-secondary/50"}`,children:[s.jsx("input",{type:"radio",name:"import-source",className:"accent-primary",checked:C===f.id,onChange:()=>B(f.id),disabled:g||i}),f.label]},f.id))}),s.jsxs(he,{className:"w-full",variant:"outline",onClick:C==="folder"?W:()=>{var f;x(null),(f=S.current)==null||f.click()},disabled:g||i,children:[g?s.jsx(Oe,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(Fe,{className:"h-4 w-4 mr-2"}),C==="folder"?"Choose folder":"Choose .zip or files"]}),r&&(()=>{const f=vn(r);return s.jsxs("p",{className:"break-words text-sm text-muted-foreground",children:[s.jsx("span",{className:"font-medium text-foreground",children:c})," — ",f," document",f===1?"":"s",s.jsxs("span",{className:"text-xs",children:[" · ",r.length," file",r.length===1?"":"s"," scanned"]})]})})()]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(mt,{children:"Nest name"}),s.jsx(Ye,{placeholder:c||"My Folder",value:_,onChange:f=>y(f.target.value)})]}),i&&s.jsxs("div",{className:"space-y-1",children:[s.jsx(Yt,{value:n&&n.total>0&&n.done<n.total?Math.round(n.done/n.total*100):void 0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:n&&n.done<n.total?`Uploading ${n.done} of ${n.total} files…`:"Registering documents…"})]}),l&&s.jsx("p",{className:"text-sm text-destructive",children:l})]}),s.jsxs(pt,{children:[s.jsx(he,{variant:"outline",onClick:F,disabled:i,children:"Cancel"}),s.jsxs(he,{onClick:ee,disabled:!r||g||i,children:[i?s.jsx(Oe,{className:"h-4 w-4 mr-2 animate-spin"}):s.jsx(Fe,{className:"h-4 w-4 mr-2"}),"Import"]})]})]})})}const Ke=24,Bt="cn:dashboard:nestScope";function Rn(){var ze,bt;const{openNest:M,manageKeys:V}=cr(),{adminStatus:m,authMode:C,isAdmin:v}=Ut(),c=((ze=m==null?void 0:m.me)==null?void 0:ze.email)??null,{data:a,isLoading:r,refetch:o}=dr(),_=(a==null?void 0:a.nests)??[],{data:y}=Ve(Ae.unreadNotifications()),g=ne.useMemo(()=>{const j=Wt(y==null?void 0:y.notifications);return _.filter(X=>!j.has(X.id))},[_,y]),{data:b}=Ve(Ae.health()),i=C==="open"||v||(b==null?void 0:b.nest_creation)==="everyone",u=(bt=m==null?void 0:m.admin)==null?void 0:bt.email,[n,h]=ne.useState(!1),{data:l,isLoading:x}=Ve({...Ae.nestList(!0),enabled:n}),w=(l==null?void 0:l.nests)??[],[S,N]=ne.useState(""),[B,F]=ne.useState("archived"),W=ne.useMemo(()=>tn(w,S,B),[w,S,B]),[R,H]=ne.useState(null),[ee,f]=ne.useState(!1),[z,t]=ne.useState(""),[O,J]=ne.useState("activity"),[U,ae]=ne.useState(()=>{try{return en(localStorage.getItem(Bt))}catch{}return Le}),Z=j=>{ae(j);try{localStorage.setItem(Bt,j)}catch{}},[se,I]=ne.useState(Ke),E=ne.useMemo(()=>{if(!Xr(U))return[];const j=z.trim().toLowerCase();return[...g.filter(Q=>Vr(Q,U)?j?(Q.name??"").toLowerCase().includes(j)||(Q.description??"").toLowerCase().includes(j):!0:!1)].sort((Q,pe)=>{const we=+!!pe.pinned-+!!Q.pinned;return we!==0?we:O==="name"?String(Q.name??"").localeCompare(String(pe.name??"")):String(pe.last_activity??pe.created_at??"").localeCompare(String(Q.last_activity??Q.created_at??""))})},[g,z,U,O]),te=E.slice(0,se),Y=z.trim()!==""||U!==Le||O!=="activity",G=()=>{t(""),Z(Le),J("activity")},fe=ne.useMemo(()=>g.filter(j=>!!j.discovered).length,[g]),ge=Mt(),[ie,ce]=ne.useState([]),me=ne.useMemo(()=>Jr(ie,U,z),[ie,U,z]),[ue,be]=ne.useState({}),[ke,e]=ne.useState({}),[T,D]=ne.useState(!1),[p,d]=ne.useState(!1),[k,P]=ne.useState(""),[L,A]=ne.useState(""),[$,K]=ne.useState(null),[q,re]=ne.useState(new Set),[de,oe]=ne.useState(null),[xe,Ce]=ne.useState(null),[ye,Ne]=ne.useState(null),[le,je]=ne.useState(null),De=typeof window<"u"?window.location.origin:"http://localhost:3838",ve=async()=>{ge.fetchQuery(Ae.unsynced()).then(j=>ce(j.folders)).catch(()=>ce([])),await o()},Me=async j=>{be(X=>({...X,[j]:!0})),e(X=>{const Q={...X};return delete Q[j],Q});try{await kr(j),await ve()}catch(X){console.error("[Dashboard] syncUnsyncedFolder failed",j,X);const Q=X instanceof Error?X.message:"Failed to sync folder";e(pe=>({...pe,[j]:Q}))}finally{be(X=>{const Q={...X};return delete Q[j],Q})}},st=async j=>{be(X=>({...X,[j]:!0})),e(X=>{const Q={...X};return delete Q[j],Q});try{await jr(j),ce(X=>X.filter(Q=>Q.name!==j)),je(null)}catch(X){console.error("[Dashboard] deleteUnsyncedFolder failed",j,X);const Q=X instanceof Error?X.message:"Failed to delete folder";e(pe=>({...pe,[j]:Q})),je(null)}finally{be(X=>{const Q={...X};return delete Q[j],Q})}};ne.useEffect(()=>{ve()},[c]);const it=async j=>{j.preventDefault();const X=qe(k);if(X){K(X);return}K(null);try{const{nest:Q}=await Nr(k.trim(),L.trim());P(""),A(""),D(!1),ve(),M(Q.id,Q.name,!0,Q.user_id===He)}catch(Q){console.error("[Dashboard] createNest failed",Q),K(Q instanceof Error?Q.message:"Failed to create nest")}},at=async(j,X)=>{if(q.has(j))return;re(pe=>new Set(pe).add(j));const Q=pe=>ge.setQueryData(Ae.nestList().queryKey,we=>we&&{...we,nests:we.nests.map(Re=>Re.id===j?{...Re,pinned:pe}:Re)});Q(X);try{await Sr(j,X)}catch(pe){Q(!X),Se.error((pe==null?void 0:pe.message)??`Failed to ${X?"pin":"unpin"} this nest`)}finally{re(pe=>{const we=new Set(pe);return we.delete(j),we})}},We=(j,X,Q=!1)=>{oe({id:j,name:X,isImported:Q})},Ee=(j,X)=>{Ce({id:j,name:X})};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs(Pe,{className:"bg-gradient-to-br from-blue-50 to-indigo-50 border-blue-200",children:[s.jsx(ur,{className:"pb-3",children:s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsx(hr,{className:"text-lg",children:"Your Community Server"}),s.jsxs(fr,{children:["Running at"," ",s.jsx("code",{className:"text-xs bg-white/60 px-1.5 py-0.5 rounded font-mono",children:De}),s.jsx(kn,{value:De})]})]}),s.jsxs("div",{className:"flex gap-6 text-center",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-bold",children:r?s.jsx(It,{}):g.length}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Nests"})]}),s.jsxs("div",{children:[s.jsx("div",{className:"text-2xl font-bold",children:r?s.jsx(It,{}):g.reduce((j,X)=>j+Number(X.document_count??0),0)}),s.jsx("div",{className:"text-xs text-muted-foreground",children:"Documents"})]})]})]})}),s.jsx(Ue,{className:"pt-0",children:s.jsxs("div",{className:"grid md:grid-cols-2 gap-3 text-xs",children:[s.jsx(Pt,{icon:s.jsx(mr,{className:"h-4 w-4"}),title:"Hootie",desc:"Settings → Vault → Remote Server → paste URL"}),s.jsx(Pt,{icon:s.jsx(pr,{className:"h-4 w-4"}),title:"Claude Desktop",desc:"Add MCP endpoint per nest via Connect button"})]})})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsx(Rr,{icon:Xe,title:"Nests",description:"Shared knowledge vaults for your team",className:"mb-0",actions:i&&s.jsxs(s.Fragment,{children:[s.jsxs(he,{variant:"outline",onClick:()=>d(!0),children:[s.jsx(Fe,{className:"h-4 w-4 mr-2"}),"Import Folder"]}),s.jsxs(he,{onClick:()=>D(!0),children:[s.jsx(lt,{className:"h-4 w-4 mr-2"}),"New Nest"]})]})}),s.jsx(jn,{nests:_,onOpen:j=>M(j.id,j.name,j.is_owner??!1,j.user_id===He),onDeclined:()=>o()}),g.length>0&&s.jsx(Yr,{nests:g,onManageKeys:V}),s.jsx(Je,{open:T,onOpenChange:j=>{j||(D(!1),K(null))},children:s.jsxs(Qe,{className:"sm:max-w-[480px]",children:[s.jsxs(et,{children:[s.jsx(tt,{children:"New nest"}),s.jsx(ht,{children:"A nest holds a set of documents and the governance around them."})]}),s.jsxs("form",{onSubmit:it,className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx(mt,{children:"Name"}),s.jsx(Ye,{placeholder:"Team Knowledge",value:k,onChange:j=>{P(j.target.value),$&&K(null)},"aria-invalid":!!$,autoFocus:!0}),($??(k?qe(k):null))&&s.jsx("p",{className:"text-xs text-destructive",children:$??qe(k)})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx(mt,{children:"Description (optional)"}),s.jsx(gr,{placeholder:"Shared docs for the engineering team",value:L,onChange:j=>A(j.target.value),rows:3})]}),s.jsxs(pt,{children:[s.jsx(he,{type:"button",variant:"outline",onClick:()=>{D(!1),K(null)},children:"Cancel"}),s.jsx(he,{type:"submit",disabled:!!qe(k),children:"Create Nest"})]})]})]})}),!r&&s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[!n&&g.length>5&&s.jsxs(s.Fragment,{children:[s.jsx(Ye,{value:z,onChange:j=>{t(j.target.value),I(Ke)},placeholder:"Filter nests by name or description…",className:"h-9 max-w-xs","data-testid":"nest-filter-input"}),s.jsxs("select",{value:U,onChange:j=>{Z(j.target.value),I(Ke)},className:"h-9 rounded-md border bg-background px-2 text-sm","aria-label":"Filter nests by access","data-testid":"nest-scope-select",children:[s.jsx("option",{value:"mine",children:"My nests"}),s.jsx("option",{value:"all",children:"All nests"}),s.jsx("option",{value:"owned",children:"Owned by me"}),s.jsx("option",{value:"shared",children:"Shared with me"}),s.jsx("option",{value:"org",children:"Organization"}),s.jsx("option",{value:"public",children:"Public"}),(ie.length>0||U==="synced"||U==="unsynced")&&s.jsxs(s.Fragment,{children:[s.jsx("option",{value:"synced",children:"Synced nests only"}),s.jsx("option",{value:"unsynced",children:"Unsynced folders only"})]})]}),s.jsxs("select",{value:O,onChange:j=>J(j.target.value),className:"h-9 rounded-md border bg-background px-2 text-sm","aria-label":"Sort nests","data-testid":"nest-sort-select",children:[s.jsx("option",{value:"activity",children:"Recent activity"}),s.jsx("option",{value:"name",children:"Name (A–Z)"})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[E.length+me.length," of"," ",g.length+ie.length]}),Y&&s.jsx(he,{variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:G,"data-testid":"nest-clear-filters",children:"Clear filters"})]}),s.jsxs("label",{className:"ml-auto flex items-center gap-2 text-sm text-muted-foreground",children:[s.jsx(dt,{className:"h-4 w-4"}),"Archived",s.jsx(xr,{checked:n,onCheckedChange:h,"aria-label":"Show archived nests","data-testid":"nest-archived-switch"})]})]}),n?s.jsx("div",{className:"space-y-4","data-testid":"archived-nests",children:x?s.jsxs("div",{className:"flex items-center gap-2 py-10 justify-center text-sm text-muted-foreground",children:[s.jsx(Oe,{className:"h-4 w-4 animate-spin"}),"Loading archived nests…"]}):w.length===0?s.jsxs("div",{className:"rounded-lg border border-dashed py-12 text-center",children:[s.jsx(dt,{className:"h-8 w-8 mx-auto mb-3 text-muted-foreground"}),s.jsx("p",{className:"text-sm font-medium",children:"No archived nests"}),s.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Archiving a nest puts it here instead of deleting it — the option is in the delete dialog on any nest you own."})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"text-xs text-muted-foreground",children:"These nests are read-only. They don't appear on your dashboard, answer agents over MCP, or serve published links until restored."}),w.length>5&&s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx(Ye,{value:S,onChange:j=>N(j.target.value),placeholder:"Filter archived nests by name…",className:"h-9 max-w-xs","data-testid":"archived-filter-input"}),s.jsxs("select",{value:B,onChange:j=>F(j.target.value),className:"h-9 rounded-md border bg-background px-2 text-sm","aria-label":"Sort archived nests","data-testid":"archived-sort-select",children:[s.jsx("option",{value:"archived",children:"Date archived"}),s.jsx("option",{value:"name",children:"Name (A–Z)"})]}),s.jsxs("span",{className:"text-xs text-muted-foreground",children:[W.length," of ",w.length]}),S.trim()!==""&&s.jsx(he,{variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>N(""),"data-testid":"archived-clear-filter",children:"Clear filter"})]}),W.length===0?s.jsxs("div",{className:"rounded-lg border border-dashed py-12 text-center",children:[s.jsx("p",{className:"text-sm font-medium",children:"Nothing matches this filter"}),s.jsx(he,{variant:"outline",size:"sm",className:"mt-3",onClick:()=>N(""),children:"Clear filter"})]}):s.jsx("div",{className:"space-y-2",children:W.map(j=>{const X=()=>M(j.id,j.name,j.is_owner??!1,j.user_id===He,!0);return s.jsxs("div",{role:"button",tabIndex:0,onClick:X,onKeyDown:Q=>{(Q.key==="Enter"||Q.key===" ")&&Q.target===Q.currentTarget&&(Q.preventDefault(),X())},className:"flex items-center gap-3 rounded-lg border px-4 py-3 hover:bg-secondary/50 cursor-pointer",children:[s.jsx(dt,{className:"h-4 w-4 text-muted-foreground shrink-0"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"truncate text-sm font-medium",children:j.name}),s.jsxs("div",{className:"truncate text-xs text-muted-foreground",children:[j.archived_at?`Archived ${vr(j.archived_at)}`:"Archived",j.description?` — ${j.description}`:""]})]}),j.is_owner&&s.jsxs(s.Fragment,{children:[s.jsxs(he,{variant:"outline",size:"sm",onClick:Q=>{Q.stopPropagation(),H({id:j.id,name:j.name})},"data-testid":"restore-nest",children:[s.jsx($r,{className:"h-3.5 w-3.5 mr-1.5"}),"Restore"]}),s.jsx(he,{variant:"ghost",size:"sm",className:"text-red-700 hover:text-red-800",onClick:Q=>{Q.stopPropagation(),oe({id:j.id,name:j.name,isImported:!!j.is_imported})},children:s.jsx(Be,{className:"h-3.5 w-3.5"})})]})]},j.id)})})]})}):r?s.jsx("div",{className:"text-center py-12 text-muted-foreground",children:"Loading..."}):U===Le&&z.trim()===""&&E.length+me.length===0&&fe>0?s.jsx(Pe,{children:s.jsxs(Ue,{className:"text-center py-12",children:[s.jsx(Xe,{className:"h-12 w-12 mx-auto text-muted-foreground mb-3"}),s.jsx("p",{className:"font-medium",children:"No nests of your own yet"}),s.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[i?"Create one, or browse":"Browse"," the ",fe," nest",fe===1?"":"s"," others have opened up on this server."]}),s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[i&&s.jsxs(he,{onClick:()=>D(!0),children:[s.jsx(lt,{className:"h-4 w-4 mr-2"}),"Create Nest"]}),s.jsx(he,{variant:"outline",onClick:()=>Z("all"),"data-testid":"nest-browse-discovered",children:"Browse all nests"})]})]})}):g.length+ie.length>0&&E.length+me.length===0?s.jsx(Pe,{children:s.jsxs(Ue,{className:"text-center py-12",children:[s.jsx("p",{className:"font-medium",children:"Nothing matches this filter"}),s.jsxs("p",{className:"text-sm text-muted-foreground mb-4",children:[g.length+ie.length," item",g.length+ie.length===1?" is":"s are"," hidden by the current filter."]}),s.jsx(he,{variant:"outline",onClick:G,children:"Clear filters"})]})}):te.length===0&&ie.length===0?s.jsx(Pe,{children:s.jsxs(Ue,{className:"text-center py-12",children:[s.jsx(Xe,{className:"h-12 w-12 mx-auto text-muted-foreground mb-3"}),i?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"font-medium",children:"No nests yet"}),s.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"Create your first nest to start sharing knowledge with your team"}),s.jsxs(he,{onClick:()=>D(!0),children:[s.jsx(lt,{className:"h-4 w-4 mr-2"}),"Create First Nest"]})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"font-medium",children:"You don't have access to any nests yet."}),s.jsxs("p",{className:"text-sm text-muted-foreground",children:["Ask ",u||"your admin"," to share one."]})]})]})}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:[me.map(j=>{const X=!!ue[j.name],Q=ke[j.name];return s.jsx("div",{className:"relative text-left p-4 rounded-lg border border-dashed border-blue-300 bg-blue-50/40",children:s.jsxs("div",{className:"flex items-start gap-3 pr-2",children:[s.jsx("div",{className:"p-2 rounded-md bg-blue-100",children:s.jsx(jt,{className:"h-5 w-5 text-blue-700"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"font-medium truncate",children:j.label}),s.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate mt-0.5",title:j.name,children:j.name}),s.jsxs("p",{className:"text-sm text-muted-foreground truncate mt-1",children:[j.mdCount," markdown file",j.mdCount===1?"":"s"," waiting to sync"]}),s.jsx("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground flex-wrap",children:s.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200",title:"Folder is on disk but not registered as a nest",children:[s.jsx(jt,{className:"h-3 w-3"}),"Unsynced"]})}),s.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[s.jsx(he,{size:"sm",onClick:()=>Me(j.name),disabled:X,children:X?s.jsxs(s.Fragment,{children:[s.jsx(Oe,{className:"h-3.5 w-3.5 mr-2 animate-spin"}),"Syncing…"]}):s.jsxs(s.Fragment,{children:[s.jsx(Kr,{className:"h-3.5 w-3.5 mr-2"}),"Sync to Nest"]})}),s.jsxs(he,{size:"sm",variant:"ghost",className:"text-muted-foreground hover:text-destructive",onClick:()=>je({name:j.name,label:j.label}),disabled:X,title:"Delete this folder from the server",children:[s.jsx(Be,{className:"h-3.5 w-3.5 mr-2"}),"Delete"]})]}),Q&&s.jsx("p",{role:"alert",className:"mt-2 text-xs text-red-700 bg-red-50 border border-red-200 rounded px-2 py-1 break-words",title:Q,children:Q})]})]})},`unsynced:${j.name}`)}),te.map(j=>{var wt,kt;const X=j.user_id===He,Q=()=>M(j.id,j.name,j.is_owner??(j.permission??"owner")==="owner",X),pe=j.permission??"owner",we=j.is_owner??pe==="owner",Re=!we,Te=we||X&&C!=="open"&&v,Xt=we||Array.isArray(j.roles)&&j.roles.includes("admin")||X&&C!=="open"&&v,Ze=Array.isArray(j.roles)?j.roles:[],ot=Ze.includes("admin")?"admin":Ze.includes("editor")?"editor":Ze.includes("reviewer")?"reviewer":Ze.includes("viewer")?"viewer":pe==="admin"?"admin":pe==="write"?"editor":pe==="read"?"viewer":null,Jt=Cr(ot,Te),Ie=ot?{admin:{label:"Admin",Icon:St,cls:"bg-purple-50 text-purple-700 border-purple-200",title:"Admin — full access except deleting the nest"},editor:{label:"Editor",Icon:Nt,cls:"bg-indigo-50 text-indigo-700 border-indigo-200",title:"Editor — you can read and edit documents"},reviewer:{label:"Reviewer",Icon:Wr,cls:"bg-amber-50 text-amber-700 border-amber-200",title:"Reviewer — you can approve or reject submissions"},viewer:{label:"Viewer",Icon:_r,cls:"bg-slate-50 text-slate-700 border-slate-200",title:"View only — you can read but not edit"}}[ot]:null,yt=(Ie==null?void 0:Ie.Icon)??null;return s.jsxs("div",{role:"button",tabIndex:0,onClick:Q,onKeyDown:_e=>{(_e.key==="Enter"||_e.key===" ")&&(_e.preventDefault(),Q())},className:`relative text-left p-4 rounded-lg border bg-card hover:bg-secondary/50 transition-colors cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ${X?"border-dashed border-amber-300":"border-border"}`,children:[s.jsxs("div",{className:"absolute top-2 right-2 flex items-center gap-0.5",children:[Xt&&s.jsx("button",{type:"button","aria-label":`Rename nest ${j.name}`,title:"Rename nest",onClick:_e=>{_e.stopPropagation(),Ne({id:j.id,name:j.name,description:j.description??null})},className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-secondary focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(Nt,{className:"h-3.5 w-3.5"})}),(Te||Jt)&&s.jsx("button",{type:"button","aria-label":Te?`Delete nest ${j.name}`:`Request removal of nest ${j.name}`,title:Te?"Delete nest":"Request nest removal",onClick:_e=>{_e.stopPropagation(),Te?We(j.id,j.name,!!j.is_imported):Ee(j.id,j.name)},className:"p-1.5 rounded-md text-muted-foreground hover:text-red-600 hover:bg-red-50 focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:s.jsx(Be,{className:"h-3.5 w-3.5"})}),s.jsx("button",{type:"button","aria-label":j.pinned?`Unpin nest ${j.name}`:`Pin nest ${j.name}`,"aria-pressed":!!j.pinned,title:j.pinned?"Unpin — stop keeping this nest at the top":"Pin — keep this nest at the top for you",disabled:q.has(j.id),onClick:_e=>{_e.stopPropagation(),at(j.id,!j.pinned)},className:`p-1.5 rounded-md focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-60 ${j.pinned?"text-amber-500 hover:text-amber-600 hover:bg-amber-50":"text-muted-foreground hover:text-foreground hover:bg-secondary"}`,"data-testid":"pin-nest",children:s.jsx(qr,{className:`h-3.5 w-3.5 ${j.pinned?"fill-current":""}`})})]}),s.jsxs("div",{className:"flex items-start gap-3 pr-20",children:[s.jsx("div",{className:`p-2 rounded-md ${X?"bg-amber-100":"bg-primary/10"}`,children:X?s.jsx(br,{className:"h-5 w-5 text-amber-700"}):s.jsx(Ct,{className:"h-5 w-5 text-primary"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("h3",{className:"font-medium truncate",title:j.name,children:j.name}),j.description&&s.jsx("p",{className:"text-sm text-muted-foreground truncate mt-0.5",title:j.description,children:j.description}),Re&&s.jsxs("p",{className:"flex items-center gap-1 mt-1 text-xs text-blue-700 truncate",title:j.owner_email?`Shared by ${j.owner_email}`:"Shared with you",children:[s.jsx(At,{className:"h-3 w-3 shrink-0"}),s.jsxs("span",{className:"truncate",children:["Shared by"," ",s.jsx("span",{className:"font-medium",children:j.owner_email||"unknown user"})]})]}),j.is_imported?s.jsxs("p",{className:"flex items-center gap-1 mt-1 text-xs text-muted-foreground truncate",title:`Imported ${ct(j.created_at)}`,children:[s.jsx(Fe,{className:"h-3 w-3 shrink-0"}),s.jsxs("span",{className:"truncate",children:["Imported by"," ",s.jsx("span",{className:"font-medium",children:j.is_owner?"you":j.owner_email||"unknown user"})," ","· ",ct(j.created_at)]})]}):null,s.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs text-muted-foreground flex-wrap",children:[s.jsxs("span",{className:"inline-flex items-center gap-1",title:"Documents",children:[s.jsx(Ct,{className:"h-3 w-3"}),j.document_count??0]}),(((wt=j.collaborator_emails)==null?void 0:wt.length)??0)>0&&s.jsxs("span",{className:"inline-flex items-center gap-0.5",title:"Shared with",children:[s.jsx(At,{className:"h-3 w-3 mr-0.5"}),j.collaborator_emails.slice(0,4).map(_e=>s.jsx("span",{title:`Shared with ${_e}`,className:"inline-flex h-4.5 min-w-[18px] items-center justify-center rounded-full bg-muted px-1 text-[9px] font-semibold uppercase",children:_e.slice(0,2)},_e)),j.collaborator_emails.length>4&&s.jsxs("span",{className:"text-[10px]",children:["+",j.collaborator_emails.length-4]})]}),(((kt=j.steward_emails)==null?void 0:kt.length)??0)>0&&s.jsxs("span",{className:"inline-flex items-center gap-0.5",title:"Stewards",children:[s.jsx(St,{className:"h-3 w-3 mr-0.5 text-emerald-600"}),j.steward_emails.slice(0,4).map(_e=>s.jsx("span",{title:`Steward: ${_e}`,className:"inline-flex h-4.5 min-w-[18px] items-center justify-center rounded-full bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 px-1 text-[9px] font-semibold uppercase",children:_e.slice(0,2)},_e)),j.steward_emails.length>4&&s.jsxs("span",{className:"text-[10px]",children:["+",j.steward_emails.length-4]})]}),X&&!j.stewardship_enabled&&s.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-50 text-amber-800 border border-amber-200",title:"Owned by the anonymous admin — no stewardship applied",children:"Ungoverned"}),X&&j.stewardship_enabled&&s.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-50 text-emerald-800 border border-emerald-200",title:"Stewardship is enabled — drafts require review before AI use",children:"Governed"}),Re&&Ie&&yt&&s.jsxs("span",{className:`inline-flex items-center gap-1 px-1.5 py-0.5 rounded border ${Ie.cls}`,title:Ie.title,children:[s.jsx(yt,{className:"h-3 w-3"}),Ie.label]}),s.jsx("span",{className:`px-1.5 py-0.5 rounded ${j.visibility==="public"?"bg-green-100 text-green-700":j.visibility==="org"?"bg-blue-100 text-blue-700":"bg-secondary text-secondary-foreground"}`,children:j.visibility==="org"?"Organization":j.visibility==="public"?"Public":"Private"}),j.is_imported?s.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-blue-50 text-blue-700 border border-blue-200",title:"Imported from a folder — its files were copied into the workspace",children:[s.jsx(Fe,{className:"h-3 w-3"}),"Imported"]}):null,s.jsx("span",{children:ct(j.created_at)})]})]})]})]},j.id)})]}),E.length>te.length&&s.jsx("div",{className:"flex justify-center",children:s.jsxs(he,{variant:"outline",onClick:()=>I(j=>j+Ke),"data-testid":"nest-show-more",children:["Show more (",E.length-te.length," left)"]})})]})]}),ye&&s.jsx(Ir,{nestId:ye.id,nestName:ye.name,nestDescription:ye.description,open:!0,onOpenChange:j=>{j||Ne(null)},onRenamed:j=>{ge.setQueryData(Ae.nestList().queryKey,X=>X&&{...X,nests:X.nests.map(Q=>Q.id===j.id?{...Q,name:j.name,slug:j.slug,description:j.description}:Q)}),Ne(null)}}),de&&s.jsx(Dr,{nestId:de.id,nestName:de.name,isImported:de.isImported,open:!0,onOpenChange:j=>{j||oe(null)},onDeleted:async()=>{oe(null),await ve()},onArchived:n?void 0:async()=>{oe(null),Se.success(`"${de.name}" archived — find it under Archived`),await ve()}}),xe&&s.jsx(yr,{open:!0,onOpenChange:j=>!j&&Ce(null),title:`Request removal of "${xe.name}"`,description:"A nest owner or admin reviews this. Nothing is removed yet — ask for the nest to be archived (reversible, nothing deleted) or deleted outright.",label:"Why should it be removed?",placeholder:"e.g. project wound down, superseded by another nest",confirmLabel:"Request deletion",secondaryLabel:"Request archive",onSecondary:async j=>{await Et(xe.id,"nest_archive",xe.id,j),Se.success("Archive requested — a nest admin will review it")},onConfirm:async j=>{await Et(xe.id,"nest",xe.id,j),Se.success("Deletion requested — a nest admin will review it")}}),s.jsx(Or,{open:!!R,onOpenChange:j=>{!j&&!ee&&H(null)},children:s.jsxs(Fr,{children:[s.jsxs(Tr,{children:[s.jsxs(Br,{children:["Restore “",R==null?void 0:R.name,"”?"]}),s.jsx(Pr,{children:"It goes back exactly as it was — same documents, versions and stewards. It returns to your dashboard, becomes writable again, and its published links and MCP access start answering."})]}),s.jsxs(Ur,{children:[s.jsx(Lr,{disabled:ee,children:"Cancel"}),s.jsx(Mr,{disabled:ee,onClick:async j=>{if(j.preventDefault(),!!R){f(!0);try{await wr(R.id),Se.success(`"${R.name}" restored`),H(null),await ve()}catch(X){Se.error((X==null?void 0:X.message)??"Failed to restore this nest")}finally{f(!1)}}},children:ee?s.jsxs(s.Fragment,{children:[s.jsx(Oe,{className:"h-3.5 w-3.5 mr-2 animate-spin"}),"Restoring..."]}):"Restore nest"})]})]})}),s.jsx(Je,{open:!!le,onOpenChange:j=>{!j&&le&&ue[le.name]||j||je(null)},children:s.jsxs(Qe,{className:"sm:max-w-[440px]",children:[s.jsxs(et,{children:[s.jsxs(tt,{className:"flex items-center gap-2 text-red-700",children:[s.jsx(Be,{className:"h-4 w-4"}),"Delete folder"]}),s.jsxs(ht,{children:["Permanently delete"," ",s.jsx("strong",{className:"text-foreground",children:le==null?void 0:le.label})," ","and its files from the server. This can't be undone. The folder won't be synced into a nest."]})]}),s.jsxs(pt,{className:"gap-2",children:[s.jsx(he,{variant:"outline",onClick:()=>je(null),disabled:!!le&&!!ue[le.name],children:"Cancel"}),s.jsx(he,{variant:"destructive",onClick:()=>le&&st(le.name),disabled:!!le&&!!ue[le.name],children:le&&ue[le.name]?s.jsxs(s.Fragment,{children:[s.jsx(Oe,{className:"h-3.5 w-3.5 mr-2 animate-spin"}),"Deleting…"]}):s.jsxs(s.Fragment,{children:[s.jsx(Be,{className:"h-3.5 w-3.5 mr-2"}),"Delete folder"]})})]})]})}),s.jsx(wn,{isOpen:p,onClose:()=>d(!1),onImported:ve})]})}function Pt({icon:M,title:V,desc:m,mono:C}){return s.jsxs("div",{className:"flex items-start gap-2 p-2 rounded bg-white/40",children:[s.jsx("div",{className:"text-muted-foreground mt-0.5",children:M}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"font-medium text-foreground",children:V}),s.jsx("div",{className:`text-muted-foreground ${C?"font-mono text-[10px]":""} truncate`,children:m})]})]})}function kn({value:M}){const[V,m]=ne.useState(!1);return s.jsx("button",{onClick:async C=>{C.stopPropagation(),await ft(M)&&(m(!0),setTimeout(()=>m(!1),1200))},className:"ml-1 inline-flex items-center hover:text-foreground",children:V?s.jsx(Ar,{className:"h-3 w-3 text-green-600"}):s.jsx(Lt,{className:"h-3 w-3"})})}function jn({nests:M,onOpen:V,onDeclined:m}){const C=Mt(),{data:v}=Ve(Ae.unreadNotifications()),[c,a]=ne.useState(null),r=((v==null?void 0:v.notifications)??[]).filter(u=>u.kind==="nest_invite"),o=Wt(v==null?void 0:v.notifications),_=M.filter(u=>o.has(u.id));if(_.length===0)return null;const y=u=>zr(r.filter(n=>n.nest_id===u).map(n=>n.id)),g=()=>C.invalidateQueries({queryKey:Ae.unreadNotifications().queryKey}),b=async u=>{a(u.id),await y(u.id).catch(()=>{}),await g(),a(null),V(u)},i=async u=>{a(u.id);try{const{left:n}=await Er(u.id);n?(Se.success(`Declined ${u.name}`),m()):Se.info(`${u.name} was shared with your team, so it stays in your list.`)}catch(n){Se.error((n==null?void 0:n.message)||"Couldn't decline this invite")}finally{await g(),a(null)}};return s.jsx(Pe,{className:"border-primary/30 bg-primary/5",children:s.jsxs(Ue,{className:"py-4 space-y-2",children:[s.jsx("p",{className:"font-medium text-sm",children:"Pending invites"}),_.map(u=>{var n;return s.jsxs("div",{className:"flex items-center gap-3 rounded-md border bg-background p-3",children:[s.jsx(Xe,{className:"h-4 w-4 text-muted-foreground shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"font-medium truncate",children:u.name}),s.jsx("div",{className:"text-xs text-muted-foreground truncate",children:(n=r.find(h=>h.nest_id===u.id))==null?void 0:n.message})]}),s.jsx(he,{size:"sm",disabled:c===u.id,onClick:()=>b(u),children:"Accept"}),s.jsx(he,{size:"sm",variant:"outline",disabled:c===u.id,onClick:()=>i(u),children:"Decline"})]},u.id)})]})})}export{Rn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,j as e,D as P,
|
|
1
|
+
import{r,j as e,D as P,G as D,H as A,J as T,d3 as F,K as R,I as b,M as z,B as h,d4 as H,E as I,d5 as K,i as k,S as B,d6 as Y,d7 as O,d8 as U,e as G,bK as J,d9 as L}from"./index-DvuUIUP6.js";import{P as M}from"./page-title-Dn5jANiU.js";function S({shown:n,onToggle:c}){return e.jsx("button",{type:"button",onClick:c,tabIndex:-1,"aria-label":n?"Hide password":"Show password",title:n?"Hide password":"Show password",className:"absolute right-2 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground",children:n?e.jsx(H,{className:"h-4 w-4"}):e.jsx(I,{className:"h-4 w-4"})})}function W({open:n,onClose:c}){const[u,l]=r.useState(""),[a,m]=r.useState(""),[t,x]=r.useState(""),[d,p]=r.useState(!1),[j,i]=r.useState(null),[N,v]=r.useState(!1),[w,g]=r.useState(!1),[f,o]=r.useState(!1),C=()=>{l(""),m(""),x(""),i(null),v(!1),g(!1),o(!1)},E=async()=>{if(i(null),a.trim().length===0){i("New password cannot be empty or only whitespace.");return}if(a.length<8){i("New password must be at least 8 characters.");return}if(a!==t){i("New passwords don't match.");return}if(a===u){i("New password must be different from the current password.");return}p(!0);try{await K(u,a),k.success("Password changed. Your other sessions were signed out."),C(),c()}catch(s){i((s==null?void 0:s.message)||"Could not change password.")}finally{p(!1)}};return e.jsx(P,{open:n,onOpenChange:s=>{!s&&!d&&(C(),c())},children:e.jsxs(D,{className:"sm:max-w-[400px]",children:[e.jsxs(A,{children:[e.jsxs(T,{className:"flex items-center gap-2",children:[e.jsx(F,{className:"h-4 w-4 text-muted-foreground"}),"Change password"]}),e.jsx(R,{children:"If an admin gave you a temporary password, set your own here. This signs out your other sessions."})]}),e.jsxs("div",{className:"space-y-3 py-1",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"cp-current",className:"block text-sm font-medium",children:"Current password"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{id:"cp-current",type:N?"text":"password",placeholder:"Enter your current password",value:u,onChange:s=>l(s.target.value),autoComplete:"current-password",className:"pr-10"}),e.jsx(S,{shown:N,onToggle:()=>v(s=>!s)})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"cp-next",className:"block text-sm font-medium",children:"New password"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{id:"cp-next",type:w?"text":"password",placeholder:"At least 8 characters",value:a,onChange:s=>m(s.target.value),autoComplete:"new-password",className:"pr-10"}),e.jsx(S,{shown:w,onToggle:()=>g(s=>!s)})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"cp-confirm",className:"block text-sm font-medium",children:"Confirm new password"}),e.jsxs("div",{className:"relative",children:[e.jsx(b,{id:"cp-confirm",type:f?"text":"password",placeholder:"Re-enter your new password",value:t,onChange:s=>x(s.target.value),autoComplete:"new-password","aria-invalid":t.length>0&&t!==a,className:"pr-10"}),e.jsx(S,{shown:f,onToggle:()=>o(s=>!s)})]}),t.length>0&&t!==a&&e.jsx("p",{className:"text-sm text-destructive",children:"Passwords don't match."})]}),j&&e.jsx("p",{className:"text-sm text-destructive",children:j})]}),e.jsxs(z,{className:"gap-2",children:[e.jsx(h,{variant:"outline",onClick:()=>{C(),c()},disabled:d,children:"Cancel"}),e.jsx(h,{onClick:E,disabled:d||!u||!a||!t||a!==t,children:d?"Saving...":"Change password"})]})]})})}function V(){var g,f;const{adminStatus:n,isAdmin:c,refresh:u}=B(),l=(n==null?void 0:n.me)??null,[a,m]=r.useState(!1),[t,x]=r.useState(""),[d,p]=r.useState(!1),[j,i]=r.useState(!1);if(!l)return e.jsx("div",{className:"py-12 text-center text-muted-foreground",children:"Sign in to see your account."});const N=((g=l.name)==null?void 0:g.trim())||l.email,v=()=>{x(l.name??""),m(!0)},w=async()=>{p(!0);try{await L(t),await u(),k.success("Name updated."),m(!1)}catch(o){k.error((o==null?void 0:o.message)||"Could not update name.")}finally{p(!1)}};return e.jsxs("div",{"data-testid":"account-page",children:[e.jsx(M,{icon:Y,title:"Your Account",description:"Who you are on this server."}),e.jsx(y,{label:"Profile photo",children:e.jsx(O,{className:"h-20 w-20",children:e.jsx(U,{className:"text-3xl",children:N.charAt(0).toUpperCase()})})}),e.jsx(y,{label:"Name",action:a?null:e.jsx(h,{variant:"outline",size:"sm",onClick:v,"data-testid":"account-edit-name",children:"Edit"}),children:a?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{value:t,"aria-label":"Name",maxLength:80,placeholder:"Your name",autoFocus:!0,onChange:o=>x(o.target.value),onKeyDown:o=>{o.key==="Enter"&&!d&&w(),o.key==="Escape"&&m(!1)},className:"max-w-xs","data-testid":"account-name-input"}),e.jsx(h,{size:"sm",onClick:w,disabled:d||t.trim()===(l.name??"").trim(),children:d?"Saving...":"Save"}),e.jsx(h,{size:"sm",variant:"ghost",onClick:()=>m(!1),disabled:d,children:"Cancel"})]}):e.jsx("span",{className:"text-muted-foreground",children:((f=l.name)==null?void 0:f.trim())||e.jsx("em",{children:"Not set — your email is shown instead"})})}),e.jsx(y,{label:"Email address",children:e.jsxs("span",{className:"flex items-center gap-2 text-muted-foreground",children:[l.email,c&&e.jsxs(G,{variant:"outline",className:"gap-1 border-blue-200 bg-blue-50 text-blue-700 text-[10px] px-1.5 py-0",children:[e.jsx(J,{className:"h-2.5 w-2.5"}),"Admin"]})]})}),e.jsx(y,{label:"Password",action:e.jsx(h,{variant:"outline",size:"sm",onClick:()=>i(!0),"data-testid":"account-change-password",children:"Change password"}),children:e.jsx("span",{className:"tracking-widest text-muted-foreground","aria-hidden":!0,children:"••••••••••••"})}),e.jsx(W,{open:j,onClose:()=>i(!1)})]})}function y({label:n,action:c,children:u}){return e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-border py-5",children:[e.jsxs("div",{className:"min-w-0 space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",children:n}),e.jsx("div",{className:"text-sm",children:u})]}),c]})}export{V as default};
|