skill-base 2.0.8 → 2.0.10

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.
@@ -79,7 +79,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),gt=fe,je=Ne),Pe===void
79
79
  `)}),U=Ie(()=>{const E=B(_.value);return Array.from({length:E},(x,P)=>P+1).join(`
80
80
  `)});Ht(async()=>{document.title=i("skill.title"),await r.fetchSkill(a.value),await H(),o.value.length>0&&(l.value=o.value[0].version,await te(l.value)),S.value=!1,document.addEventListener("keydown",Y)}),or([()=>L.value,()=>w.value],([E])=>{E&&W.value&&!g.value&&hi(()=>{fS.highlightElement(E)})});async function H(){try{const E=await Rr.list(a.value);o.value=E.versions||[]}catch(E){console.error("Failed to load versions:",E)}}async function q(){l.value&&await te(l.value)}async function te(E){c.value=!0,p.value="",_.value="";try{const x=await fetch(Rr.downloadUrl(a.value,E),{credentials:"include"});if(!x.ok)throw new Error("Failed to download version");const P=await x.arrayBuffer(),A=await(await QR(async()=>{const{default:F}=await Promise.resolve().then(()=>rx);return{default:F}},void 0,import.meta.url)).default.loadAsync(P);d.value=A,u.value=M(A)}catch(x){console.error("Failed to load version zip:",x),u.value=[]}finally{c.value=!1}}function M(E){const x={children:[]};return E.forEach((P,R)=>{if(!P)return;const A=P.split("/").filter(Boolean);let F=x;for(let Q=0;Q<A.length;Q++){const $=A[Q],z=Q===A.length-1,ee=R.dir||!z;let se=F.children.find(ae=>ae.name===$);se||(se={type:ee?"directory":"file",name:$,path:P,...ee?{children:[],isOpen:!1}:{}},F.children.push(se)),ee&&(F=se)}}),G(x.children),x.children}function G(E){E.sort((x,P)=>x.type!==P.type?x.type==="directory"?-1:1:x.name.localeCompare(P.name)),E.forEach(x=>{x.children&&G(x.children)})}async function j(E){if(p.value=E.path,!d.value)return;const x=d.value.file(E.path);if(x)try{const P=await x.async("string");_.value=P,g.value&&(f.value="render")}catch{_.value=""}}function oe(E){E.isOpen=!E.isOpen}function ie(E){f.value=E}function Ee(){l.value&&Z(l.value)}function Z(E){window.open(Rr.downloadUrl(a.value,E),"_blank")}function ne(){if(!s.value){rt.warning(i("skill.infoLoading"));return}if(o.value.length<2){rt.warning(i("skill.needTwoVersions"));return}const E=o.value[1]?.version||"",x=o.value[0]?.version||"",P=`/diff?id=${encodeURIComponent(a.value)}&version_a=${encodeURIComponent(E)}&version_b=${encodeURIComponent(x)}`;window.open(P,"_blank")}async function re(){if(C.value){y.value=!0;try{await r.addCollaborator(a.value,C.value),h.value=!1,C.value="",rt.success(i("collab.addSuccess"))}catch{rt.error(i("collab.addFailed"))}finally{y.value=!1}}}async function _e(E){if(confirm(i("collab.removeConfirm")))try{await r.removeCollaborator(a.value,E),rt.success(i("collab.removeSuccess"))}catch{rt.error(i("collab.removeFailed"))}}async function ge(){if(D.value===String(s.value?.id))try{await r.deleteSkill(a.value),v.value=!1,n.push("/")}catch{rt.error(i("collab.deleteFailed"))}}function k(){O.value=!O.value,document.body.style.overflow=O.value?"hidden":""}function Y(E){E.key==="Escape"&&O.value&&k()}return(E,x)=>{const P=Bn("router-link");return le(),de("div",hA,[m("div",TA,[S.value||J(r).isLoadingDetail?(le(),de("div",vA,[...x[14]||(x[14]=[dr('<div class="cube-loader" data-v-406f7ae2><div class="cube cube-1" data-v-406f7ae2></div><div class="cube cube-2" data-v-406f7ae2></div><div class="cube cube-3" data-v-406f7ae2></div><div class="cube cube-4" data-v-406f7ae2></div></div>',1)])])):s.value?(le(),de(ke,{key:2},[m("div",NA,[x[16]||(x[16]=m("span",{class:"text-neon-400"},"~",-1)),x[17]||(x[17]=m("span",{class:"opacity-50"},"/",-1)),Ue(P,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[he(X(J(i)("skill.breadcrumbHome")),1)]),_:1}),x[18]||(x[18]=m("span",{class:"opacity-50"},"/",-1)),m("span",OA,X(s.value.name),1)]),m("div",AA,[m("div",IA,"ID: "+X(s.value.id.toString().substring(0,8)),1),m("h1",xA,[x[19]||(x[19]=m("span",{class:"text-neon-400 font-mono font-normal opacity-70"},">",-1)),he(" "+X(s.value.name),1)]),m("p",DA,X(s.value.description||J(i)("state.noDesc")),1),m("div",wA,[m("div",LA,[Ye(m("select",{"onUpdate:modelValue":x[0]||(x[0]=R=>l.value=R),onChange:q,class:"w-full appearance-none bg-base-950 border border-base-800 text-white font-mono text-sm rounded-lg px-4 py-2.5 focus:outline-none focus:border-neon-500 focus:ring-1 focus:ring-neon-500 transition-colors cursor-pointer"},[(le(!0),de(ke,null,Rt(o.value,(R,A)=>(le(),de("option",{key:R.id,value:R.version},X(R.version)+" "+X(A===0?J(i)("skill.latestTag"):""),9,MA))),128))],544),[[Ir,l.value]]),x[20]||(x[20]=m("svg",{class:"w-4 h-4 absolute right-4 top-3 pointer-events-none text-base-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 9l-7 7-7-7"})],-1))]),m("div",kA,[m("button",{onClick:ne,class:"flex items-center justify-center gap-2 bg-transparent text-white border border-base-800 hover:bg-base-800 text-sm font-mono px-5 py-2.5 rounded-lg transition-colors w-full sm:w-auto"},[x[21]||(x[21]=m("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})],-1)),he(" "+X(J(i)("skill.compare")),1)]),m("button",{onClick:Ee,class:"flex items-center justify-center gap-2 bg-transparent border border-neon-500 text-neon-400 hover:bg-neon-400/10 text-sm font-mono px-5 py-2.5 rounded-lg transition-colors w-full sm:w-auto shadow-[0_0_15px_rgba(0,255,163,0.1)] hover:shadow-[0_0_20px_rgba(0,255,163,0.2)]"},[x[22]||(x[22]=m("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)),he(" "+X(J(i)("skill.download")),1)])])])]),m("section",PA,[m("div",UA,[x[24]||(x[24]=dr('<div class="px-5 py-3 border-b border-base-800 font-mono text-sm text-base-400 flex items-center gap-2" data-v-406f7ae2><span class="w-2.5 h-2.5 rounded-full bg-base-800" data-v-406f7ae2></span><span class="w-2.5 h-2.5 rounded-full bg-base-800" data-v-406f7ae2></span><span class="w-2.5 h-2.5 rounded-full bg-base-800" data-v-406f7ae2></span><span class="ml-2 text-white/50" data-v-406f7ae2>ls -la</span></div>',1)),m("div",FA,[c.value?(le(),de("div",BA,[...x[23]||(x[23]=[m("div",{class:"spinner spinner-sm"},null,-1)])])):u.value.length===0?(le(),de("div",GA,[m("p",YA,X(J(i)("skill.noFile")),1)])):(le(!0),de(ke,{key:2},Rt(u.value,R=>(le(),Dn(ES,{key:R.path,node:R,"selected-path":p.value,onSelect:j,onToggle:oe},null,8,["node","selected-path"]))),128))])]),m("div",{id:"file-preview-panel",class:Fe(["lg:col-span-3 bg-base-900 border border-base-800 rounded-xl flex flex-col min-h-[400px] max-h-[500px]",{fullscreen:O.value}])},[m("div",qA,[m("div",null,[m("span",null,[x[25]||(x[25]=he("cat ",-1)),m("span",HA,X(p.value||"<file>"),1)])]),m("div",VA,[g.value?(le(),de("div",zA,[m("button",{onClick:x[1]||(x[1]=R=>ie("render")),class:Fe(["md-view-btn",f.value==="render"?"is-active":""])},X(J(i)("skill.htmlPreview")),3),m("button",{onClick:x[2]||(x[2]=R=>ie("source")),class:Fe(["md-view-btn",f.value==="source"?"is-active":""])},X(J(i)("skill.mdSource")),3)])):ze("",!0),m("button",{onClick:k,class:"md-view-btn",title:O.value?J(i)("skill.exitFullscreen"):J(i)("skill.fullscreen")},[O.value?(le(),de("svg",KA,[...x[27]||(x[27]=[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"},null,-1)])])):(le(),de("svg",WA,[...x[26]||(x[26]=[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4"},null,-1)])]))],8,$A)])]),m("div",QA,[_.value?g.value&&f.value==="render"?(le(),de("div",{key:1,class:"markdown-body p-6",innerHTML:T.value},null,8,jA)):g.value&&f.value==="source"?(le(),de("div",JA,[m("div",eI,X(ce.value),1),m("pre",tI,[m("code",null,X(w.value),1)])])):W.value?(le(),de("div",nI,[m("div",rI,X(U.value),1),m("pre",null,[m("code",{ref_key:"codeBlock",ref:L},X(w.value),513)])])):(le(),de("div",iI,[m("p",aI,X(J(i)("skill.binaryFile")),1)])):(le(),de("div",XA,[x[28]||(x[28]=m("div",{class:"flex items-center gap-3 opacity-30 font-mono mb-4"},[m("span",{class:"text-neon-400 animate-pulse"},"_"),m("span",null,"EOF")],-1)),m("p",ZA,X(J(i)("skill.selectFile")),1)]))])],2)]),m("div",sI,[m("div",oI,[m("div",lI,[m("div",cI,[x[29]||(x[29]=m("span",{class:"text-neon-400"},"#",-1)),he(" "+X(J(i)("skill.collaborators")),1)]),J(r).isOwner?(le(),de("button",{key:0,onClick:x[3]||(x[3]=R=>h.value=!0),class:"text-xs text-neon-400 hover:text-white transition-colors"}," + "+X(J(i)("btn.add")),1)):ze("",!0)]),m("div",dI,[m("div",uI,[m("div",_I,[m("span",pI,X((s.value.owner?.username||"U").charAt(0).toUpperCase()),1),m("div",null,[m("div",mI,X(s.value.owner?.name||s.value.owner?.username),1),m("div",gI,X(s.value.owner?.email||""),1)])]),m("span",fI,X(J(i)("collab.owner")),1)]),(le(!0),de(ke,null,Rt(s.value.collaborators,R=>(le(),de("div",{key:R.id,class:"flex items-center justify-between"},[m("div",EI,[m("span",SI,X((R.username||"U").charAt(0).toUpperCase()),1),m("div",null,[m("div",bI,X(R.name||R.username),1),m("div",hI,X(R.email||""),1)])]),m("div",TI,[m("span",vI,X(J(i)("collab.collaborator")),1),J(r).isOwner?(le(),de("button",{key:0,onClick:A=>_e(R.id),class:"p-1.5 text-base-400 hover:text-red-400 transition-colors",title:J(i)("btn.remove")},[...x[30]||(x[30]=[m("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1)])],8,RI)):ze("",!0)])]))),128))]),J(r).isOwner?(le(),de("div",CI,[m("div",yI,[m("button",{onClick:x[4]||(x[4]=R=>v.value=!0),class:"w-full py-2 text-xs font-mono text-red-500 border border-red-500/30 rounded bg-red-500/5 hover:bg-red-500/10 transition-colors"},X(J(i)("skill.deleteSkill")),1)])])):ze("",!0)]),m("div",NI,[m("div",{class:"px-5 py-4 border-b border-base-800 flex items-center justify-between rounded-t-xl cursor-pointer hover:bg-white/5 transition-colors",onClick:x[5]||(x[5]=R=>b.value=!b.value)},[x[32]||(x[32]=m("div",{class:"flex items-center gap-2 font-mono font-semibold text-white text-sm"},[m("span",{class:"text-neon-400"},"git"),he(" log ")],-1)),m("span",{class:Fe(["text-base-400 transition-transform",b.value?"-rotate-90":""])},[...x[31]||(x[31]=[m("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("polyline",{points:"6 9 12 15 18 9"})],-1)])],2)]),b.value?ze("",!0):(le(),de("div",OI,[m("div",AI,[x[34]||(x[34]=m("div",{class:"absolute left-[5px] top-0 bottom-2 w-px bg-base-800"},null,-1)),(le(!0),de(ke,null,Rt(o.value,(R,A)=>(le(),de("div",{key:R.id,class:"relative mb-8 last:mb-0 group cursor-pointer"},[m("span",{class:Fe(["absolute -left-[21px] top-2 w-2.5 h-2.5 rounded-full ring-4 ring-base-900 transition-colors",A===0?"bg-neon-400 shadow-[0_0_8px_rgba(0,255,163,0.8)]":"bg-base-800 group-hover:bg-neon-500"])},null,2),m("div",II,[m("div",xI,[m("div",DI,[m("span",{class:Fe(["text-xs px-2 py-0.5 rounded font-mono border transition-colors",A===0?"text-neon-400 border-neon-500/30 bg-neon-400/5":"text-base-400 border-base-800 group-hover:text-neon-400 group-hover:border-neon-500/30"])},X(R.version),3),A===0?(le(),de("span",wI,"Head")):ze("",!0)]),m("p",{class:Fe(["text-sm font-medium mt-2",A===0?"text-white":"text-base-200"])},X(R.changelog||J(i)("skill.noChangelog")),3),m("p",LI," by @"+X(R.uploader?.name||R.uploader?.username||J(i)("state.unknown")),1)]),m("div",MI,[m("span",{class:"text-xs text-base-400 font-mono whitespace-nowrap text-right",title:J(pR)(R.created_at)},X(J(iS)(R.created_at)),9,kI),m("button",{title:J(i)("skill.download"),class:"flex items-center justify-center p-2 text-base-400 border border-base-800 rounded bg-base-950 hover:text-neon-400 hover:border-neon-500 hover:bg-neon-400/10 hover:shadow-[0_0_10px_rgba(0,255,163,0.15)] transition-all",onClick:F=>Z(R.version)},[...x[33]||(x[33]=[m("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})],-1)])],8,PI)])])]))),128)),o.value.length===0?(le(),de("div",UI,[m("p",FI,X(J(i)("skill.noVersions")),1)])):ze("",!0)])]))])])],64)):(le(),de("div",RA,[x[15]||(x[15]=m("div",{class:"w-20 h-20 mx-auto mb-6 rounded-full bg-base-800 flex items-center justify-center"},[m("svg",{class:"w-10 h-10 text-base-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),m("h3",CA,X(J(i)("skill.notFound")),1),m("p",yA,X(J(i)("skill.notFoundDesc")),1),Ue(P,{to:"/",class:"btn-primary px-6 py-3 rounded-lg"},{default:it(()=>[he(X(J(i)("skill.backToHome")),1)]),_:1})]))]),h.value?(le(),de("div",{key:0,class:"modal",onClick:x[9]||(x[9]=At(R=>h.value=!1,["self"]))},[x[35]||(x[35]=m("div",{class:"modal-overlay"},null,-1)),m("div",BI,[m("div",GI,[m("h3",null,X(J(i)("collab.modal")),1),m("button",{class:"modal-close",onClick:x[6]||(x[6]=R=>h.value=!1)},"×")]),m("div",YI,[m("div",qI,[m("label",null,X(J(i)("collab.usernameLabel")),1),Ye(m("input",{"onUpdate:modelValue":x[7]||(x[7]=R=>C.value=R),type:"text",placeholder:J(i)("collab.usernamePlaceholder"),class:"form-input",onKeyup:cT(re,["enter"])},null,40,HI),[[at,C.value]])])]),m("div",VI,[m("button",{class:"btn btn-secondary",onClick:x[8]||(x[8]=R=>h.value=!1)},X(J(i)("btn.cancel")),1),m("button",{class:"btn btn-primary",onClick:re,disabled:!C.value||y.value},[y.value?(le(),de("span",$I)):ze("",!0),he(" "+X(J(i)("btn.add")),1)],8,zI)])])])):ze("",!0),v.value?(le(),de("div",{key:1,class:"modal",onClick:x[13]||(x[13]=At(R=>v.value=!1,["self"]))},[x[36]||(x[36]=m("div",{class:"modal-overlay"},null,-1)),m("div",WI,[m("div",KI,[m("h3",null,X(J(i)("collab.deleteModal")),1),m("button",{class:"modal-close",onClick:x[10]||(x[10]=R=>v.value=!1)},"×")]),m("div",QI,[m("p",XI,X(J(i)("collab.deleteWarning")),1),m("div",ZI,[m("label",null,X(J(i)("collab.deleteLabel"))+" "+X(s.value?.id),1),Ye(m("input",{"onUpdate:modelValue":x[11]||(x[11]=R=>D.value=R),type:"text",placeholder:"",class:"form-input"},null,512),[[at,D.value]])])]),m("div",jI,[m("button",{class:"btn btn-secondary",onClick:x[12]||(x[12]=R=>v.value=!1)},X(J(i)("btn.cancel")),1),m("button",{class:"btn btn-danger",onClick:ge,disabled:D.value!==String(s.value?.id)},X(J(i)("collab.deleteConfirmBtn")),9,JI)])])])):ze("",!0)])}}}),tx=Tn(ex,[["__scopeId","data-v-406f7ae2"]]);function Pi(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Pc={exports:{}};var lf;function nx(){return lf||(lf=1,(function(t,e){(function(n){t.exports=n()})(function(){return(function n(r,i,a){function s(c,d){if(!i[c]){if(!r[c]){var u=typeof Pi=="function"&&Pi;if(!d&&u)return u(c,!0);if(o)return o(c,!0);var p=new Error("Cannot find module '"+c+"'");throw p.code="MODULE_NOT_FOUND",p}var _=i[c]={exports:{}};r[c][0].call(_.exports,function(f){var g=r[c][1][f];return s(g||f)},_,_.exports,n,r,i,a)}return i[c].exports}for(var o=typeof Pi=="function"&&Pi,l=0;l<a.length;l++)s(a[l]);return s})({1:[function(n,r,i){var a=n("./utils"),s=n("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";i.encode=function(l){for(var c,d,u,p,_,f,g,S=[],b=0,h=l.length,v=h,C=a.getTypeOf(l)!=="string";b<l.length;)v=h-b,u=C?(c=l[b++],d=b<h?l[b++]:0,b<h?l[b++]:0):(c=l.charCodeAt(b++),d=b<h?l.charCodeAt(b++):0,b<h?l.charCodeAt(b++):0),p=c>>2,_=(3&c)<<4|d>>4,f=1<v?(15&d)<<2|u>>6:64,g=2<v?63&u:64,S.push(o.charAt(p)+o.charAt(_)+o.charAt(f)+o.charAt(g));return S.join("")},i.decode=function(l){var c,d,u,p,_,f,g=0,S=0,b="data:";if(l.substr(0,b.length)===b)throw new Error("Invalid base64 input, it looks like a data url.");var h,v=3*(l=l.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(l.charAt(l.length-1)===o.charAt(64)&&v--,l.charAt(l.length-2)===o.charAt(64)&&v--,v%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=s.uint8array?new Uint8Array(0|v):new Array(0|v);g<l.length;)c=o.indexOf(l.charAt(g++))<<2|(p=o.indexOf(l.charAt(g++)))>>4,d=(15&p)<<4|(_=o.indexOf(l.charAt(g++)))>>2,u=(3&_)<<6|(f=o.indexOf(l.charAt(g++))),h[S++]=c,_!==64&&(h[S++]=d),f!==64&&(h[S++]=u);return h}},{"./support":30,"./utils":32}],2:[function(n,r,i){var a=n("./external"),s=n("./stream/DataWorker"),o=n("./stream/Crc32Probe"),l=n("./stream/DataLengthProbe");function c(d,u,p,_,f){this.compressedSize=d,this.uncompressedSize=u,this.crc32=p,this.compression=_,this.compressedContent=f}c.prototype={getContentWorker:function(){var d=new s(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new l("data_length")),u=this;return d.on("end",function(){if(this.streamInfo.data_length!==u.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),d},getCompressedWorker:function(){return new s(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},c.createWorkerFrom=function(d,u,p){return d.pipe(new o).pipe(new l("uncompressedSize")).pipe(u.compressWorker(p)).pipe(new l("compressedSize")).withStreamInfo("compression",u)},r.exports=c},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(n,r,i){var a=n("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},i.DEFLATE=n("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(n,r,i){var a=n("./utils"),s=(function(){for(var o,l=[],c=0;c<256;c++){o=c;for(var d=0;d<8;d++)o=1&o?3988292384^o>>>1:o>>>1;l[c]=o}return l})();r.exports=function(o,l){return o!==void 0&&o.length?a.getTypeOf(o)!=="string"?(function(c,d,u,p){var _=s,f=p+u;c^=-1;for(var g=p;g<f;g++)c=c>>>8^_[255&(c^d[g])];return-1^c})(0|l,o,o.length,0):(function(c,d,u,p){var _=s,f=p+u;c^=-1;for(var g=p;g<f;g++)c=c>>>8^_[255&(c^d.charCodeAt(g))];return-1^c})(0|l,o,o.length,0):0}},{"./utils":32}],5:[function(n,r,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(n,r,i){var a=null;a=typeof Promise<"u"?Promise:n("lie"),r.exports={Promise:a}},{lie:37}],7:[function(n,r,i){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=n("pako"),o=n("./utils"),l=n("./stream/GenericWorker"),c=a?"uint8array":"array";function d(u,p){l.call(this,"FlateWorker/"+u),this._pako=null,this._pakoAction=u,this._pakoOptions=p,this.meta={}}i.magic="\b\0",o.inherits(d,l),d.prototype.processChunk=function(u){this.meta=u.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(c,u.data),!1)},d.prototype.flush=function(){l.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var u=this;this._pako.onData=function(p){u.push({data:p,meta:u.meta})}},i.compressWorker=function(u){return new d("Deflate",u)},i.uncompressWorker=function(){return new d("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(n,r,i){function a(_,f){var g,S="";for(g=0;g<f;g++)S+=String.fromCharCode(255&_),_>>>=8;return S}function s(_,f,g,S,b,h){var v,C,y=_.file,D=_.compression,L=h!==c.utf8encode,O=o.transformTo("string",h(y.name)),N=o.transformTo("string",c.utf8encode(y.name)),B=y.comment,K=o.transformTo("string",h(B)),I=o.transformTo("string",c.utf8encode(B)),W=N.length!==y.name.length,T=I.length!==B.length,w="",ce="",U="",H=y.dir,q=y.date,te={crc32:0,compressedSize:0,uncompressedSize:0};f&&!g||(te.crc32=_.crc32,te.compressedSize=_.compressedSize,te.uncompressedSize=_.uncompressedSize);var M=0;f&&(M|=8),L||!W&&!T||(M|=2048);var G=0,j=0;H&&(G|=16),b==="UNIX"?(j=798,G|=(function(ie,Ee){var Z=ie;return ie||(Z=Ee?16893:33204),(65535&Z)<<16})(y.unixPermissions,H)):(j=20,G|=(function(ie){return 63&(ie||0)})(y.dosPermissions)),v=q.getUTCHours(),v<<=6,v|=q.getUTCMinutes(),v<<=5,v|=q.getUTCSeconds()/2,C=q.getUTCFullYear()-1980,C<<=4,C|=q.getUTCMonth()+1,C<<=5,C|=q.getUTCDate(),W&&(ce=a(1,1)+a(d(O),4)+N,w+="up"+a(ce.length,2)+ce),T&&(U=a(1,1)+a(d(K),4)+I,w+="uc"+a(U.length,2)+U);var oe="";return oe+=`
81
81
  \0`,oe+=a(M,2),oe+=D.magic,oe+=a(v,2),oe+=a(C,2),oe+=a(te.crc32,4),oe+=a(te.compressedSize,4),oe+=a(te.uncompressedSize,4),oe+=a(O.length,2),oe+=a(w.length,2),{fileRecord:u.LOCAL_FILE_HEADER+oe+O+w,dirRecord:u.CENTRAL_FILE_HEADER+a(j,2)+oe+a(K.length,2)+"\0\0\0\0"+a(G,4)+a(S,4)+O+w+K}}var o=n("../utils"),l=n("../stream/GenericWorker"),c=n("../utf8"),d=n("../crc32"),u=n("../signature");function p(_,f,g,S){l.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=f,this.zipPlatform=g,this.encodeFileName=S,this.streamFiles=_,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(p,l),p.prototype.push=function(_){var f=_.meta.percent||0,g=this.entriesCount,S=this._sources.length;this.accumulate?this.contentBuffer.push(_):(this.bytesWritten+=_.data.length,l.prototype.push.call(this,{data:_.data,meta:{currentFile:this.currentFile,percent:g?(f+100*(g-S-1))/g:100}}))},p.prototype.openedSource=function(_){this.currentSourceOffset=this.bytesWritten,this.currentFile=_.file.name;var f=this.streamFiles&&!_.file.dir;if(f){var g=s(_,f,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:g.fileRecord,meta:{percent:0}})}else this.accumulate=!0},p.prototype.closedSource=function(_){this.accumulate=!1;var f=this.streamFiles&&!_.file.dir,g=s(_,f,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(g.dirRecord),f)this.push({data:(function(S){return u.DATA_DESCRIPTOR+a(S.crc32,4)+a(S.compressedSize,4)+a(S.uncompressedSize,4)})(_),meta:{percent:100}});else for(this.push({data:g.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},p.prototype.flush=function(){for(var _=this.bytesWritten,f=0;f<this.dirRecords.length;f++)this.push({data:this.dirRecords[f],meta:{percent:100}});var g=this.bytesWritten-_,S=(function(b,h,v,C,y){var D=o.transformTo("string",y(C));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(b,2)+a(b,2)+a(h,4)+a(v,4)+a(D.length,2)+D})(this.dirRecords.length,g,_,this.zipComment,this.encodeFileName);this.push({data:S,meta:{percent:100}})},p.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},p.prototype.registerPrevious=function(_){this._sources.push(_);var f=this;return _.on("data",function(g){f.processChunk(g)}),_.on("end",function(){f.closedSource(f.previous.streamInfo),f._sources.length?f.prepareNextSource():f.end()}),_.on("error",function(g){f.error(g)}),this},p.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},p.prototype.error=function(_){var f=this._sources;if(!l.prototype.error.call(this,_))return!1;for(var g=0;g<f.length;g++)try{f[g].error(_)}catch{}return!0},p.prototype.lock=function(){l.prototype.lock.call(this);for(var _=this._sources,f=0;f<_.length;f++)_[f].lock()},r.exports=p},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(n,r,i){var a=n("../compressions"),s=n("./ZipFileWorker");i.generateWorker=function(o,l,c){var d=new s(l.streamFiles,c,l.platform,l.encodeFileName),u=0;try{o.forEach(function(p,_){u++;var f=(function(h,v){var C=h||v,y=a[C];if(!y)throw new Error(C+" is not a valid compression method !");return y})(_.options.compression,l.compression),g=_.options.compressionOptions||l.compressionOptions||{},S=_.dir,b=_.date;_._compressWorker(f,g).withStreamInfo("file",{name:p,dir:S,date:b,comment:_.comment||"",unixPermissions:_.unixPermissions,dosPermissions:_.dosPermissions}).pipe(d)}),d.entriesCount=u}catch(p){d.error(p)}return d}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(n,r,i){function a(){if(!(this instanceof a))return new a;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new a;for(var o in this)typeof this[o]!="function"&&(s[o]=this[o]);return s}}(a.prototype=n("./object")).loadAsync=n("./load"),a.support=n("./support"),a.defaults=n("./defaults"),a.version="3.10.1",a.loadAsync=function(s,o){return new a().loadAsync(s,o)},a.external=n("./external"),r.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(n,r,i){var a=n("./utils"),s=n("./external"),o=n("./utf8"),l=n("./zipEntries"),c=n("./stream/Crc32Probe"),d=n("./nodejsUtils");function u(p){return new s.Promise(function(_,f){var g=p.decompressed.getContentWorker().pipe(new c);g.on("error",function(S){f(S)}).on("end",function(){g.streamInfo.crc32!==p.decompressed.crc32?f(new Error("Corrupted zip : CRC32 mismatch")):_()}).resume()})}r.exports=function(p,_){var f=this;return _=a.extend(_||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),d.isNode&&d.isStream(p)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",p,!0,_.optimizedBinaryString,_.base64).then(function(g){var S=new l(_);return S.load(g),S}).then(function(g){var S=[s.Promise.resolve(g)],b=g.files;if(_.checkCRC32)for(var h=0;h<b.length;h++)S.push(u(b[h]));return s.Promise.all(S)}).then(function(g){for(var S=g.shift(),b=S.files,h=0;h<b.length;h++){var v=b[h],C=v.fileNameStr,y=a.resolve(v.fileNameStr);f.file(y,v.decompressed,{binary:!0,optimizedBinaryString:!0,date:v.date,dir:v.dir,comment:v.fileCommentStr.length?v.fileCommentStr:null,unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions,createFolders:_.createFolders}),v.dir||(f.file(y).unsafeOriginalName=C)}return S.zipComment.length&&(f.comment=S.zipComment),f})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(n,r,i){var a=n("../utils"),s=n("../stream/GenericWorker");function o(l,c){s.call(this,"Nodejs stream input adapter for "+l),this._upstreamEnded=!1,this._bindStream(c)}a.inherits(o,s),o.prototype._bindStream=function(l){var c=this;(this._stream=l).pause(),l.on("data",function(d){c.push({data:d,meta:{percent:0}})}).on("error",function(d){c.isPaused?this.generatedError=d:c.error(d)}).on("end",function(){c.isPaused?c._upstreamEnded=!0:c.end()})},o.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},r.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(n,r,i){var a=n("readable-stream").Readable;function s(o,l,c){a.call(this,l),this._helper=o;var d=this;o.on("data",function(u,p){d.push(u)||d._helper.pause(),c&&c(p)}).on("error",function(u){d.emit("error",u)}).on("end",function(){d.push(null)})}n("../utils").inherits(s,a),s.prototype._read=function(){this._helper.resume()},r.exports=s},{"../utils":32,"readable-stream":16}],14:[function(n,r,i){r.exports={isNode:typeof Buffer<"u",newBufferFrom:function(a,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(a,s);if(typeof a=="number")throw new Error('The "data" argument must not be a number');return new Buffer(a,s)},allocBuffer:function(a){if(Buffer.alloc)return Buffer.alloc(a);var s=new Buffer(a);return s.fill(0),s},isBuffer:function(a){return Buffer.isBuffer(a)},isStream:function(a){return a&&typeof a.on=="function"&&typeof a.pause=="function"&&typeof a.resume=="function"}}},{}],15:[function(n,r,i){function a(y,D,L){var O,N=o.getTypeOf(D),B=o.extend(L||{},d);B.date=B.date||new Date,B.compression!==null&&(B.compression=B.compression.toUpperCase()),typeof B.unixPermissions=="string"&&(B.unixPermissions=parseInt(B.unixPermissions,8)),B.unixPermissions&&16384&B.unixPermissions&&(B.dir=!0),B.dosPermissions&&16&B.dosPermissions&&(B.dir=!0),B.dir&&(y=b(y)),B.createFolders&&(O=S(y))&&h.call(this,O,!0);var K=N==="string"&&B.binary===!1&&B.base64===!1;L&&L.binary!==void 0||(B.binary=!K),(D instanceof u&&D.uncompressedSize===0||B.dir||!D||D.length===0)&&(B.base64=!1,B.binary=!0,D="",B.compression="STORE",N="string");var I=null;I=D instanceof u||D instanceof l?D:f.isNode&&f.isStream(D)?new g(y,D):o.prepareContent(y,D,B.binary,B.optimizedBinaryString,B.base64);var W=new p(y,I,B);this.files[y]=W}var s=n("./utf8"),o=n("./utils"),l=n("./stream/GenericWorker"),c=n("./stream/StreamHelper"),d=n("./defaults"),u=n("./compressedObject"),p=n("./zipObject"),_=n("./generate"),f=n("./nodejsUtils"),g=n("./nodejs/NodejsStreamInputAdapter"),S=function(y){y.slice(-1)==="/"&&(y=y.substring(0,y.length-1));var D=y.lastIndexOf("/");return 0<D?y.substring(0,D):""},b=function(y){return y.slice(-1)!=="/"&&(y+="/"),y},h=function(y,D){return D=D!==void 0?D:d.createFolders,y=b(y),this.files[y]||a.call(this,y,null,{dir:!0,createFolders:D}),this.files[y]};function v(y){return Object.prototype.toString.call(y)==="[object RegExp]"}var C={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(y){var D,L,O;for(D in this.files)O=this.files[D],(L=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&y(L,O)},filter:function(y){var D=[];return this.forEach(function(L,O){y(L,O)&&D.push(O)}),D},file:function(y,D,L){if(arguments.length!==1)return y=this.root+y,a.call(this,y,D,L),this;if(v(y)){var O=y;return this.filter(function(B,K){return!K.dir&&O.test(B)})}var N=this.files[this.root+y];return N&&!N.dir?N:null},folder:function(y){if(!y)return this;if(v(y))return this.filter(function(N,B){return B.dir&&y.test(N)});var D=this.root+y,L=h.call(this,D),O=this.clone();return O.root=L.name,O},remove:function(y){y=this.root+y;var D=this.files[y];if(D||(y.slice(-1)!=="/"&&(y+="/"),D=this.files[y]),D&&!D.dir)delete this.files[y];else for(var L=this.filter(function(N,B){return B.name.slice(0,y.length)===y}),O=0;O<L.length;O++)delete this.files[L[O].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(y){var D,L={};try{if((L=o.extend(y||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=L.type.toLowerCase(),L.compression=L.compression.toUpperCase(),L.type==="binarystring"&&(L.type="string"),!L.type)throw new Error("No output type specified.");o.checkSupport(L.type),L.platform!=="darwin"&&L.platform!=="freebsd"&&L.platform!=="linux"&&L.platform!=="sunos"||(L.platform="UNIX"),L.platform==="win32"&&(L.platform="DOS");var O=L.comment||this.comment||"";D=_.generateWorker(this,L,O)}catch(N){(D=new l("error")).error(N)}return new c(D,L.type||"string",L.mimeType)},generateAsync:function(y,D){return this.generateInternalStream(y).accumulate(D)},generateNodeStream:function(y,D){return(y=y||{}).type||(y.type="nodebuffer"),this.generateInternalStream(y).toNodejsStream(D)}};r.exports=C},{"./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(n,r,i){r.exports=n("stream")},{stream:void 0}],17:[function(n,r,i){var a=n("./DataReader");function s(o){a.call(this,o);for(var l=0;l<this.data.length;l++)o[l]=255&o[l]}n("../utils").inherits(s,a),s.prototype.byteAt=function(o){return this.data[this.zero+o]},s.prototype.lastIndexOfSignature=function(o){for(var l=o.charCodeAt(0),c=o.charCodeAt(1),d=o.charCodeAt(2),u=o.charCodeAt(3),p=this.length-4;0<=p;--p)if(this.data[p]===l&&this.data[p+1]===c&&this.data[p+2]===d&&this.data[p+3]===u)return p-this.zero;return-1},s.prototype.readAndCheckSignature=function(o){var l=o.charCodeAt(0),c=o.charCodeAt(1),d=o.charCodeAt(2),u=o.charCodeAt(3),p=this.readData(4);return l===p[0]&&c===p[1]&&d===p[2]&&u===p[3]},s.prototype.readData=function(o){if(this.checkOffset(o),o===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=s},{"../utils":32,"./DataReader":18}],18:[function(n,r,i){var a=n("../utils");function s(o){this.data=o,this.length=o.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(o){this.checkIndex(this.index+o)},checkIndex:function(o){if(this.length<this.zero+o||o<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+o+"). Corrupted zip ?")},setIndex:function(o){this.checkIndex(o),this.index=o},skip:function(o){this.setIndex(this.index+o)},byteAt:function(){},readInt:function(o){var l,c=0;for(this.checkOffset(o),l=this.index+o-1;l>=this.index;l--)c=(c<<8)+this.byteAt(l);return this.index+=o,c},readString:function(o){return a.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},r.exports=s},{"../utils":32}],19:[function(n,r,i){var a=n("./Uint8ArrayReader");function s(o){a.call(this,o)}n("../utils").inherits(s,a),s.prototype.readData=function(o){this.checkOffset(o);var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(n,r,i){var a=n("./DataReader");function s(o){a.call(this,o)}n("../utils").inherits(s,a),s.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},s.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},s.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},s.prototype.readData=function(o){this.checkOffset(o);var l=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=s},{"../utils":32,"./DataReader":18}],21:[function(n,r,i){var a=n("./ArrayReader");function s(o){a.call(this,o)}n("../utils").inherits(s,a),s.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,l},r.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(n,r,i){var a=n("../utils"),s=n("../support"),o=n("./ArrayReader"),l=n("./StringReader"),c=n("./NodeBufferReader"),d=n("./Uint8ArrayReader");r.exports=function(u){var p=a.getTypeOf(u);return a.checkSupport(p),p!=="string"||s.uint8array?p==="nodebuffer"?new c(u):s.uint8array?new d(a.transformTo("uint8array",u)):new o(a.transformTo("array",u)):new l(u)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(n,r,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(n,r,i){var a=n("./GenericWorker"),s=n("../utils");function o(l){a.call(this,"ConvertWorker to "+l),this.destType=l}s.inherits(o,a),o.prototype.processChunk=function(l){this.push({data:s.transformTo(this.destType,l.data),meta:l.meta})},r.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(n,r,i){var a=n("./GenericWorker"),s=n("../crc32");function o(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n("../utils").inherits(o,a),o.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},r.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(n,r,i){var a=n("../utils"),s=n("./GenericWorker");function o(l){s.call(this,"DataLengthProbe for "+l),this.propName=l,this.withStreamInfo(l,0)}a.inherits(o,s),o.prototype.processChunk=function(l){if(l){var c=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=c+l.data.length}s.prototype.processChunk.call(this,l)},r.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(n,r,i){var a=n("../utils"),s=n("./GenericWorker");function o(l){s.call(this,"DataWorker");var c=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(d){c.dataIsReady=!0,c.data=d,c.max=d&&d.length||0,c.type=a.getTypeOf(d),c.isPaused||c._tickAndRepeat()},function(d){c.error(d)})}a.inherits(o,s),o.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=null,c=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":l=this.data.substring(this.index,c);break;case"uint8array":l=this.data.subarray(this.index,c);break;case"array":case"nodebuffer":l=this.data.slice(this.index,c)}return this.index=c,this.push({data:l,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(n,r,i){function a(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}a.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,o){return this._listeners[s].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,o){if(this._listeners[s])for(var l=0;l<this._listeners[s].length;l++)this._listeners[s][l].call(this,o)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var o=this;return s.on("data",function(l){o.processChunk(l)}),s.on("end",function(){o.end()}),s.on("error",function(l){o.error(l)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,o){return this.extraStreamInfo[s]=o,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},r.exports=a},{}],29:[function(n,r,i){var a=n("../utils"),s=n("./ConvertWorker"),o=n("./GenericWorker"),l=n("../base64"),c=n("../support"),d=n("../external"),u=null;if(c.nodestream)try{u=n("../nodejs/NodejsStreamOutputAdapter")}catch{}function p(f,g){return new d.Promise(function(S,b){var h=[],v=f._internalType,C=f._outputType,y=f._mimeType;f.on("data",function(D,L){h.push(D),g&&g(L)}).on("error",function(D){h=[],b(D)}).on("end",function(){try{var D=(function(L,O,N){switch(L){case"blob":return a.newBlob(a.transformTo("arraybuffer",O),N);case"base64":return l.encode(O);default:return a.transformTo(L,O)}})(C,(function(L,O){var N,B=0,K=null,I=0;for(N=0;N<O.length;N++)I+=O[N].length;switch(L){case"string":return O.join("");case"array":return Array.prototype.concat.apply([],O);case"uint8array":for(K=new Uint8Array(I),N=0;N<O.length;N++)K.set(O[N],B),B+=O[N].length;return K;case"nodebuffer":return Buffer.concat(O);default:throw new Error("concat : unsupported type '"+L+"'")}})(v,h),y);S(D)}catch(L){b(L)}h=[]}).resume()})}function _(f,g,S){var b=g;switch(g){case"blob":case"arraybuffer":b="uint8array";break;case"base64":b="string"}try{this._internalType=b,this._outputType=g,this._mimeType=S,a.checkSupport(b),this._worker=f.pipe(new s(b)),f.lock()}catch(h){this._worker=new o("error"),this._worker.error(h)}}_.prototype={accumulate:function(f){return p(this,f)},on:function(f,g){var S=this;return f==="data"?this._worker.on(f,function(b){g.call(S,b.data,b.meta)}):this._worker.on(f,function(){a.delay(g,arguments,S)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(f){if(a.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:this._outputType!=="nodebuffer"},f)}},r.exports=_},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(n,r,i){if(i.base64=!0,i.array=!0,i.string=!0,i.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",i.nodebuffer=typeof Buffer<"u",i.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")i.blob=!1;else{var a=new ArrayBuffer(0);try{i.blob=new Blob([a],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(a),i.blob=s.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!n("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(n,r,i){for(var a=n("./utils"),s=n("./support"),o=n("./nodejsUtils"),l=n("./stream/GenericWorker"),c=new Array(256),d=0;d<256;d++)c[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;c[254]=c[254]=1;function u(){l.call(this,"utf-8 decode"),this.leftOver=null}function p(){l.call(this,"utf-8 encode")}i.utf8encode=function(_){return s.nodebuffer?o.newBufferFrom(_,"utf-8"):(function(f){var g,S,b,h,v,C=f.length,y=0;for(h=0;h<C;h++)(64512&(S=f.charCodeAt(h)))==55296&&h+1<C&&(64512&(b=f.charCodeAt(h+1)))==56320&&(S=65536+(S-55296<<10)+(b-56320),h++),y+=S<128?1:S<2048?2:S<65536?3:4;for(g=s.uint8array?new Uint8Array(y):new Array(y),h=v=0;v<y;h++)(64512&(S=f.charCodeAt(h)))==55296&&h+1<C&&(64512&(b=f.charCodeAt(h+1)))==56320&&(S=65536+(S-55296<<10)+(b-56320),h++),S<128?g[v++]=S:(S<2048?g[v++]=192|S>>>6:(S<65536?g[v++]=224|S>>>12:(g[v++]=240|S>>>18,g[v++]=128|S>>>12&63),g[v++]=128|S>>>6&63),g[v++]=128|63&S);return g})(_)},i.utf8decode=function(_){return s.nodebuffer?a.transformTo("nodebuffer",_).toString("utf-8"):(function(f){var g,S,b,h,v=f.length,C=new Array(2*v);for(g=S=0;g<v;)if((b=f[g++])<128)C[S++]=b;else if(4<(h=c[b]))C[S++]=65533,g+=h-1;else{for(b&=h===2?31:h===3?15:7;1<h&&g<v;)b=b<<6|63&f[g++],h--;1<h?C[S++]=65533:b<65536?C[S++]=b:(b-=65536,C[S++]=55296|b>>10&1023,C[S++]=56320|1023&b)}return C.length!==S&&(C.subarray?C=C.subarray(0,S):C.length=S),a.applyFromCharCode(C)})(_=a.transformTo(s.uint8array?"uint8array":"array",_))},a.inherits(u,l),u.prototype.processChunk=function(_){var f=a.transformTo(s.uint8array?"uint8array":"array",_.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var g=f;(f=new Uint8Array(g.length+this.leftOver.length)).set(this.leftOver,0),f.set(g,this.leftOver.length)}else f=this.leftOver.concat(f);this.leftOver=null}var S=(function(h,v){var C;for((v=v||h.length)>h.length&&(v=h.length),C=v-1;0<=C&&(192&h[C])==128;)C--;return C<0||C===0?v:C+c[h[C]]>v?C:v})(f),b=f;S!==f.length&&(s.uint8array?(b=f.subarray(0,S),this.leftOver=f.subarray(S,f.length)):(b=f.slice(0,S),this.leftOver=f.slice(S,f.length))),this.push({data:i.utf8decode(b),meta:_.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=u,a.inherits(p,l),p.prototype.processChunk=function(_){this.push({data:i.utf8encode(_.data),meta:_.meta})},i.Utf8EncodeWorker=p},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(n,r,i){var a=n("./support"),s=n("./base64"),o=n("./nodejsUtils"),l=n("./external");function c(g){return g}function d(g,S){for(var b=0;b<g.length;++b)S[b]=255&g.charCodeAt(b);return S}n("setimmediate"),i.newBlob=function(g,S){i.checkSupport("blob");try{return new Blob([g],{type:S})}catch{try{var b=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return b.append(g),b.getBlob(S)}catch{throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(g,S,b){var h=[],v=0,C=g.length;if(C<=b)return String.fromCharCode.apply(null,g);for(;v<C;)S==="array"||S==="nodebuffer"?h.push(String.fromCharCode.apply(null,g.slice(v,Math.min(v+b,C)))):h.push(String.fromCharCode.apply(null,g.subarray(v,Math.min(v+b,C)))),v+=b;return h.join("")},stringifyByChar:function(g){for(var S="",b=0;b<g.length;b++)S+=String.fromCharCode(g[b]);return S},applyCanBeUsed:{uint8array:(function(){try{return a.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return a.nodebuffer&&String.fromCharCode.apply(null,o.allocBuffer(1)).length===1}catch{return!1}})()}};function p(g){var S=65536,b=i.getTypeOf(g),h=!0;if(b==="uint8array"?h=u.applyCanBeUsed.uint8array:b==="nodebuffer"&&(h=u.applyCanBeUsed.nodebuffer),h)for(;1<S;)try{return u.stringifyByChunk(g,b,S)}catch{S=Math.floor(S/2)}return u.stringifyByChar(g)}function _(g,S){for(var b=0;b<g.length;b++)S[b]=g[b];return S}i.applyFromCharCode=p;var f={};f.string={string:c,array:function(g){return d(g,new Array(g.length))},arraybuffer:function(g){return f.string.uint8array(g).buffer},uint8array:function(g){return d(g,new Uint8Array(g.length))},nodebuffer:function(g){return d(g,o.allocBuffer(g.length))}},f.array={string:p,array:c,arraybuffer:function(g){return new Uint8Array(g).buffer},uint8array:function(g){return new Uint8Array(g)},nodebuffer:function(g){return o.newBufferFrom(g)}},f.arraybuffer={string:function(g){return p(new Uint8Array(g))},array:function(g){return _(new Uint8Array(g),new Array(g.byteLength))},arraybuffer:c,uint8array:function(g){return new Uint8Array(g)},nodebuffer:function(g){return o.newBufferFrom(new Uint8Array(g))}},f.uint8array={string:p,array:function(g){return _(g,new Array(g.length))},arraybuffer:function(g){return g.buffer},uint8array:c,nodebuffer:function(g){return o.newBufferFrom(g)}},f.nodebuffer={string:p,array:function(g){return _(g,new Array(g.length))},arraybuffer:function(g){return f.nodebuffer.uint8array(g).buffer},uint8array:function(g){return _(g,new Uint8Array(g.length))},nodebuffer:c},i.transformTo=function(g,S){if(S=S||"",!g)return S;i.checkSupport(g);var b=i.getTypeOf(S);return f[b][g](S)},i.resolve=function(g){for(var S=g.split("/"),b=[],h=0;h<S.length;h++){var v=S[h];v==="."||v===""&&h!==0&&h!==S.length-1||(v===".."?b.pop():b.push(v))}return b.join("/")},i.getTypeOf=function(g){return typeof g=="string"?"string":Object.prototype.toString.call(g)==="[object Array]"?"array":a.nodebuffer&&o.isBuffer(g)?"nodebuffer":a.uint8array&&g instanceof Uint8Array?"uint8array":a.arraybuffer&&g instanceof ArrayBuffer?"arraybuffer":void 0},i.checkSupport=function(g){if(!a[g.toLowerCase()])throw new Error(g+" is not supported by this platform")},i.MAX_VALUE_16BITS=65535,i.MAX_VALUE_32BITS=-1,i.pretty=function(g){var S,b,h="";for(b=0;b<(g||"").length;b++)h+="\\x"+((S=g.charCodeAt(b))<16?"0":"")+S.toString(16).toUpperCase();return h},i.delay=function(g,S,b){setImmediate(function(){g.apply(b||null,S||[])})},i.inherits=function(g,S){function b(){}b.prototype=S.prototype,g.prototype=new b},i.extend=function(){var g,S,b={};for(g=0;g<arguments.length;g++)for(S in arguments[g])Object.prototype.hasOwnProperty.call(arguments[g],S)&&b[S]===void 0&&(b[S]=arguments[g][S]);return b},i.prepareContent=function(g,S,b,h,v){return l.Promise.resolve(S).then(function(C){return a.blob&&(C instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(C))!==-1)&&typeof FileReader<"u"?new l.Promise(function(y,D){var L=new FileReader;L.onload=function(O){y(O.target.result)},L.onerror=function(O){D(O.target.error)},L.readAsArrayBuffer(C)}):C}).then(function(C){var y=i.getTypeOf(C);return y?(y==="arraybuffer"?C=i.transformTo("uint8array",C):y==="string"&&(v?C=s.decode(C):b&&h!==!0&&(C=(function(D){return d(D,a.uint8array?new Uint8Array(D.length):new Array(D.length))})(C))),C):l.Promise.reject(new Error("Can't read the data of '"+g+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(n,r,i){var a=n("./reader/readerFor"),s=n("./utils"),o=n("./signature"),l=n("./zipEntry"),c=n("./support");function d(u){this.files=[],this.loadOptions=u}d.prototype={checkSignature:function(u){if(!this.reader.readAndCheckSignature(u)){this.reader.index-=4;var p=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(p)+", expected "+s.pretty(u)+")")}},isSignature:function(u,p){var _=this.reader.index;this.reader.setIndex(u);var f=this.reader.readString(4)===p;return this.reader.setIndex(_),f},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 u=this.reader.readData(this.zipCommentLength),p=c.uint8array?"uint8array":"array",_=s.transformTo(p,u);this.zipComment=this.loadOptions.decodeFileName(_)},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 u,p,_,f=this.zip64EndOfCentralSize-44;0<f;)u=this.reader.readInt(2),p=this.reader.readInt(4),_=this.reader.readData(p),this.zip64ExtensibleData[u]={id:u,length:p,value:_}},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 u,p;for(u=0;u<this.files.length;u++)p=this.files[u],this.reader.setIndex(p.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),p.readLocalPart(this.reader),p.handleUTF8(),p.processAttributes()},readCentralDir:function(){var u;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(u=new l({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(u);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 u=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(u<0)throw this.isSignature(0,o.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(u);var p=u;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(u=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(u),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.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(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var _=this.centralDirOffset+this.centralDirSize;this.zip64&&(_+=20,_+=12+this.zip64EndOfCentralSize);var f=p-_;if(0<f)this.isSignature(p,o.CENTRAL_FILE_HEADER)||(this.reader.zero=f);else if(f<0)throw new Error("Corrupted zip: missing "+Math.abs(f)+" bytes.")},prepareReader:function(u){this.reader=a(u)},load:function(u){this.prepareReader(u),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},r.exports=d},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(n,r,i){var a=n("./reader/readerFor"),s=n("./utils"),o=n("./compressedObject"),l=n("./crc32"),c=n("./utf8"),d=n("./compressions"),u=n("./support");function p(_,f){this.options=_,this.loadOptions=f}p.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(_){var f,g;if(_.skip(22),this.fileNameLength=_.readInt(2),g=_.readInt(2),this.fileName=_.readData(this.fileNameLength),_.skip(g),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((f=(function(S){for(var b in d)if(Object.prototype.hasOwnProperty.call(d,b)&&d[b].magic===S)return d[b];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,f,_.readData(this.compressedSize))},readCentralPart:function(_){this.versionMadeBy=_.readInt(2),_.skip(2),this.bitFlag=_.readInt(2),this.compressionMethod=_.readString(2),this.date=_.readDate(),this.crc32=_.readInt(4),this.compressedSize=_.readInt(4),this.uncompressedSize=_.readInt(4);var f=_.readInt(2);if(this.extraFieldsLength=_.readInt(2),this.fileCommentLength=_.readInt(2),this.diskNumberStart=_.readInt(2),this.internalFileAttributes=_.readInt(2),this.externalFileAttributes=_.readInt(4),this.localHeaderOffset=_.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");_.skip(f),this.readExtraFields(_),this.parseZIP64ExtraField(_),this.fileComment=_.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var _=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),_==0&&(this.dosPermissions=63&this.externalFileAttributes),_==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var _=a(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=_.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=_.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=_.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=_.readInt(4))}},readExtraFields:function(_){var f,g,S,b=_.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});_.index+4<b;)f=_.readInt(2),g=_.readInt(2),S=_.readData(g),this.extraFields[f]={id:f,length:g,value:S};_.setIndex(b)},handleUTF8:function(){var _=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=c.utf8decode(this.fileName),this.fileCommentStr=c.utf8decode(this.fileComment);else{var f=this.findExtraFieldUnicodePath();if(f!==null)this.fileNameStr=f;else{var g=s.transformTo(_,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(g)}var S=this.findExtraFieldUnicodeComment();if(S!==null)this.fileCommentStr=S;else{var b=s.transformTo(_,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(b)}}},findExtraFieldUnicodePath:function(){var _=this.extraFields[28789];if(_){var f=a(_.value);return f.readInt(1)!==1||l(this.fileName)!==f.readInt(4)?null:c.utf8decode(f.readData(_.length-5))}return null},findExtraFieldUnicodeComment:function(){var _=this.extraFields[25461];if(_){var f=a(_.value);return f.readInt(1)!==1||l(this.fileComment)!==f.readInt(4)?null:c.utf8decode(f.readData(_.length-5))}return null}},r.exports=p},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(n,r,i){function a(f,g,S){this.name=f,this.dir=S.dir,this.date=S.date,this.comment=S.comment,this.unixPermissions=S.unixPermissions,this.dosPermissions=S.dosPermissions,this._data=g,this._dataBinary=S.binary,this.options={compression:S.compression,compressionOptions:S.compressionOptions}}var s=n("./stream/StreamHelper"),o=n("./stream/DataWorker"),l=n("./utf8"),c=n("./compressedObject"),d=n("./stream/GenericWorker");a.prototype={internalStream:function(f){var g=null,S="string";try{if(!f)throw new Error("No output type specified.");var b=(S=f.toLowerCase())==="string"||S==="text";S!=="binarystring"&&S!=="text"||(S="string"),g=this._decompressWorker();var h=!this._dataBinary;h&&!b&&(g=g.pipe(new l.Utf8EncodeWorker)),!h&&b&&(g=g.pipe(new l.Utf8DecodeWorker))}catch(v){(g=new d("error")).error(v)}return new s(g,S,"")},async:function(f,g){return this.internalStream(f).accumulate(g)},nodeStream:function(f,g){return this.internalStream(f||"nodebuffer").toNodejsStream(g)},_compressWorker:function(f,g){if(this._data instanceof c&&this._data.compression.magic===f.magic)return this._data.getCompressedWorker();var S=this._decompressWorker();return this._dataBinary||(S=S.pipe(new l.Utf8EncodeWorker)),c.createWorkerFrom(S,f,g)},_decompressWorker:function(){return this._data instanceof c?this._data.getContentWorker():this._data instanceof d?this._data:new o(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],p=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},_=0;_<u.length;_++)a.prototype[u[_]]=p;r.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(n,r,i){(function(a){var s,o,l=a.MutationObserver||a.WebKitMutationObserver;if(l){var c=0,d=new l(f),u=a.document.createTextNode("");d.observe(u,{characterData:!0}),s=function(){u.data=c=++c%2}}else if(a.setImmediate||a.MessageChannel===void 0)s="document"in a&&"onreadystatechange"in a.document.createElement("script")?function(){var g=a.document.createElement("script");g.onreadystatechange=function(){f(),g.onreadystatechange=null,g.parentNode.removeChild(g),g=null},a.document.documentElement.appendChild(g)}:function(){setTimeout(f,0)};else{var p=new a.MessageChannel;p.port1.onmessage=f,s=function(){p.port2.postMessage(0)}}var _=[];function f(){var g,S;o=!0;for(var b=_.length;b;){for(S=_,_=[],g=-1;++g<b;)S[g]();b=_.length}o=!1}r.exports=function(g){_.push(g)!==1||o||s()}}).call(this,typeof ki<"u"?ki:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(n,r,i){var a=n("immediate");function s(){}var o={},l=["REJECTED"],c=["FULFILLED"],d=["PENDING"];function u(b){if(typeof b!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,b!==s&&g(this,b)}function p(b,h,v){this.promise=b,typeof h=="function"&&(this.onFulfilled=h,this.callFulfilled=this.otherCallFulfilled),typeof v=="function"&&(this.onRejected=v,this.callRejected=this.otherCallRejected)}function _(b,h,v){a(function(){var C;try{C=h(v)}catch(y){return o.reject(b,y)}C===b?o.reject(b,new TypeError("Cannot resolve promise with itself")):o.resolve(b,C)})}function f(b){var h=b&&b.then;if(b&&(typeof b=="object"||typeof b=="function")&&typeof h=="function")return function(){h.apply(b,arguments)}}function g(b,h){var v=!1;function C(L){v||(v=!0,o.reject(b,L))}function y(L){v||(v=!0,o.resolve(b,L))}var D=S(function(){h(y,C)});D.status==="error"&&C(D.value)}function S(b,h){var v={};try{v.value=b(h),v.status="success"}catch(C){v.status="error",v.value=C}return v}(r.exports=u).prototype.finally=function(b){if(typeof b!="function")return this;var h=this.constructor;return this.then(function(v){return h.resolve(b()).then(function(){return v})},function(v){return h.resolve(b()).then(function(){throw v})})},u.prototype.catch=function(b){return this.then(null,b)},u.prototype.then=function(b,h){if(typeof b!="function"&&this.state===c||typeof h!="function"&&this.state===l)return this;var v=new this.constructor(s);return this.state!==d?_(v,this.state===c?b:h,this.outcome):this.queue.push(new p(v,b,h)),v},p.prototype.callFulfilled=function(b){o.resolve(this.promise,b)},p.prototype.otherCallFulfilled=function(b){_(this.promise,this.onFulfilled,b)},p.prototype.callRejected=function(b){o.reject(this.promise,b)},p.prototype.otherCallRejected=function(b){_(this.promise,this.onRejected,b)},o.resolve=function(b,h){var v=S(f,h);if(v.status==="error")return o.reject(b,v.value);var C=v.value;if(C)g(b,C);else{b.state=c,b.outcome=h;for(var y=-1,D=b.queue.length;++y<D;)b.queue[y].callFulfilled(h)}return b},o.reject=function(b,h){b.state=l,b.outcome=h;for(var v=-1,C=b.queue.length;++v<C;)b.queue[v].callRejected(h);return b},u.resolve=function(b){return b instanceof this?b:o.resolve(new this(s),b)},u.reject=function(b){var h=new this(s);return o.reject(h,b)},u.all=function(b){var h=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=b.length,C=!1;if(!v)return this.resolve([]);for(var y=new Array(v),D=0,L=-1,O=new this(s);++L<v;)N(b[L],L);return O;function N(B,K){h.resolve(B).then(function(I){y[K]=I,++D!==v||C||(C=!0,o.resolve(O,y))},function(I){C||(C=!0,o.reject(O,I))})}},u.race=function(b){var h=this;if(Object.prototype.toString.call(b)!=="[object Array]")return this.reject(new TypeError("must be an array"));var v=b.length,C=!1;if(!v)return this.resolve([]);for(var y=-1,D=new this(s);++y<v;)L=b[y],h.resolve(L).then(function(O){C||(C=!0,o.resolve(D,O))},function(O){C||(C=!0,o.reject(D,O))});var L;return D}},{immediate:36}],38:[function(n,r,i){var a={};(0,n("./lib/utils/common").assign)(a,n("./lib/deflate"),n("./lib/inflate"),n("./lib/zlib/constants")),r.exports=a},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(n,r,i){var a=n("./zlib/deflate"),s=n("./utils/common"),o=n("./utils/strings"),l=n("./zlib/messages"),c=n("./zlib/zstream"),d=Object.prototype.toString,u=0,p=-1,_=0,f=8;function g(b){if(!(this instanceof g))return new g(b);this.options=s.assign({level:p,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:_,to:""},b||{});var h=this.options;h.raw&&0<h.windowBits?h.windowBits=-h.windowBits:h.gzip&&0<h.windowBits&&h.windowBits<16&&(h.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var v=a.deflateInit2(this.strm,h.level,h.method,h.windowBits,h.memLevel,h.strategy);if(v!==u)throw new Error(l[v]);if(h.header&&a.deflateSetHeader(this.strm,h.header),h.dictionary){var C;if(C=typeof h.dictionary=="string"?o.string2buf(h.dictionary):d.call(h.dictionary)==="[object ArrayBuffer]"?new Uint8Array(h.dictionary):h.dictionary,(v=a.deflateSetDictionary(this.strm,C))!==u)throw new Error(l[v]);this._dict_set=!0}}function S(b,h){var v=new g(h);if(v.push(b,!0),v.err)throw v.msg||l[v.err];return v.result}g.prototype.push=function(b,h){var v,C,y=this.strm,D=this.options.chunkSize;if(this.ended)return!1;C=h===~~h?h:h===!0?4:0,typeof b=="string"?y.input=o.string2buf(b):d.call(b)==="[object ArrayBuffer]"?y.input=new Uint8Array(b):y.input=b,y.next_in=0,y.avail_in=y.input.length;do{if(y.avail_out===0&&(y.output=new s.Buf8(D),y.next_out=0,y.avail_out=D),(v=a.deflate(y,C))!==1&&v!==u)return this.onEnd(v),!(this.ended=!0);y.avail_out!==0&&(y.avail_in!==0||C!==4&&C!==2)||(this.options.to==="string"?this.onData(o.buf2binstring(s.shrinkBuf(y.output,y.next_out))):this.onData(s.shrinkBuf(y.output,y.next_out)))}while((0<y.avail_in||y.avail_out===0)&&v!==1);return C===4?(v=a.deflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===u):C!==2||(this.onEnd(u),!(y.avail_out=0))},g.prototype.onData=function(b){this.chunks.push(b)},g.prototype.onEnd=function(b){b===u&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=b,this.msg=this.strm.msg},i.Deflate=g,i.deflate=S,i.deflateRaw=function(b,h){return(h=h||{}).raw=!0,S(b,h)},i.gzip=function(b,h){return(h=h||{}).gzip=!0,S(b,h)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(n,r,i){var a=n("./zlib/inflate"),s=n("./utils/common"),o=n("./utils/strings"),l=n("./zlib/constants"),c=n("./zlib/messages"),d=n("./zlib/zstream"),u=n("./zlib/gzheader"),p=Object.prototype.toString;function _(g){if(!(this instanceof _))return new _(g);this.options=s.assign({chunkSize:16384,windowBits:0,to:""},g||{});var S=this.options;S.raw&&0<=S.windowBits&&S.windowBits<16&&(S.windowBits=-S.windowBits,S.windowBits===0&&(S.windowBits=-15)),!(0<=S.windowBits&&S.windowBits<16)||g&&g.windowBits||(S.windowBits+=32),15<S.windowBits&&S.windowBits<48&&(15&S.windowBits)==0&&(S.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var b=a.inflateInit2(this.strm,S.windowBits);if(b!==l.Z_OK)throw new Error(c[b]);this.header=new u,a.inflateGetHeader(this.strm,this.header)}function f(g,S){var b=new _(S);if(b.push(g,!0),b.err)throw b.msg||c[b.err];return b.result}_.prototype.push=function(g,S){var b,h,v,C,y,D,L=this.strm,O=this.options.chunkSize,N=this.options.dictionary,B=!1;if(this.ended)return!1;h=S===~~S?S:S===!0?l.Z_FINISH:l.Z_NO_FLUSH,typeof g=="string"?L.input=o.binstring2buf(g):p.call(g)==="[object ArrayBuffer]"?L.input=new Uint8Array(g):L.input=g,L.next_in=0,L.avail_in=L.input.length;do{if(L.avail_out===0&&(L.output=new s.Buf8(O),L.next_out=0,L.avail_out=O),(b=a.inflate(L,l.Z_NO_FLUSH))===l.Z_NEED_DICT&&N&&(D=typeof N=="string"?o.string2buf(N):p.call(N)==="[object ArrayBuffer]"?new Uint8Array(N):N,b=a.inflateSetDictionary(this.strm,D)),b===l.Z_BUF_ERROR&&B===!0&&(b=l.Z_OK,B=!1),b!==l.Z_STREAM_END&&b!==l.Z_OK)return this.onEnd(b),!(this.ended=!0);L.next_out&&(L.avail_out!==0&&b!==l.Z_STREAM_END&&(L.avail_in!==0||h!==l.Z_FINISH&&h!==l.Z_SYNC_FLUSH)||(this.options.to==="string"?(v=o.utf8border(L.output,L.next_out),C=L.next_out-v,y=o.buf2string(L.output,v),L.next_out=C,L.avail_out=O-C,C&&s.arraySet(L.output,L.output,v,C,0),this.onData(y)):this.onData(s.shrinkBuf(L.output,L.next_out)))),L.avail_in===0&&L.avail_out===0&&(B=!0)}while((0<L.avail_in||L.avail_out===0)&&b!==l.Z_STREAM_END);return b===l.Z_STREAM_END&&(h=l.Z_FINISH),h===l.Z_FINISH?(b=a.inflateEnd(this.strm),this.onEnd(b),this.ended=!0,b===l.Z_OK):h!==l.Z_SYNC_FLUSH||(this.onEnd(l.Z_OK),!(L.avail_out=0))},_.prototype.onData=function(g){this.chunks.push(g)},_.prototype.onEnd=function(g){g===l.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=s.flattenChunks(this.chunks)),this.chunks=[],this.err=g,this.msg=this.strm.msg},i.Inflate=_,i.inflate=f,i.inflateRaw=function(g,S){return(S=S||{}).raw=!0,f(g,S)},i.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(n,r,i){var a=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";i.assign=function(l){for(var c=Array.prototype.slice.call(arguments,1);c.length;){var d=c.shift();if(d){if(typeof d!="object")throw new TypeError(d+"must be non-object");for(var u in d)d.hasOwnProperty(u)&&(l[u]=d[u])}}return l},i.shrinkBuf=function(l,c){return l.length===c?l:l.subarray?l.subarray(0,c):(l.length=c,l)};var s={arraySet:function(l,c,d,u,p){if(c.subarray&&l.subarray)l.set(c.subarray(d,d+u),p);else for(var _=0;_<u;_++)l[p+_]=c[d+_]},flattenChunks:function(l){var c,d,u,p,_,f;for(c=u=0,d=l.length;c<d;c++)u+=l[c].length;for(f=new Uint8Array(u),c=p=0,d=l.length;c<d;c++)_=l[c],f.set(_,p),p+=_.length;return f}},o={arraySet:function(l,c,d,u,p){for(var _=0;_<u;_++)l[p+_]=c[d+_]},flattenChunks:function(l){return[].concat.apply([],l)}};i.setTyped=function(l){l?(i.Buf8=Uint8Array,i.Buf16=Uint16Array,i.Buf32=Int32Array,i.assign(i,s)):(i.Buf8=Array,i.Buf16=Array,i.Buf32=Array,i.assign(i,o))},i.setTyped(a)},{}],42:[function(n,r,i){var a=n("./common"),s=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch{s=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{o=!1}for(var l=new a.Buf8(256),c=0;c<256;c++)l[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function d(u,p){if(p<65537&&(u.subarray&&o||!u.subarray&&s))return String.fromCharCode.apply(null,a.shrinkBuf(u,p));for(var _="",f=0;f<p;f++)_+=String.fromCharCode(u[f]);return _}l[254]=l[254]=1,i.string2buf=function(u){var p,_,f,g,S,b=u.length,h=0;for(g=0;g<b;g++)(64512&(_=u.charCodeAt(g)))==55296&&g+1<b&&(64512&(f=u.charCodeAt(g+1)))==56320&&(_=65536+(_-55296<<10)+(f-56320),g++),h+=_<128?1:_<2048?2:_<65536?3:4;for(p=new a.Buf8(h),g=S=0;S<h;g++)(64512&(_=u.charCodeAt(g)))==55296&&g+1<b&&(64512&(f=u.charCodeAt(g+1)))==56320&&(_=65536+(_-55296<<10)+(f-56320),g++),_<128?p[S++]=_:(_<2048?p[S++]=192|_>>>6:(_<65536?p[S++]=224|_>>>12:(p[S++]=240|_>>>18,p[S++]=128|_>>>12&63),p[S++]=128|_>>>6&63),p[S++]=128|63&_);return p},i.buf2binstring=function(u){return d(u,u.length)},i.binstring2buf=function(u){for(var p=new a.Buf8(u.length),_=0,f=p.length;_<f;_++)p[_]=u.charCodeAt(_);return p},i.buf2string=function(u,p){var _,f,g,S,b=p||u.length,h=new Array(2*b);for(_=f=0;_<b;)if((g=u[_++])<128)h[f++]=g;else if(4<(S=l[g]))h[f++]=65533,_+=S-1;else{for(g&=S===2?31:S===3?15:7;1<S&&_<b;)g=g<<6|63&u[_++],S--;1<S?h[f++]=65533:g<65536?h[f++]=g:(g-=65536,h[f++]=55296|g>>10&1023,h[f++]=56320|1023&g)}return d(h,f)},i.utf8border=function(u,p){var _;for((p=p||u.length)>u.length&&(p=u.length),_=p-1;0<=_&&(192&u[_])==128;)_--;return _<0||_===0?p:_+l[u[_]]>p?_:p}},{"./common":41}],43:[function(n,r,i){r.exports=function(a,s,o,l){for(var c=65535&a|0,d=a>>>16&65535|0,u=0;o!==0;){for(o-=u=2e3<o?2e3:o;d=d+(c=c+s[l++]|0)|0,--u;);c%=65521,d%=65521}return c|d<<16|0}},{}],44:[function(n,r,i){r.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(n,r,i){var a=(function(){for(var s,o=[],l=0;l<256;l++){s=l;for(var c=0;c<8;c++)s=1&s?3988292384^s>>>1:s>>>1;o[l]=s}return o})();r.exports=function(s,o,l,c){var d=a,u=c+l;s^=-1;for(var p=c;p<u;p++)s=s>>>8^d[255&(s^o[p])];return-1^s}},{}],46:[function(n,r,i){var a,s=n("../utils/common"),o=n("./trees"),l=n("./adler32"),c=n("./crc32"),d=n("./messages"),u=0,p=4,_=0,f=-2,g=-1,S=4,b=2,h=8,v=9,C=286,y=30,D=19,L=2*C+1,O=15,N=3,B=258,K=B+N+1,I=42,W=113,T=1,w=2,ce=3,U=4;function H(E,x){return E.msg=d[x],x}function q(E){return(E<<1)-(4<E?9:0)}function te(E){for(var x=E.length;0<=--x;)E[x]=0}function M(E){var x=E.state,P=x.pending;P>E.avail_out&&(P=E.avail_out),P!==0&&(s.arraySet(E.output,x.pending_buf,x.pending_out,P,E.next_out),E.next_out+=P,x.pending_out+=P,E.total_out+=P,E.avail_out-=P,x.pending-=P,x.pending===0&&(x.pending_out=0))}function G(E,x){o._tr_flush_block(E,0<=E.block_start?E.block_start:-1,E.strstart-E.block_start,x),E.block_start=E.strstart,M(E.strm)}function j(E,x){E.pending_buf[E.pending++]=x}function oe(E,x){E.pending_buf[E.pending++]=x>>>8&255,E.pending_buf[E.pending++]=255&x}function ie(E,x){var P,R,A=E.max_chain_length,F=E.strstart,Q=E.prev_length,$=E.nice_match,z=E.strstart>E.w_size-K?E.strstart-(E.w_size-K):0,ee=E.window,se=E.w_mask,ae=E.prev,pe=E.strstart+B,Re=ee[F+Q-1],Te=ee[F+Q];E.prev_length>=E.good_match&&(A>>=2),$>E.lookahead&&($=E.lookahead);do if(ee[(P=x)+Q]===Te&&ee[P+Q-1]===Re&&ee[P]===ee[F]&&ee[++P]===ee[F+1]){F+=2,P++;do;while(ee[++F]===ee[++P]&&ee[++F]===ee[++P]&&ee[++F]===ee[++P]&&ee[++F]===ee[++P]&&ee[++F]===ee[++P]&&ee[++F]===ee[++P]&&ee[++F]===ee[++P]&&ee[++F]===ee[++P]&&F<pe);if(R=B-(pe-F),F=pe-B,Q<R){if(E.match_start=x,$<=(Q=R))break;Re=ee[F+Q-1],Te=ee[F+Q]}}while((x=ae[x&se])>z&&--A!=0);return Q<=E.lookahead?Q:E.lookahead}function Ee(E){var x,P,R,A,F,Q,$,z,ee,se,ae=E.w_size;do{if(A=E.window_size-E.lookahead-E.strstart,E.strstart>=ae+(ae-K)){for(s.arraySet(E.window,E.window,ae,ae,0),E.match_start-=ae,E.strstart-=ae,E.block_start-=ae,x=P=E.hash_size;R=E.head[--x],E.head[x]=ae<=R?R-ae:0,--P;);for(x=P=ae;R=E.prev[--x],E.prev[x]=ae<=R?R-ae:0,--P;);A+=ae}if(E.strm.avail_in===0)break;if(Q=E.strm,$=E.window,z=E.strstart+E.lookahead,ee=A,se=void 0,se=Q.avail_in,ee<se&&(se=ee),P=se===0?0:(Q.avail_in-=se,s.arraySet($,Q.input,Q.next_in,se,z),Q.state.wrap===1?Q.adler=l(Q.adler,$,se,z):Q.state.wrap===2&&(Q.adler=c(Q.adler,$,se,z)),Q.next_in+=se,Q.total_in+=se,se),E.lookahead+=P,E.lookahead+E.insert>=N)for(F=E.strstart-E.insert,E.ins_h=E.window[F],E.ins_h=(E.ins_h<<E.hash_shift^E.window[F+1])&E.hash_mask;E.insert&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[F+N-1])&E.hash_mask,E.prev[F&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=F,F++,E.insert--,!(E.lookahead+E.insert<N)););}while(E.lookahead<K&&E.strm.avail_in!==0)}function Z(E,x){for(var P,R;;){if(E.lookahead<K){if(Ee(E),E.lookahead<K&&x===u)return T;if(E.lookahead===0)break}if(P=0,E.lookahead>=N&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,P=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),P!==0&&E.strstart-P<=E.w_size-K&&(E.match_length=ie(E,P)),E.match_length>=N)if(R=o._tr_tally(E,E.strstart-E.match_start,E.match_length-N),E.lookahead-=E.match_length,E.match_length<=E.max_lazy_match&&E.lookahead>=N){for(E.match_length--;E.strstart++,E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,P=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 R=o._tr_tally(E,0,E.window[E.strstart]),E.lookahead--,E.strstart++;if(R&&(G(E,!1),E.strm.avail_out===0))return T}return E.insert=E.strstart<N-1?E.strstart:N-1,x===p?(G(E,!0),E.strm.avail_out===0?ce:U):E.last_lit&&(G(E,!1),E.strm.avail_out===0)?T:w}function ne(E,x){for(var P,R,A;;){if(E.lookahead<K){if(Ee(E),E.lookahead<K&&x===u)return T;if(E.lookahead===0)break}if(P=0,E.lookahead>=N&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,P=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=N-1,P!==0&&E.prev_length<E.max_lazy_match&&E.strstart-P<=E.w_size-K&&(E.match_length=ie(E,P),E.match_length<=5&&(E.strategy===1||E.match_length===N&&4096<E.strstart-E.match_start)&&(E.match_length=N-1)),E.prev_length>=N&&E.match_length<=E.prev_length){for(A=E.strstart+E.lookahead-N,R=o._tr_tally(E,E.strstart-1-E.prev_match,E.prev_length-N),E.lookahead-=E.prev_length-1,E.prev_length-=2;++E.strstart<=A&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+N-1])&E.hash_mask,P=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=N-1,E.strstart++,R&&(G(E,!1),E.strm.avail_out===0))return T}else if(E.match_available){if((R=o._tr_tally(E,0,E.window[E.strstart-1]))&&G(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&&(R=o._tr_tally(E,0,E.window[E.strstart-1]),E.match_available=0),E.insert=E.strstart<N-1?E.strstart:N-1,x===p?(G(E,!0),E.strm.avail_out===0?ce:U):E.last_lit&&(G(E,!1),E.strm.avail_out===0)?T:w}function re(E,x,P,R,A){this.good_length=E,this.max_lazy=x,this.nice_length=P,this.max_chain=R,this.func=A}function _e(){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=h,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new s.Buf16(2*L),this.dyn_dtree=new s.Buf16(2*(2*y+1)),this.bl_tree=new s.Buf16(2*(2*D+1)),te(this.dyn_ltree),te(this.dyn_dtree),te(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new s.Buf16(O+1),this.heap=new s.Buf16(2*C+1),te(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new s.Buf16(2*C+1),te(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 ge(E){var x;return E&&E.state?(E.total_in=E.total_out=0,E.data_type=b,(x=E.state).pending=0,x.pending_out=0,x.wrap<0&&(x.wrap=-x.wrap),x.status=x.wrap?I:W,E.adler=x.wrap===2?0:1,x.last_flush=u,o._tr_init(x),_):H(E,f)}function k(E){var x=ge(E);return x===_&&(function(P){P.window_size=2*P.w_size,te(P.head),P.max_lazy_match=a[P.level].max_lazy,P.good_match=a[P.level].good_length,P.nice_match=a[P.level].nice_length,P.max_chain_length=a[P.level].max_chain,P.strstart=0,P.block_start=0,P.lookahead=0,P.insert=0,P.match_length=P.prev_length=N-1,P.match_available=0,P.ins_h=0})(E.state),x}function Y(E,x,P,R,A,F){if(!E)return f;var Q=1;if(x===g&&(x=6),R<0?(Q=0,R=-R):15<R&&(Q=2,R-=16),A<1||v<A||P!==h||R<8||15<R||x<0||9<x||F<0||S<F)return H(E,f);R===8&&(R=9);var $=new _e;return(E.state=$).strm=E,$.wrap=Q,$.gzhead=null,$.w_bits=R,$.w_size=1<<$.w_bits,$.w_mask=$.w_size-1,$.hash_bits=A+7,$.hash_size=1<<$.hash_bits,$.hash_mask=$.hash_size-1,$.hash_shift=~~(($.hash_bits+N-1)/N),$.window=new s.Buf8(2*$.w_size),$.head=new s.Buf16($.hash_size),$.prev=new s.Buf16($.w_size),$.lit_bufsize=1<<A+6,$.pending_buf_size=4*$.lit_bufsize,$.pending_buf=new s.Buf8($.pending_buf_size),$.d_buf=1*$.lit_bufsize,$.l_buf=3*$.lit_bufsize,$.level=x,$.strategy=F,$.method=P,k(E)}a=[new re(0,0,0,0,function(E,x){var P=65535;for(P>E.pending_buf_size-5&&(P=E.pending_buf_size-5);;){if(E.lookahead<=1){if(Ee(E),E.lookahead===0&&x===u)return T;if(E.lookahead===0)break}E.strstart+=E.lookahead,E.lookahead=0;var R=E.block_start+P;if((E.strstart===0||E.strstart>=R)&&(E.lookahead=E.strstart-R,E.strstart=R,G(E,!1),E.strm.avail_out===0)||E.strstart-E.block_start>=E.w_size-K&&(G(E,!1),E.strm.avail_out===0))return T}return E.insert=0,x===p?(G(E,!0),E.strm.avail_out===0?ce:U):(E.strstart>E.block_start&&(G(E,!1),E.strm.avail_out),T)}),new re(4,4,8,4,Z),new re(4,5,16,8,Z),new re(4,6,32,32,Z),new re(4,4,16,16,ne),new re(8,16,32,32,ne),new re(8,16,128,128,ne),new re(8,32,128,256,ne),new re(32,128,258,1024,ne),new re(32,258,258,4096,ne)],i.deflateInit=function(E,x){return Y(E,x,h,15,8,0)},i.deflateInit2=Y,i.deflateReset=k,i.deflateResetKeep=ge,i.deflateSetHeader=function(E,x){return E&&E.state?E.state.wrap!==2?f:(E.state.gzhead=x,_):f},i.deflate=function(E,x){var P,R,A,F;if(!E||!E.state||5<x||x<0)return E?H(E,f):f;if(R=E.state,!E.output||!E.input&&E.avail_in!==0||R.status===666&&x!==p)return H(E,E.avail_out===0?-5:f);if(R.strm=E,P=R.last_flush,R.last_flush=x,R.status===I)if(R.wrap===2)E.adler=0,j(R,31),j(R,139),j(R,8),R.gzhead?(j(R,(R.gzhead.text?1:0)+(R.gzhead.hcrc?2:0)+(R.gzhead.extra?4:0)+(R.gzhead.name?8:0)+(R.gzhead.comment?16:0)),j(R,255&R.gzhead.time),j(R,R.gzhead.time>>8&255),j(R,R.gzhead.time>>16&255),j(R,R.gzhead.time>>24&255),j(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),j(R,255&R.gzhead.os),R.gzhead.extra&&R.gzhead.extra.length&&(j(R,255&R.gzhead.extra.length),j(R,R.gzhead.extra.length>>8&255)),R.gzhead.hcrc&&(E.adler=c(E.adler,R.pending_buf,R.pending,0)),R.gzindex=0,R.status=69):(j(R,0),j(R,0),j(R,0),j(R,0),j(R,0),j(R,R.level===9?2:2<=R.strategy||R.level<2?4:0),j(R,3),R.status=W);else{var Q=h+(R.w_bits-8<<4)<<8;Q|=(2<=R.strategy||R.level<2?0:R.level<6?1:R.level===6?2:3)<<6,R.strstart!==0&&(Q|=32),Q+=31-Q%31,R.status=W,oe(R,Q),R.strstart!==0&&(oe(R,E.adler>>>16),oe(R,65535&E.adler)),E.adler=1}if(R.status===69)if(R.gzhead.extra){for(A=R.pending;R.gzindex<(65535&R.gzhead.extra.length)&&(R.pending!==R.pending_buf_size||(R.gzhead.hcrc&&R.pending>A&&(E.adler=c(E.adler,R.pending_buf,R.pending-A,A)),M(E),A=R.pending,R.pending!==R.pending_buf_size));)j(R,255&R.gzhead.extra[R.gzindex]),R.gzindex++;R.gzhead.hcrc&&R.pending>A&&(E.adler=c(E.adler,R.pending_buf,R.pending-A,A)),R.gzindex===R.gzhead.extra.length&&(R.gzindex=0,R.status=73)}else R.status=73;if(R.status===73)if(R.gzhead.name){A=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>A&&(E.adler=c(E.adler,R.pending_buf,R.pending-A,A)),M(E),A=R.pending,R.pending===R.pending_buf_size)){F=1;break}F=R.gzindex<R.gzhead.name.length?255&R.gzhead.name.charCodeAt(R.gzindex++):0,j(R,F)}while(F!==0);R.gzhead.hcrc&&R.pending>A&&(E.adler=c(E.adler,R.pending_buf,R.pending-A,A)),F===0&&(R.gzindex=0,R.status=91)}else R.status=91;if(R.status===91)if(R.gzhead.comment){A=R.pending;do{if(R.pending===R.pending_buf_size&&(R.gzhead.hcrc&&R.pending>A&&(E.adler=c(E.adler,R.pending_buf,R.pending-A,A)),M(E),A=R.pending,R.pending===R.pending_buf_size)){F=1;break}F=R.gzindex<R.gzhead.comment.length?255&R.gzhead.comment.charCodeAt(R.gzindex++):0,j(R,F)}while(F!==0);R.gzhead.hcrc&&R.pending>A&&(E.adler=c(E.adler,R.pending_buf,R.pending-A,A)),F===0&&(R.status=103)}else R.status=103;if(R.status===103&&(R.gzhead.hcrc?(R.pending+2>R.pending_buf_size&&M(E),R.pending+2<=R.pending_buf_size&&(j(R,255&E.adler),j(R,E.adler>>8&255),E.adler=0,R.status=W)):R.status=W),R.pending!==0){if(M(E),E.avail_out===0)return R.last_flush=-1,_}else if(E.avail_in===0&&q(x)<=q(P)&&x!==p)return H(E,-5);if(R.status===666&&E.avail_in!==0)return H(E,-5);if(E.avail_in!==0||R.lookahead!==0||x!==u&&R.status!==666){var $=R.strategy===2?(function(z,ee){for(var se;;){if(z.lookahead===0&&(Ee(z),z.lookahead===0)){if(ee===u)return T;break}if(z.match_length=0,se=o._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++,se&&(G(z,!1),z.strm.avail_out===0))return T}return z.insert=0,ee===p?(G(z,!0),z.strm.avail_out===0?ce:U):z.last_lit&&(G(z,!1),z.strm.avail_out===0)?T:w})(R,x):R.strategy===3?(function(z,ee){for(var se,ae,pe,Re,Te=z.window;;){if(z.lookahead<=B){if(Ee(z),z.lookahead<=B&&ee===u)return T;if(z.lookahead===0)break}if(z.match_length=0,z.lookahead>=N&&0<z.strstart&&(ae=Te[pe=z.strstart-1])===Te[++pe]&&ae===Te[++pe]&&ae===Te[++pe]){Re=z.strstart+B;do;while(ae===Te[++pe]&&ae===Te[++pe]&&ae===Te[++pe]&&ae===Te[++pe]&&ae===Te[++pe]&&ae===Te[++pe]&&ae===Te[++pe]&&ae===Te[++pe]&&pe<Re);z.match_length=B-(Re-pe),z.match_length>z.lookahead&&(z.match_length=z.lookahead)}if(z.match_length>=N?(se=o._tr_tally(z,1,z.match_length-N),z.lookahead-=z.match_length,z.strstart+=z.match_length,z.match_length=0):(se=o._tr_tally(z,0,z.window[z.strstart]),z.lookahead--,z.strstart++),se&&(G(z,!1),z.strm.avail_out===0))return T}return z.insert=0,ee===p?(G(z,!0),z.strm.avail_out===0?ce:U):z.last_lit&&(G(z,!1),z.strm.avail_out===0)?T:w})(R,x):a[R.level].func(R,x);if($!==ce&&$!==U||(R.status=666),$===T||$===ce)return E.avail_out===0&&(R.last_flush=-1),_;if($===w&&(x===1?o._tr_align(R):x!==5&&(o._tr_stored_block(R,0,0,!1),x===3&&(te(R.head),R.lookahead===0&&(R.strstart=0,R.block_start=0,R.insert=0))),M(E),E.avail_out===0))return R.last_flush=-1,_}return x!==p?_:R.wrap<=0?1:(R.wrap===2?(j(R,255&E.adler),j(R,E.adler>>8&255),j(R,E.adler>>16&255),j(R,E.adler>>24&255),j(R,255&E.total_in),j(R,E.total_in>>8&255),j(R,E.total_in>>16&255),j(R,E.total_in>>24&255)):(oe(R,E.adler>>>16),oe(R,65535&E.adler)),M(E),0<R.wrap&&(R.wrap=-R.wrap),R.pending!==0?_:1)},i.deflateEnd=function(E){var x;return E&&E.state?(x=E.state.status)!==I&&x!==69&&x!==73&&x!==91&&x!==103&&x!==W&&x!==666?H(E,f):(E.state=null,x===W?H(E,-3):_):f},i.deflateSetDictionary=function(E,x){var P,R,A,F,Q,$,z,ee,se=x.length;if(!E||!E.state||(F=(P=E.state).wrap)===2||F===1&&P.status!==I||P.lookahead)return f;for(F===1&&(E.adler=l(E.adler,x,se,0)),P.wrap=0,se>=P.w_size&&(F===0&&(te(P.head),P.strstart=0,P.block_start=0,P.insert=0),ee=new s.Buf8(P.w_size),s.arraySet(ee,x,se-P.w_size,P.w_size,0),x=ee,se=P.w_size),Q=E.avail_in,$=E.next_in,z=E.input,E.avail_in=se,E.next_in=0,E.input=x,Ee(P);P.lookahead>=N;){for(R=P.strstart,A=P.lookahead-(N-1);P.ins_h=(P.ins_h<<P.hash_shift^P.window[R+N-1])&P.hash_mask,P.prev[R&P.w_mask]=P.head[P.ins_h],P.head[P.ins_h]=R,R++,--A;);P.strstart=R,P.lookahead=N-1,Ee(P)}return P.strstart+=P.lookahead,P.block_start=P.strstart,P.insert=P.lookahead,P.lookahead=0,P.match_length=P.prev_length=N-1,P.match_available=0,E.next_in=$,E.input=z,E.avail_in=Q,P.wrap=F,_},i.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(n,r,i){r.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(n,r,i){r.exports=function(a,s){var o,l,c,d,u,p,_,f,g,S,b,h,v,C,y,D,L,O,N,B,K,I,W,T,w;o=a.state,l=a.next_in,T=a.input,c=l+(a.avail_in-5),d=a.next_out,w=a.output,u=d-(s-a.avail_out),p=d+(a.avail_out-257),_=o.dmax,f=o.wsize,g=o.whave,S=o.wnext,b=o.window,h=o.hold,v=o.bits,C=o.lencode,y=o.distcode,D=(1<<o.lenbits)-1,L=(1<<o.distbits)-1;e:do{v<15&&(h+=T[l++]<<v,v+=8,h+=T[l++]<<v,v+=8),O=C[h&D];t:for(;;){if(h>>>=N=O>>>24,v-=N,(N=O>>>16&255)===0)w[d++]=65535&O;else{if(!(16&N)){if((64&N)==0){O=C[(65535&O)+(h&(1<<N)-1)];continue t}if(32&N){o.mode=12;break e}a.msg="invalid literal/length code",o.mode=30;break e}B=65535&O,(N&=15)&&(v<N&&(h+=T[l++]<<v,v+=8),B+=h&(1<<N)-1,h>>>=N,v-=N),v<15&&(h+=T[l++]<<v,v+=8,h+=T[l++]<<v,v+=8),O=y[h&L];n:for(;;){if(h>>>=N=O>>>24,v-=N,!(16&(N=O>>>16&255))){if((64&N)==0){O=y[(65535&O)+(h&(1<<N)-1)];continue n}a.msg="invalid distance code",o.mode=30;break e}if(K=65535&O,v<(N&=15)&&(h+=T[l++]<<v,(v+=8)<N&&(h+=T[l++]<<v,v+=8)),_<(K+=h&(1<<N)-1)){a.msg="invalid distance too far back",o.mode=30;break e}if(h>>>=N,v-=N,(N=d-u)<K){if(g<(N=K-N)&&o.sane){a.msg="invalid distance too far back",o.mode=30;break e}if(W=b,(I=0)===S){if(I+=f-N,N<B){for(B-=N;w[d++]=b[I++],--N;);I=d-K,W=w}}else if(S<N){if(I+=f+S-N,(N-=S)<B){for(B-=N;w[d++]=b[I++],--N;);if(I=0,S<B){for(B-=N=S;w[d++]=b[I++],--N;);I=d-K,W=w}}}else if(I+=S-N,N<B){for(B-=N;w[d++]=b[I++],--N;);I=d-K,W=w}for(;2<B;)w[d++]=W[I++],w[d++]=W[I++],w[d++]=W[I++],B-=3;B&&(w[d++]=W[I++],1<B&&(w[d++]=W[I++]))}else{for(I=d-K;w[d++]=w[I++],w[d++]=w[I++],w[d++]=w[I++],2<(B-=3););B&&(w[d++]=w[I++],1<B&&(w[d++]=w[I++]))}break}}break}}while(l<c&&d<p);l-=B=v>>3,h&=(1<<(v-=B<<3))-1,a.next_in=l,a.next_out=d,a.avail_in=l<c?c-l+5:5-(l-c),a.avail_out=d<p?p-d+257:257-(d-p),o.hold=h,o.bits=v}},{}],49:[function(n,r,i){var a=n("../utils/common"),s=n("./adler32"),o=n("./crc32"),l=n("./inffast"),c=n("./inftrees"),d=1,u=2,p=0,_=-2,f=1,g=852,S=592;function b(I){return(I>>>24&255)+(I>>>8&65280)+((65280&I)<<8)+((255&I)<<24)}function h(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function v(I){var W;return I&&I.state?(W=I.state,I.total_in=I.total_out=W.total=0,I.msg="",W.wrap&&(I.adler=1&W.wrap),W.mode=f,W.last=0,W.havedict=0,W.dmax=32768,W.head=null,W.hold=0,W.bits=0,W.lencode=W.lendyn=new a.Buf32(g),W.distcode=W.distdyn=new a.Buf32(S),W.sane=1,W.back=-1,p):_}function C(I){var W;return I&&I.state?((W=I.state).wsize=0,W.whave=0,W.wnext=0,v(I)):_}function y(I,W){var T,w;return I&&I.state?(w=I.state,W<0?(T=0,W=-W):(T=1+(W>>4),W<48&&(W&=15)),W&&(W<8||15<W)?_:(w.window!==null&&w.wbits!==W&&(w.window=null),w.wrap=T,w.wbits=W,C(I))):_}function D(I,W){var T,w;return I?(w=new h,(I.state=w).window=null,(T=y(I,W))!==p&&(I.state=null),T):_}var L,O,N=!0;function B(I){if(N){var W;for(L=new a.Buf32(512),O=new a.Buf32(32),W=0;W<144;)I.lens[W++]=8;for(;W<256;)I.lens[W++]=9;for(;W<280;)I.lens[W++]=7;for(;W<288;)I.lens[W++]=8;for(c(d,I.lens,0,288,L,0,I.work,{bits:9}),W=0;W<32;)I.lens[W++]=5;c(u,I.lens,0,32,O,0,I.work,{bits:5}),N=!1}I.lencode=L,I.lenbits=9,I.distcode=O,I.distbits=5}function K(I,W,T,w){var ce,U=I.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new a.Buf8(U.wsize)),w>=U.wsize?(a.arraySet(U.window,W,T-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(w<(ce=U.wsize-U.wnext)&&(ce=w),a.arraySet(U.window,W,T-w,ce,U.wnext),(w-=ce)?(a.arraySet(U.window,W,T-w,w,0),U.wnext=w,U.whave=U.wsize):(U.wnext+=ce,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=ce))),0}i.inflateReset=C,i.inflateReset2=y,i.inflateResetKeep=v,i.inflateInit=function(I){return D(I,15)},i.inflateInit2=D,i.inflate=function(I,W){var T,w,ce,U,H,q,te,M,G,j,oe,ie,Ee,Z,ne,re,_e,ge,k,Y,E,x,P,R,A=0,F=new a.Buf8(4),Q=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!I||!I.state||!I.output||!I.input&&I.avail_in!==0)return _;(T=I.state).mode===12&&(T.mode=13),H=I.next_out,ce=I.output,te=I.avail_out,U=I.next_in,w=I.input,q=I.avail_in,M=T.hold,G=T.bits,j=q,oe=te,x=p;e:for(;;)switch(T.mode){case f:if(T.wrap===0){T.mode=13;break}for(;G<16;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if(2&T.wrap&&M===35615){F[T.check=0]=255&M,F[1]=M>>>8&255,T.check=o(T.check,F,2,0),G=M=0,T.mode=2;break}if(T.flags=0,T.head&&(T.head.done=!1),!(1&T.wrap)||(((255&M)<<8)+(M>>8))%31){I.msg="incorrect header check",T.mode=30;break}if((15&M)!=8){I.msg="unknown compression method",T.mode=30;break}if(G-=4,E=8+(15&(M>>>=4)),T.wbits===0)T.wbits=E;else if(E>T.wbits){I.msg="invalid window size",T.mode=30;break}T.dmax=1<<E,I.adler=T.check=1,T.mode=512&M?10:12,G=M=0;break;case 2:for(;G<16;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if(T.flags=M,(255&T.flags)!=8){I.msg="unknown compression method",T.mode=30;break}if(57344&T.flags){I.msg="unknown header flags set",T.mode=30;break}T.head&&(T.head.text=M>>8&1),512&T.flags&&(F[0]=255&M,F[1]=M>>>8&255,T.check=o(T.check,F,2,0)),G=M=0,T.mode=3;case 3:for(;G<32;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}T.head&&(T.head.time=M),512&T.flags&&(F[0]=255&M,F[1]=M>>>8&255,F[2]=M>>>16&255,F[3]=M>>>24&255,T.check=o(T.check,F,4,0)),G=M=0,T.mode=4;case 4:for(;G<16;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}T.head&&(T.head.xflags=255&M,T.head.os=M>>8),512&T.flags&&(F[0]=255&M,F[1]=M>>>8&255,T.check=o(T.check,F,2,0)),G=M=0,T.mode=5;case 5:if(1024&T.flags){for(;G<16;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}T.length=M,T.head&&(T.head.extra_len=M),512&T.flags&&(F[0]=255&M,F[1]=M>>>8&255,T.check=o(T.check,F,2,0)),G=M=0}else T.head&&(T.head.extra=null);T.mode=6;case 6:if(1024&T.flags&&(q<(ie=T.length)&&(ie=q),ie&&(T.head&&(E=T.head.extra_len-T.length,T.head.extra||(T.head.extra=new Array(T.head.extra_len)),a.arraySet(T.head.extra,w,U,ie,E)),512&T.flags&&(T.check=o(T.check,w,ie,U)),q-=ie,U+=ie,T.length-=ie),T.length))break e;T.length=0,T.mode=7;case 7:if(2048&T.flags){if(q===0)break e;for(ie=0;E=w[U+ie++],T.head&&E&&T.length<65536&&(T.head.name+=String.fromCharCode(E)),E&&ie<q;);if(512&T.flags&&(T.check=o(T.check,w,ie,U)),q-=ie,U+=ie,E)break e}else T.head&&(T.head.name=null);T.length=0,T.mode=8;case 8:if(4096&T.flags){if(q===0)break e;for(ie=0;E=w[U+ie++],T.head&&E&&T.length<65536&&(T.head.comment+=String.fromCharCode(E)),E&&ie<q;);if(512&T.flags&&(T.check=o(T.check,w,ie,U)),q-=ie,U+=ie,E)break e}else T.head&&(T.head.comment=null);T.mode=9;case 9:if(512&T.flags){for(;G<16;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if(M!==(65535&T.check)){I.msg="header crc mismatch",T.mode=30;break}G=M=0}T.head&&(T.head.hcrc=T.flags>>9&1,T.head.done=!0),I.adler=T.check=0,T.mode=12;break;case 10:for(;G<32;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}I.adler=T.check=b(M),G=M=0,T.mode=11;case 11:if(T.havedict===0)return I.next_out=H,I.avail_out=te,I.next_in=U,I.avail_in=q,T.hold=M,T.bits=G,2;I.adler=T.check=1,T.mode=12;case 12:if(W===5||W===6)break e;case 13:if(T.last){M>>>=7&G,G-=7&G,T.mode=27;break}for(;G<3;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}switch(T.last=1&M,G-=1,3&(M>>>=1)){case 0:T.mode=14;break;case 1:if(B(T),T.mode=20,W!==6)break;M>>>=2,G-=2;break e;case 2:T.mode=17;break;case 3:I.msg="invalid block type",T.mode=30}M>>>=2,G-=2;break;case 14:for(M>>>=7&G,G-=7&G;G<32;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if((65535&M)!=(M>>>16^65535)){I.msg="invalid stored block lengths",T.mode=30;break}if(T.length=65535&M,G=M=0,T.mode=15,W===6)break e;case 15:T.mode=16;case 16:if(ie=T.length){if(q<ie&&(ie=q),te<ie&&(ie=te),ie===0)break e;a.arraySet(ce,w,U,ie,H),q-=ie,U+=ie,te-=ie,H+=ie,T.length-=ie;break}T.mode=12;break;case 17:for(;G<14;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if(T.nlen=257+(31&M),M>>>=5,G-=5,T.ndist=1+(31&M),M>>>=5,G-=5,T.ncode=4+(15&M),M>>>=4,G-=4,286<T.nlen||30<T.ndist){I.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(;G<3;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}T.lens[Q[T.have++]]=7&M,M>>>=3,G-=3}for(;T.have<19;)T.lens[Q[T.have++]]=0;if(T.lencode=T.lendyn,T.lenbits=7,P={bits:T.lenbits},x=c(0,T.lens,0,19,T.lencode,0,T.work,P),T.lenbits=P.bits,x){I.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(;re=(A=T.lencode[M&(1<<T.lenbits)-1])>>>16&255,_e=65535&A,!((ne=A>>>24)<=G);){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if(_e<16)M>>>=ne,G-=ne,T.lens[T.have++]=_e;else{if(_e===16){for(R=ne+2;G<R;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if(M>>>=ne,G-=ne,T.have===0){I.msg="invalid bit length repeat",T.mode=30;break}E=T.lens[T.have-1],ie=3+(3&M),M>>>=2,G-=2}else if(_e===17){for(R=ne+3;G<R;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}G-=ne,E=0,ie=3+(7&(M>>>=ne)),M>>>=3,G-=3}else{for(R=ne+7;G<R;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}G-=ne,E=0,ie=11+(127&(M>>>=ne)),M>>>=7,G-=7}if(T.have+ie>T.nlen+T.ndist){I.msg="invalid bit length repeat",T.mode=30;break}for(;ie--;)T.lens[T.have++]=E}}if(T.mode===30)break;if(T.lens[256]===0){I.msg="invalid code -- missing end-of-block",T.mode=30;break}if(T.lenbits=9,P={bits:T.lenbits},x=c(d,T.lens,0,T.nlen,T.lencode,0,T.work,P),T.lenbits=P.bits,x){I.msg="invalid literal/lengths set",T.mode=30;break}if(T.distbits=6,T.distcode=T.distdyn,P={bits:T.distbits},x=c(u,T.lens,T.nlen,T.ndist,T.distcode,0,T.work,P),T.distbits=P.bits,x){I.msg="invalid distances set",T.mode=30;break}if(T.mode=20,W===6)break e;case 20:T.mode=21;case 21:if(6<=q&&258<=te){I.next_out=H,I.avail_out=te,I.next_in=U,I.avail_in=q,T.hold=M,T.bits=G,l(I,oe),H=I.next_out,ce=I.output,te=I.avail_out,U=I.next_in,w=I.input,q=I.avail_in,M=T.hold,G=T.bits,T.mode===12&&(T.back=-1);break}for(T.back=0;re=(A=T.lencode[M&(1<<T.lenbits)-1])>>>16&255,_e=65535&A,!((ne=A>>>24)<=G);){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if(re&&(240&re)==0){for(ge=ne,k=re,Y=_e;re=(A=T.lencode[Y+((M&(1<<ge+k)-1)>>ge)])>>>16&255,_e=65535&A,!(ge+(ne=A>>>24)<=G);){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}M>>>=ge,G-=ge,T.back+=ge}if(M>>>=ne,G-=ne,T.back+=ne,T.length=_e,re===0){T.mode=26;break}if(32&re){T.back=-1,T.mode=12;break}if(64&re){I.msg="invalid literal/length code",T.mode=30;break}T.extra=15&re,T.mode=22;case 22:if(T.extra){for(R=T.extra;G<R;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}T.length+=M&(1<<T.extra)-1,M>>>=T.extra,G-=T.extra,T.back+=T.extra}T.was=T.length,T.mode=23;case 23:for(;re=(A=T.distcode[M&(1<<T.distbits)-1])>>>16&255,_e=65535&A,!((ne=A>>>24)<=G);){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if((240&re)==0){for(ge=ne,k=re,Y=_e;re=(A=T.distcode[Y+((M&(1<<ge+k)-1)>>ge)])>>>16&255,_e=65535&A,!(ge+(ne=A>>>24)<=G);){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}M>>>=ge,G-=ge,T.back+=ge}if(M>>>=ne,G-=ne,T.back+=ne,64&re){I.msg="invalid distance code",T.mode=30;break}T.offset=_e,T.extra=15&re,T.mode=24;case 24:if(T.extra){for(R=T.extra;G<R;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}T.offset+=M&(1<<T.extra)-1,M>>>=T.extra,G-=T.extra,T.back+=T.extra}if(T.offset>T.dmax){I.msg="invalid distance too far back",T.mode=30;break}T.mode=25;case 25:if(te===0)break e;if(ie=oe-te,T.offset>ie){if((ie=T.offset-ie)>T.whave&&T.sane){I.msg="invalid distance too far back",T.mode=30;break}Ee=ie>T.wnext?(ie-=T.wnext,T.wsize-ie):T.wnext-ie,ie>T.length&&(ie=T.length),Z=T.window}else Z=ce,Ee=H-T.offset,ie=T.length;for(te<ie&&(ie=te),te-=ie,T.length-=ie;ce[H++]=Z[Ee++],--ie;);T.length===0&&(T.mode=21);break;case 26:if(te===0)break e;ce[H++]=T.length,te--,T.mode=21;break;case 27:if(T.wrap){for(;G<32;){if(q===0)break e;q--,M|=w[U++]<<G,G+=8}if(oe-=te,I.total_out+=oe,T.total+=oe,oe&&(I.adler=T.check=T.flags?o(T.check,ce,oe,H-oe):s(T.check,ce,oe,H-oe)),oe=te,(T.flags?M:b(M))!==T.check){I.msg="incorrect data check",T.mode=30;break}G=M=0}T.mode=28;case 28:if(T.wrap&&T.flags){for(;G<32;){if(q===0)break e;q--,M+=w[U++]<<G,G+=8}if(M!==(4294967295&T.total)){I.msg="incorrect length check",T.mode=30;break}G=M=0}T.mode=29;case 29:x=1;break e;case 30:x=-3;break e;case 31:return-4;default:return _}return I.next_out=H,I.avail_out=te,I.next_in=U,I.avail_in=q,T.hold=M,T.bits=G,(T.wsize||oe!==I.avail_out&&T.mode<30&&(T.mode<27||W!==4))&&K(I,I.output,I.next_out,oe-I.avail_out)?(T.mode=31,-4):(j-=I.avail_in,oe-=I.avail_out,I.total_in+=j,I.total_out+=oe,T.total+=oe,T.wrap&&oe&&(I.adler=T.check=T.flags?o(T.check,ce,oe,I.next_out-oe):s(T.check,ce,oe,I.next_out-oe)),I.data_type=T.bits+(T.last?64:0)+(T.mode===12?128:0)+(T.mode===20||T.mode===15?256:0),(j==0&&oe===0||W===4)&&x===p&&(x=-5),x)},i.inflateEnd=function(I){if(!I||!I.state)return _;var W=I.state;return W.window&&(W.window=null),I.state=null,p},i.inflateGetHeader=function(I,W){var T;return I&&I.state?(2&(T=I.state).wrap)==0?_:((T.head=W).done=!1,p):_},i.inflateSetDictionary=function(I,W){var T,w=W.length;return I&&I.state?(T=I.state).wrap!==0&&T.mode!==11?_:T.mode===11&&s(1,W,w,0)!==T.check?-3:K(I,W,w,w)?(T.mode=31,-4):(T.havedict=1,p):_},i.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(n,r,i){var a=n("../utils/common"),s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[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],l=[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],c=[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];r.exports=function(d,u,p,_,f,g,S,b){var h,v,C,y,D,L,O,N,B,K=b.bits,I=0,W=0,T=0,w=0,ce=0,U=0,H=0,q=0,te=0,M=0,G=null,j=0,oe=new a.Buf16(16),ie=new a.Buf16(16),Ee=null,Z=0;for(I=0;I<=15;I++)oe[I]=0;for(W=0;W<_;W++)oe[u[p+W]]++;for(ce=K,w=15;1<=w&&oe[w]===0;w--);if(w<ce&&(ce=w),w===0)return f[g++]=20971520,f[g++]=20971520,b.bits=1,0;for(T=1;T<w&&oe[T]===0;T++);for(ce<T&&(ce=T),I=q=1;I<=15;I++)if(q<<=1,(q-=oe[I])<0)return-1;if(0<q&&(d===0||w!==1))return-1;for(ie[1]=0,I=1;I<15;I++)ie[I+1]=ie[I]+oe[I];for(W=0;W<_;W++)u[p+W]!==0&&(S[ie[u[p+W]]++]=W);if(L=d===0?(G=Ee=S,19):d===1?(G=s,j-=257,Ee=o,Z-=257,256):(G=l,Ee=c,-1),I=T,D=g,H=W=M=0,C=-1,y=(te=1<<(U=ce))-1,d===1&&852<te||d===2&&592<te)return 1;for(;;){for(O=I-H,B=S[W]<L?(N=0,S[W]):S[W]>L?(N=Ee[Z+S[W]],G[j+S[W]]):(N=96,0),h=1<<I-H,T=v=1<<U;f[D+(M>>H)+(v-=h)]=O<<24|N<<16|B|0,v!==0;);for(h=1<<I-1;M&h;)h>>=1;if(h!==0?(M&=h-1,M+=h):M=0,W++,--oe[I]==0){if(I===w)break;I=u[p+S[W]]}if(ce<I&&(M&y)!==C){for(H===0&&(H=ce),D+=T,q=1<<(U=I-H);U+H<w&&!((q-=oe[U+H])<=0);)U++,q<<=1;if(te+=1<<U,d===1&&852<te||d===2&&592<te)return 1;f[C=M&y]=ce<<24|U<<16|D-g|0}}return M!==0&&(f[D+M]=I-H<<24|64<<16|0),b.bits=ce,0}},{"../utils/common":41}],51:[function(n,r,i){r.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(n,r,i){var a=n("../utils/common"),s=0,o=1;function l(A){for(var F=A.length;0<=--F;)A[F]=0}var c=0,d=29,u=256,p=u+1+d,_=30,f=19,g=2*p+1,S=15,b=16,h=7,v=256,C=16,y=17,D=18,L=[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],O=[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],N=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=new Array(2*(p+2));l(K);var I=new Array(2*_);l(I);var W=new Array(512);l(W);var T=new Array(256);l(T);var w=new Array(d);l(w);var ce,U,H,q=new Array(_);function te(A,F,Q,$,z){this.static_tree=A,this.extra_bits=F,this.extra_base=Q,this.elems=$,this.max_length=z,this.has_stree=A&&A.length}function M(A,F){this.dyn_tree=A,this.max_code=0,this.stat_desc=F}function G(A){return A<256?W[A]:W[256+(A>>>7)]}function j(A,F){A.pending_buf[A.pending++]=255&F,A.pending_buf[A.pending++]=F>>>8&255}function oe(A,F,Q){A.bi_valid>b-Q?(A.bi_buf|=F<<A.bi_valid&65535,j(A,A.bi_buf),A.bi_buf=F>>b-A.bi_valid,A.bi_valid+=Q-b):(A.bi_buf|=F<<A.bi_valid&65535,A.bi_valid+=Q)}function ie(A,F,Q){oe(A,Q[2*F],Q[2*F+1])}function Ee(A,F){for(var Q=0;Q|=1&A,A>>>=1,Q<<=1,0<--F;);return Q>>>1}function Z(A,F,Q){var $,z,ee=new Array(S+1),se=0;for($=1;$<=S;$++)ee[$]=se=se+Q[$-1]<<1;for(z=0;z<=F;z++){var ae=A[2*z+1];ae!==0&&(A[2*z]=Ee(ee[ae]++,ae))}}function ne(A){var F;for(F=0;F<p;F++)A.dyn_ltree[2*F]=0;for(F=0;F<_;F++)A.dyn_dtree[2*F]=0;for(F=0;F<f;F++)A.bl_tree[2*F]=0;A.dyn_ltree[2*v]=1,A.opt_len=A.static_len=0,A.last_lit=A.matches=0}function re(A){8<A.bi_valid?j(A,A.bi_buf):0<A.bi_valid&&(A.pending_buf[A.pending++]=A.bi_buf),A.bi_buf=0,A.bi_valid=0}function _e(A,F,Q,$){var z=2*F,ee=2*Q;return A[z]<A[ee]||A[z]===A[ee]&&$[F]<=$[Q]}function ge(A,F,Q){for(var $=A.heap[Q],z=Q<<1;z<=A.heap_len&&(z<A.heap_len&&_e(F,A.heap[z+1],A.heap[z],A.depth)&&z++,!_e(F,$,A.heap[z],A.depth));)A.heap[Q]=A.heap[z],Q=z,z<<=1;A.heap[Q]=$}function k(A,F,Q){var $,z,ee,se,ae=0;if(A.last_lit!==0)for(;$=A.pending_buf[A.d_buf+2*ae]<<8|A.pending_buf[A.d_buf+2*ae+1],z=A.pending_buf[A.l_buf+ae],ae++,$===0?ie(A,z,F):(ie(A,(ee=T[z])+u+1,F),(se=L[ee])!==0&&oe(A,z-=w[ee],se),ie(A,ee=G(--$),Q),(se=O[ee])!==0&&oe(A,$-=q[ee],se)),ae<A.last_lit;);ie(A,v,F)}function Y(A,F){var Q,$,z,ee=F.dyn_tree,se=F.stat_desc.static_tree,ae=F.stat_desc.has_stree,pe=F.stat_desc.elems,Re=-1;for(A.heap_len=0,A.heap_max=g,Q=0;Q<pe;Q++)ee[2*Q]!==0?(A.heap[++A.heap_len]=Re=Q,A.depth[Q]=0):ee[2*Q+1]=0;for(;A.heap_len<2;)ee[2*(z=A.heap[++A.heap_len]=Re<2?++Re:0)]=1,A.depth[z]=0,A.opt_len--,ae&&(A.static_len-=se[2*z+1]);for(F.max_code=Re,Q=A.heap_len>>1;1<=Q;Q--)ge(A,ee,Q);for(z=pe;Q=A.heap[1],A.heap[1]=A.heap[A.heap_len--],ge(A,ee,1),$=A.heap[1],A.heap[--A.heap_max]=Q,A.heap[--A.heap_max]=$,ee[2*z]=ee[2*Q]+ee[2*$],A.depth[z]=(A.depth[Q]>=A.depth[$]?A.depth[Q]:A.depth[$])+1,ee[2*Q+1]=ee[2*$+1]=z,A.heap[1]=z++,ge(A,ee,1),2<=A.heap_len;);A.heap[--A.heap_max]=A.heap[1],(function(Te,Me){var $e,et,st,qe,Bt,ot,nt=Me.dyn_tree,ln=Me.max_code,Zt=Me.stat_desc.static_tree,Zn=Me.stat_desc.has_stree,He=Me.stat_desc.extra_bits,cn=Me.stat_desc.extra_base,It=Me.stat_desc.max_length,Ut=0;for(qe=0;qe<=S;qe++)Te.bl_count[qe]=0;for(nt[2*Te.heap[Te.heap_max]+1]=0,$e=Te.heap_max+1;$e<g;$e++)It<(qe=nt[2*nt[2*(et=Te.heap[$e])+1]+1]+1)&&(qe=It,Ut++),nt[2*et+1]=qe,ln<et||(Te.bl_count[qe]++,Bt=0,cn<=et&&(Bt=He[et-cn]),ot=nt[2*et],Te.opt_len+=ot*(qe+Bt),Zn&&(Te.static_len+=ot*(Zt[2*et+1]+Bt)));if(Ut!==0){do{for(qe=It-1;Te.bl_count[qe]===0;)qe--;Te.bl_count[qe]--,Te.bl_count[qe+1]+=2,Te.bl_count[It]--,Ut-=2}while(0<Ut);for(qe=It;qe!==0;qe--)for(et=Te.bl_count[qe];et!==0;)ln<(st=Te.heap[--$e])||(nt[2*st+1]!==qe&&(Te.opt_len+=(qe-nt[2*st+1])*nt[2*st],nt[2*st+1]=qe),et--)}})(A,F),Z(ee,Re,A.bl_count)}function E(A,F,Q){var $,z,ee=-1,se=F[1],ae=0,pe=7,Re=4;for(se===0&&(pe=138,Re=3),F[2*(Q+1)+1]=65535,$=0;$<=Q;$++)z=se,se=F[2*($+1)+1],++ae<pe&&z===se||(ae<Re?A.bl_tree[2*z]+=ae:z!==0?(z!==ee&&A.bl_tree[2*z]++,A.bl_tree[2*C]++):ae<=10?A.bl_tree[2*y]++:A.bl_tree[2*D]++,ee=z,Re=(ae=0)===se?(pe=138,3):z===se?(pe=6,3):(pe=7,4))}function x(A,F,Q){var $,z,ee=-1,se=F[1],ae=0,pe=7,Re=4;for(se===0&&(pe=138,Re=3),$=0;$<=Q;$++)if(z=se,se=F[2*($+1)+1],!(++ae<pe&&z===se)){if(ae<Re)for(;ie(A,z,A.bl_tree),--ae!=0;);else z!==0?(z!==ee&&(ie(A,z,A.bl_tree),ae--),ie(A,C,A.bl_tree),oe(A,ae-3,2)):ae<=10?(ie(A,y,A.bl_tree),oe(A,ae-3,3)):(ie(A,D,A.bl_tree),oe(A,ae-11,7));ee=z,Re=(ae=0)===se?(pe=138,3):z===se?(pe=6,3):(pe=7,4)}}l(q);var P=!1;function R(A,F,Q,$){oe(A,(c<<1)+($?1:0),3),(function(z,ee,se,ae){re(z),j(z,se),j(z,~se),a.arraySet(z.pending_buf,z.window,ee,se,z.pending),z.pending+=se})(A,F,Q)}i._tr_init=function(A){P||((function(){var F,Q,$,z,ee,se=new Array(S+1);for(z=$=0;z<d-1;z++)for(w[z]=$,F=0;F<1<<L[z];F++)T[$++]=z;for(T[$-1]=z,z=ee=0;z<16;z++)for(q[z]=ee,F=0;F<1<<O[z];F++)W[ee++]=z;for(ee>>=7;z<_;z++)for(q[z]=ee<<7,F=0;F<1<<O[z]-7;F++)W[256+ee++]=z;for(Q=0;Q<=S;Q++)se[Q]=0;for(F=0;F<=143;)K[2*F+1]=8,F++,se[8]++;for(;F<=255;)K[2*F+1]=9,F++,se[9]++;for(;F<=279;)K[2*F+1]=7,F++,se[7]++;for(;F<=287;)K[2*F+1]=8,F++,se[8]++;for(Z(K,p+1,se),F=0;F<_;F++)I[2*F+1]=5,I[2*F]=Ee(F,5);ce=new te(K,L,u+1,p,S),U=new te(I,O,0,_,S),H=new te(new Array(0),N,0,f,h)})(),P=!0),A.l_desc=new M(A.dyn_ltree,ce),A.d_desc=new M(A.dyn_dtree,U),A.bl_desc=new M(A.bl_tree,H),A.bi_buf=0,A.bi_valid=0,ne(A)},i._tr_stored_block=R,i._tr_flush_block=function(A,F,Q,$){var z,ee,se=0;0<A.level?(A.strm.data_type===2&&(A.strm.data_type=(function(ae){var pe,Re=4093624447;for(pe=0;pe<=31;pe++,Re>>>=1)if(1&Re&&ae.dyn_ltree[2*pe]!==0)return s;if(ae.dyn_ltree[18]!==0||ae.dyn_ltree[20]!==0||ae.dyn_ltree[26]!==0)return o;for(pe=32;pe<u;pe++)if(ae.dyn_ltree[2*pe]!==0)return o;return s})(A)),Y(A,A.l_desc),Y(A,A.d_desc),se=(function(ae){var pe;for(E(ae,ae.dyn_ltree,ae.l_desc.max_code),E(ae,ae.dyn_dtree,ae.d_desc.max_code),Y(ae,ae.bl_desc),pe=f-1;3<=pe&&ae.bl_tree[2*B[pe]+1]===0;pe--);return ae.opt_len+=3*(pe+1)+5+5+4,pe})(A),z=A.opt_len+3+7>>>3,(ee=A.static_len+3+7>>>3)<=z&&(z=ee)):z=ee=Q+5,Q+4<=z&&F!==-1?R(A,F,Q,$):A.strategy===4||ee===z?(oe(A,2+($?1:0),3),k(A,K,I)):(oe(A,4+($?1:0),3),(function(ae,pe,Re,Te){var Me;for(oe(ae,pe-257,5),oe(ae,Re-1,5),oe(ae,Te-4,4),Me=0;Me<Te;Me++)oe(ae,ae.bl_tree[2*B[Me]+1],3);x(ae,ae.dyn_ltree,pe-1),x(ae,ae.dyn_dtree,Re-1)})(A,A.l_desc.max_code+1,A.d_desc.max_code+1,se+1),k(A,A.dyn_ltree,A.dyn_dtree)),ne(A),$&&re(A)},i._tr_tally=function(A,F,Q){return A.pending_buf[A.d_buf+2*A.last_lit]=F>>>8&255,A.pending_buf[A.d_buf+2*A.last_lit+1]=255&F,A.pending_buf[A.l_buf+A.last_lit]=255&Q,A.last_lit++,F===0?A.dyn_ltree[2*Q]++:(A.matches++,F--,A.dyn_ltree[2*(T[Q]+u+1)]++,A.dyn_dtree[2*G(F)]++),A.last_lit===A.lit_bufsize-1},i._tr_align=function(A){oe(A,2,3),ie(A,v,K),(function(F){F.bi_valid===16?(j(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)})(A)}},{"../utils/common":41}],53:[function(n,r,i){r.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(n,r,i){(function(a){(function(s,o){if(!s.setImmediate){var l,c,d,u,p=1,_={},f=!1,g=s.document,S=Object.getPrototypeOf&&Object.getPrototypeOf(s);S=S&&S.setTimeout?S:s,l={}.toString.call(s.process)==="[object process]"?function(C){process.nextTick(function(){h(C)})}:(function(){if(s.postMessage&&!s.importScripts){var C=!0,y=s.onmessage;return s.onmessage=function(){C=!1},s.postMessage("","*"),s.onmessage=y,C}})()?(u="setImmediate$"+Math.random()+"$",s.addEventListener?s.addEventListener("message",v,!1):s.attachEvent("onmessage",v),function(C){s.postMessage(u+C,"*")}):s.MessageChannel?((d=new MessageChannel).port1.onmessage=function(C){h(C.data)},function(C){d.port2.postMessage(C)}):g&&"onreadystatechange"in g.createElement("script")?(c=g.documentElement,function(C){var y=g.createElement("script");y.onreadystatechange=function(){h(C),y.onreadystatechange=null,c.removeChild(y),y=null},c.appendChild(y)}):function(C){setTimeout(h,0,C)},S.setImmediate=function(C){typeof C!="function"&&(C=new Function(""+C));for(var y=new Array(arguments.length-1),D=0;D<y.length;D++)y[D]=arguments[D+1];var L={callback:C,args:y};return _[p]=L,l(p),p++},S.clearImmediate=b}function b(C){delete _[C]}function h(C){if(f)setTimeout(h,0,C);else{var y=_[C];if(y){f=!0;try{(function(D){var L=D.callback,O=D.args;switch(O.length){case 0:L();break;case 1:L(O[0]);break;case 2:L(O[0],O[1]);break;case 3:L(O[0],O[1],O[2]);break;default:L.apply(o,O)}})(y)}finally{b(C),f=!1}}}}function v(C){C.source===s&&typeof C.data=="string"&&C.data.indexOf(u)===0&&h(+C.data.slice(u.length))}})(typeof self>"u"?a===void 0?this:a:self)}).call(this,typeof ki<"u"?ki:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Pc)),Pc.exports}var SS=nx();const Cr=gS(SS),rx=OS({__proto__:null,default:Cr},[SS]),ix={class:"page-content"},ax={class:"container mx-auto px-4 sm:px-6 lg:px-8 pb-16",style:{"max-width":"720px"}},sx={class:"text-sm text-base-400 font-mono mb-6 flex items-center gap-2"},ox={class:"card publish-card relative overflow-hidden p-8"},lx={class:"text-2xl font-bold text-white mb-8 flex items-center gap-3"},cx={class:"form-group"},dx={class:"form-label font-mono text-base-400 mb-2 block required"},ux={class:"drop-zone-text"},_x={class:"drop-zone-subtitle"},px={class:"drop-zone-hint"},mx={class:"text-center"},gx={class:"btn btn-secondary zip-select-btn px-4 py-2 rounded-lg cursor-pointer"},fx={class:"file-preview-header"},Ex={id:"file-preview-list",class:"file-preview-list"},Sx={key:0,class:"mt-2 text-neon-400"},bx={id:"file-preview-summary",class:"file-preview-summary"},hx={class:"form-group"},Tx={for:"skill-select",class:"form-label font-mono text-base-400 mb-2 block"},vx=["disabled"],Rx={value:""},Cx=["value"],yx={class:"form-hint"},Nx={class:"skill-meta-readonly space-y-4 pt-4 border-t border-base-800"},Ox={class:"form-group"},Ax={for:"skill-id",class:"form-label font-mono text-base-400 mb-2 block required"},Ix=["placeholder"],xx={class:"form-hint"},Dx={class:"form-group"},wx={for:"skill-name",class:"form-label font-mono text-base-400 mb-2 block required"},Lx=["placeholder"],Mx={class:"form-group"},kx={for:"skill-description",class:"form-label font-mono text-base-400 mb-2 block required"},Px=["placeholder"],Ux={class:"form-hint"},Fx={class:"text-neon-400"},Bx={class:"form-group pt-4 border-t border-base-800"},Gx={for:"changelog",class:"form-label font-mono text-base-400 mb-2 block"},Yx=["disabled","placeholder"],qx={key:0,class:"p-4 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 text-sm"},Hx={key:1,class:"progress-container visible"},Vx={class:"progress-bar-wrapper"},zx={class:"progress-text"},$x={class:"flex gap-4 justify-end pt-6 border-t border-base-800 mt-8"},Wx=["disabled"],Kx={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Qx={key:1,class:"spinner spinner-sm"},Ui=500,Xx=Pt({__name:"PublishView",setup(t){const e=Mr(),{t:n}=on(),r=me(),i=me(),a=me([]),s=me([]),o=me(null),l=me(""),c=me(!1),d=me(!1),u=me(0),p=me(""),_=me(""),f=me(""),g=me({skillId:"",name:"",description:"",changelog:""}),S=Ie(()=>f.value===""),b=Ie(()=>S.value?g.value.name&&s.value.length>0:s.value.length>0);Ht(async()=>{try{const U=await rr.list();a.value=U.skills.filter(H=>H.permission==="owner"||H.permission==="collaborator")}catch(U){console.error("Failed to load skills:",U)}});function h(U){if(!U||typeof U!="string")return"";let H=U.trim().replace(/\.zip$/i,"");return H=H.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9\-]+/g,""),H=H.replace(/-+/g,"-").replace(/^-|-$/g,""),!H||!/^[a-z0-9\-_]+$/.test(H)?"":H}function v(U){const H=U.filter(q=>/(^|\/)SKILL\.md$/i.test(q));return H.length?H.slice().sort((q,te)=>q.length-te.length)[0]:null}function C(U){const H={},q=U.split(/\r?\n/);let te=0;for(;te<q.length;){const M=q[te];if(M===void 0){te+=1;continue}const G=M.match(/^([\w-]+):\s*(.*)$/);if(!G||!G[1]){te+=1;continue}const j=G[1];let oe=G[2]?.trimEnd()||"";if([">","|",">-",">+","|-","|+"].includes(oe)){te+=1;const Ee=[];for(;te<q.length;){const Z=q[te];if(Z===void 0||Z.match(/^([\w-]+):\s/)&&!Z.startsWith(" ")&&Ee.length)break;if(Z.startsWith(" ")||Z===""&&Ee.length)Ee.push(Z.startsWith(" ")?Z.slice(2):"");else{if(Ee.length)break;if(Z===""){te+=1;continue}else break}te+=1}H[j]=Ee.join(`
82
- `).trim();continue}H[j]=oe.replace(/^["'](.+)["']$/,"$1").trim(),te+=1}return H}function y(U){let H=U,q="",te="";const M=U.match(/^---\r?\n([\s\S]*?)\r?\n---\s*\r?\n?/);if(M&&M[1]){const G=C(M[1]);q=(G.name||"").trim(),te=(G.description||"").trim(),H=U.slice(M[0].length)}if(!q){const G=H.match(/^#\s+(.+)$/m);G&&G[1]&&(q=G[1].trim())}if(!te){const j=H.replace(/^#\s+.+$/m,"").trim().split(/\n\n+/).find(oe=>{const ie=oe.trim();return ie&&!ie.startsWith("#")&&!ie.startsWith("```")});j&&(te=j.replace(/\s*\n\s*/g," ").trim())}return te.length>Ui&&(te=te.slice(0,Ui)),{name:q,description:te}}function D(U,H){U&&(g.value.skillId=U),g.value.name=H.name||"",g.value.description=H.description||""}async function L(U,H){const q=v(H);if(!q)return null;const te=U.file(q);return te?te.async("string"):null}function O(){r.value?.click()}async function N(U){const q=U.target.files;if(!q||q.length===0)return;_.value="",s.value=[];let te=0;const M=new Cr,G=[];try{for(let Z=0;Z<q.length;Z++){const ne=q[Z];if(!ne)continue;const re=ne.webkitRelativePath;M.file(re,ne),G.push(re),s.value.push({name:re,size:ne.size}),te+=ne.size}if(!v(G)){_.value="上传的目录中未找到 SKILL.md 文件";return}const j=await L(M,G),oe=j!=null?y(j):{name:"",description:""},ie=q[0],Ee=ie?h(ie.webkitRelativePath.split("/")[0]||""):"";o.value=await M.generateAsync({type:"blob"}),l.value="skill-package.zip",D(Ee,oe)}catch(j){_.value="处理文件失败: "+j.message}}async function B(U){const q=U.target.files?.[0];if(!q)return;if(_.value="",!q.name.toLowerCase().endsWith(".zip")){_.value="请选择 .zip 文件";return}const te=h(q.name);await K(q,te),i.value&&(i.value.value="")}async function K(U,H){try{const q=await Cr.loadAsync(U),te=[];if(q.forEach((j,oe)=>{oe.dir||te.push(j)}),!v(te)){_.value="zip 中未找到 SKILL.md";return}const M=await L(q,te),G=M!=null?y(M):{name:"",description:""};o.value=U,l.value=U.name,s.value=te.map(j=>({name:j,size:0})),D(H,G)}catch(q){_.value="读取 zip 失败: "+q.message}}async function I(U){c.value=!1,_.value="";const H=U.dataTransfer?.items;if(!H||H.length===0)return;const q=H[0];if(!q||q.kind!=="file"){_.value="请拖拽文件夹或 zip 文件";return}const te=q.webkitGetAsEntry();if(!te){_.value="无法读取拖拽项";return}if(te.isFile&&te.name.toLowerCase().endsWith(".zip")){const ie=await new Promise((Z,ne)=>{te.file(Z,ne)}),Ee=h(ie.name);await K(ie,Ee);return}let M="";te.isDirectory&&(M=h(te.name));const G=new Cr,j=[];s.value=[];let oe=0;try{for(let Z=0;Z<H.length;Z++){const ne=H[Z];if(ne&&ne.kind==="file"){const re=ne.webkitGetAsEntry();re&&await W(re,G,"",j,(_e,ge)=>{s.value.push({name:ge,size:_e}),oe+=_e})}}if(!v(j)){_.value="上传的目录中未找到 SKILL.md 文件";return}const ie=await L(G,j),Ee=ie!=null?y(ie):{name:"",description:""};o.value=await G.generateAsync({type:"blob"}),l.value="skill-package.zip",D(M,Ee)}catch(ie){_.value="处理文件失败: "+ie.message}}async function W(U,H,q,te,M){if(U.isFile){const G=await new Promise((oe,ie)=>{U.file(oe,ie)}),j=q+U.name;H.file(j,G),te.push(j),M&&M(G.size,j)}else if(U.isDirectory){const G=q+U.name+"/",j=U.createReader(),oe=await new Promise((ie,Ee)=>{const Z=[],ne=()=>{j.readEntries(re=>{re.length===0?ie(Z):(Z.push(...re),ne())},Ee)};ne()});for(const ie of oe)await W(ie,H,G,te,M)}}function T(){s.value=[],o.value=null,l.value="",g.value.skillId="",g.value.name="",g.value.description="",r.value&&(r.value.value=""),i.value&&(i.value.value="")}function w(U){return U<1024?U+" B":U<1024*1024?(U/1024).toFixed(1)+" KB":(U/(1024*1024)).toFixed(1)+" MB"}async function ce(){if(!o.value||d.value)return;_.value="";const U=g.value.skillId.trim();if(!U){_.value="无法从上传包得到 Skill ID,请使用合法文件夹名或 zip 文件名";return}if(!/^[a-z0-9\-_]+$/.test(U)){_.value="Skill ID 只能包含小写字母、数字、下划线和连字符";return}if(f.value&&f.value!==U){_.value="上传包的 Skill ID 与下拉框所选已有 Skill 不一致,请重新选择或更换压缩包";return}if(S.value){if(!g.value.name.trim()){_.value="SKILL.md 中缺少可用的 Skill 名称";return}const q=g.value.description.trim();if(!q){_.value="SKILL.md 中缺少描述";return}if(q.length>Ui){_.value=`描述不能超过 ${Ui} 字`;return}}d.value=!0,u.value=0,p.value=n("publish.preparing");try{p.value=n("publish.uploading");const H=setInterval(()=>{u.value<90&&(u.value+=Math.random()*15)},200),q=new FormData;q.append("zip_file",o.value,l.value),q.append("skill_id",U),S.value&&(q.append("name",g.value.name.trim()),q.append("description",g.value.description.trim())),g.value.changelog.trim()&&q.append("changelog",g.value.changelog.trim());const te=await rr.upload(q);clearInterval(H),u.value=100,p.value=n("publish.completed"),setTimeout(()=>{e.push("/")},1e3)}catch(H){_.value=H.message||n("publish.uploadFailed"),d.value=!1}}return(U,H)=>{const q=Bn("router-link");return le(),de("main",ix,[m("div",ax,[m("div",sx,[H[8]||(H[8]=m("span",{class:"text-neon-400"},"~",-1)),H[9]||(H[9]=m("span",{class:"opacity-50"},"/",-1)),Ue(q,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[...H[7]||(H[7]=[he("home",-1)])]),_:1}),H[10]||(H[10]=m("span",{class:"opacity-50"},"/",-1)),H[11]||(H[11]=m("span",{class:"text-white"},"publish",-1))]),m("div",ox,[H[18]||(H[18]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"CMD-PUB",-1)),m("h1",lx,[H[12]||(H[12]=m("span",{class:"text-neon-400 font-mono font-normal opacity-70"},">",-1)),m("span",null,X(J(n)("publish.title")),1)]),m("form",{onSubmit:At(ce,["prevent"]),class:"space-y-6"},[m("div",cx,[m("label",dx,X(J(n)("publish.uploadFile")),1),m("div",{id:"drop-zone",class:Fe(["drop-zone",{"drag-over":c.value}]),onDragover:H[0]||(H[0]=At(te=>c.value=!0,["prevent"])),onDragleave:H[1]||(H[1]=At(te=>c.value=!1,["prevent"])),onDrop:At(I,["prevent"]),onClick:O},[H[13]||(H[13]=dr('<div class="drop-zone-icon" data-v-be48081d><svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-be48081d><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" data-v-be48081d></path><polyline points="17 8 12 3 7 8" data-v-be48081d></polyline><line x1="12" y1="3" x2="12" y2="15" data-v-be48081d></line></svg></div>',1)),m("div",ux,X(J(n)("publish.dropZoneText")),1),m("div",_x,X(J(n)("publish.dropZoneSubtitle")),1),m("div",px,X(J(n)("publish.dropZoneHint")),1)],34),m("input",{ref_key:"fileInput",ref:r,type:"file",webkitdirectory:"",directory:"",multiple:"",class:"hidden",onChange:N},null,544),H[15]||(H[15]=m("div",{class:"divider"},[m("span",null,"OR")],-1)),m("div",mx,[m("label",gx,[H[14]||(H[14]=m("span",{class:"text-neon-400"},"📎",-1)),m("span",null,X(J(n)("publish.selectZip")),1),m("input",{type:"file",ref_key:"zipInput",ref:i,class:"hidden",accept:".zip",onChange:B},null,544)])]),m("div",{id:"file-preview",class:Fe(["file-preview",{visible:s.value.length>0}])},[m("div",fx,[m("span",null,X(J(n)("publish.selectedFiles")),1),m("button",{type:"button",class:"file-preview-clear",onClick:T},"[ clear ]")]),m("div",Ex,[(le(!0),de(ke,null,Rt(s.value.slice(0,20),te=>(le(),de("div",{key:te.name,class:"file-item"},X(te.name)+" ("+X(w(te.size))+") ",1))),128)),s.value.length>20?(le(),de("div",Sx,X(J(n)("publish.moreFiles",{count:s.value.length-20})),1)):ze("",!0)]),m("div",bx,X(J(n)("publish.totalFiles",{count:s.value.length})),1)],2)]),m("div",hx,[m("label",Tx,X(J(n)("publish.selectSkill")),1),Ye(m("select",{id:"skill-select","onUpdate:modelValue":H[2]||(H[2]=te=>f.value=te),class:"rounded-lg px-4 py-2.5 w-full",disabled:d.value},[m("option",Rx,"-- "+X(J(n)("publish.createNewSkill"))+" --",1),(le(!0),de(ke,null,Rt(a.value,te=>(le(),de("option",{key:te.id,value:te.id},X(te.name),9,Cx))),128))],8,vx),[[Ir,f.value]]),m("p",yx,X(J(n)("publish.skillSelectHint")),1)]),m("div",Nx,[m("div",Ox,[m("label",Ax,X(J(n)("publish.skillId")),1),Ye(m("input",{type:"text",id:"skill-id","onUpdate:modelValue":H[3]||(H[3]=te=>g.value.skillId=te),readonly:"",placeholder:J(n)("publish.skillIdPlaceholder"),pattern:"[a-z0-9\\-_]+",class:"rounded-lg px-4 py-2.5 w-full"},null,8,Ix),[[at,g.value.skillId]]),m("p",xx,X(J(n)("publish.skillIdHint")),1)]),m("div",Dx,[m("label",wx,X(J(n)("publish.skillName")),1),Ye(m("input",{type:"text",id:"skill-name","onUpdate:modelValue":H[4]||(H[4]=te=>g.value.name=te),readonly:"",placeholder:J(n)("publish.skillNamePlaceholder"),class:"rounded-lg px-4 py-2.5 w-full"},null,8,Lx),[[at,g.value.name]])]),m("div",Mx,[m("label",kx,X(J(n)("publish.description")),1),Ye(m("textarea",{id:"skill-description","onUpdate:modelValue":H[5]||(H[5]=te=>g.value.description=te),rows:"3",readonly:"",maxlength:"500",placeholder:J(n)("publish.descriptionPlaceholder"),class:"rounded-lg px-4 py-2.5 w-full"},null,8,Px),[[at,g.value.description]]),m("p",Ux,[m("span",Fx,X(g.value.description.length),1),H[16]||(H[16]=he(" / 500 chars",-1))])])]),m("div",Bx,[m("label",Gx,X(J(n)("publish.changelog")),1),Ye(m("textarea",{id:"changelog","onUpdate:modelValue":H[6]||(H[6]=te=>g.value.changelog=te),rows:"4",disabled:d.value,placeholder:J(n)("publish.changelogPlaceholder"),class:"rounded-lg px-4 py-2.5 w-full"},null,8,Yx),[[at,g.value.changelog]])]),_.value?(le(),de("div",qx,X(_.value),1)):ze("",!0),d.value?(le(),de("div",Hx,[m("div",Vx,[m("div",{class:"progress-bar",style:ma({width:u.value+"%"})},null,4)]),m("p",zx,X(p.value),1)])):ze("",!0),m("div",$x,[Ue(q,{to:"/",class:"btn btn-secondary px-6 py-2.5 rounded-lg"},{default:it(()=>[he(X(J(n)("common.cancel")),1)]),_:1}),m("button",{type:"submit",id:"submit-btn",disabled:!b.value||d.value,class:"btn btn-primary px-6 py-2.5 rounded-lg flex items-center gap-2"},[d.value?ze("",!0):(le(),de("svg",Kx,[...H[17]||(H[17]=[m("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},null,-1),m("polyline",{points:"17 8 12 3 7 8"},null,-1),m("line",{x1:"12",y1:"3",x2:"12",y2:"15"},null,-1)])])),d.value?(le(),de("span",Qx)):ze("",!0),he(" "+X(d.value?J(n)("publish.publishing"):J(n)("publish.publishBtn")),1)],8,Wx)])],32)])])])}}}),Zx=Tn(Xx,[["__scopeId","data-v-be48081d"]]),jx={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-8"},Jx={class:"max-w-2xl mx-auto"},eD={class:"text-sm text-base-400 font-mono mb-6 flex items-center gap-2"},tD={class:"text-white"},nD={class:"skill-card p-8 relative overflow-hidden"},rD={class:"mb-8 border-b border-base-800 pb-6"},iD={class:"text-2xl font-bold text-white mb-2 flex items-center gap-3"},aD={class:"text-base-400 text-sm font-mono"},sD={class:"mb-10"},oD={class:"flex items-center gap-2 text-lg font-semibold text-white pb-3 border-b border-base-800 font-mono"},lD={class:"font-mono text-xs text-base-500 mt-1"},cD=["placeholder"],dD={class:"font-mono text-xs text-base-500 mt-1"},uD={class:"pt-2"},_D=["disabled"],pD={key:0,class:"spinner spinner-sm"},mD={class:"mb-10"},gD={class:"flex items-center gap-2 text-lg font-semibold text-white pb-3 border-b border-base-800 font-mono"},fD={class:"mt-6"},ED=["innerHTML"],SD={class:"flex items-center gap-2 text-lg font-semibold text-white pb-3 border-b border-base-800 font-mono"},bD={class:"font-mono text-xs text-base-500 mt-1"},hD={class:"pt-2"},TD=["disabled"],vD={key:0,class:"spinner spinner-sm"},RD=Pt({__name:"SettingsView",setup(t){const e=vi(),{t:n}=on(),r=me({username:"",name:""}),i=me(!1),a=me({current:"",new:"",confirm:""}),s=me(!1),o=Ie(()=>a.value.current&&a.value.new&&a.value.confirm&&a.value.new===a.value.confirm);Ht(()=>{l()});function l(){r.value={username:e.username||"",name:e.user?.name||""}}async function c(){i.value=!0;try{await e.updateProfile({name:r.value.name}),rt.success(n("settings.saveSuccess"))}catch{rt.error(n("settings.saveFailed"))}finally{i.value=!1}}async function d(){if(!a.value.current){rt.warning(n("settings.noOldPassword"));return}if(a.value.new.length<6){rt.warning(n("settings.newPassTooShort"));return}if(a.value.new!==a.value.confirm){rt.warning(n("settings.passMismatch"));return}s.value=!0;try{const u=await Un("/auth/me/change-password",{old_password:a.value.current,new_password:a.value.new});u.ok?(rt.success(n("settings.changeSuccess")),a.value={current:"",new:"",confirm:""}):rt.error(u.detail||n("settings.changeFailed"))}catch(u){u.data?.error==="wrong_password"?rt.error(n("settings.wrongPassword")):rt.error(u.message||n("settings.changeFailed"))}finally{s.value=!1}}return(u,p)=>{const _=Bn("router-link");return le(),de("main",jx,[m("div",Jx,[m("div",eD,[p[5]||(p[5]=m("span",{class:"text-neon-400"},"~",-1)),p[6]||(p[6]=m("span",{class:"opacity-50"},"/",-1)),Ue(_,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[he(X(J(n)("nav.home")),1)]),_:1}),p[7]||(p[7]=m("span",{class:"opacity-50"},"/",-1)),m("span",tD,X(J(n)("nav.settings")),1)]),m("div",nD,[p[18]||(p[18]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"CFG-USER",-1)),m("div",rD,[m("h1",iD,[p[8]||(p[8]=m("span",{class:"text-neon-400 font-mono font-normal opacity-70"},">",-1)),m("span",null,X(J(n)("settings.heading")),1)]),m("p",aD,X(J(n)("settings.subtitle")),1)]),m("div",sD,[m("h2",oD,[p[9]||(p[9]=m("span",{class:"text-neon-400"},"#",-1)),he(" "+X(J(n)("settings.basicInfo")),1)]),m("form",{onSubmit:At(c,["prevent"]),class:"space-y-5 mt-6"},[m("div",null,[p[10]||(p[10]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"username"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":p[0]||(p[0]=f=>r.value.username=f),disabled:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white opacity-50 cursor-not-allowed"},null,512),[[at,r.value.username]]),m("p",lD,X(J(n)("settings.usernameHint")),1)]),m("div",null,[p[11]||(p[11]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"name"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":p[1]||(p[1]=f=>r.value.name=f),placeholder:J(n)("settings.namePlaceholder"),class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,8,cD),[[at,r.value.name]]),m("p",dD,X(J(n)("settings.nameHint")),1)]),m("div",uD,[m("button",{type:"submit",disabled:i.value,class:"btn-primary px-6 py-2.5 rounded-lg font-mono flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"},[i.value?(le(),de("span",pD)):(le(),de(ke,{key:1},[he(X(J(n)("settings.saveBtn")),1)],64))],8,_D)])],32)]),m("div",mD,[m("h2",gD,[p[12]||(p[12]=m("span",{class:"text-neon-400"},"#",-1)),he(" "+X(J(n)("settings.cliSection")),1)]),m("div",fD,[m("p",{class:"text-base-400 text-sm font-mono mb-4",innerHTML:J(n)("settings.cliDesc")},null,8,ED),Ue(_,{to:"/cli-code",class:"inline-flex items-center gap-2 rounded-lg px-4 py-3 font-mono text-sm border border-neon-400/20 text-neon-400 bg-neon-400/5 hover:bg-neon-400/10 transition-colors"},{default:it(()=>[p[13]||(p[13]=m("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"w-4 h-4"},[m("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),m("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})],-1)),m("span",null,X(J(n)("settings.cliLink")),1)]),_:1})])]),m("div",null,[m("h2",SD,[p[14]||(p[14]=m("span",{class:"text-neon-400"},"#",-1)),he(" "+X(J(n)("settings.passwordSection")),1)]),m("form",{onSubmit:At(d,["prevent"]),class:"space-y-5 mt-6"},[m("div",null,[p[15]||(p[15]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"current_password"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"password","onUpdate:modelValue":p[2]||(p[2]=f=>a.value.current=f),required:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,a.value.current]])]),m("div",null,[p[16]||(p[16]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"new_password"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"password","onUpdate:modelValue":p[3]||(p[3]=f=>a.value.new=f),required:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,a.value.new]]),m("p",bD,X(J(n)("settings.newPasswordHint")),1)]),m("div",null,[p[17]||(p[17]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"confirm_password"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"password","onUpdate:modelValue":p[4]||(p[4]=f=>a.value.confirm=f),required:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,a.value.confirm]])]),m("div",hD,[m("button",{type:"submit",disabled:s.value||!o.value,class:"btn-primary px-6 py-2.5 rounded-lg font-mono flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"},[s.value?(le(),de("span",vD)):(le(),de(ke,{key:1},[he(X(J(n)("settings.changePasswordBtn")),1)],64))],8,TD)])],32)])])])])}}}),CD={class:"min-h-screen"},yD={class:"container mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-0",style:{"max-width":"520px"}},ND={class:"text-sm text-base-400 font-mono mb-6 flex items-center gap-2"},OD={class:"page-content"},AD={class:"container mx-auto px-4 sm:px-6 lg:px-8 pt-0 pb-16",style:{"max-width":"520px"}},ID={class:"card cli-code-card relative overflow-hidden p-8"},xD={class:"cli-code-header mb-8 text-left"},DD={class:"text-2xl font-bold text-white mb-2 flex items-center gap-3"},wD={class:"text-base-400 text-sm font-mono"},LD={key:0,class:"cli-code-loading py-8 text-center"},MD={class:"text-base-400 text-sm font-mono mt-4"},kD={key:1},PD={class:"cli-code-display rounded-xl p-8 mb-8 flex flex-col items-center"},UD={class:"cli-code-value text-4xl sm:text-5xl font-mono tracking-widest text-center select-all"},FD={class:"cli-code-timer font-mono mt-6 flex items-center gap-2 text-base-400"},BD={class:"cli-code-actions flex flex-col sm:flex-row gap-4 justify-center"},GD=["disabled"],YD={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},qD={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},HD=["disabled"],VD={class:"cli-code-hint mt-8 p-4 rounded-lg text-left"},zD={class:"block mb-2 font-mono text-neon-400"},$D=["innerHTML"],WD=Pt({__name:"CliCodeView",setup(t){const e=vi(),{t:n}=on(),r=me(""),i=me(!1),a=me(!1),s=me(null),o=me(null),l=me(0),c=Ie(()=>l.value<=0),d=Ie(()=>l.value>0&&l.value<=6e4),u=Ie(()=>{if(c.value)return n("cliCode.expired");const S=Math.floor(l.value/6e4),b=Math.floor(l.value%6e4/1e3);return`${`${S}:${String(b).padStart(2,"0")}`}${n("cliCode.expires")}`});Ht(async()=>{await e.fetchUser()&&p()}),ba(()=>{o.value&&clearInterval(o.value)});async function p(){i.value=!0;try{const S=await Un("/auth/cli-code/generate");r.value=S.code,s.value=new Date(S.expires_at),_()}catch{rt.error(n("cliCode.genFailed"))}finally{i.value=!1}}function _(){o.value&&clearInterval(o.value),f(),o.value=window.setInterval(f,1e3)}function f(){if(!s.value){l.value=0;return}const S=new Date;l.value=Math.max(0,s.value.getTime()-S.getTime()),l.value<=0&&o.value&&clearInterval(o.value)}async function g(){if(r.value)try{await navigator.clipboard.writeText(r.value),a.value=!0,setTimeout(()=>{a.value=!1},2e3)}catch{rt.info(n("cliCode.copiedToast"))}}return(S,b)=>{const h=Bn("router-link");return le(),de("div",CD,[m("div",yD,[m("div",ND,[b[1]||(b[1]=m("span",{class:"text-neon-400"},"~",-1)),b[2]||(b[2]=m("span",{class:"opacity-50"},"/",-1)),Ue(h,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[...b[0]||(b[0]=[he("home",-1)])]),_:1}),b[3]||(b[3]=m("span",{class:"opacity-50"},"/",-1)),b[4]||(b[4]=m("span",{class:"text-white"},"cli-code",-1))])]),m("main",OD,[m("div",AD,[m("div",ID,[b[11]||(b[11]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"AUTH-CLI",-1)),m("div",xD,[m("h1",DD,[b[5]||(b[5]=m("span",{class:"text-neon-400 font-mono font-normal opacity-70"},">",-1)),m("span",null,X(J(n)("cliCode.heading")),1)]),m("p",wD,"// "+X(J(n)("cliCode.subtitle")),1)]),i.value?(le(),de("div",LD,[b[6]||(b[6]=m("div",{class:"spinner mx-auto"},null,-1)),m("div",MD,X(J(n)("cliCode.secureToken")),1)])):(le(),de("div",kD,[m("div",PD,[m("div",UD,X(r.value||"----"),1),m("div",FD,[b[7]||(b[7]=m("svg",{class:"cli-code-timer-icon w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("circle",{cx:"12",cy:"12",r:"10"}),m("polyline",{points:"12 6 12 12 16 14"})],-1)),m("span",{class:Fe({"text-red-400":d.value,"text-red-500":c.value})},X(u.value),3)])]),m("div",BD,[m("button",{onClick:g,disabled:!r.value||i.value,class:"btn btn-primary flex-1 py-3 font-mono text-sm rounded-lg flex items-center justify-center gap-2"},[a.value?(le(),de("svg",qD,[...b[9]||(b[9]=[m("polyline",{points:"20 6 9 17 4 12"},null,-1)])])):(le(),de("svg",YD,[...b[8]||(b[8]=[m("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},null,-1),m("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},null,-1)])])),m("span",null,X(a.value?J(n)("cliCode.copied"):J(n)("cliCode.copyBtn")),1)],8,GD),m("button",{onClick:p,disabled:i.value,class:"btn btn-secondary flex-1 py-3 font-mono text-sm rounded-lg flex items-center justify-center gap-2"},[b[10]||(b[10]=m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("polyline",{points:"23 4 23 10 17 10"}),m("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})],-1)),m("span",null,X(J(n)("cliCode.regenerate")),1)],8,HD)])])),m("div",VD,[m("strong",zD,"# "+X(J(n)("cliCode.usage")),1),m("span",{class:"font-mono text-sm",innerHTML:J(n)("cliCode.cliHint")},null,8,$D)])])])])])}}}),KD=Tn(WD,[["__scopeId","data-v-d1a07731"]]),QD={class:"setup-container"},XD={class:"setup-shell"},ZD={class:"lang-switcher-menu"},jD={class:"setup-card"},JD={class:"setup-header"},ew={class:"setup-subtitle"},tw={key:0,class:"setup-error",role:"alert"},nw={key:1,class:"setup-success",role:"status"},rw={class:"setup-field"},iw=["disabled"],aw={class:"setup-hint"},sw={class:"setup-field"},ow=["disabled"],lw={class:"setup-hint"},cw={class:"setup-field"},dw=["disabled"],uw={class:"setup-actions"},_w=["disabled"],pw=Pt({__name:"SetupView",setup(t){const e=Mr(),{t:n,setLang:r,currentLang:i}=on(),a=Ie(()=>i.value),s=me(!1),o=Ie(()=>a.value==="zh"?"中文":"English"),l=me(""),c=me(""),d=me(""),u=me(!1),p=me(""),_=me("");function f(){s.value=!s.value}function g(v){r(v),s.value=!1}async function S(){try{(await ur("/init/status")).initialized&&e.push("/")}catch(v){console.error("Failed to check init status:",v)}}async function b(){p.value="",_.value="";const v=l.value.trim(),C=c.value,y=d.value;if(!v){p.value=n("setup.errUsername");return}if(v.length<3||v.length>50){p.value=n("setup.errUsernameLength");return}if(!C){p.value=n("setup.errPassword");return}if(C.length<6){p.value=n("setup.errPasswordLength");return}if(C!==y){p.value=n("setup.errPasswordMismatch");return}u.value=!0;try{await Un("/init/setup",{username:v,password:C}),_.value=n("setup.success"),setTimeout(()=>{e.push("/login")},2e3)}catch(D){p.value=D.message||n("setup.errFailed")}finally{u.value=!1}}function h(v){v.target.closest(".lang-switcher")||(s.value=!1)}return Ht(()=>{S(),document.addEventListener("click",h)}),(v,C)=>(le(),de("div",QD,[m("div",XD,[m("div",{class:Fe(["lang-switcher",{active:s.value}])},[m("button",{class:"lang-switcher-trigger",onClick:f},[C[6]||(C[6]=m("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("circle",{cx:"12",cy:"12",r:"10"}),m("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),m("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})],-1)),m("span",null,X(o.value),1),(le(),de("svg",{class:Fe(["lang-chevron",{rotated:s.value}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...C[5]||(C[5]=[m("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2))]),m("div",ZD,[m("button",{class:Fe(["lang-switcher-option",{active:a.value==="zh"}]),onClick:C[0]||(C[0]=y=>g("zh"))}," 中文 ",2),m("button",{class:Fe(["lang-switcher-option",{active:a.value==="en"}]),onClick:C[1]||(C[1]=y=>g("en"))}," English ",2)])],2),C[13]||(C[13]=dr('<div class="setup-brand" data-v-0ec8dc37><span class="setup-brand-icon" data-v-0ec8dc37><svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true" data-v-0ec8dc37><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" data-v-0ec8dc37></path><polyline points="3.27 6.96 12 12.01 20.73 6.96" data-v-0ec8dc37></polyline><line x1="12" y1="22.08" x2="12" y2="12" data-v-0ec8dc37></line></svg></span><span class="setup-brand-text" data-v-0ec8dc37>Skill Base</span></div>',1)),m("div",jD,[C[12]||(C[12]=m("div",{class:"setup-card-badge"},"INIT-SYS",-1)),m("div",JD,[C[7]||(C[7]=m("h1",{class:"setup-title"},[m("span",{class:"setup-title-prompt"},">"),he(" Setup ")],-1)),m("p",ew,X(J(n)("setup.subtitle")),1)]),p.value?(le(),de("div",tw,X(p.value),1)):ze("",!0),_.value?(le(),de("div",nw,X(_.value),1)):ze("",!0),m("form",{onSubmit:At(b,["prevent"]),class:"setup-form"},[m("div",rw,[C[8]||(C[8]=m("label",{for:"username",class:"setup-label"},[m("span",{class:"setup-keyword"},"let"),he(),m("span",{class:"setup-label-name"},"admin_username"),he(),m("span",{class:"setup-equals"},"=")],-1)),m("div",null,[Ye(m("input",{type:"text",id:"username","onUpdate:modelValue":C[2]||(C[2]=y=>l.value=y),placeholder:"admin",autocomplete:"username",required:"",minlength:"3",maxlength:"50",disabled:u.value,class:"setup-input"},null,8,iw),[[at,l.value]])]),m("p",aw,X(J(n)("setup.usernameHint")),1)]),m("div",sw,[C[9]||(C[9]=m("label",{for:"password",class:"setup-label"},[m("span",{class:"setup-keyword"},"let"),he(),m("span",{class:"setup-label-name"},"password"),he(),m("span",{class:"setup-equals"},"=")],-1)),m("div",null,[Ye(m("input",{type:"password",id:"password","onUpdate:modelValue":C[3]||(C[3]=y=>c.value=y),placeholder:"••••••••",autocomplete:"new-password",required:"",minlength:"6",disabled:u.value,class:"setup-input"},null,8,ow),[[at,c.value]])]),m("p",lw,X(J(n)("setup.passwordHint")),1)]),m("div",cw,[C[10]||(C[10]=m("label",{for:"confirmPassword",class:"setup-label"},[m("span",{class:"setup-keyword"},"let"),he(),m("span",{class:"setup-label-name"},"confirm_password"),he(),m("span",{class:"setup-equals"},"=")],-1)),m("div",null,[Ye(m("input",{type:"password",id:"confirmPassword","onUpdate:modelValue":C[4]||(C[4]=y=>d.value=y),placeholder:"••••••••",autocomplete:"new-password",required:"",minlength:"6",disabled:u.value,class:"setup-input"},null,8,dw),[[at,d.value]])])]),m("div",uw,[m("button",{type:"submit",disabled:u.value,class:"setup-submit"},[C[11]||(C[11]=m("svg",{class:"btn-devtools-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})],-1)),m("span",null,X(u.value?J(n)("setup.loading"):J(n)("setup.submit")),1)],8,_w)])],32)]),C[14]||(C[14]=m("div",{class:"setup-status"},[m("span",{class:"setup-status-dot"}),m("span",{class:"setup-status-text"},"System Initialization")],-1))])]))}}),mw=Tn(pw,[["__scopeId","data-v-0ec8dc37"]]);class Hd{diff(e,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const a=this.castInput(e,r),s=this.castInput(n,r),o=this.removeEmpty(this.tokenize(a,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(o,l,r,i)}diffWithOptionsObj(e,n,r,i){var a;const s=h=>{if(h=this.postProcess(h,r),i){setTimeout(function(){i(h)},0);return}else return h},o=n.length,l=e.length;let c=1,d=o+l;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const u=(a=r.timeout)!==null&&a!==void 0?a:1/0,p=Date.now()+u,_=[{oldPos:-1,lastComponent:void 0}];let f=this.extractCommon(_[0],n,e,0,r);if(_[0].oldPos+1>=l&&f+1>=o)return s(this.buildValues(_[0].lastComponent,n,e));let g=-1/0,S=1/0;const b=()=>{for(let h=Math.max(g,-c);h<=Math.min(S,c);h+=2){let v;const C=_[h-1],y=_[h+1];C&&(_[h-1]=void 0);let D=!1;if(y){const O=y.oldPos-h;D=y&&0<=O&&O<o}const L=C&&C.oldPos+1<l;if(!D&&!L){_[h]=void 0;continue}if(!L||D&&C.oldPos<y.oldPos?v=this.addToPath(y,!0,!1,0,r):v=this.addToPath(C,!1,!0,1,r),f=this.extractCommon(v,n,e,h,r),v.oldPos+1>=l&&f+1>=o)return s(this.buildValues(v.lastComponent,n,e))||!0;_[h]=v,v.oldPos+1>=l&&(S=Math.min(S,h-1)),f+1>=o&&(g=Math.max(g,h+1))}c++};if(i)(function h(){setTimeout(function(){if(c>d||Date.now()>p)return i(void 0);b()||h()},0)})();else for(;c<=d&&Date.now()<=p;){const h=b();if(h)return h}}addToPath(e,n,r,i,a){const s=e.lastComponent;return s&&!a.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(e,n,r,i,a){const s=n.length,o=r.length;let l=e.oldPos,c=l-i,d=0;for(;c+1<s&&l+1<o&&this.equals(r[l+1],n[c+1],a);)c++,l++,d++,a.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!a.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,c}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,r){const i=[];let a;for(;e;)i.push(e),a=e.previousComponent,delete e.previousComponent,e=a;i.reverse();const s=i.length;let o=0,l=0,c=0;for(;o<s;o++){const d=i[o];if(d.removed)d.value=this.join(r.slice(c,c+d.count)),c+=d.count;else{if(!d.added&&this.useLongestToken){let u=n.slice(l,l+d.count);u=u.map(function(p,_){const f=r[c+_];return f.length>p.length?f:p}),d.value=this.join(u)}else d.value=this.join(n.slice(l,l+d.count));l+=d.count,d.added||(c+=d.count)}}return i}}class gw extends Hd{}const fw=new gw;function Ew(t,e,n){return fw.diff(t,e,n)}const cf="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Sw extends Hd{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${cf}]+|[^\\S\\n\\r]+|[^${cf}]`,"ug");return e.match(n)||[]}}const bw=new Sw;function hw(t,e,n){return bw.diff(t,e,n)}class Tw extends Hd{constructor(){super(...arguments),this.tokenize=Rw}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
82
+ `).trim();continue}H[j]=oe.replace(/^["'](.+)["']$/,"$1").trim(),te+=1}return H}function y(U){let H=U,q="",te="";const M=U.match(/^---\r?\n([\s\S]*?)\r?\n---\s*\r?\n?/);if(M&&M[1]){const G=C(M[1]);q=(G.name||"").trim(),te=(G.description||"").trim(),H=U.slice(M[0].length)}if(!q){const G=H.match(/^#\s+(.+)$/m);G&&G[1]&&(q=G[1].trim())}if(!te){const j=H.replace(/^#\s+.+$/m,"").trim().split(/\n\n+/).find(oe=>{const ie=oe.trim();return ie&&!ie.startsWith("#")&&!ie.startsWith("```")});j&&(te=j.replace(/\s*\n\s*/g," ").trim())}return te.length>Ui&&(te=te.slice(0,Ui)),{name:q,description:te}}function D(U,H){U&&(g.value.skillId=U),g.value.name=H.name||"",g.value.description=H.description||""}async function L(U,H){const q=v(H);if(!q)return null;const te=U.file(q);return te?te.async("string"):null}function O(){r.value?.click()}async function N(U){const q=U.target.files;if(!q||q.length===0)return;_.value="",s.value=[];let te=0;const M=new Cr,G=[];try{for(let Z=0;Z<q.length;Z++){const ne=q[Z];if(!ne)continue;const re=ne.webkitRelativePath;M.file(re,ne),G.push(re),s.value.push({name:re,size:ne.size}),te+=ne.size}if(!v(G)){_.value="上传的目录中未找到 SKILL.md 文件";return}const j=await L(M,G),oe=j!=null?y(j):{name:"",description:""},ie=q[0],Ee=ie?h(ie.webkitRelativePath.split("/")[0]||""):"";o.value=await M.generateAsync({type:"blob"}),l.value="skill-package.zip",D(Ee,oe)}catch(j){_.value="处理文件失败: "+j.message}}async function B(U){const q=U.target.files?.[0];if(!q)return;if(_.value="",!q.name.toLowerCase().endsWith(".zip")){_.value="请选择 .zip 文件";return}const te=h(q.name);await K(q,te),i.value&&(i.value.value="")}async function K(U,H){try{const q=await Cr.loadAsync(U),te=[];if(q.forEach((j,oe)=>{oe.dir||te.push(j)}),!v(te)){_.value="zip 中未找到 SKILL.md";return}const M=await L(q,te),G=M!=null?y(M):{name:"",description:""};o.value=U,l.value=U.name,s.value=te.map(j=>({name:j,size:0})),D(H,G)}catch(q){_.value="读取 zip 失败: "+q.message}}async function I(U){c.value=!1,_.value="";const H=U.dataTransfer?.items;if(!H||H.length===0)return;const q=H[0];if(!q||q.kind!=="file"){_.value="请拖拽文件夹或 zip 文件";return}const te=q.webkitGetAsEntry();if(!te){_.value="无法读取拖拽项";return}if(te.isFile&&te.name.toLowerCase().endsWith(".zip")){const ie=await new Promise((Z,ne)=>{te.file(Z,ne)}),Ee=h(ie.name);await K(ie,Ee);return}let M="";te.isDirectory&&(M=h(te.name));const G=new Cr,j=[];s.value=[];let oe=0;try{for(let Z=0;Z<H.length;Z++){const ne=H[Z];if(ne&&ne.kind==="file"){const re=ne.webkitGetAsEntry();re&&await W(re,G,"",j,(_e,ge)=>{s.value.push({name:ge,size:_e}),oe+=_e})}}if(!v(j)){_.value="上传的目录中未找到 SKILL.md 文件";return}const ie=await L(G,j),Ee=ie!=null?y(ie):{name:"",description:""};o.value=await G.generateAsync({type:"blob"}),l.value="skill-package.zip",D(M,Ee)}catch(ie){_.value="处理文件失败: "+ie.message}}async function W(U,H,q,te,M){if(U.isFile){const G=await new Promise((oe,ie)=>{U.file(oe,ie)}),j=q+U.name;H.file(j,G),te.push(j),M&&M(G.size,j)}else if(U.isDirectory){const G=q+U.name+"/",j=U.createReader(),oe=await new Promise((ie,Ee)=>{const Z=[],ne=()=>{j.readEntries(re=>{re.length===0?ie(Z):(Z.push(...re),ne())},Ee)};ne()});for(const ie of oe)await W(ie,H,G,te,M)}}function T(){s.value=[],o.value=null,l.value="",g.value.skillId="",g.value.name="",g.value.description="",r.value&&(r.value.value=""),i.value&&(i.value.value="")}function w(U){return U<1024?U+" B":U<1024*1024?(U/1024).toFixed(1)+" KB":(U/(1024*1024)).toFixed(1)+" MB"}async function ce(){if(!o.value||d.value)return;_.value="";const U=g.value.skillId.trim();if(!U){_.value="无法从上传包得到 Skill ID,请使用合法文件夹名或 zip 文件名";return}if(!/^[a-z0-9\-_]+$/.test(U)){_.value="Skill ID 只能包含小写字母、数字、下划线和连字符";return}if(f.value&&f.value!==U){_.value="上传包的 Skill ID 与下拉框所选已有 Skill 不一致,请重新选择或更换压缩包";return}if(S.value){if(!g.value.name.trim()){_.value="SKILL.md 中缺少可用的 Skill 名称";return}const q=g.value.description.trim();if(!q){_.value="SKILL.md 中缺少描述";return}if(q.length>Ui){_.value=`描述不能超过 ${Ui} 字`;return}}d.value=!0,u.value=0,p.value=n("publish.preparing");try{p.value=n("publish.uploading");const H=setInterval(()=>{u.value<90&&(u.value+=Math.random()*15)},200),q=new FormData;q.append("zip_file",o.value,l.value),q.append("skill_id",U),S.value&&(q.append("name",g.value.name.trim()),q.append("description",g.value.description.trim())),g.value.changelog.trim()&&q.append("changelog",g.value.changelog.trim());const te=await rr.upload(q);clearInterval(H),u.value=100,p.value=n("publish.completed"),setTimeout(()=>{e.push("/")},1e3)}catch(H){_.value=H.message||n("publish.uploadFailed"),d.value=!1}}return(U,H)=>{const q=Bn("router-link");return le(),de("main",ix,[m("div",ax,[m("div",sx,[H[8]||(H[8]=m("span",{class:"text-neon-400"},"~",-1)),H[9]||(H[9]=m("span",{class:"opacity-50"},"/",-1)),Ue(q,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[...H[7]||(H[7]=[he("home",-1)])]),_:1}),H[10]||(H[10]=m("span",{class:"opacity-50"},"/",-1)),H[11]||(H[11]=m("span",{class:"text-white"},"publish",-1))]),m("div",ox,[H[18]||(H[18]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"CMD-PUB",-1)),m("h1",lx,[H[12]||(H[12]=m("span",{class:"text-neon-400 font-mono font-normal opacity-70"},">",-1)),m("span",null,X(J(n)("publish.title")),1)]),m("form",{onSubmit:At(ce,["prevent"]),class:"space-y-6"},[m("div",cx,[m("label",dx,X(J(n)("publish.uploadFile")),1),m("div",{id:"drop-zone",class:Fe(["drop-zone",{"drag-over":c.value}]),onDragover:H[0]||(H[0]=At(te=>c.value=!0,["prevent"])),onDragleave:H[1]||(H[1]=At(te=>c.value=!1,["prevent"])),onDrop:At(I,["prevent"]),onClick:O},[H[13]||(H[13]=dr('<div class="drop-zone-icon" data-v-2271b8c9><svg width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" data-v-2271b8c9><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" data-v-2271b8c9></path><polyline points="17 8 12 3 7 8" data-v-2271b8c9></polyline><line x1="12" y1="3" x2="12" y2="15" data-v-2271b8c9></line></svg></div>',1)),m("div",ux,X(J(n)("publish.dropZoneText")),1),m("div",_x,X(J(n)("publish.dropZoneSubtitle")),1),m("div",px,X(J(n)("publish.dropZoneHint")),1)],34),m("input",{ref_key:"fileInput",ref:r,type:"file",webkitdirectory:"",directory:"",multiple:"",class:"hidden",onChange:N},null,544),H[15]||(H[15]=m("div",{class:"divider"},[m("span",null,"OR")],-1)),m("div",mx,[m("label",gx,[H[14]||(H[14]=m("span",{class:"text-neon-400"},"📎",-1)),m("span",null,X(J(n)("publish.selectZip")),1),m("input",{type:"file",ref_key:"zipInput",ref:i,class:"hidden",accept:".zip",onChange:B},null,544)])]),m("div",{id:"file-preview",class:Fe(["file-preview",{visible:s.value.length>0}])},[m("div",fx,[m("span",null,X(J(n)("publish.selectedFiles")),1),m("button",{type:"button",class:"file-preview-clear",onClick:T},"[ clear ]")]),m("div",Ex,[(le(!0),de(ke,null,Rt(s.value.slice(0,20),te=>(le(),de("div",{key:te.name,class:"file-item"},X(te.name)+" ("+X(w(te.size))+") ",1))),128)),s.value.length>20?(le(),de("div",Sx,X(J(n)("publish.moreFiles",{count:s.value.length-20})),1)):ze("",!0)]),m("div",bx,X(J(n)("publish.totalFiles",{count:s.value.length})),1)],2)]),m("div",hx,[m("label",Tx,X(J(n)("publish.selectSkill")),1),Ye(m("select",{id:"skill-select","onUpdate:modelValue":H[2]||(H[2]=te=>f.value=te),class:"rounded-lg px-4 py-2.5 w-full",disabled:d.value},[m("option",Rx,"-- "+X(J(n)("publish.createNewSkill"))+" --",1),(le(!0),de(ke,null,Rt(a.value,te=>(le(),de("option",{key:te.id,value:te.id},X(te.name),9,Cx))),128))],8,vx),[[Ir,f.value]]),m("p",yx,X(J(n)("publish.skillSelectHint")),1)]),m("div",Nx,[m("div",Ox,[m("label",Ax,X(J(n)("publish.skillId")),1),Ye(m("input",{type:"text",id:"skill-id","onUpdate:modelValue":H[3]||(H[3]=te=>g.value.skillId=te),readonly:"",placeholder:J(n)("publish.skillIdPlaceholder"),pattern:"[a-z0-9\\-_]+",class:"rounded-lg px-4 py-2.5 w-full"},null,8,Ix),[[at,g.value.skillId]]),m("p",xx,X(J(n)("publish.skillIdHint")),1)]),m("div",Dx,[m("label",wx,X(J(n)("publish.skillName")),1),Ye(m("input",{type:"text",id:"skill-name","onUpdate:modelValue":H[4]||(H[4]=te=>g.value.name=te),readonly:"",placeholder:J(n)("publish.skillNamePlaceholder"),class:"rounded-lg px-4 py-2.5 w-full"},null,8,Lx),[[at,g.value.name]])]),m("div",Mx,[m("label",kx,X(J(n)("publish.description")),1),Ye(m("textarea",{id:"skill-description","onUpdate:modelValue":H[5]||(H[5]=te=>g.value.description=te),rows:"3",readonly:"",maxlength:"500",placeholder:J(n)("publish.descriptionPlaceholder"),class:"rounded-lg px-4 py-2.5 w-full"},null,8,Px),[[at,g.value.description]]),m("p",Ux,[m("span",Fx,X(g.value.description.length),1),H[16]||(H[16]=he(" / 500 chars",-1))])])]),m("div",Bx,[m("label",Gx,X(J(n)("publish.changelog")),1),Ye(m("textarea",{id:"changelog","onUpdate:modelValue":H[6]||(H[6]=te=>g.value.changelog=te),rows:"4",disabled:d.value,placeholder:J(n)("publish.changelogPlaceholder"),class:"rounded-lg px-4 py-2.5 w-full"},null,8,Yx),[[at,g.value.changelog]])]),_.value?(le(),de("div",qx,X(_.value),1)):ze("",!0),d.value?(le(),de("div",Hx,[m("div",Vx,[m("div",{class:"progress-bar",style:ma({width:u.value+"%"})},null,4)]),m("p",zx,X(p.value),1)])):ze("",!0),m("div",$x,[Ue(q,{to:"/",class:"btn btn-secondary px-6 py-2.5 rounded-lg"},{default:it(()=>[he(X(J(n)("common.cancel")),1)]),_:1}),m("button",{type:"submit",id:"submit-btn",disabled:!b.value||d.value,class:"btn btn-primary px-6 py-2.5 rounded-lg flex items-center gap-2"},[d.value?ze("",!0):(le(),de("svg",Kx,[...H[17]||(H[17]=[m("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"},null,-1),m("polyline",{points:"17 8 12 3 7 8"},null,-1),m("line",{x1:"12",y1:"3",x2:"12",y2:"15"},null,-1)])])),d.value?(le(),de("span",Qx)):ze("",!0),he(" "+X(d.value?J(n)("publish.publishing"):J(n)("publish.publishBtn")),1)],8,Wx)])],32)])])])}}}),Zx=Tn(Xx,[["__scopeId","data-v-2271b8c9"]]),jx={class:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-8"},Jx={class:"max-w-2xl mx-auto"},eD={class:"text-sm text-base-400 font-mono mb-6 flex items-center gap-2"},tD={class:"text-white"},nD={class:"skill-card p-8 relative overflow-hidden"},rD={class:"mb-8 border-b border-base-800 pb-6"},iD={class:"text-2xl font-bold text-white mb-2 flex items-center gap-3"},aD={class:"text-base-400 text-sm font-mono"},sD={class:"mb-10"},oD={class:"flex items-center gap-2 text-lg font-semibold text-white pb-3 border-b border-base-800 font-mono"},lD={class:"font-mono text-xs text-base-500 mt-1"},cD=["placeholder"],dD={class:"font-mono text-xs text-base-500 mt-1"},uD={class:"pt-2"},_D=["disabled"],pD={key:0,class:"spinner spinner-sm"},mD={class:"mb-10"},gD={class:"flex items-center gap-2 text-lg font-semibold text-white pb-3 border-b border-base-800 font-mono"},fD={class:"mt-6"},ED=["innerHTML"],SD={class:"flex items-center gap-2 text-lg font-semibold text-white pb-3 border-b border-base-800 font-mono"},bD={class:"font-mono text-xs text-base-500 mt-1"},hD={class:"pt-2"},TD=["disabled"],vD={key:0,class:"spinner spinner-sm"},RD=Pt({__name:"SettingsView",setup(t){const e=vi(),{t:n}=on(),r=me({username:"",name:""}),i=me(!1),a=me({current:"",new:"",confirm:""}),s=me(!1),o=Ie(()=>a.value.current&&a.value.new&&a.value.confirm&&a.value.new===a.value.confirm);Ht(()=>{l()});function l(){r.value={username:e.username||"",name:e.user?.name||""}}async function c(){i.value=!0;try{await e.updateProfile({name:r.value.name}),rt.success(n("settings.saveSuccess"))}catch{rt.error(n("settings.saveFailed"))}finally{i.value=!1}}async function d(){if(!a.value.current){rt.warning(n("settings.noOldPassword"));return}if(a.value.new.length<6){rt.warning(n("settings.newPassTooShort"));return}if(a.value.new!==a.value.confirm){rt.warning(n("settings.passMismatch"));return}s.value=!0;try{const u=await Un("/auth/me/change-password",{old_password:a.value.current,new_password:a.value.new});u.ok?(rt.success(n("settings.changeSuccess")),a.value={current:"",new:"",confirm:""}):rt.error(u.detail||n("settings.changeFailed"))}catch(u){u.data?.error==="wrong_password"?rt.error(n("settings.wrongPassword")):rt.error(u.message||n("settings.changeFailed"))}finally{s.value=!1}}return(u,p)=>{const _=Bn("router-link");return le(),de("main",jx,[m("div",Jx,[m("div",eD,[p[5]||(p[5]=m("span",{class:"text-neon-400"},"~",-1)),p[6]||(p[6]=m("span",{class:"opacity-50"},"/",-1)),Ue(_,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[he(X(J(n)("nav.home")),1)]),_:1}),p[7]||(p[7]=m("span",{class:"opacity-50"},"/",-1)),m("span",tD,X(J(n)("nav.settings")),1)]),m("div",nD,[p[18]||(p[18]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"CFG-USER",-1)),m("div",rD,[m("h1",iD,[p[8]||(p[8]=m("span",{class:"text-neon-400 font-mono font-normal opacity-70"},">",-1)),m("span",null,X(J(n)("settings.heading")),1)]),m("p",aD,X(J(n)("settings.subtitle")),1)]),m("div",sD,[m("h2",oD,[p[9]||(p[9]=m("span",{class:"text-neon-400"},"#",-1)),he(" "+X(J(n)("settings.basicInfo")),1)]),m("form",{onSubmit:At(c,["prevent"]),class:"space-y-5 mt-6"},[m("div",null,[p[10]||(p[10]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"username"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":p[0]||(p[0]=f=>r.value.username=f),disabled:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white opacity-50 cursor-not-allowed"},null,512),[[at,r.value.username]]),m("p",lD,X(J(n)("settings.usernameHint")),1)]),m("div",null,[p[11]||(p[11]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"name"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":p[1]||(p[1]=f=>r.value.name=f),placeholder:J(n)("settings.namePlaceholder"),class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,8,cD),[[at,r.value.name]]),m("p",dD,X(J(n)("settings.nameHint")),1)]),m("div",uD,[m("button",{type:"submit",disabled:i.value,class:"btn-primary px-6 py-2.5 rounded-lg font-mono flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"},[i.value?(le(),de("span",pD)):(le(),de(ke,{key:1},[he(X(J(n)("settings.saveBtn")),1)],64))],8,_D)])],32)]),m("div",mD,[m("h2",gD,[p[12]||(p[12]=m("span",{class:"text-neon-400"},"#",-1)),he(" "+X(J(n)("settings.cliSection")),1)]),m("div",fD,[m("p",{class:"text-base-400 text-sm font-mono mb-4",innerHTML:J(n)("settings.cliDesc")},null,8,ED),Ue(_,{to:"/cli-code",class:"inline-flex items-center gap-2 rounded-lg px-4 py-3 font-mono text-sm border border-neon-400/20 text-neon-400 bg-neon-400/5 hover:bg-neon-400/10 transition-colors"},{default:it(()=>[p[13]||(p[13]=m("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2",class:"w-4 h-4"},[m("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),m("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})],-1)),m("span",null,X(J(n)("settings.cliLink")),1)]),_:1})])]),m("div",null,[m("h2",SD,[p[14]||(p[14]=m("span",{class:"text-neon-400"},"#",-1)),he(" "+X(J(n)("settings.passwordSection")),1)]),m("form",{onSubmit:At(d,["prevent"]),class:"space-y-5 mt-6"},[m("div",null,[p[15]||(p[15]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"current_password"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"password","onUpdate:modelValue":p[2]||(p[2]=f=>a.value.current=f),required:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,a.value.current]])]),m("div",null,[p[16]||(p[16]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"new_password"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"password","onUpdate:modelValue":p[3]||(p[3]=f=>a.value.new=f),required:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,a.value.new]]),m("p",bD,X(J(n)("settings.newPasswordHint")),1)]),m("div",null,[p[17]||(p[17]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"confirm_password"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"password","onUpdate:modelValue":p[4]||(p[4]=f=>a.value.confirm=f),required:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,a.value.confirm]])]),m("div",hD,[m("button",{type:"submit",disabled:s.value||!o.value,class:"btn-primary px-6 py-2.5 rounded-lg font-mono flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"},[s.value?(le(),de("span",vD)):(le(),de(ke,{key:1},[he(X(J(n)("settings.changePasswordBtn")),1)],64))],8,TD)])],32)])])])])}}}),CD={class:"min-h-screen"},yD={class:"container mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-0",style:{"max-width":"520px"}},ND={class:"text-sm text-base-400 font-mono mb-6 flex items-center gap-2"},OD={class:"page-content"},AD={class:"container mx-auto px-4 sm:px-6 lg:px-8 pt-0 pb-16",style:{"max-width":"520px"}},ID={class:"card cli-code-card relative overflow-hidden p-8"},xD={class:"cli-code-header mb-8 text-left"},DD={class:"text-2xl font-bold text-white mb-2 flex items-center gap-3"},wD={class:"text-base-400 text-sm font-mono"},LD={key:0,class:"cli-code-loading py-8 text-center"},MD={class:"text-base-400 text-sm font-mono mt-4"},kD={key:1},PD={class:"cli-code-display rounded-xl p-8 mb-8 flex flex-col items-center"},UD={class:"cli-code-value text-4xl sm:text-5xl font-mono tracking-widest text-center select-all"},FD={class:"cli-code-timer font-mono mt-6 flex items-center gap-2 text-base-400"},BD={class:"cli-code-actions flex flex-col sm:flex-row gap-4 justify-center"},GD=["disabled"],YD={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},qD={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},HD=["disabled"],VD={class:"cli-code-hint mt-8 p-4 rounded-lg text-left"},zD={class:"block mb-2 font-mono text-neon-400"},$D=["innerHTML"],WD=Pt({__name:"CliCodeView",setup(t){const e=vi(),{t:n}=on(),r=me(""),i=me(!1),a=me(!1),s=me(null),o=me(null),l=me(0),c=Ie(()=>l.value<=0),d=Ie(()=>l.value>0&&l.value<=6e4),u=Ie(()=>{if(c.value)return n("cliCode.expired");const S=Math.floor(l.value/6e4),b=Math.floor(l.value%6e4/1e3);return`${`${S}:${String(b).padStart(2,"0")}`}${n("cliCode.expires")}`});Ht(async()=>{await e.fetchUser()&&p()}),ba(()=>{o.value&&clearInterval(o.value)});async function p(){i.value=!0;try{const S=await Un("/auth/cli-code/generate");r.value=S.code,s.value=new Date(S.expires_at),_()}catch{rt.error(n("cliCode.genFailed"))}finally{i.value=!1}}function _(){o.value&&clearInterval(o.value),f(),o.value=window.setInterval(f,1e3)}function f(){if(!s.value){l.value=0;return}const S=new Date;l.value=Math.max(0,s.value.getTime()-S.getTime()),l.value<=0&&o.value&&clearInterval(o.value)}async function g(){if(r.value)try{await navigator.clipboard.writeText(r.value),a.value=!0,setTimeout(()=>{a.value=!1},2e3)}catch{rt.info(n("cliCode.copiedToast"))}}return(S,b)=>{const h=Bn("router-link");return le(),de("div",CD,[m("div",yD,[m("div",ND,[b[1]||(b[1]=m("span",{class:"text-neon-400"},"~",-1)),b[2]||(b[2]=m("span",{class:"opacity-50"},"/",-1)),Ue(h,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[...b[0]||(b[0]=[he("home",-1)])]),_:1}),b[3]||(b[3]=m("span",{class:"opacity-50"},"/",-1)),b[4]||(b[4]=m("span",{class:"text-white"},"cli-code",-1))])]),m("main",OD,[m("div",AD,[m("div",ID,[b[11]||(b[11]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"AUTH-CLI",-1)),m("div",xD,[m("h1",DD,[b[5]||(b[5]=m("span",{class:"text-neon-400 font-mono font-normal opacity-70"},">",-1)),m("span",null,X(J(n)("cliCode.heading")),1)]),m("p",wD,"// "+X(J(n)("cliCode.subtitle")),1)]),i.value?(le(),de("div",LD,[b[6]||(b[6]=m("div",{class:"spinner mx-auto"},null,-1)),m("div",MD,X(J(n)("cliCode.secureToken")),1)])):(le(),de("div",kD,[m("div",PD,[m("div",UD,X(r.value||"----"),1),m("div",FD,[b[7]||(b[7]=m("svg",{class:"cli-code-timer-icon w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("circle",{cx:"12",cy:"12",r:"10"}),m("polyline",{points:"12 6 12 12 16 14"})],-1)),m("span",{class:Fe({"text-red-400":d.value,"text-red-500":c.value})},X(u.value),3)])]),m("div",BD,[m("button",{onClick:g,disabled:!r.value||i.value,class:"btn btn-primary flex-1 py-3 font-mono text-sm rounded-lg flex items-center justify-center gap-2"},[a.value?(le(),de("svg",qD,[...b[9]||(b[9]=[m("polyline",{points:"20 6 9 17 4 12"},null,-1)])])):(le(),de("svg",YD,[...b[8]||(b[8]=[m("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"},null,-1),m("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"},null,-1)])])),m("span",null,X(a.value?J(n)("cliCode.copied"):J(n)("cliCode.copyBtn")),1)],8,GD),m("button",{onClick:p,disabled:i.value,class:"btn btn-secondary flex-1 py-3 font-mono text-sm rounded-lg flex items-center justify-center gap-2"},[b[10]||(b[10]=m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("polyline",{points:"23 4 23 10 17 10"}),m("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})],-1)),m("span",null,X(J(n)("cliCode.regenerate")),1)],8,HD)])])),m("div",VD,[m("strong",zD,"# "+X(J(n)("cliCode.usage")),1),m("span",{class:"font-mono text-sm",innerHTML:J(n)("cliCode.cliHint")},null,8,$D)])])])])])}}}),KD=Tn(WD,[["__scopeId","data-v-d1a07731"]]),QD={class:"setup-container"},XD={class:"setup-shell"},ZD={class:"lang-switcher-menu"},jD={class:"setup-card"},JD={class:"setup-header"},ew={class:"setup-subtitle"},tw={key:0,class:"setup-error",role:"alert"},nw={key:1,class:"setup-success",role:"status"},rw={class:"setup-field"},iw=["disabled"],aw={class:"setup-hint"},sw={class:"setup-field"},ow=["disabled"],lw={class:"setup-hint"},cw={class:"setup-field"},dw=["disabled"],uw={class:"setup-actions"},_w=["disabled"],pw=Pt({__name:"SetupView",setup(t){const e=Mr(),{t:n,setLang:r,currentLang:i}=on(),a=Ie(()=>i.value),s=me(!1),o=Ie(()=>a.value==="zh"?"中文":"English"),l=me(""),c=me(""),d=me(""),u=me(!1),p=me(""),_=me("");function f(){s.value=!s.value}function g(v){r(v),s.value=!1}async function S(){try{(await ur("/init/status")).initialized&&e.push("/")}catch(v){console.error("Failed to check init status:",v)}}async function b(){p.value="",_.value="";const v=l.value.trim(),C=c.value,y=d.value;if(!v){p.value=n("setup.errUsername");return}if(v.length<3||v.length>50){p.value=n("setup.errUsernameLength");return}if(!C){p.value=n("setup.errPassword");return}if(C.length<6){p.value=n("setup.errPasswordLength");return}if(C!==y){p.value=n("setup.errPasswordMismatch");return}u.value=!0;try{await Un("/init/setup",{username:v,password:C}),_.value=n("setup.success"),setTimeout(()=>{e.push("/login")},2e3)}catch(D){p.value=D.message||n("setup.errFailed")}finally{u.value=!1}}function h(v){v.target.closest(".lang-switcher")||(s.value=!1)}return Ht(()=>{S(),document.addEventListener("click",h)}),(v,C)=>(le(),de("div",QD,[m("div",XD,[m("div",{class:Fe(["lang-switcher",{active:s.value}])},[m("button",{class:"lang-switcher-trigger",onClick:f},[C[6]||(C[6]=m("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("circle",{cx:"12",cy:"12",r:"10"}),m("line",{x1:"2",y1:"12",x2:"22",y2:"12"}),m("path",{d:"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"})],-1)),m("span",null,X(o.value),1),(le(),de("svg",{class:Fe(["lang-chevron",{rotated:s.value}]),width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[...C[5]||(C[5]=[m("polyline",{points:"6 9 12 15 18 9"},null,-1)])],2))]),m("div",ZD,[m("button",{class:Fe(["lang-switcher-option",{active:a.value==="zh"}]),onClick:C[0]||(C[0]=y=>g("zh"))}," 中文 ",2),m("button",{class:Fe(["lang-switcher-option",{active:a.value==="en"}]),onClick:C[1]||(C[1]=y=>g("en"))}," English ",2)])],2),C[13]||(C[13]=dr('<div class="setup-brand" data-v-0ec8dc37><span class="setup-brand-icon" data-v-0ec8dc37><svg width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true" data-v-0ec8dc37><path d="M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z" data-v-0ec8dc37></path><polyline points="3.27 6.96 12 12.01 20.73 6.96" data-v-0ec8dc37></polyline><line x1="12" y1="22.08" x2="12" y2="12" data-v-0ec8dc37></line></svg></span><span class="setup-brand-text" data-v-0ec8dc37>Skill Base</span></div>',1)),m("div",jD,[C[12]||(C[12]=m("div",{class:"setup-card-badge"},"INIT-SYS",-1)),m("div",JD,[C[7]||(C[7]=m("h1",{class:"setup-title"},[m("span",{class:"setup-title-prompt"},">"),he(" Setup ")],-1)),m("p",ew,X(J(n)("setup.subtitle")),1)]),p.value?(le(),de("div",tw,X(p.value),1)):ze("",!0),_.value?(le(),de("div",nw,X(_.value),1)):ze("",!0),m("form",{onSubmit:At(b,["prevent"]),class:"setup-form"},[m("div",rw,[C[8]||(C[8]=m("label",{for:"username",class:"setup-label"},[m("span",{class:"setup-keyword"},"let"),he(),m("span",{class:"setup-label-name"},"admin_username"),he(),m("span",{class:"setup-equals"},"=")],-1)),m("div",null,[Ye(m("input",{type:"text",id:"username","onUpdate:modelValue":C[2]||(C[2]=y=>l.value=y),placeholder:"admin",autocomplete:"username",required:"",minlength:"3",maxlength:"50",disabled:u.value,class:"setup-input"},null,8,iw),[[at,l.value]])]),m("p",aw,X(J(n)("setup.usernameHint")),1)]),m("div",sw,[C[9]||(C[9]=m("label",{for:"password",class:"setup-label"},[m("span",{class:"setup-keyword"},"let"),he(),m("span",{class:"setup-label-name"},"password"),he(),m("span",{class:"setup-equals"},"=")],-1)),m("div",null,[Ye(m("input",{type:"password",id:"password","onUpdate:modelValue":C[3]||(C[3]=y=>c.value=y),placeholder:"••••••••",autocomplete:"new-password",required:"",minlength:"6",disabled:u.value,class:"setup-input"},null,8,ow),[[at,c.value]])]),m("p",lw,X(J(n)("setup.passwordHint")),1)]),m("div",cw,[C[10]||(C[10]=m("label",{for:"confirmPassword",class:"setup-label"},[m("span",{class:"setup-keyword"},"let"),he(),m("span",{class:"setup-label-name"},"confirm_password"),he(),m("span",{class:"setup-equals"},"=")],-1)),m("div",null,[Ye(m("input",{type:"password",id:"confirmPassword","onUpdate:modelValue":C[4]||(C[4]=y=>d.value=y),placeholder:"••••••••",autocomplete:"new-password",required:"",minlength:"6",disabled:u.value,class:"setup-input"},null,8,dw),[[at,d.value]])])]),m("div",uw,[m("button",{type:"submit",disabled:u.value,class:"setup-submit"},[C[11]||(C[11]=m("svg",{class:"btn-devtools-icon",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[m("path",{d:"M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"})],-1)),m("span",null,X(u.value?J(n)("setup.loading"):J(n)("setup.submit")),1)],8,_w)])],32)]),C[14]||(C[14]=m("div",{class:"setup-status"},[m("span",{class:"setup-status-dot"}),m("span",{class:"setup-status-text"},"System Initialization")],-1))])]))}}),mw=Tn(pw,[["__scopeId","data-v-0ec8dc37"]]);class Hd{diff(e,n,r={}){let i;typeof r=="function"?(i=r,r={}):"callback"in r&&(i=r.callback);const a=this.castInput(e,r),s=this.castInput(n,r),o=this.removeEmpty(this.tokenize(a,r)),l=this.removeEmpty(this.tokenize(s,r));return this.diffWithOptionsObj(o,l,r,i)}diffWithOptionsObj(e,n,r,i){var a;const s=h=>{if(h=this.postProcess(h,r),i){setTimeout(function(){i(h)},0);return}else return h},o=n.length,l=e.length;let c=1,d=o+l;r.maxEditLength!=null&&(d=Math.min(d,r.maxEditLength));const u=(a=r.timeout)!==null&&a!==void 0?a:1/0,p=Date.now()+u,_=[{oldPos:-1,lastComponent:void 0}];let f=this.extractCommon(_[0],n,e,0,r);if(_[0].oldPos+1>=l&&f+1>=o)return s(this.buildValues(_[0].lastComponent,n,e));let g=-1/0,S=1/0;const b=()=>{for(let h=Math.max(g,-c);h<=Math.min(S,c);h+=2){let v;const C=_[h-1],y=_[h+1];C&&(_[h-1]=void 0);let D=!1;if(y){const O=y.oldPos-h;D=y&&0<=O&&O<o}const L=C&&C.oldPos+1<l;if(!D&&!L){_[h]=void 0;continue}if(!L||D&&C.oldPos<y.oldPos?v=this.addToPath(y,!0,!1,0,r):v=this.addToPath(C,!1,!0,1,r),f=this.extractCommon(v,n,e,h,r),v.oldPos+1>=l&&f+1>=o)return s(this.buildValues(v.lastComponent,n,e))||!0;_[h]=v,v.oldPos+1>=l&&(S=Math.min(S,h-1)),f+1>=o&&(g=Math.max(g,h+1))}c++};if(i)(function h(){setTimeout(function(){if(c>d||Date.now()>p)return i(void 0);b()||h()},0)})();else for(;c<=d&&Date.now()<=p;){const h=b();if(h)return h}}addToPath(e,n,r,i,a){const s=e.lastComponent;return s&&!a.oneChangePerToken&&s.added===n&&s.removed===r?{oldPos:e.oldPos+i,lastComponent:{count:s.count+1,added:n,removed:r,previousComponent:s.previousComponent}}:{oldPos:e.oldPos+i,lastComponent:{count:1,added:n,removed:r,previousComponent:s}}}extractCommon(e,n,r,i,a){const s=n.length,o=r.length;let l=e.oldPos,c=l-i,d=0;for(;c+1<s&&l+1<o&&this.equals(r[l+1],n[c+1],a);)c++,l++,d++,a.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return d&&!a.oneChangePerToken&&(e.lastComponent={count:d,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,c}equals(e,n,r){return r.comparator?r.comparator(e,n):e===n||!!r.ignoreCase&&e.toLowerCase()===n.toLowerCase()}removeEmpty(e){const n=[];for(let r=0;r<e.length;r++)e[r]&&n.push(e[r]);return n}castInput(e,n){return e}tokenize(e,n){return Array.from(e)}join(e){return e.join("")}postProcess(e,n){return e}get useLongestToken(){return!1}buildValues(e,n,r){const i=[];let a;for(;e;)i.push(e),a=e.previousComponent,delete e.previousComponent,e=a;i.reverse();const s=i.length;let o=0,l=0,c=0;for(;o<s;o++){const d=i[o];if(d.removed)d.value=this.join(r.slice(c,c+d.count)),c+=d.count;else{if(!d.added&&this.useLongestToken){let u=n.slice(l,l+d.count);u=u.map(function(p,_){const f=r[c+_];return f.length>p.length?f:p}),d.value=this.join(u)}else d.value=this.join(n.slice(l,l+d.count));l+=d.count,d.added||(c+=d.count)}}return i}}class gw extends Hd{}const fw=new gw;function Ew(t,e,n){return fw.diff(t,e,n)}const cf="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Sw extends Hd{tokenize(e){const n=new RegExp(`(\\r?\\n)|[${cf}]+|[^\\S\\n\\r]+|[^${cf}]`,"ug");return e.match(n)||[]}}const bw=new Sw;function hw(t,e,n){return bw.diff(t,e,n)}class Tw extends Hd{constructor(){super(...arguments),this.tokenize=Rw}equals(e,n,r){return r.ignoreWhitespace?((!r.newlineIsToken||!e.includes(`
83
83
  `))&&(e=e.trim()),(!r.newlineIsToken||!n.includes(`
84
84
  `))&&(n=n.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(e.endsWith(`
85
85
  `)&&(e=e.slice(0,-1)),n.endsWith(`
@@ -206,4 +206,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),gt=fe,je=Ne),Pe===void
206
206
  `+n),r.b("</div>"),r.fl()},partials:{},subs:{}});St["tag-file-added"]=new mt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-added d2h-added-tag">ADDED</span>'),r.fl()},partials:{},subs:{}});St["tag-file-changed"]=new mt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-changed d2h-changed-tag">CHANGED</span>'),r.fl()},partials:{},subs:{}});St["tag-file-deleted"]=new mt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-deleted d2h-deleted-tag">DELETED</span>'),r.fl()},partials:{},subs:{}});St["tag-file-renamed"]=new mt.Template({code:function(t,e,n){var r=this;return r.b(n=n||""),r.b('<span class="d2h-tag d2h-moved d2h-moved-tag">RENAMED</span>'),r.fl()},partials:{},subs:{}});class sL{constructor({compiledTemplates:e={},rawTemplates:n={}}){const r=Object.entries(n).reduce((i,[a,s])=>{const o=mt.compile(s,{asString:!1});return Object.assign(Object.assign({},i),{[a]:o})},{});this.preCompiledTemplates=Object.assign(Object.assign(Object.assign({},St),e),r)}static compile(e){return mt.compile(e,{asString:!1})}render(e,n,r,i,a){const s=this.templateKey(e,n);try{return this.preCompiledTemplates[s].render(r,i,a)}catch{throw new Error(`Could not find template to render '${s}'`)}}template(e,n){return this.preCompiledTemplates[this.templateKey(e,n)]}templateKey(e,n){return`${e}-${n}`}}const yS=Object.assign(Object.assign(Object.assign({},RS),CS),{outputFormat:ww.LINE_BY_LINE,drawFileList:!0});function oL(t,e={}){const n=Object.assign(Object.assign({},yS),e),r=typeof t=="string"?Yw(t,n):t,i=new sL(n),{colorScheme:a}=n,s={colorScheme:a},o=n.drawFileList?new Qw(i,s).render(r):"",l=n.outputFormat==="side-by-side"?new nL(i,n).render(r):new jw(i,n).render(r);return o+l}const lL=Object.assign(Object.assign({},yS),{synchronisedScroll:!0,highlight:!0,fileListToggle:!0,fileListStartVisible:!1,highlightLanguages:new Map,smartSelection:!0,fileContentToggle:!0,stickyFileHeaders:!0});let cL=class{constructor(e,n,r={},i){this.hljs=null,this.currentSelectionColumnId=-1,this.config=Object.assign(Object.assign({},lL),r),this.diffHtml=n!==void 0?oL(n,this.config):e.innerHTML,this.targetElement=e,i!==void 0&&(this.hljs=i)}draw(){this.targetElement.innerHTML=this.diffHtml,this.config.synchronisedScroll&&this.synchronisedScroll(),this.config.highlight&&this.highlightCode(),this.config.fileListToggle&&this.fileListToggle(this.config.fileListStartVisible),this.config.fileContentToggle&&this.fileContentToggle(),this.config.stickyFileHeaders&&this.stickyFileHeaders()}synchronisedScroll(){this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach(e=>{const[n,r]=Array().slice.call(e.querySelectorAll(".d2h-file-side-diff"));if(n===void 0||r===void 0)return;const i=a=>{a===null||a.target===null||(a.target===n?(r.scrollTop=n.scrollTop,r.scrollLeft=n.scrollLeft):(n.scrollTop=r.scrollTop,n.scrollLeft=r.scrollLeft))};n.addEventListener("scroll",i),r.addEventListener("scroll",i)})}fileListToggle(e){const n=this.targetElement.querySelector(".d2h-show"),r=this.targetElement.querySelector(".d2h-hide"),i=this.targetElement.querySelector(".d2h-file-list");if(n===null||r===null||i===null)return;const a=()=>{n.style.display="none",r.style.display="inline",i.style.display="block"},s=()=>{n.style.display="inline",r.style.display="none",i.style.display="none"};n.addEventListener("click",()=>a()),r.addEventListener("click",()=>s());const o=this.getHashTag();o==="files-summary-show"?a():o==="files-summary-hide"?s():e?a():s()}fileContentToggle(){this.targetElement.querySelectorAll(".d2h-file-collapse").forEach(e=>{e.style.display="flex";const n=i=>{var a;const s=(a=e.closest(".d2h-file-wrapper"))===null||a===void 0?void 0:a.querySelector(i);s!=null&&(e.classList.toggle("d2h-selected"),s.classList.toggle("d2h-d-none"))},r=i=>{e!==i.target&&(n(".d2h-file-diff"),n(".d2h-files-diff"))};e.addEventListener("click",i=>r(i))})}highlightCode(){const e=this.hljs;if(e===null)throw new Error("Missing a `highlight.js` implementation. Please provide one when instantiating Diff2HtmlUI.");this.targetElement.querySelectorAll(".d2h-file-wrapper").forEach(r=>{const i=r.getAttribute("data-lang");this.config.highlightLanguages instanceof Map||(this.config.highlightLanguages=new Map(Object.entries(this.config.highlightLanguages)));let a=i&&this.config.highlightLanguages.has(i)?this.config.highlightLanguages.get(i):i?Dw(i):"plaintext";e.getLanguage(a)===void 0&&(a="plaintext"),r.querySelectorAll(".d2h-code-line-ctn").forEach(o=>{const l=o.textContent,c=o.parentNode;if(l===null||c===null||!this.isElement(c))return;const d=Iw(e.highlight(l,{language:a,ignoreIllegals:!0})),u=_f(o);if(u.length){const p=document.createElementNS("http://www.w3.org/1999/xhtml","div");p.innerHTML=d.value,d.value=Aw(u,_f(p),l)}o.classList.add("hljs"),d.language&&o.classList.add(d.language),o.innerHTML=d.value})})}stickyFileHeaders(){this.targetElement.querySelectorAll(".d2h-file-header").forEach(e=>{e.classList.add("d2h-sticky-header")})}smartSelection(){console.warn("Smart selection is now enabled by default with CSS. No need to call this method anymore.")}getHashTag(){const e=document.URL,n=e.indexOf("#");let r=null;return n!==-1&&(r=e.substr(n+1)),r}isElement(e){return e!==null&&e?.classList!==void 0}};class dL extends cL{constructor(e,n,r={}){super(e,n,r,fS)}}const uL={class:"min-h-screen pt-24 pb-12 px-4 sm:px-6 lg:px-8"},_L={class:"max-w-7xl mx-auto"},pL={key:0,class:"flex items-center justify-center py-20"},mL={key:1,class:"text-center py-20"},gL={class:"text-xl font-semibold text-white mb-2"},fL={class:"text-base-400 mb-6"},EL={class:"text-sm text-base-400 font-mono mb-6 flex items-center gap-2"},SL={class:"card p-6 mb-6 relative"},bL={class:"flex flex-wrap items-center gap-4"},hL={class:"flex items-center gap-2"},TL={class:"text-xs font-mono text-base-400"},vL={value:""},RL=["value"],CL={class:"flex items-center gap-2"},yL={class:"text-xs font-mono text-base-400"},NL={value:""},OL=["value"],AL=["disabled"],IL={key:0,width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},xL={key:1,class:"spinner spinner-sm"},DL={class:"flex flex-wrap items-center justify-between mt-6 pt-6 border-t border-base-800 gap-4"},wL={class:"flex items-center gap-3"},LL={class:"text-xs font-mono text-base-400"},ML={class:"text-xs font-mono px-2 py-1 rounded bg-base-950 border border-base-800 text-neon-400"},kL={class:"flex rounded-lg overflow-hidden border border-base-800"},PL={key:0,class:"flex items-center gap-6 py-3 px-4 mb-6 text-xs bg-base-950 border border-base-800 rounded-lg"},UL={class:"text-green-400 font-mono"},FL={class:"text-red-400 font-mono"},BL={class:"text-base-400 font-mono"},GL={key:1,class:"card mb-6"},YL={class:"max-h-64 overflow-y-auto"},qL=["onClick"],HL={class:"text-sm font-mono text-base-400"},VL={class:"card overflow-hidden min-h-[300px]"},zL={key:0,class:"flex flex-col items-center justify-center py-24"},$L={class:"text-sm text-base-400 font-mono"},WL=["innerHTML"],KL={key:2,class:"flex flex-col items-center justify-center py-24 opacity-50"},QL={class:"text-xs font-mono text-base-400"},XL={class:"mt-8 pb-16"},ZL=Pt({__name:"DiffView",setup(t){const e=ya(),n=Mr(),r=Ld(),{t:i}=on(),a=me(!0),s=me(!1),o=me(""),l=me(null),c=me(""),d=me([]),u=me(""),p=me(""),_=me(""),f=me("side-by-side"),g=me(""),S=me([]),b=me(-1),h=me({added:0,removed:0}),v=me(null);let C=null,y=null;const D={added:i("diff.added"),deleted:i("diff.deleted"),modified:i("diff.modified")},L=new Set([".png",".jpg",".jpeg",".gif",".bmp",".ico",".webp",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".zip",".tar",".gz",".rar",".7z",".exe",".dll",".so",".dylib",".mp3",".mp4",".wav",".avi",".mov",".ttf",".otf",".woff",".woff2"]);function O(H){const q="."+H.split(".").pop()?.toLowerCase();return L.has(q)}async function N(){a.value=!0,o.value="";try{if(c.value=e.query.id,u.value=e.query.version_a||"",p.value=e.query.version_b||"",_.value=e.query.path||"",!c.value){o.value=i("diff.missingId");return}await r.fetchSkill(c.value),l.value=r.currentSkill;const H=await r.fetchVersions(c.value);d.value=H||[],u.value&&p.value&&await B()}catch(H){o.value=H.message||i("diff.loadFailed")}finally{a.value=!1}}async function B(){if(!u.value||!p.value){rt.warning(i("diff.selectBoth"));return}if(u.value===p.value){rt.warning(i("diff.selectBoth"));return}s.value=!0,g.value="",S.value=[],b.value=-1;try{const[H,q]=await Promise.all([fetch(Rr.downloadUrl(c.value,u.value),{credentials:"include"}).then(te=>{if(!te.ok)throw new Error(`${i("diff.loadFailed")} ${u.value}`);return te.arrayBuffer()}),fetch(Rr.downloadUrl(c.value,p.value),{credentials:"include"}).then(te=>{if(!te.ok)throw new Error(`${i("diff.loadFailed")} ${p.value}`);return te.arrayBuffer()})]);C=await Cr.loadAsync(H),y=await Cr.loadAsync(q),_.value?await K(_.value):await I(),U()}catch(H){console.error("Diff failed:",H),g.value=`<div class="flex flex-col items-center justify-center py-24"><div class="text-4xl mb-4">❌</div><p class="text-base-400">${H.message}</p></div>`}finally{s.value=!1}}async function K(H){if(O(H)){g.value=`<div class="flex flex-col items-center justify-center py-24"><div class="text-4xl mb-4">📦</div><p class="text-base-400">${i("diff.binaryDiff")}: ${H}</p></div>`,h.value={added:0,removed:0};return}const q=C.file(H),te=y.file(H),M=q?await q.async("string"):"",G=te?await te.async("string"):"";if(M===G){g.value=`<div class="flex flex-col items-center justify-center py-24"><div class="text-4xl mb-4">✅</div><p class="text-base-400">${i("state.noData")}</p></div>`,h.value={added:0,removed:0};return}const j=uf(H,M,G,`Version ${u.value}`,`Version ${p.value}`);W(j),T(j)}async function I(){const H=new Set,q=new Set;C.forEach((j,oe)=>{oe.dir||H.add(j)}),y.forEach((j,oe)=>{oe.dir||q.add(j)});const te=new Set([...H,...q]),M=[];for(const j of te){const oe=H.has(j),ie=q.has(j);let Ee;if(!oe&&ie)Ee="added";else if(oe&&!ie)Ee="deleted";else{const Z=await C.file(j)?.async("string")??"",ne=await y.file(j)?.async("string")??"";if(Z!==ne)Ee="modified";else continue}M.push({file:j,status:Ee})}if(M.sort((j,oe)=>{const ie={added:0,deleted:1,modified:2};return ie[j.status]!==ie[oe.status]?ie[j.status]-ie[oe.status]:j.file.localeCompare(oe.file)}),S.value=M,M.length===0){g.value=`<div class="flex flex-col items-center justify-center py-24"><div class="text-4xl mb-4">✅</div><p class="text-base-400">${i("state.noData")}</p></div>`,h.value={added:0,removed:0};return}let G="";for(const j of M){if(O(j.file)){G+=`diff --git a/${j.file} b/${j.file}
207
207
  `,G+=`Binary files differ
208
208
  `;continue}const oe=await C.file(j.file)?.async("string")??"",ie=await y.file(j.file)?.async("string")??"",Ee=uf(j.file,oe,ie,`Version ${u.value}`,`Version ${p.value}`);G+=Ee}W(G),T(G,M.length)}function W(H){const q=document.createElement("div"),te={drawFileList:!1,matching:"lines",outputFormat:f.value,renderNothingWhenEmpty:!1};new dL(q,H,te).draw(),g.value=q.innerHTML}function T(H,q){let te=0,M=0;H.split(`
209
- `).forEach(G=>{G.startsWith("+")&&!G.startsWith("+++")&&te++,G.startsWith("-")&&!G.startsWith("---")&&M++}),h.value={added:te,removed:M}}async function w(H,q){b.value=q,_.value=H,U(),await K(H)}function ce(){_.value="",b.value=-1,U(),C&&y&&I()}function U(){const H={id:c.value,version_a:u.value,version_b:p.value};_.value&&(H.path=_.value),n.replace({path:"/diff",query:H})}return or(f,()=>{C&&y&&(_.value?K(_.value):S.value.length>0&&B())}),Ht(()=>{N()}),(H,q)=>{const te=Bn("router-link");return le(),de("div",uL,[m("div",_L,[a.value?(le(),de("div",pL,[...q[4]||(q[4]=[m("div",{class:"spinner"},null,-1)])])):o.value?(le(),de("div",mL,[q[5]||(q[5]=m("div",{class:"w-20 h-20 mx-auto mb-6 rounded-full bg-base-800 flex items-center justify-center"},[m("svg",{class:"w-10 h-10 text-base-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),m("h3",gL,X(J(i)("diff.loadFailed")),1),m("p",fL,X(o.value),1),Ue(te,{to:"/",class:"btn-primary px-6 py-3 rounded-lg"},{default:it(()=>[he(X(J(i)("diff.backToHome")),1)]),_:1})])):(le(),de(ke,{key:2},[m("div",EL,[q[7]||(q[7]=m("span",{class:"text-neon-400"},"~",-1)),q[8]||(q[8]=m("span",{class:"opacity-50"},"/",-1)),Ue(te,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[...q[6]||(q[6]=[he("home",-1)])]),_:1}),q[9]||(q[9]=m("span",{class:"opacity-50"},"/",-1)),Ue(te,{to:`/skills/${c.value}`,class:"hover:text-white transition-colors"},{default:it(()=>[he(X(l.value?.name||c.value),1)]),_:1},8,["to"]),q[10]||(q[10]=m("span",{class:"opacity-50"},"/",-1)),q[11]||(q[11]=m("span",{class:"text-white"},"diff",-1))]),m("div",SL,[q[14]||(q[14]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"GIT-DIFF",-1)),m("div",bL,[m("div",hL,[m("span",TL,X(J(i)("diff.old")),1),Ye(m("select",{"onUpdate:modelValue":q[0]||(q[0]=M=>u.value=M),class:"bg-base-950 border border-base-800 text-white font-mono text-xs rounded-lg px-3 py-2 focus:border-neon-500 focus:outline-none w-48"},[m("option",vL,X(J(i)("diff.selectVersion")),1),(le(!0),de(ke,null,Rt(d.value,(M,G)=>(le(),de("option",{key:M.version,value:M.version},X(M.version)+" "+X(G===0?J(i)("skill.latestTag"):""),9,RL))),128))],512),[[Ir,u.value]])]),q[13]||(q[13]=m("span",{class:"font-mono text-base-600"},"->",-1)),m("div",CL,[m("span",yL,X(J(i)("diff.new")),1),Ye(m("select",{"onUpdate:modelValue":q[1]||(q[1]=M=>p.value=M),class:"bg-base-950 border border-base-800 text-white font-mono text-xs rounded-lg px-3 py-2 focus:border-neon-500 focus:outline-none w-48"},[m("option",NL,X(J(i)("diff.selectVersion")),1),(le(!0),de(ke,null,Rt(d.value,(M,G)=>(le(),de("option",{key:M.version,value:M.version},X(M.version)+" "+X(G===0?J(i)("skill.latestTag"):""),9,OL))),128))],512),[[Ir,p.value]])]),m("button",{onClick:B,class:"btn-primary flex items-center gap-2 ml-2 text-xs px-4 py-2",disabled:s.value},[s.value?(le(),de("div",xL)):(le(),de("svg",IL,[...q[12]||(q[12]=[m("polyline",{points:"23 4 23 10 17 10"},null,-1),m("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"},null,-1)])])),he(" "+X(s.value?J(i)("diff.computingDiff"):"Diff"),1)],8,AL)]),m("div",DL,[m("div",wL,[m("span",LL,X(J(i)("diff.file")),1),m("span",ML,X(_.value||J(i)("diff.allFiles")),1),_.value?(le(),de("button",{key:0,onClick:ce,class:"text-xs text-base-400 hover:text-white"},X(J(i)("diff.clearSelection")),1)):ze("",!0)]),m("div",kL,[m("button",{onClick:q[2]||(q[2]=M=>f.value="side-by-side"),class:Fe(["px-4 py-1.5 text-xs font-mono transition-colors",f.value==="side-by-side"?"bg-neon-400/10 border-neon-500 text-neon-400 border":"bg-transparent text-base-400 hover:text-white"])},X(J(i)("diff.split")),3),m("button",{onClick:q[3]||(q[3]=M=>f.value="line-by-line"),class:Fe(["px-4 py-1.5 text-xs font-mono transition-colors border-l border-base-800",f.value==="line-by-line"?"bg-neon-400/10 border-neon-500 text-neon-400 border":"bg-transparent text-base-400 hover:text-white"])},X(J(i)("diff.unifiedView")),3)])])]),h.value.added>0||h.value.removed>0?(le(),de("div",PL,[m("span",UL,"+"+X(h.value.added)+" "+X(J(i)("diff.linesAdded")),1),m("span",FL,"-"+X(h.value.removed)+" "+X(J(i)("diff.linesRemoved")),1),m("span",BL,X(S.value.length)+X(J(i)("diff.filesChanged")),1)])):ze("",!0),S.value.length>0&&!_.value?(le(),de("div",GL,[q[15]||(q[15]=m("div",{class:"px-4 py-3 bg-base-950/50 border-b border-base-800 flex items-center gap-2 text-xs"},[m("span",{class:"text-neon-400"},"ls"),m("span",{class:"opacity-50"},"--changed")],-1)),m("div",YL,[(le(!0),de(ke,null,Rt(S.value,(M,G)=>(le(),de("div",{key:M.file,onClick:j=>w(M.file,G),class:Fe(["flex items-center gap-3 px-4 py-3 border-b border-base-800 cursor-pointer hover:bg-white/5 transition-colors",{"bg-neon-400/5":b.value===G}])},[m("span",{class:Fe(["text-xs px-2 py-0.5 rounded",{"bg-green-500/10 text-green-400":M.status==="added","bg-red-500/10 text-red-400":M.status==="deleted","bg-orange-500/10 text-orange-400":M.status==="modified"}])},X(D[M.status]),3),m("span",HL,X(M.file),1)],10,qL))),128))])])):ze("",!0),m("div",VL,[s.value?(le(),de("div",zL,[q[16]||(q[16]=m("div",{class:"spinner mb-4"},null,-1)),m("p",$L,X(J(i)("diff.computing")),1)])):g.value?(le(),de("div",{key:1,ref_key:"diffOutputRef",ref:v,class:"diff-output",innerHTML:g.value},null,8,WL)):(le(),de("div",KL,[q[17]||(q[17]=m("div",{class:"font-mono text-4xl mb-4"},"_",-1)),m("p",QL,X(J(i)("diff.empty")),1)]))]),m("div",XL,[Ue(te,{to:`/skills/${c.value}`,class:"btn-secondary flex items-center gap-2 text-sm px-4 py-2 w-fit"},{default:it(()=>[q[18]||(q[18]=m("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),m("polyline",{points:"12 19 5 12 12 5"})],-1)),he(" "+X(J(i)("diff.back")),1)]),_:1},8,["to"])])],64))])])}}}),jL=Tn(ZL,[["__scopeId","data-v-90ff69f8"]]),JL={class:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-16"},eM={class:"text-sm text-base-400 font-mono mb-6 flex items-center gap-2"},tM={class:"skill-card p-8 relative overflow-hidden"},nM={class:"mb-8 border-b border-base-800 pb-6"},rM={class:"text-2xl font-bold text-white mb-2 flex items-center gap-3"},iM={class:"text-base-400 text-sm font-mono"},aM={class:"flex items-center justify-between mb-8 flex-wrap gap-4"},sM={class:"flex items-center gap-2 text-lg font-semibold text-white pb-3 border-b border-base-800 font-mono mb-0"},oM={class:"flex gap-4 mb-6 flex-wrap items-center"},lM={class:"flex-1 min-w-[200px]"},cM={class:"relative"},dM=["placeholder"],uM={value:""},_M={value:"active"},pM={value:"disabled"},mM={class:"border border-base-800 rounded-xl overflow-hidden"},gM={class:"w-full"},fM={class:"bg-base-950"},EM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},SM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},bM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},hM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},TM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},vM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},RM={key:1,class:"border-t border-base-800"},CM={colspan:"6",class:"px-4 py-12 text-center"},yM={class:"text-base-400 font-mono"},NM={class:"px-4 py-4 font-mono text-white"},OM={class:"px-4 py-4 font-mono text-white"},AM={class:"px-4 py-4"},IM={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},xM={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},DM={class:"px-4 py-4 font-mono"},wM={class:"px-4 py-4 font-mono text-base-400 text-sm"},LM={class:"px-4 py-4"},MM=["onClick","title"],kM={key:0,class:"flex items-center justify-center gap-4 px-4 py-4 border-t border-base-800"},PM=["disabled"],UM={class:"text-base-400 font-mono text-sm"},FM=["disabled"],BM={class:"bg-base-900 border border-base-800 rounded-xl shadow-2xl w-full max-w-md mx-4 transform transition-all"},GM={class:"flex items-center justify-between px-6 py-4 border-b border-base-800"},YM={class:"text-lg font-semibold text-white font-mono flex items-center gap-2"},qM={class:"relative"},HM=["type"],VM={class:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1"},zM={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},$M={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},WM={class:"font-mono text-base-400 mb-3 block text-sm"},KM={class:"flex gap-6"},QM={class:"flex items-center gap-2 cursor-pointer"},XM={class:"text-white font-mono text-sm"},ZM={class:"flex items-center gap-2 cursor-pointer"},jM={class:"text-white font-mono text-sm"},JM={class:"flex items-center justify-end gap-3 pt-4 border-t border-base-800"},ek=["disabled"],tk={key:0,class:"spinner spinner-sm"},nk={class:"bg-base-900 border border-base-800 rounded-xl shadow-2xl w-full max-w-md mx-4 transform transition-all"},rk={class:"flex items-center justify-between px-6 py-4 border-b border-base-800"},ik={class:"text-lg font-semibold text-white font-mono flex items-center gap-2"},ak=["value"],sk={class:"font-mono text-base-400 mb-3 block text-sm"},ok={class:"flex gap-6"},lk={class:"flex items-center gap-2 cursor-pointer"},ck={class:"text-white font-mono text-sm"},dk={class:"flex items-center gap-2 cursor-pointer"},uk={class:"text-white font-mono text-sm"},_k={class:"border-t border-base-800 pt-5"},pk={class:"flex items-center justify-between"},mk={class:"font-mono text-base-400 block text-sm"},gk={class:"text-xs text-base-500 font-mono mt-1"},fk={class:"relative inline-flex items-center cursor-pointer"},Ek={class:"border-t border-base-800 pt-5"},Sk={class:"flex items-center justify-between"},bk={class:"font-mono text-base-400 block text-sm"},hk={class:"text-xs text-base-500 font-mono mt-1"},Tk={key:0,class:"mt-4"},vk={class:"relative"},Rk=["type","placeholder"],Ck={class:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1"},yk={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Nk={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ok={class:"flex items-center justify-end gap-3 pt-4 border-t border-base-800"},Ak=["disabled"],Ik={key:0,class:"spinner spinner-sm"},qc=10,xk=Pt({__name:"UserManagementView",setup(t){const{t:e,currentLang:n}=on();Ht(()=>{a()});const r=me([]),i=me(!1);async function a(){i.value=!0;try{const T=await Vi.list();r.value=T.users}catch(T){rt.error(e("admin.fetchError")+": "+T.message)}finally{i.value=!1}}const s=me(""),o=me(""),l=Ie(()=>{let T=r.value;if(s.value){const w=s.value.toLowerCase();T=T.filter(ce=>ce.username.toLowerCase().includes(w)||ce.name&&ce.name.toLowerCase().includes(w))}return o.value&&(o.value==="active"?T=T.filter(w=>!w.disabled):o.value==="disabled"&&(T=T.filter(w=>w.disabled))),T}),c=me(1),d=Ie(()=>Math.ceil(l.value.length/qc)),u=Ie(()=>{const T=(c.value-1)*qc,w=T+qc;return l.value.slice(T,w)}),p=me(!1),_=me(!1),f=me(!1),g=me({username:"",password:"",name:"",role:"user"});function S(){g.value={username:"",password:"",name:"",role:"user"},_.value=!1,p.value=!0}function b(){p.value=!1}function h(){const T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*";let w="";for(let ce=0;ce<12;ce++)w+=T.charAt(Math.floor(Math.random()*T.length));g.value.password=w,_.value=!0}async function v(){f.value=!0;try{await Vi.create(g.value),await a(),b(),rt.success(e("admin.addSuccess"))}catch(T){rt.error(e("admin.addError")+": "+T.message)}finally{f.value=!1}}const C=me(!1),y=me(!1),D=me(!1),L=me(!1),O=me({id:0,username:"",name:"",role:"user",disabled:!1,newPassword:""});function N(T){O.value={id:T.id,username:T.username,name:T.name||"",role:T.role,disabled:T.disabled||!1,newPassword:""},y.value=!1,D.value=!1,C.value=!0}function B(){C.value=!1}function K(){const T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*";let w="";for(let ce=0;ce<12;ce++)w+=T.charAt(Math.floor(Math.random()*T.length));O.value.newPassword=w,y.value=!0}async function I(){L.value=!0;try{await Vi.update(O.value.id,{name:O.value.name,role:O.value.role}),O.value.newPassword,await a(),B(),rt.success(e("admin.editSuccess"))}catch(T){rt.error(e("admin.editError")+": "+T.message)}finally{L.value=!1}}function W(T){return new Date(T).toLocaleDateString(n.value==="zh"?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit"})}return(T,w)=>{const ce=Bn("router-link");return le(),de("main",JL,[m("div",eM,[w[18]||(w[18]=m("span",{class:"text-neon-400"},"~",-1)),w[19]||(w[19]=m("span",{class:"opacity-50"},"/",-1)),Ue(ce,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[he(X(J(e)("nav.home")),1)]),_:1}),w[20]||(w[20]=m("span",{class:"opacity-50"},"/",-1)),w[21]||(w[21]=m("span",{class:"text-white"},"admin",-1)),w[22]||(w[22]=m("span",{class:"opacity-50"},"/",-1)),w[23]||(w[23]=m("span",{class:"text-white"},"users",-1))]),m("div",tM,[w[34]||(w[34]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"ADMIN-USERS",-1)),m("div",nM,[m("h1",rM,[w[24]||(w[24]=m("span",{class:"text-neon-400 font-mono font-normal opacity-70"},">",-1)),m("span",null,X(J(e)("admin.heading")),1)]),m("p",iM,X(J(e)("admin.subtitle")),1)]),m("div",aM,[m("h2",sM,[w[25]||(w[25]=m("span",{class:"text-neon-400"},"#",-1)),he(" "+X(J(e)("admin.userList")),1)]),m("button",{class:"btn-primary px-4 py-2.5 rounded-lg font-mono flex items-center gap-2",onClick:S},[w[26]||(w[26]=m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),m("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),m("span",null,X(J(e)("admin.addUser")),1)])]),m("div",oM,[m("div",lM,[m("div",cM,[Ye(m("input",{type:"text","onUpdate:modelValue":w[0]||(w[0]=U=>s.value=U),placeholder:J(e)("admin.searchPlaceholder"),class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-2.5 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors pl-10"},null,8,dM),[[at,s.value]]),w[28]||(w[28]=m("span",{class:"absolute left-3 top-1/2 -translate-y-1/2 text-base-400"},[m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("circle",{cx:"11",cy:"11",r:"8"}),m("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})])],-1)),s.value?(le(),de("button",{key:0,type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-base-400 hover:text-white transition-colors",onClick:w[1]||(w[1]=U=>s.value="")},[...w[27]||(w[27]=[m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])):ze("",!0)])]),Ye(m("select",{"onUpdate:modelValue":w[2]||(w[2]=U=>o.value=U),class:"bg-base-950 border border-base-800 rounded-lg px-4 py-2.5 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors min-w-[140px] appearance-none cursor-pointer",style:{"background-image":"url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 24 24%27 stroke=%27%23a1a1aa%27%3E%3Cpath stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27M19 9l-7 7-7-7%27/%3E%3C/svg%3E')","background-repeat":"no-repeat","background-position":"right 0.75rem center","background-size":"1rem","padding-right":"2.5rem"}},[m("option",uM,X(J(e)("admin.allStatus")),1),m("option",_M,X(J(e)("admin.active")),1),m("option",pM,X(J(e)("admin.disabled")),1)],512),[[Ir,o.value]])]),m("div",mM,[m("table",gM,[m("thead",null,[m("tr",fM,[m("th",EM,X(J(e)("admin.thUsername")),1),m("th",SM,X(J(e)("admin.thName")),1),m("th",bM,X(J(e)("admin.thRole")),1),m("th",hM,X(J(e)("admin.thStatus")),1),m("th",TM,X(J(e)("admin.thCreatedAt")),1),m("th",vM,X(J(e)("admin.thActions")),1)])]),m("tbody",null,[i.value?(le(),de(ke,{key:0},Rt(5,U=>m("tr",{key:U,class:"border-t border-base-800"},[(le(),de(ke,null,Rt(6,H=>m("td",{key:H,class:"px-4 py-4"},[...w[29]||(w[29]=[m("div",{class:"h-4 bg-base-800 rounded animate-pulse"},null,-1)])])),64))])),64)):u.value.length===0?(le(),de("tr",RM,[m("td",CM,[w[30]||(w[30]=m("div",{class:"text-4xl mb-4 opacity-30"},"📦",-1)),m("p",yM,X(J(e)("admin.emptyState")),1)])])):(le(!0),de(ke,{key:2},Rt(u.value,U=>(le(),de("tr",{key:U.id,class:"border-t border-base-800 hover:bg-white/5 transition-colors"},[m("td",NM,X(U.username),1),m("td",OM,X(U.name||"-"),1),m("td",AM,[m("span",{class:Fe(["inline-flex items-center gap-1 px-3 py-1 text-xs font-medium rounded-full font-mono",U.role==="admin"?"bg-neon-400/10 text-neon-400 border border-neon-400/30":"bg-blue-500/10 text-blue-400 border border-blue-500/30"])},[U.role==="admin"?(le(),de("svg",IM,[...w[31]||(w[31]=[m("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])])):(le(),de("svg",xM,[...w[32]||(w[32]=[m("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},null,-1),m("circle",{cx:"12",cy:"7",r:"4"},null,-1)])])),he(" "+X(U.role==="admin"?J(e)("admin.roleAdmin"):J(e)("admin.roleUser")),1)],2)]),m("td",DM,[m("span",{class:Fe(U.disabled?"text-red-400":"text-neon-400")},X(U.disabled?J(e)("admin.disabled"):J(e)("admin.active")),3)]),m("td",wM,X(W(U.created_at)),1),m("td",LM,[m("button",{class:"p-2 text-base-400 hover:text-neon-400 hover:bg-neon-400/10 rounded-lg transition-colors",onClick:H=>N(U),title:J(e)("admin.editUser")},[...w[33]||(w[33]=[m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),m("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})],-1)])],8,MM)])]))),128))])]),d.value>1?(le(),de("div",kM,[m("button",{class:"px-4 py-2 rounded-lg font-mono text-sm border border-base-800 text-base-400 hover:border-neon-400 hover:text-neon-400 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:c.value===1,onClick:w[3]||(w[3]=U=>c.value--)},X(J(e)("admin.prevPage")),9,PM),m("span",UM,X(c.value)+" / "+X(d.value),1),m("button",{class:"px-4 py-2 rounded-lg font-mono text-sm border border-base-800 text-base-400 hover:border-neon-400 hover:text-neon-400 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:c.value===d.value,onClick:w[4]||(w[4]=U=>c.value++)},X(J(e)("admin.nextPage")),9,FM)])):ze("",!0)])]),p.value?(le(),de("div",{key:0,class:"fixed inset-0 bg-black/80 flex items-center justify-center z-50",onClick:At(b,["self"])},[m("div",BM,[m("div",GM,[m("h3",YM,[w[35]||(w[35]=m("span",{class:"text-neon-400 opacity-70"},">",-1)),he(" "+X(J(e)("admin.addModal")),1)]),m("button",{class:"text-base-400 hover:text-white transition-colors",onClick:b},[...w[36]||(w[36]=[m("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),m("form",{onSubmit:At(v,["prevent"]),class:"p-6 space-y-5"},[m("div",null,[w[37]||(w[37]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"username"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":w[5]||(w[5]=U=>g.value.username=U),required:"",autocomplete:"off",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,g.value.username]])]),m("div",null,[w[41]||(w[41]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"password"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),m("div",qM,[Ye(m("input",{type:_.value?"text":"password","onUpdate:modelValue":w[6]||(w[6]=U=>g.value.password=U),required:"",autocomplete:"new-password",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors pr-20"},null,8,HM),[[e_,g.value.password]]),m("div",VM,[m("button",{type:"button",class:"p-1.5 text-base-400 hover:text-neon-400 rounded transition-colors",onClick:w[7]||(w[7]=U=>_.value=!_.value)},[_.value?(le(),de("svg",zM,[...w[38]||(w[38]=[m("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),m("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):(le(),de("svg",$M,[...w[39]||(w[39]=[m("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),m("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])]))]),m("button",{type:"button",class:"p-1.5 text-base-400 hover:text-neon-400 rounded transition-colors",onClick:h,title:"Generate password"},[...w[40]||(w[40]=[dr('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="2" width="20" height="20" rx="2" ry="2"></rect><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="16" cy="8" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="8" cy="16" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="16" cy="16" r="1.5" fill="currentColor" stroke="none"></circle></svg>',1)])])])])]),m("div",null,[w[42]||(w[42]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"name"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":w[8]||(w[8]=U=>g.value.name=U),class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,g.value.name]])]),m("div",null,[m("label",WM,X(J(e)("admin.roleLabel")),1),m("div",KM,[m("label",QM,[Ye(m("input",{type:"radio","onUpdate:modelValue":w[9]||(w[9]=U=>g.value.role=U),value:"user",class:"w-4 h-4 accent-neon-400"},null,512),[[jr,g.value.role]]),m("span",XM,X(J(e)("admin.roleUser")),1)]),m("label",ZM,[Ye(m("input",{type:"radio","onUpdate:modelValue":w[10]||(w[10]=U=>g.value.role=U),value:"admin",class:"w-4 h-4 accent-neon-400"},null,512),[[jr,g.value.role]]),m("span",jM,X(J(e)("admin.roleAdmin")),1)])])]),m("div",JM,[m("button",{type:"button",class:"px-4 py-2 rounded-lg font-mono text-sm border border-base-800 text-base-400 hover:border-white hover:text-white transition-colors",onClick:b},X(J(e)("admin.cancel")),1),m("button",{type:"submit",disabled:f.value,class:"btn-primary px-4 py-2 rounded-lg font-mono text-sm flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"},[f.value?(le(),de("span",tk)):(le(),de(ke,{key:1},[he(X(J(e)("admin.confirmAdd")),1)],64))],8,ek)])],32)])])):ze("",!0),C.value?(le(),de("div",{key:1,class:"fixed inset-0 bg-black/80 flex items-center justify-center z-50",onClick:At(B,["self"])},[m("div",nk,[m("div",rk,[m("h3",ik,[w[43]||(w[43]=m("span",{class:"text-neon-400 opacity-70"},">",-1)),he(" "+X(J(e)("admin.editModal")),1)]),m("button",{class:"text-base-400 hover:text-white transition-colors",onClick:B},[...w[44]||(w[44]=[m("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),m("form",{onSubmit:At(I,["prevent"]),class:"p-6 space-y-5"},[m("div",null,[w[45]||(w[45]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"username"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),m("input",{type:"text",value:O.value.username,disabled:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-base-400 cursor-not-allowed"},null,8,ak)]),m("div",null,[w[46]||(w[46]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"name"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":w[11]||(w[11]=U=>O.value.name=U),autocomplete:"off",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,O.value.name]])]),m("div",null,[m("label",sk,X(J(e)("admin.roleLabel")),1),m("div",ok,[m("label",lk,[Ye(m("input",{type:"radio","onUpdate:modelValue":w[12]||(w[12]=U=>O.value.role=U),value:"user",class:"w-4 h-4 accent-neon-400"},null,512),[[jr,O.value.role]]),m("span",ck,X(J(e)("admin.roleUser")),1)]),m("label",dk,[Ye(m("input",{type:"radio","onUpdate:modelValue":w[13]||(w[13]=U=>O.value.role=U),value:"admin",class:"w-4 h-4 accent-neon-400"},null,512),[[jr,O.value.role]]),m("span",uk,X(J(e)("admin.roleAdmin")),1)])])]),m("div",_k,[m("div",pk,[m("div",null,[m("label",mk,X(J(e)("admin.statusLabel")),1),m("p",gk,X(O.value.disabled?J(e)("admin.statusDisabled"):J(e)("admin.statusActive")),1)]),m("label",fk,[Ye(m("input",{type:"checkbox","onUpdate:modelValue":w[14]||(w[14]=U=>O.value.disabled=U),class:"sr-only peer"},null,512),[[FE,O.value.disabled]]),w[47]||(w[47]=m("div",{class:"w-12 h-6 bg-base-800 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-base-400 after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-neon-400 peer-checked:after:bg-base-950"},null,-1))])])]),m("div",Ek,[m("div",Sk,[m("div",null,[m("label",bk,X(J(e)("admin.resetPassword")),1),m("p",hk,X(J(e)("admin.resetPasswordHint")),1)]),m("button",{type:"button",class:"px-3 py-1.5 rounded-lg font-mono text-xs border border-base-800 text-base-400 hover:border-neon-400 hover:text-neon-400 transition-colors",onClick:w[15]||(w[15]=U=>D.value=!D.value)},X(D.value?J(e)("admin.cancelReset"):J(e)("admin.doReset")),1)]),D.value?(le(),de("div",Tk,[m("div",vk,[Ye(m("input",{type:y.value?"text":"password","onUpdate:modelValue":w[16]||(w[16]=U=>O.value.newPassword=U),placeholder:J(e)("admin.newPasswordPlaceholder"),autocomplete:"new-password",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors pr-16"},null,8,Rk),[[e_,O.value.newPassword]]),m("div",Ck,[m("button",{type:"button",class:"p-1.5 text-base-400 hover:text-neon-400 rounded transition-colors",onClick:w[17]||(w[17]=U=>y.value=!y.value)},[y.value?(le(),de("svg",yk,[...w[48]||(w[48]=[m("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),m("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):(le(),de("svg",Nk,[...w[49]||(w[49]=[m("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),m("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])]))]),m("button",{type:"button",class:"p-1.5 text-base-400 hover:text-neon-400 rounded transition-colors",onClick:K,title:"Generate password"},[...w[50]||(w[50]=[dr('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="2" width="20" height="20" rx="2" ry="2"></rect><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="16" cy="8" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="8" cy="16" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="16" cy="16" r="1.5" fill="currentColor" stroke="none"></circle></svg>',1)])])])])])):ze("",!0)]),m("div",Ok,[m("button",{type:"button",class:"px-4 py-2 rounded-lg font-mono text-sm border border-base-800 text-base-400 hover:border-white hover:text-white transition-colors",onClick:B},X(J(e)("admin.cancel")),1),m("button",{type:"submit",disabled:L.value,class:"btn-primary px-4 py-2 rounded-lg font-mono text-sm flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"},[L.value?(le(),de("span",Ik)):(le(),de(ke,{key:1},[he(X(J(e)("admin.confirmSave")),1)],64))],8,Ak)])],32)])])):ze("",!0)])}}}),NS=Nv({history:iv(ta),routes:[{path:"/",name:"",component:xR},{path:"/login",name:"login",component:$R},{path:"/skills/:id",name:"skill-detail",component:tx},{path:"/publish",name:"publish",component:Zx,meta:{requiresAuth:!0}},{path:"/settings",name:"settings",component:RD,meta:{requiresAuth:!0}},{path:"/cli-code",name:"cli-code",component:KD},{path:"/setup",name:"setup",component:mw},{path:"/diff",name:"diff",component:jL},{path:"/admin/users",name:"user-management",component:xk,meta:{requiresAuth:!0,requiresAdmin:!0}}]});NS.beforeEach(async t=>{if(!t.meta.requiresAuth&&!t.meta.requiresAdmin)return!0;const e=vi();return await e.fetchUser({force:!0})?t.meta.requiresAdmin&&!e.isAdmin?{path:"/"}:!0:{path:"/login",query:{redirect:t.fullPath}}});const Qd=_T(_R);Qd.use(gT());Qd.use(NS);Qd.mount("#app");
209
+ `).forEach(G=>{G.startsWith("+")&&!G.startsWith("+++")&&te++,G.startsWith("-")&&!G.startsWith("---")&&M++}),h.value={added:te,removed:M}}async function w(H,q){b.value=q,_.value=H,U(),await K(H)}function ce(){_.value="",b.value=-1,U(),C&&y&&I()}function U(){const H={id:c.value,version_a:u.value,version_b:p.value};_.value&&(H.path=_.value),n.replace({path:"/diff",query:H})}return or(f,()=>{C&&y&&(_.value?K(_.value):S.value.length>0&&B())}),Ht(()=>{N()}),(H,q)=>{const te=Bn("router-link");return le(),de("div",uL,[m("div",_L,[a.value?(le(),de("div",pL,[...q[4]||(q[4]=[m("div",{class:"spinner"},null,-1)])])):o.value?(le(),de("div",mL,[q[5]||(q[5]=m("div",{class:"w-20 h-20 mx-auto mb-6 rounded-full bg-base-800 flex items-center justify-center"},[m("svg",{class:"w-10 h-10 text-base-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[m("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})])],-1)),m("h3",gL,X(J(i)("diff.loadFailed")),1),m("p",fL,X(o.value),1),Ue(te,{to:"/",class:"btn-primary px-6 py-3 rounded-lg"},{default:it(()=>[he(X(J(i)("diff.backToHome")),1)]),_:1})])):(le(),de(ke,{key:2},[m("div",EL,[q[7]||(q[7]=m("span",{class:"text-neon-400"},"~",-1)),q[8]||(q[8]=m("span",{class:"opacity-50"},"/",-1)),Ue(te,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[...q[6]||(q[6]=[he("home",-1)])]),_:1}),q[9]||(q[9]=m("span",{class:"opacity-50"},"/",-1)),Ue(te,{to:`/skills/${c.value}`,class:"hover:text-white transition-colors"},{default:it(()=>[he(X(l.value?.name||c.value),1)]),_:1},8,["to"]),q[10]||(q[10]=m("span",{class:"opacity-50"},"/",-1)),q[11]||(q[11]=m("span",{class:"text-white"},"diff",-1))]),m("div",SL,[q[14]||(q[14]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"GIT-DIFF",-1)),m("div",bL,[m("div",hL,[m("span",TL,X(J(i)("diff.old")),1),Ye(m("select",{"onUpdate:modelValue":q[0]||(q[0]=M=>u.value=M),class:"bg-base-950 border border-base-800 text-white font-mono text-xs rounded-lg px-3 py-2 focus:border-neon-500 focus:outline-none w-48"},[m("option",vL,X(J(i)("diff.selectVersion")),1),(le(!0),de(ke,null,Rt(d.value,(M,G)=>(le(),de("option",{key:M.version,value:M.version},X(M.version)+" "+X(G===0?J(i)("skill.latestTag"):""),9,RL))),128))],512),[[Ir,u.value]])]),q[13]||(q[13]=m("span",{class:"font-mono text-base-600"},"->",-1)),m("div",CL,[m("span",yL,X(J(i)("diff.new")),1),Ye(m("select",{"onUpdate:modelValue":q[1]||(q[1]=M=>p.value=M),class:"bg-base-950 border border-base-800 text-white font-mono text-xs rounded-lg px-3 py-2 focus:border-neon-500 focus:outline-none w-48"},[m("option",NL,X(J(i)("diff.selectVersion")),1),(le(!0),de(ke,null,Rt(d.value,(M,G)=>(le(),de("option",{key:M.version,value:M.version},X(M.version)+" "+X(G===0?J(i)("skill.latestTag"):""),9,OL))),128))],512),[[Ir,p.value]])]),m("button",{onClick:B,class:"btn-primary flex items-center gap-2 ml-2 text-xs px-4 py-2",disabled:s.value},[s.value?(le(),de("div",xL)):(le(),de("svg",IL,[...q[12]||(q[12]=[m("polyline",{points:"23 4 23 10 17 10"},null,-1),m("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"},null,-1)])])),he(" "+X(s.value?J(i)("diff.computingDiff"):"Diff"),1)],8,AL)]),m("div",DL,[m("div",wL,[m("span",LL,X(J(i)("diff.file")),1),m("span",ML,X(_.value||J(i)("diff.allFiles")),1),_.value?(le(),de("button",{key:0,onClick:ce,class:"text-xs text-base-400 hover:text-white"},X(J(i)("diff.clearSelection")),1)):ze("",!0)]),m("div",kL,[m("button",{onClick:q[2]||(q[2]=M=>f.value="side-by-side"),class:Fe(["px-4 py-1.5 text-xs font-mono transition-colors",f.value==="side-by-side"?"bg-neon-400/10 border-neon-500 text-neon-400 border":"bg-transparent text-base-400 hover:text-white"])},X(J(i)("diff.split")),3),m("button",{onClick:q[3]||(q[3]=M=>f.value="line-by-line"),class:Fe(["px-4 py-1.5 text-xs font-mono transition-colors border-l border-base-800",f.value==="line-by-line"?"bg-neon-400/10 border-neon-500 text-neon-400 border":"bg-transparent text-base-400 hover:text-white"])},X(J(i)("diff.unifiedView")),3)])])]),h.value.added>0||h.value.removed>0?(le(),de("div",PL,[m("span",UL,"+"+X(h.value.added)+" "+X(J(i)("diff.linesAdded")),1),m("span",FL,"-"+X(h.value.removed)+" "+X(J(i)("diff.linesRemoved")),1),m("span",BL,X(S.value.length)+X(J(i)("diff.filesChanged")),1)])):ze("",!0),S.value.length>0&&!_.value?(le(),de("div",GL,[q[15]||(q[15]=m("div",{class:"px-4 py-3 bg-base-950/50 border-b border-base-800 flex items-center gap-2 text-xs"},[m("span",{class:"text-neon-400"},"ls"),m("span",{class:"opacity-50"},"--changed")],-1)),m("div",YL,[(le(!0),de(ke,null,Rt(S.value,(M,G)=>(le(),de("div",{key:M.file,onClick:j=>w(M.file,G),class:Fe(["flex items-center gap-3 px-4 py-3 border-b border-base-800 cursor-pointer hover:bg-white/5 transition-colors",{"bg-neon-400/5":b.value===G}])},[m("span",{class:Fe(["text-xs px-2 py-0.5 rounded",{"bg-green-500/10 text-green-400":M.status==="added","bg-red-500/10 text-red-400":M.status==="deleted","bg-orange-500/10 text-orange-400":M.status==="modified"}])},X(D[M.status]),3),m("span",HL,X(M.file),1)],10,qL))),128))])])):ze("",!0),m("div",VL,[s.value?(le(),de("div",zL,[q[16]||(q[16]=m("div",{class:"spinner mb-4"},null,-1)),m("p",$L,X(J(i)("diff.computing")),1)])):g.value?(le(),de("div",{key:1,ref_key:"diffOutputRef",ref:v,class:"diff-output",innerHTML:g.value},null,8,WL)):(le(),de("div",KL,[q[17]||(q[17]=m("div",{class:"font-mono text-4xl mb-4"},"_",-1)),m("p",QL,X(J(i)("diff.empty")),1)]))]),m("div",XL,[Ue(te,{to:`/skills/${c.value}`,class:"btn-secondary flex items-center gap-2 text-sm px-4 py-2 w-fit"},{default:it(()=>[q[18]||(q[18]=m("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"19",y1:"12",x2:"5",y2:"12"}),m("polyline",{points:"12 19 5 12 12 5"})],-1)),he(" "+X(J(i)("diff.back")),1)]),_:1},8,["to"])])],64))])])}}}),jL=Tn(ZL,[["__scopeId","data-v-90ff69f8"]]),JL={class:"max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 pt-8 pb-16"},eM={class:"text-sm text-base-400 font-mono mb-6 flex items-center gap-2"},tM={class:"skill-card p-8 relative overflow-hidden"},nM={class:"mb-8 border-b border-base-800 pb-6"},rM={class:"text-2xl font-bold text-white mb-2 flex items-center gap-3"},iM={class:"text-base-400 text-sm font-mono"},aM={class:"flex items-center justify-between mb-8 flex-wrap gap-4"},sM={class:"flex items-center gap-2 text-lg font-semibold text-white pb-3 border-b border-base-800 font-mono mb-0"},oM={class:"flex gap-4 mb-6 flex-wrap items-center"},lM={class:"flex-1 min-w-[200px]"},cM={class:"relative"},dM=["placeholder"],uM={value:""},_M={value:"active"},pM={value:"disabled"},mM={class:"border border-base-800 rounded-xl overflow-hidden"},gM={class:"w-full"},fM={class:"bg-base-950"},EM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},SM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},bM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},hM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},TM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},vM={class:"px-4 py-3 text-left text-xs font-semibold text-base-400 font-mono uppercase tracking-wider"},RM={key:1,class:"border-t border-base-800"},CM={colspan:"6",class:"px-4 py-12 text-center"},yM={class:"text-base-400 font-mono"},NM={class:"px-4 py-4 font-mono text-white"},OM={class:"px-4 py-4 font-mono text-white"},AM={class:"px-4 py-4"},IM={key:0,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},xM={key:1,width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},DM={class:"px-4 py-4 font-mono"},wM={class:"px-4 py-4 font-mono text-base-400 text-sm"},LM={class:"px-4 py-4"},MM=["onClick","title"],kM={key:0,class:"flex items-center justify-center gap-4 px-4 py-4 border-t border-base-800"},PM=["disabled"],UM={class:"text-base-400 font-mono text-sm"},FM=["disabled"],BM={class:"bg-base-900 border border-base-800 rounded-xl shadow-2xl w-full max-w-md mx-4 transform transition-all"},GM={class:"flex items-center justify-between px-6 py-4 border-b border-base-800"},YM={class:"text-lg font-semibold text-white font-mono flex items-center gap-2"},qM={class:"relative"},HM=["type"],VM={class:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1"},zM={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},$M={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},WM={class:"font-mono text-base-400 mb-3 block text-sm"},KM={class:"flex gap-6"},QM={class:"flex items-center gap-2 cursor-pointer"},XM={class:"text-white font-mono text-sm"},ZM={class:"flex items-center gap-2 cursor-pointer"},jM={class:"text-white font-mono text-sm"},JM={class:"flex items-center justify-end gap-3 pt-4 border-t border-base-800"},ek=["disabled"],tk={key:0,class:"spinner spinner-sm"},nk={class:"bg-base-900 border border-base-800 rounded-xl shadow-2xl w-full max-w-md mx-4 transform transition-all"},rk={class:"flex items-center justify-between px-6 py-4 border-b border-base-800"},ik={class:"text-lg font-semibold text-white font-mono flex items-center gap-2"},ak=["value"],sk={class:"font-mono text-base-400 mb-3 block text-sm"},ok={class:"flex gap-6"},lk={class:"flex items-center gap-2 cursor-pointer"},ck={class:"text-white font-mono text-sm"},dk={class:"flex items-center gap-2 cursor-pointer"},uk={class:"text-white font-mono text-sm"},_k={class:"border-t border-base-800 pt-5"},pk={class:"flex items-center justify-between"},mk={class:"font-mono text-base-400 block text-sm"},gk={class:"text-xs text-base-500 font-mono mt-1"},fk={class:"relative inline-flex items-center cursor-pointer"},Ek={class:"border-t border-base-800 pt-5"},Sk={class:"flex items-center justify-between"},bk={class:"font-mono text-base-400 block text-sm"},hk={class:"text-xs text-base-500 font-mono mt-1"},Tk={key:0,class:"mt-4"},vk={class:"relative"},Rk=["type","placeholder"],Ck={class:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1"},yk={key:0,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Nk={key:1,width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},Ok={class:"flex items-center justify-end gap-3 pt-4 border-t border-base-800"},Ak=["disabled"],Ik={key:0,class:"spinner spinner-sm"},qc=10,xk=Pt({__name:"UserManagementView",setup(t){const{t:e,currentLang:n}=on();Ht(()=>{a()});const r=me([]),i=me(!1);async function a(){i.value=!0;try{const T=await Vi.list();r.value=T.users}catch(T){rt.error(e("admin.fetchError")+": "+T.message)}finally{i.value=!1}}const s=me(""),o=me(""),l=Ie(()=>{let T=r.value;if(s.value){const w=s.value.toLowerCase();T=T.filter(ce=>ce.username.toLowerCase().includes(w)||ce.name&&ce.name.toLowerCase().includes(w))}return o.value&&(o.value==="active"?T=T.filter(w=>!w.disabled):o.value==="disabled"&&(T=T.filter(w=>w.disabled))),T}),c=me(1),d=Ie(()=>Math.ceil(l.value.length/qc)),u=Ie(()=>{const T=(c.value-1)*qc,w=T+qc;return l.value.slice(T,w)}),p=me(!1),_=me(!1),f=me(!1),g=me({username:"",password:"",name:"",role:"developer"});function S(){g.value={username:"",password:"",name:"",role:"developer"},_.value=!1,p.value=!0}function b(){p.value=!1}function h(){const T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*";let w="";for(let ce=0;ce<12;ce++)w+=T.charAt(Math.floor(Math.random()*T.length));g.value.password=w,_.value=!0}async function v(){f.value=!0;try{await Vi.create(g.value),await a(),b(),rt.success(e("admin.addSuccess"))}catch(T){rt.error(e("admin.addError")+": "+T.message)}finally{f.value=!1}}const C=me(!1),y=me(!1),D=me(!1),L=me(!1),O=me({id:0,username:"",name:"",role:"developer",disabled:!1,newPassword:""});function N(T){O.value={id:T.id,username:T.username,name:T.name||"",role:T.role,disabled:T.disabled||!1,newPassword:""},y.value=!1,D.value=!1,C.value=!0}function B(){C.value=!1}function K(){const T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*";let w="";for(let ce=0;ce<12;ce++)w+=T.charAt(Math.floor(Math.random()*T.length));O.value.newPassword=w,y.value=!0}async function I(){L.value=!0;try{await Vi.update(O.value.id,{name:O.value.name,role:O.value.role}),O.value.newPassword,await a(),B(),rt.success(e("admin.editSuccess"))}catch(T){rt.error(e("admin.editError")+": "+T.message)}finally{L.value=!1}}function W(T){return new Date(T).toLocaleDateString(n.value==="zh"?"zh-CN":"en-US",{year:"numeric",month:"2-digit",day:"2-digit"})}return(T,w)=>{const ce=Bn("router-link");return le(),de("main",JL,[m("div",eM,[w[18]||(w[18]=m("span",{class:"text-neon-400"},"~",-1)),w[19]||(w[19]=m("span",{class:"opacity-50"},"/",-1)),Ue(ce,{to:"/",class:"hover:text-white transition-colors"},{default:it(()=>[he(X(J(e)("nav.home")),1)]),_:1}),w[20]||(w[20]=m("span",{class:"opacity-50"},"/",-1)),w[21]||(w[21]=m("span",{class:"text-white"},"admin",-1)),w[22]||(w[22]=m("span",{class:"opacity-50"},"/",-1)),w[23]||(w[23]=m("span",{class:"text-white"},"users",-1))]),m("div",tM,[w[34]||(w[34]=m("div",{class:"absolute top-0 right-0 bg-base-800 text-base-400 text-[10px] font-mono px-2 py-1 rounded-bl-lg opacity-50 select-none"},"ADMIN-USERS",-1)),m("div",nM,[m("h1",rM,[w[24]||(w[24]=m("span",{class:"text-neon-400 font-mono font-normal opacity-70"},">",-1)),m("span",null,X(J(e)("admin.heading")),1)]),m("p",iM,X(J(e)("admin.subtitle")),1)]),m("div",aM,[m("h2",sM,[w[25]||(w[25]=m("span",{class:"text-neon-400"},"#",-1)),he(" "+X(J(e)("admin.userList")),1)]),m("button",{class:"btn-primary px-4 py-2.5 rounded-lg font-mono flex items-center gap-2",onClick:S},[w[26]||(w[26]=m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),m("line",{x1:"5",y1:"12",x2:"19",y2:"12"})],-1)),m("span",null,X(J(e)("admin.addUser")),1)])]),m("div",oM,[m("div",lM,[m("div",cM,[Ye(m("input",{type:"text","onUpdate:modelValue":w[0]||(w[0]=U=>s.value=U),placeholder:J(e)("admin.searchPlaceholder"),class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-2.5 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors pl-10"},null,8,dM),[[at,s.value]]),w[28]||(w[28]=m("span",{class:"absolute left-3 top-1/2 -translate-y-1/2 text-base-400"},[m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("circle",{cx:"11",cy:"11",r:"8"}),m("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})])],-1)),s.value?(le(),de("button",{key:0,type:"button",class:"absolute right-3 top-1/2 -translate-y-1/2 text-base-400 hover:text-white transition-colors",onClick:w[1]||(w[1]=U=>s.value="")},[...w[27]||(w[27]=[m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])):ze("",!0)])]),Ye(m("select",{"onUpdate:modelValue":w[2]||(w[2]=U=>o.value=U),class:"bg-base-950 border border-base-800 rounded-lg px-4 py-2.5 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors min-w-[140px] appearance-none cursor-pointer",style:{"background-image":"url('data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 fill=%27none%27 viewBox=%270 0 24 24%27 stroke=%27%23a1a1aa%27%3E%3Cpath stroke-linecap=%27round%27 stroke-linejoin=%27round%27 stroke-width=%272%27 d=%27M19 9l-7 7-7-7%27/%3E%3C/svg%3E')","background-repeat":"no-repeat","background-position":"right 0.75rem center","background-size":"1rem","padding-right":"2.5rem"}},[m("option",uM,X(J(e)("admin.allStatus")),1),m("option",_M,X(J(e)("admin.active")),1),m("option",pM,X(J(e)("admin.disabled")),1)],512),[[Ir,o.value]])]),m("div",mM,[m("table",gM,[m("thead",null,[m("tr",fM,[m("th",EM,X(J(e)("admin.thUsername")),1),m("th",SM,X(J(e)("admin.thName")),1),m("th",bM,X(J(e)("admin.thRole")),1),m("th",hM,X(J(e)("admin.thStatus")),1),m("th",TM,X(J(e)("admin.thCreatedAt")),1),m("th",vM,X(J(e)("admin.thActions")),1)])]),m("tbody",null,[i.value?(le(),de(ke,{key:0},Rt(5,U=>m("tr",{key:U,class:"border-t border-base-800"},[(le(),de(ke,null,Rt(6,H=>m("td",{key:H,class:"px-4 py-4"},[...w[29]||(w[29]=[m("div",{class:"h-4 bg-base-800 rounded animate-pulse"},null,-1)])])),64))])),64)):u.value.length===0?(le(),de("tr",RM,[m("td",CM,[w[30]||(w[30]=m("div",{class:"text-4xl mb-4 opacity-30"},"📦",-1)),m("p",yM,X(J(e)("admin.emptyState")),1)])])):(le(!0),de(ke,{key:2},Rt(u.value,U=>(le(),de("tr",{key:U.id,class:"border-t border-base-800 hover:bg-white/5 transition-colors"},[m("td",NM,X(U.username),1),m("td",OM,X(U.name||"-"),1),m("td",AM,[m("span",{class:Fe(["inline-flex items-center gap-1 px-3 py-1 text-xs font-medium rounded-full font-mono",U.role==="admin"?"bg-neon-400/10 text-neon-400 border border-neon-400/30":"bg-blue-500/10 text-blue-400 border border-blue-500/30"])},[U.role==="admin"?(le(),de("svg",IM,[...w[31]||(w[31]=[m("path",{d:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"},null,-1)])])):(le(),de("svg",xM,[...w[32]||(w[32]=[m("path",{d:"M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"},null,-1),m("circle",{cx:"12",cy:"7",r:"4"},null,-1)])])),he(" "+X(U.role==="admin"?J(e)("admin.roleAdmin"):J(e)("admin.roleUser")),1)],2)]),m("td",DM,[m("span",{class:Fe(U.disabled?"text-red-400":"text-neon-400")},X(U.disabled?J(e)("admin.disabled"):J(e)("admin.active")),3)]),m("td",wM,X(W(U.created_at)),1),m("td",LM,[m("button",{class:"p-2 text-base-400 hover:text-neon-400 hover:bg-neon-400/10 rounded-lg transition-colors",onClick:H=>N(U),title:J(e)("admin.editUser")},[...w[33]||(w[33]=[m("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),m("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})],-1)])],8,MM)])]))),128))])]),d.value>1?(le(),de("div",kM,[m("button",{class:"px-4 py-2 rounded-lg font-mono text-sm border border-base-800 text-base-400 hover:border-neon-400 hover:text-neon-400 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:c.value===1,onClick:w[3]||(w[3]=U=>c.value--)},X(J(e)("admin.prevPage")),9,PM),m("span",UM,X(c.value)+" / "+X(d.value),1),m("button",{class:"px-4 py-2 rounded-lg font-mono text-sm border border-base-800 text-base-400 hover:border-neon-400 hover:text-neon-400 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",disabled:c.value===d.value,onClick:w[4]||(w[4]=U=>c.value++)},X(J(e)("admin.nextPage")),9,FM)])):ze("",!0)])]),p.value?(le(),de("div",{key:0,class:"fixed inset-0 bg-black/80 flex items-center justify-center z-50",onClick:At(b,["self"])},[m("div",BM,[m("div",GM,[m("h3",YM,[w[35]||(w[35]=m("span",{class:"text-neon-400 opacity-70"},">",-1)),he(" "+X(J(e)("admin.addModal")),1)]),m("button",{class:"text-base-400 hover:text-white transition-colors",onClick:b},[...w[36]||(w[36]=[m("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),m("form",{onSubmit:At(v,["prevent"]),class:"p-6 space-y-5"},[m("div",null,[w[37]||(w[37]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"username"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":w[5]||(w[5]=U=>g.value.username=U),required:"",autocomplete:"off",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,g.value.username]])]),m("div",null,[w[41]||(w[41]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"password"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),m("div",qM,[Ye(m("input",{type:_.value?"text":"password","onUpdate:modelValue":w[6]||(w[6]=U=>g.value.password=U),required:"",autocomplete:"new-password",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors pr-20"},null,8,HM),[[e_,g.value.password]]),m("div",VM,[m("button",{type:"button",class:"p-1.5 text-base-400 hover:text-neon-400 rounded transition-colors",onClick:w[7]||(w[7]=U=>_.value=!_.value)},[_.value?(le(),de("svg",zM,[...w[38]||(w[38]=[m("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),m("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):(le(),de("svg",$M,[...w[39]||(w[39]=[m("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),m("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])]))]),m("button",{type:"button",class:"p-1.5 text-base-400 hover:text-neon-400 rounded transition-colors",onClick:h,title:"Generate password"},[...w[40]||(w[40]=[dr('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="2" width="20" height="20" rx="2" ry="2"></rect><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="16" cy="8" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="8" cy="16" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="16" cy="16" r="1.5" fill="currentColor" stroke="none"></circle></svg>',1)])])])])]),m("div",null,[w[42]||(w[42]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"name"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":w[8]||(w[8]=U=>g.value.name=U),class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,g.value.name]])]),m("div",null,[m("label",WM,X(J(e)("admin.roleLabel")),1),m("div",KM,[m("label",QM,[Ye(m("input",{type:"radio","onUpdate:modelValue":w[9]||(w[9]=U=>g.value.role=U),value:"developer",class:"w-4 h-4 accent-neon-400"},null,512),[[jr,g.value.role]]),m("span",XM,X(J(e)("admin.roleUser")),1)]),m("label",ZM,[Ye(m("input",{type:"radio","onUpdate:modelValue":w[10]||(w[10]=U=>g.value.role=U),value:"admin",class:"w-4 h-4 accent-neon-400"},null,512),[[jr,g.value.role]]),m("span",jM,X(J(e)("admin.roleAdmin")),1)])])]),m("div",JM,[m("button",{type:"button",class:"px-4 py-2 rounded-lg font-mono text-sm border border-base-800 text-base-400 hover:border-white hover:text-white transition-colors",onClick:b},X(J(e)("admin.cancel")),1),m("button",{type:"submit",disabled:f.value,class:"btn-primary px-4 py-2 rounded-lg font-mono text-sm flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"},[f.value?(le(),de("span",tk)):(le(),de(ke,{key:1},[he(X(J(e)("admin.confirmAdd")),1)],64))],8,ek)])],32)])])):ze("",!0),C.value?(le(),de("div",{key:1,class:"fixed inset-0 bg-black/80 flex items-center justify-center z-50",onClick:At(B,["self"])},[m("div",nk,[m("div",rk,[m("h3",ik,[w[43]||(w[43]=m("span",{class:"text-neon-400 opacity-70"},">",-1)),he(" "+X(J(e)("admin.editModal")),1)]),m("button",{class:"text-base-400 hover:text-white transition-colors",onClick:B},[...w[44]||(w[44]=[m("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},[m("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m("line",{x1:"6",y1:"6",x2:"18",y2:"18"})],-1)])])]),m("form",{onSubmit:At(I,["prevent"]),class:"p-6 space-y-5"},[m("div",null,[w[45]||(w[45]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"username"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),m("input",{type:"text",value:O.value.username,disabled:"",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-base-400 cursor-not-allowed"},null,8,ak)]),m("div",null,[w[46]||(w[46]=m("label",{class:"font-mono text-base-400 mb-2 block text-sm"},[m("span",{class:"text-neon-400 opacity-70"},"let"),he(),m("span",{class:"text-white"},"name"),he(),m("span",{class:"text-neon-400 opacity-70"},"=")],-1)),Ye(m("input",{type:"text","onUpdate:modelValue":w[11]||(w[11]=U=>O.value.name=U),autocomplete:"off",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors"},null,512),[[at,O.value.name]])]),m("div",null,[m("label",sk,X(J(e)("admin.roleLabel")),1),m("div",ok,[m("label",lk,[Ye(m("input",{type:"radio","onUpdate:modelValue":w[12]||(w[12]=U=>O.value.role=U),value:"developer",class:"w-4 h-4 accent-neon-400"},null,512),[[jr,O.value.role]]),m("span",ck,X(J(e)("admin.roleUser")),1)]),m("label",dk,[Ye(m("input",{type:"radio","onUpdate:modelValue":w[13]||(w[13]=U=>O.value.role=U),value:"admin",class:"w-4 h-4 accent-neon-400"},null,512),[[jr,O.value.role]]),m("span",uk,X(J(e)("admin.roleAdmin")),1)])])]),m("div",_k,[m("div",pk,[m("div",null,[m("label",mk,X(J(e)("admin.statusLabel")),1),m("p",gk,X(O.value.disabled?J(e)("admin.statusDisabled"):J(e)("admin.statusActive")),1)]),m("label",fk,[Ye(m("input",{type:"checkbox","onUpdate:modelValue":w[14]||(w[14]=U=>O.value.disabled=U),class:"sr-only peer"},null,512),[[FE,O.value.disabled]]),w[47]||(w[47]=m("div",{class:"w-12 h-6 bg-base-800 peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-base-400 after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-neon-400 peer-checked:after:bg-base-950"},null,-1))])])]),m("div",Ek,[m("div",Sk,[m("div",null,[m("label",bk,X(J(e)("admin.resetPassword")),1),m("p",hk,X(J(e)("admin.resetPasswordHint")),1)]),m("button",{type:"button",class:"px-3 py-1.5 rounded-lg font-mono text-xs border border-base-800 text-base-400 hover:border-neon-400 hover:text-neon-400 transition-colors",onClick:w[15]||(w[15]=U=>D.value=!D.value)},X(D.value?J(e)("admin.cancelReset"):J(e)("admin.doReset")),1)]),D.value?(le(),de("div",Tk,[m("div",vk,[Ye(m("input",{type:y.value?"text":"password","onUpdate:modelValue":w[16]||(w[16]=U=>O.value.newPassword=U),placeholder:J(e)("admin.newPasswordPlaceholder"),autocomplete:"new-password",class:"w-full bg-base-950 border border-base-800 rounded-lg px-4 py-3 font-mono text-white focus:border-neon-400 focus:outline-none focus:ring-1 focus:ring-neon-400 transition-colors pr-16"},null,8,Rk),[[e_,O.value.newPassword]]),m("div",Ck,[m("button",{type:"button",class:"p-1.5 text-base-400 hover:text-neon-400 rounded transition-colors",onClick:w[17]||(w[17]=U=>y.value=!y.value)},[y.value?(le(),de("svg",yk,[...w[48]||(w[48]=[m("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),m("circle",{cx:"12",cy:"12",r:"3"},null,-1)])])):(le(),de("svg",Nk,[...w[49]||(w[49]=[m("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),m("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)])]))]),m("button",{type:"button",class:"p-1.5 text-base-400 hover:text-neon-400 rounded transition-colors",onClick:K,title:"Generate password"},[...w[50]||(w[50]=[dr('<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="2" width="20" height="20" rx="2" ry="2"></rect><circle cx="8" cy="8" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="16" cy="8" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="8" cy="16" r="1.5" fill="currentColor" stroke="none"></circle><circle cx="16" cy="16" r="1.5" fill="currentColor" stroke="none"></circle></svg>',1)])])])])])):ze("",!0)]),m("div",Ok,[m("button",{type:"button",class:"px-4 py-2 rounded-lg font-mono text-sm border border-base-800 text-base-400 hover:border-white hover:text-white transition-colors",onClick:B},X(J(e)("admin.cancel")),1),m("button",{type:"submit",disabled:L.value,class:"btn-primary px-4 py-2 rounded-lg font-mono text-sm flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed"},[L.value?(le(),de("span",Ik)):(le(),de(ke,{key:1},[he(X(J(e)("admin.confirmSave")),1)],64))],8,Ak)])],32)])])):ze("",!0)])}}}),NS=Nv({history:iv(ta),routes:[{path:"/",name:"",component:xR},{path:"/login",name:"login",component:$R},{path:"/skills/:id",name:"skill-detail",component:tx},{path:"/publish",name:"publish",component:Zx,meta:{requiresAuth:!0}},{path:"/settings",name:"settings",component:RD,meta:{requiresAuth:!0}},{path:"/cli-code",name:"cli-code",component:KD},{path:"/setup",name:"setup",component:mw},{path:"/diff",name:"diff",component:jL},{path:"/admin/users",name:"user-management",component:xk,meta:{requiresAuth:!0,requiresAdmin:!0}}]});NS.beforeEach(async t=>{if(!t.meta.requiresAuth&&!t.meta.requiresAdmin)return!0;const e=vi();return await e.fetchUser({force:!0})?t.meta.requiresAdmin&&!e.isAdmin?{path:"/"}:!0:{path:"/login",query:{redirect:t.fullPath}}});const Qd=_T(_R);Qd.use(gT());Qd.use(NS);Qd.mount("#app");