Files
open-kimi-ppt-skill/editor/neo-ppt/assets/useMessage-legacy-BwPIj8SG.js
T

1 line
154 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
System.register(["./rolldown-runtime-legacy-C7CQ20b7.js","./vue-legacy-BnJhYd-u.js","./const-legacy-Bw9iWaro.js","./preload-helper-legacy-CKCAnWGV.js","./_plugin-vue_export-helper-legacy-DNBbTZ02.js","./kimi-legacy-KFfRFtSB.js","./index-legacy-Ce-qKpT_.js","./yaml-legacy-soNf5IPv.js","./yaml-legacy-PSsIiII3.js","./ThumbnailSlide-legacy-CSXTq44l.js","./kimi.button-legacy-Dfu-bBlw.js","./penpal-legacy-Dgg3M9hr.js","./dayjs.min-legacy-Ca-t_sOd.js","./snapdom-legacy-NB0v_n4w.js","./dom-legacy-D-syBzLK.js"],function(e,t){var r,n,a,i,o,s,l,u,d,c,f,h,p,m,v,g,y,b,_,w,k,x,S,A,C,I,T,z,E,P,O,F,B,D,R,N,L,j,M,U,$,W,H,Z,V,G,K,J,Y,X,q,Q,ee,te,re,ne,ae,ie,oe,se,le,ue,de,ce,fe,he,pe,me,ve,ge,ye,be,_e,we,ke,xe,Se,Ae,Ce,Ie,Te,ze,Ee,Pe,Oe,Fe,Be,De,Re,Ne,Le,je,Me,Ue,$e,We,He,Ze,Ve,Ge,Ke,Je,Ye,Xe,qe,Qe,et,tt,rt,nt,at,it,ot,st,lt,ut,dt,ct,ft,ht,pt,mt,vt,gt,yt,bt,_t,wt,kt,xt,St,At,Ct,It,Tt,zt,Et,Pt,Ot,Ft,Bt,Dt,Rt,Nt,Lt,jt,Mt,Ut,$t,Wt,Ht,Zt,Vt,Gt,Kt,Jt,Yt,Xt,qt,Qt,er,tr,rr,nr,ar,ir,or,sr,lr,ur,dr,cr,fr,hr,pr,mr;function vr(e){return new Date(function(e){return 1e3*Number(e.seconds)+Math.round(e.nanos/1e6)}(e))}async function gr(e,r){const n=je(e),a=await async function(e,t,r){if(!t)return;const{scan:n,loadFonts:a}=Fe();return n(e),(await a({force:!0,onError:(e,t)=>{ce(`字体下载失败: ${e.label}`,t)},onProgress:r?({done:e,total:t,fraction:n})=>r(20+Math.round((e+n)/t*30)):void 0})).filter(e=>!!e.fontBlob).map(e=>({typeface:e.typeface,fontBlob:e.fontBlob}))}(n,r?.embedFonts,r?.onProgress),{exportPPTDToPPTXByWasm:i}=await H(async()=>{const{exportPPTDToPPTXByWasm:e}=await t.import("./exportPPTXWasm-legacy-C42D91Tt.js");return{exportPPTDToPPTXByWasm:e}},void 0);return await i(function(e){if("v2"===Ae(e))return yr({...e,version:"v2"});const t=e.pages.map(e=>e.pagePath??`${e.pageId}.page`),r=De({title:e.title,theme:e.theme,size:e.size,pages:t}).data;return yr({...r,customFonts:e.customFonts,pages:e.pages.map((e,r)=>({...xe(e).data,pageId:e.pageId,pagePath:e.pagePath??t[r]})),pptdFileName:e.pptdFileName})}(n),{fonts:a,fileName:r?.fileName,metadata:r?.metadata,aiMetadata:r?.aiMetadata,slideTransition:r?.slideTransition,onProgress:r?.onProgress})}function yr(e){return{...e,pages:e.pages.map(e=>({...e,elements:e.elements.map(br)}))}}function br(e){const t=[e.bounds[2],e.bounds[3]];if("shape"===e.elementType){const r=_r(e,t);return r===e?e:{...e,viewBox:r.viewBox}}if("image"===e.elementType&&e.cropShape){const r=_r(e.cropShape,t);return r===e.cropShape?e:{...e,cropShape:r}}return e}function _r(e,t){return"custom"!==e.shapeName||!e.path||e.viewBox||e.path.includes(";")?e:{...e,viewBox:t}}function wr(e,t){const r=URL.createObjectURL(e),n=document.createElement("a");n.href=r,n.download=t,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(r)}function kr(e){return!!e}function xr(){const e=new Set;for(const t of Array.from(document.querySelectorAll('link[rel="stylesheet"]')))try{const r=new URL(t.href).host;r&&r!==location.host&&e.add(r)}catch{}return[...e]}function Sr(){const e=y(0),t=d(()=>e.value>0),r=async(t,r)=>{e.value++;try{return await async function(e,t={}){const r=new FormData,{accessToken:n}=await se(),a={};r.append(t.fieldName??nt,e),n&&(a.Authorization=`Bearer ${n}`),Object.assign(a,await oe());const i=await fetch("/apiv2/slides:upload",{method:"POST",body:r,headers:a});if(!i.ok)throw new Error(`slides upload failed: ${i.status}`);const o=await i.json();if(!o.url)throw new Error("slides upload response missing url");return o.url}(t,r)}finally{e.value--}};return{isUploading:t,upload:r,uploadImage:e=>r(e)}}function Ar(e){if(!e.content)return{valid:!1,path:e.path,reason:"Missing page content"};let t;try{t=_e(e.content)}catch{return{valid:!1,path:e.path,reason:"Invalid page YAML"}}if(!xt(t))return{valid:!1,path:e.path,reason:"Page must be an object"};if(null===t.elements&&!function(e){const t=e.split("\n"),r=t.findIndex(e=>/^\s*elements\s*:\s*(?:#.*)?$/.test(e));if(-1===r)return!1;const n=t[r].match(/^\s*/)?.[0].length??0;for(const a of t.slice(r+1))if(""!==a.trim()&&!a.trim().startsWith("#"))return!((a.match(/^\s*/)?.[0].length??0)<=n);return!1}(e.content))return{valid:!0};if(!Array.isArray(t.elements))return{valid:!1,path:e.path,reason:"Page elements must be an array"};for(const r of t.elements){if(!xt(r))return{valid:!1,path:e.path,reason:"Element must be an object"};if(!St(r.elementId)||!St(r.elementType))return{valid:!1,path:e.path,reason:"Element requires elementId and elementType"}}return{valid:!0}}function Cr(e,t,r,n){const a={path:t,message:r,value:n};e.warnings.push(a),le("[PPTD v1 converter]",a)}function Ir(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}function Tr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function zr(e){return!e||0===Object.keys(e).length}function Er(e,t,r){if(e)return"string"==typeof e?e:(Cr(t,r,"v1 fontFamily 不支持对象格式,已转为字符串",e),[e.latin,e.ea].filter(Boolean).join(", "))}function Pr(e,t,r){switch(e){case"table_of_contents":return"contents";case"final":return"end";case"cover":return"cover";case"chapter":return"chapter";case"content":return"content"}return void 0!==e&&Cr(t,r,"v1 不支持该 pageType,已降级为 content",e),"content"}function Or(e,t,r){if(e)return void 0!==e.bold&&Cr(t,`${r}.bold`,"v1 TextStyle 不支持 bold,已丢弃",e.bold),void 0!==e.italic&&Cr(t,`${r}.italic`,"v1 TextStyle 使用 fontStyle 表达 italic",e.italic),void 0!==e.backgroundColor&&Cr(t,`${r}.backgroundColor`,"v1 TextStyle 不支持 backgroundColor,已丢弃",e.backgroundColor),Ir({color:e.color,fontSize:e.fontSize,fontFamily:Er(e.fontFamily,t,`${r}.fontFamily`),fontStyle:e.fontStyle??(e.italic?"italic":void 0),lineHeight:e.lineHeight,lineHeightPx:e.lineHeightPx,letterSpacing:e.letterSpacing,marginTop:e.marginTop})}function Fr(e,t,r){return e?(void 0!==e.bold&&Cr(t,`${r}.bold`,"v1 TextContent 不支持 bold,已丢弃",e.bold),void 0!==e.italic&&Cr(t,`${r}.italic`,"v1 TextContent 使用 fontStyle 表达 italic",e.italic),void 0!==e.backgroundColor&&Cr(t,`${r}.backgroundColor`,"v1 TextContent 不支持 backgroundColor,已丢弃",e.backgroundColor),Ir({text:e.text??"",style:e.style,color:e.color,fontSize:e.fontSize,fontFamily:Er(e.fontFamily,t,`${r}.fontFamily`),fontStyle:e.fontStyle??(e.italic?"italic":void 0),lineHeight:e.lineHeight,lineHeightPx:e.lineHeightPx,letterSpacing:e.letterSpacing,textDirection:e.textDirection,wrap:e.wrap,align:e.align,marginTop:e.marginTop,gradient:e.gradient,shadow:e.shadow})):(Cr(t,r,"Text content 缺失,已补空文本",e),{text:""})}function Br(e,t,r){if(e)return"solid"===e.type?{type:"solid",color:e.color}:(e.type,{...e})}function Dr(e,t,r,n=!1){return null===e?n?null:void 0:e&&!zr(e)?(e.color||Cr(t,`${r}.color`,"v1 Border.color 必填,已补默认黑色",e),{style:e.style??"solid",width:e.width,color:e.color??It}):void 0}function Rr(e,t,r){if(void 0!==e)return null===e?{style:"none",color:It}:Array.isArray(e)?e.map((e,n)=>Dr(e,t,`${r}[${n}]`,!0)):Dr(e,t,r)??void 0}function Nr(e,t,r){return function(e,t,r){if(e)return"solid"===e.type?e.color:void Cr(t,r,"v1 TableStyle legacy 字段只支持纯色,已丢弃非 solid fill",e)}(e?.fill,t,`${r}.fill`)}function Lr(e,t,r){if(!e||"string"==typeof e)return e;const n=e.cellStyle,a=e.firstRowStyle,i=e.bodyStyles?.[0],o=e.firstColumnStyle;e.lastColumnStyle&&Cr(t,`${r}.lastColumnStyle`,"v1 TableStyle 不支持 lastColumnStyle,已丢弃"),void 0!==e.rowOverColumn&&Cr(t,`${r}.rowOverColumn`,"v1 TableStyle 不支持 rowOverColumn,已丢弃"),n?.align&&Cr(t,`${r}.cellStyle.align`,"v1 TableStyle 不支持 cellStyle.align,已丢弃");const s=Ir({fontSize:e.fontSize??n?.fontSize,fontFamily:e.fontFamily&&"string"!=typeof e.fontFamily?Er(e.fontFamily,t,`${r}.fontFamily`):e.fontFamily??Er(n?.fontFamily,t,`${r}.cellStyle.fontFamily`),fill:Br(e.fill??n?.fill),headerFill:e.headerFill??Nr(a,t,`${r}.firstRowStyle`),headerColor:e.headerColor??a?.color,headerBold:e.headerBold??a?.bold,headerBorder:Rr(e.headerBorder??a?.border,t,`${r}.headerBorder`),bodyFill:e.bodyFill??e.bodyStyles?.map((e,n)=>Nr(e,t,`${r}.bodyStyles[${n}]`)).filter(e=>!!e),bodyColor:e.bodyColor??i?.color,bodyBorder:Rr(e.bodyBorder??i?.border,t,`${r}.bodyBorder`),lastRowBorder:Rr(e.lastRowBorder??e.lastRowStyle?.border,t,`${r}.lastRowBorder`),firstColumnFill:e.firstColumnFill??Nr(o,t,`${r}.firstColumnStyle`),firstColumnColor:e.firstColumnColor??o?.color,firstColumnBold:e.firstColumnBold??o?.bold,border:Rr(e.border??n?.border,t,`${r}.border`)});return zr(s)?void 0:s}function jr(e,t,r){if(!e)return;const n={};for(const[i,o]of Object.entries(e.textStyles??{})){const e=Or(o,t,`${r}.textStyles.${i}`);e&&(n[i]=e)}let a;if(e.tableStyles){a={};for(const[n,i]of Object.entries(e.tableStyles)){const e=Lr(i,t,`${r}.tableStyles.${n}`);"string"==typeof e?Cr(t,`${r}.tableStyles.${n}`,"v1 Theme.tableStyles 不支持字符串引用,已丢弃",e):e&&(a[n]=e)}zr(a)&&(a=void 0)}return Ir({colors:e.colors??{},textStyles:n,tableStyles:a})}function Mr(e){return Ir({elementId:e.elementId,bounds:e.bounds,rotation:e.rotation,opacity:e.opacity,flip:e.flip})}function Ur(e,t,r){return e.fill&&Cr(t,`${r}.fill`,"v1 Table 不支持表格级 fill,已丢弃",e.fill),Ir({...Mr(e),elementType:"table",columnWidths:e.columnWidths??[],rowHeights:e.rowHeights??[],rows:(e.rows??[]).map((e,n)=>e.map((e,a)=>function(e,t,r){return Ir({content:e.content?Fr(e.content,t,`${r}.content`):void 0!==e.text||void 0!==e.textStyle?Fr(Ir({text:e.text??"",style:e.textStyle,color:e.color,fontSize:e.fontSize,fontFamily:e.fontFamily,bold:e.bold,italic:e.italic,backgroundColor:e.backgroundColor,lineHeight:e.lineHeight,lineHeightPx:e.lineHeightPx,letterSpacing:e.letterSpacing,marginTop:e.marginTop,align:e.align}),t,r):void 0,fill:Br(e.fill),border:Rr(e.border,t,`${r}.border`),rowSpan:e.rowSpan,colSpan:e.colSpan})}(e,t,`${r}.rows[${n}][${a}]`))),style:Lr(e.style,t,`${r}.style`),border:Rr(e.border,t,`${r}.border`),shadow:e.shadow})}function $r(e){if(e)return Ir({show:e.show,content:e.content,color:e.color,numberFormat:e.numberFormat,fontSize:e.fontSize})}function Wr(e,t,r){return void 0===e||"boolean"==typeof e?e:("arrow"in e&&e.arrow&&!0!==e.arrow&&"end"!==e.arrow&&Cr(t,`${r}.arrow`,"v1 axisLine 只支持 end arrow,已降级为 true",e.arrow),Ir({style:e.style,color:e.color,width:e.width,arrow:"arrow"in e&&!!e.arrow}))}function Hr(e,t,r){if(!e)return;e.type&&Cr(t,`${r}.type`,"v1 Axis 不支持 type,已丢弃",e.type),void 0!==e.reverse&&Cr(t,`${r}.reverse`,"v1 Axis 不支持 reverse,已丢弃",e.reverse);let n,a=e.label;if(Tr(e.label)){const{numberFormat:i,fontFamily:o,...s}=e.label;o&&Cr(t,`${r}.label.fontFamily`,"v1 Axis label 不支持 fontFamily,已丢弃",o),a=s,n="string"==typeof i?i:void 0}return Ir({show:e.show,label:a,axisLine:Wr(e.axisLine,t,`${r}.axisLine`),gridLine:Wr(e.gridLine,t,`${r}.gridLine`),min:e.min,max:e.max,numberFormat:n,title:e.title})}function Zr(e){if(e)return"string"==typeof e?{type:"solid",color:e}:e}function Vr(e,t=0){if(e)return"string"==typeof e?e:Array.isArray(e)?Vr(e[t]??e[0],t):Tr(e)&&"solid"===e.type&&"string"==typeof e.color?e.color:void 0}function Gr(e,t=0){return Array.isArray(e)?e[t]:0===t?e:void 0}function Kr(e,t=0){return Gr(e,t)?.type}function Jr(e){return"stack"in e?e.stack:void 0}function Yr(e,t,r){if("bar"===e.type||"line"===e.type||"area"===e.type||"scatter"===e.type||"bubble"===e.type||"pie"===e.type||"radar"===e.type)return e.type;const n="treemap"===e.type||"sunburst"===e.type?"pie":"heatmap"===e.type?"scatter":"bar";return Cr(t,`${r}.type`,`v1 不支持 ${e.type},已降级为 ${n}`,e),n}function Xr(e,t,r,n){const a=Ir({name:"name"in e?e.name:void 0,type:"combo"===t||"scatter"===t||"bubble"===t||"radar"===t||"pie"===t?void 0:t,axis:"yAxisIndex"in e&&1===e.yAxisIndex?"secondary":void 0,dataLabels:$r("dataLabels"in e?e.dataLabels:void 0)});var i;return"border"in e&&(a.border=e.border),"smooth"in e&&(a.smooth=e.smooth),"lineStyle"in e&&(a.line=e.lineStyle),"width"in e&&(a.width=e.width),"marker"in e&&(a.marker=!1===(i=e.marker)||void 0===i?i:Ir({shape:"rect"===i.shape?"square":i.shape,fill:Zr(i.fill),border:i.border,size:i.size})),"bar"===e.type||"scatter"===e.type||"bubble"===e.type?a.fill=Zr(e.fill):"line"===e.type||"radar"===e.type?a.fill=Zr(e.lineColor):"area"===e.type?a.fill=Zr(e.areaColor??e.lineColor):"pie"===e.type?a.fill=Array.isArray(e.fill)?Zr(e.fill[0]):Zr(e.fill):"waterfall"===e.type?a.fill=Zr(e.increaseBars?.fill??e.totalBars?.fill??e.decreaseBars?.fill):"treemap"!==e.type&&"sunburst"!==e.type||(a.fill=Array.isArray(e.fill)?Zr(e.fill[0]):Zr(e.fill)),"dataFilter"in e&&e.dataFilter&&Cr(r,`${n}.dataFilter`,"v1 Chart 不支持 dataFilter,已丢弃",e.dataFilter),"bubble"===e.type&&(e.sizeScale&&Cr(r,`${n}.sizeScale`,"v1 bubble 不支持 sizeScale,已丢弃",e.sizeScale),e.sizeRange&&Cr(r,`${n}.sizeRange`,"v1 bubble 不支持 sizeRange,已丢弃",e.sizeRange)),Ir(a)}function qr(e,t,r,n){const a=t[0],i=t.map(Jr).find(Boolean),o=Ir({direction:r?"horizontal":void 0,barWidth:e.barWidth,innerRadius:"pie"===a?.type?a.innerRadius:void 0,startAngle:"pie"===a?.type?a.startAngle:void 0,stacked:"percent"===i?"100%":"value"===i||"stream"===i||void 0,nullHandling:"nullHandling"in(a??{})?a.nullHandling:void 0,fontFamily:Er(e.fontFamily,n,"chart.fontFamily")});return void 0!==e.barGap&&Cr(n,"chart.barGap","v1 Chart options 不支持 barGap,已丢弃",e.barGap),void 0!==e.categoryGap&&Cr(n,"chart.categoryGap","v1 Chart options 不支持 categoryGap,已丢弃",e.categoryGap),zr(o)?void 0:o}function Qr(e,t,r){const n=(e.series??[]).map((n,a)=>function(e,t,r,n){const a=t?.[e.type];return a?(Cr(r,n,"v2 seriesDefaults 已合并到 v1 seriesStyle",a),{...a,...e}):e}(n,e.seriesDefaults,t,`${r}.series[${a}]`)),a=n[0];a||Cr(t,`${r}.series`,"Chart 缺少 series,已降级为空 bar chart",e);const i=a?Yr(a,t,`${r}.series[0]`):"bar",o=n.map((e,n)=>Yr(e,t,`${r}.series[${n}]`)),s=o.some(e=>e!==i),l=s?"combo":i,u=!!a&&function(e,t){return"bar"===t.type&&"value"===Kr(e.xAxis,t.xAxisIndex??0)&&"category"===Kr(e.yAxis,t.yAxisIndex??0)}(e,a),d=a?u&&"bar"===a.type?a.encode.y:function(e){return"pie"===e.type||"radar"===e.type||"treemap"===e.type||"sunburst"===e.type?e.encode.category:"sankey"===e.type?e.encode.source:e.encode.x}(a):"category",c=n.map(e=>u&&"bar"===e.type?e.encode.x:function(e){return"pie"===e.type?e.encode.value:"radar"===e.type||"bubble"===e.type?e.encode.y:"candlestick"===e.type?e.encode.close:"waterfall"===e.type?e.encode.y:"heatmap"===e.type||"treemap"===e.type||"sunburst"===e.type?e.encode.value:"sankey"===e.type?e.encode.flow:e.encode.y}(e)),f=n.map((e,t)=>"pie"===e.type?Vr(e.fill,t):"line"===e.type||"radar"===e.type?Vr(e.lineColor):"area"===e.type?Vr(e.areaColor??e.lineColor):"scatter"===e.type||"bubble"===e.type||"bar"===e.type?Vr(e.fill):void 0),h=Object.fromEntries(n.map((e,n)=>[c[n]??`series-${n}`,{...Xr(e,o[n],t,`${r}.series[${n}]`),...s?{type:o[n]}:{}}]));return e.seriesDefaults&&Cr(t,`${r}.seriesDefaults`,"v1 Chart 不支持 seriesDefaults,已合并到 seriesStyle",e.seriesDefaults),e.spokeAxis&&Cr(t,`${r}.spokeAxis`,"v1 Chart 不支持 spokeAxis,已丢弃",e.spokeAxis),e.shadow&&Cr(t,`${r}.shadow`,"v1 Chart 不支持 shadow,已丢弃",e.shadow),Ir({...Mr(e),elementType:"chart",type:l,data:(m=e.data,m?(m.rows??[]).map(e=>Object.fromEntries((m.cols??[]).map((t,r)=>[t,e[r]??null]))):[]),x:d,y:1===c.length?c[0]:c,names:n.map(e=>"name"in e?e.name:void 0).filter(Boolean),colors:f.filter(Boolean),options:qr(e,n,u,t),seriesStyle:zr(h)?void 0:h,xAxis:Hr(Gr(e.xAxis),t,`${r}.xAxis`),yAxis:Hr(Gr(e.yAxis),t,`${r}.yAxis`),secondaryAxis:Hr(Gr(e.yAxis,1),t,`${r}.yAxis[1]`),title:e.title,legend:(p=e.legend,p&&"boolean"!=typeof p?Ir({show:p.show,position:p.position,color:p.color,fontSize:p.fontSize}):p),dataLabels:$r(e.dataLabels),size:"bubble"===a?.type?a.encode.size:void 0,fill:Br(e.fill),border:Dr(e.border,t,`${r}.border`)??void 0});var p,m}function en(e,t,r){const n=`elements[${r}](${e.elementId})`;return"text"===e.elementType?Ir({...Mr(e),elementType:"text",content:Fr(e.content,t,`${n}.content`)}):"line"===e.elementType?function(e,t,r){return e.curve&&"sharp"!==e.curve&&Cr(t,`${r}.curve`,"v1 straightConnector1 无法表达 curve,已丢弃",e.curve),e.points&&e.points!==`0,0 ${e.viewBox[0]},${e.viewBox[1]}`&&Cr(t,`${r}.points`,"v1 straightConnector1 无法精确表达多点线,已按 bounds 降级",e.points),Ir({...Mr(e),elementType:"shape",shapeName:"straightConnector1",arrow:e.arrow,border:Dr(e.border,t,`${r}.border`)??void 0,shadow:e.shadow})}(e,t,n):"shape"===e.elementType?function(e,t,r){return Ir({...Mr(e),elementType:"shape",shapeName:e.shapeName,adjustments:e.adjustments,path:e.path,viewBox:e.viewBox,arrow:e.arrow,fill:Br(e.fill),border:Dr(e.border,t,`${r}.border`)??void 0,shadow:e.shadow})}(e,t,n):"image"===e.elementType?function(e,t,r){return(e.cropShape?.viewBox||e.cropShape?.path||e.viewBox||e.path)&&Cr(t,`${r}.cropShape`,"v1 Image 仅保留 shapeName / adjustments,已丢弃 viewBox / path",e.cropShape),Ir({...Mr(e),elementType:"image",src:e.src,shapeName:e.shapeName??e.cropShape?.shapeName,adjustments:e.adjustments??e.cropShape?.adjustments,fit:e.fit,crop:e.crop,border:Dr(e.border,t,`${r}.border`)??void 0,shadow:e.shadow})}(e,t,n):"icon"===e.elementType?function(e,t,r){return e.fill||Cr(t,`${r}.fill`,"v1 Icon.fill 必填,已补默认黑色",e),Ir({...Mr(e),elementType:"icon",iconName:e.iconName,fill:Br(e.fill)??Tt,border:Dr(e.border,t,`${r}.border`)??void 0,shadow:e.shadow})}(e,t,n):"table"===e.elementType?Ur(e,t,n):"chart"===e.elementType?Qr(e,t,n):void Cr(t,`${n}.elementType`,"未知 elementType,已丢弃",e.elementType)}function tn(e,t){return Ie(e,t)}function rn(e,t,r,n){if("v1"===Ce(t))return t;const a=function(e){return be.load(e)}(t);return e.endsWith(".pptd")?tn(function(e,t,r="presentation"){return e.version&&"v2"!==e.version&&Cr(t,`${r}.version`,"当前 converter 只处理 v2,version 已丢弃",e.version),"customFonts"in e&&e.customFonts&&Cr(t,`${r}.customFonts`,"v1 Presentation 不支持 customFonts,已丢弃",e.customFonts),Ir({title:e.title,theme:jr(e.theme,t,`${r}.theme`),size:e.size??Ct,pages:Array.isArray(e.pages)?e.pages.map(e=>"string"==typeof e?e:e.pagePath??e.pageId):[]})}(a,r,e),n):e.endsWith(".page")?tn(function(e,t,r="page"){const n=(e.elements??[]).map((e,r)=>en(e,t,r)).filter(e=>!!e);return Ir({pageId:"pageId"in e?e.pageId:void 0,pagePath:"pagePath"in e?e.pagePath:void 0,pageType:Pr(e.pageType,t,`${r}.pageType`),background:Br(e.background),notes:e.notes,elements:n})}(a,r,e),n):t}function nn(e){return Array.isArray(e)?e[0]:e}function an(e){const t=nn(e);return"string"==typeof t?t:void 0}function on(e){const t=an(e);if(void 0!==t)return"true"===t||"false"!==t&&void 0}function sn(e){const t=an(e);if(void 0===t)return;const r=Number(t);return!Number.isInteger(r)||r<1?void 0:r}function ln(e){const t=an(e);if(!t)return;const r=Number(t);return Number.isInteger(r)&&String(r)===t?r:t}function un(e){const t=an(e);if(!t)return{};try{const e=JSON.parse(t);return!e||"object"!=typeof e||Array.isArray(e)?{}:Object.fromEntries(Object.entries(e).filter(([e,t])=>Ot.has(e)&&"boolean"==typeof t))}catch{return Object.fromEntries(t.split(",").map(e=>e.trim()).filter(e=>Ot.has(e)).map(e=>[e,!0]))}}function dn(){const e=I(v,null),t=d(()=>e?.query??{}),r=d(()=>e?.path??""),n=d(()=>void 0!==t.value.sdkMode||void 0!==t.value.functional),a=d(()=>"ppt-preview"===nn(t.value.sdkMode)?"ppt-preview":"ppt-player"===nn(t.value.sdkMode)?"ppt-player":r.value.endsWith("/preview")?"ppt-preview":r.value.endsWith("/player")?"ppt-player":"ppt-editor"),i=d(()=>"external"===nn(t.value.sdkSaveMode)?"external":"kimi"),o=d(()=>"external"===nn(t.value.sdkImageMode)?"external":"kimi"),s=d(()=>n.value?an(t.value.pptPlatform)?.trim()||zt:U()),l=d(()=>"external"===i.value),u=d(()=>"external"===o.value),c=d(()=>n.value?{...Pt,...un(t.value.functional)}:Et),f=d(()=>({margin:an(t.value.previewMargin)||"20px",col:sn(t.value.previewCol)??1})),h=d(()=>{const e=on(t.value.playerControls),r=on(t.value.playerAutofit);return{page:ln(t.value.playerPage),controls:e??!0,autofit:r??!1}});return j(()=>{n.value&&fe({ppt_platform:s.value})}),{isSDK:n,mode:a,saveMode:i,imageMode:o,pptPlatform:s,useExternalSave:l,useExternalImage:u,functional:c,preview:f,player:h}}function cn(){const e=$e(),t=(t,r,n)=>{const a=dr.value?.showMessage;if(!(W&&a&&mr.has(t)))return e[t](r,n);a(t,r,{duration:n?.duration}).catch(a=>{ce("[Message] Failed to show remote message",a),e[t](r,n)})};return{...e,info:(e,r)=>t("info",e,r),success:(e,r)=>t("success",e,r),warning:(e,r)=>t("warning",e,r),error:(e,r)=>t("error",e,r),destroyAll:()=>{const t=dr.value?.hideMessage;e.destroyAll(),t&&t().catch(e=>{ce("[Message] Failed to hide remote message",e)})}}}return e({h:vr,l:Sr,p:wr,s:dn,t:cn}),{setters:[function(e){r=e.i,n=e.r,a=e.t},function(e){i=e.$,o=e.At,s=e.B,l=e.Et,u=e.G,d=e.H,c=e.I,f=e.J,h=e.K,p=e.N,m=e.Nt,v=e.O,g=e.Q,y=e.Tt,b=e.U,_=e.W,w=e.Y,k=e.Z,x=e.a,S=e.at,A=e.bt,C=e.ct,I=e.et,T=e.gt,z=e.h,E=e.it,P=e.j,O=e.kt,F=e.mt,B=e.nt,D=e.ot,R=e.p,N=e.vt,L=e.xt,j=e.yt,M=e.z},function(e){U=e.c,$=e.d,W=e.m,e.r},function(e){H=e.t},function(e){Z=e.t},function(e){V=e.a,G=e.c,K=e.i,J=e.o,Y=e.r},function(e){X=e.D,q=e.F,Q=e.I,ee=e.L,te=e.O,re=e.T,ne=e.V,ae=e.a,ie=e.b,oe=e.c,se=e.d,le=e.i,ue=e.k,de=e.l,ce=e.n,fe=e.o,he=e.r,pe=e.t,me=e.u,ve=e.v,ge=e.x,ye=e.z},function(e){be=e.a},function(e){_e=e.n,we=e.t},function(e){ke=e.$,xe=e.At,Se=e.K,Ae=e.Mt,Ce=e.Nt,Ie=e.Pt,Te=e.Q,ze=e.X,Ee=e.Y,Pe=e.Z,Oe=e.et,Fe=e.ht,Be=e.it,De=e.jt,Re=e.kt,Ne=e.ot,Le=e.q,je=e.st,Me=e.t,Ue=e.tt},function(e){$e=e.n,We=e.t},function(e){He=e.i,Ze=e.r},function(e){Ve=e.t},function(e){Ge=e.t},function(e){e.n}],execute:function(){(Ke=document.createElement("style")).textContent=".kimi-checkbox.small[data-v-a78725a1]{--checkbox-size:12px}.kimi-checkbox.medium[data-v-a78725a1]{--checkbox-size:16px}.kimi-checkbox.large[data-v-a78725a1]{--checkbox-size:20px}.kimi-checkbox[data-v-a78725a1]{box-sizing:border-box;width:var(--checkbox-size);height:var(--checkbox-size);border-radius:6px;display:inline-flex;position:relative}.kimi-checkbox.round[data-v-a78725a1]{border-radius:100%}.kimi-checkbox input[data-v-a78725a1]{opacity:0;cursor:pointer;width:100%;height:100%;margin:0;position:absolute;top:0;bottom:0;left:0;right:0}.kimi-checkbox .kimi-checkbox-inner[data-v-a78725a1]{box-sizing:border-box;width:var(--checkbox-size);height:var(--checkbox-size);border:1px solid var(--Fills-F4);pointer-events:none;background-color:transparent;border-radius:30%;transition:background-color .3s,border-color .3s;display:block}.kimi-checkbox .kimi-checkbox-inner .icon[data-v-a78725a1]{width:calc(var(--checkbox-size) * 1.2);height:calc(var(--checkbox-size) * 1.2);color:var(--Always-White);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.kimi-checkbox .kimi-checkbox-inner.round[data-v-a78725a1]{border-radius:100%}.kimi-checkbox input:hover+.kimi-checkbox-inner[data-v-a78725a1]{border-color:var(--Colors-KMBlue-hover)}.kimi-checkbox.checked .kimi-checkbox-inner[data-v-a78725a1]{background-color:var(--Colors-KMBlue-active);border-color:transparent}.kimi-checkbox.disabled input[data-v-a78725a1]{cursor:not-allowed}.kimi-checkbox.disabled input:hover+.kimi-checkbox-inner[data-v-a78725a1]{border-color:var(--Fills-F4-hover)}.kimi-checkbox.disabled .kimi-checkbox-inner[data-v-a78725a1]{background-color:var(--Fills-F3)}.modal-mask[data-v-02f98061]{z-index:1000;background:rgba(0,0,0,.5);justify-content:center;align-items:center;width:100vw;height:100vh;display:flex;position:fixed;top:0;left:0}.modal-container[data-v-02f98061]{background:var(--BgGp-Secondary);border-radius:16px;flex-direction:column;width:328px;max-height:600px;padding:16px;display:flex}.header[data-v-02f98061]{flex-direction:row;justify-content:space-between;align-items:center;display:flex;position:relative}.title[data-v-02f98061]{color:var(--Labels-Primary);font-size:16px;font-style:normal;font-weight:500;line-height:24px}.body[data-v-02f98061]{color:var(--Labels-Primary);scrollbar-width:none;white-space:pre-wrap;-ms-overflow-style:none;margin-top:12px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;overflow-y:scroll}.body[data-v-02f98061]::-webkit-scrollbar{display:none}.bottom[data-v-02f98061]{flex-direction:row;justify-content:flex-end;align-items:center;gap:8px;margin-top:16px;display:flex}.remind-label[data-v-02f98061]{cursor:pointer;color:var(--Labels-Tertiary,rgba(0,0,0,.45));user-select:none;align-items:center;gap:6px;margin-right:auto;font-size:14px;line-height:20px;display:flex}.button-group[data-v-02f98061]{flex-direction:row;gap:8px;display:flex}.fade-enter-active[data-v-02f98061],.fade-leave-active[data-v-02f98061]{transition:opacity .225s cubic-bezier(.4,0,.2,1)}.fade-enter-from[data-v-02f98061],.fade-leave-to[data-v-02f98061]{opacity:0}.modal-button[data-v-02f98061]{border-radius:10px;min-width:62px;height:32px;padding:0 10px}.modal-button.button-secondary[data-v-02f98061]{color:var(--Labels-Primary)}.modal-mask[data-v-37bdf1f0]{z-index:30;background:rgba(0,0,0,.5);justify-content:center;align-items:center;width:100vw;height:100vh;display:flex;position:fixed;top:0;left:0}.modal-container[data-v-37bdf1f0]{background:var(--BgGp-Secondary);border-radius:16px;flex-direction:column;width:328px;max-height:600px;padding:16px;display:flex}.header[data-v-37bdf1f0]{flex-direction:row;justify-content:space-between;align-items:center;display:flex;position:relative}.title[data-v-37bdf1f0]{color:var(--Labels-Primary);font-size:16px;font-style:normal;font-weight:500;line-height:24px}.body[data-v-37bdf1f0]{margin-top:12px}.input-field[data-v-37bdf1f0]{box-sizing:border-box;background:var(--Fills-F1);width:100%;color:var(--Labels-Primary);border:none;border-radius:8px;outline:none;padding:12px 16px;font-size:14px;line-height:20px}.input-field[data-v-37bdf1f0]::placeholder{color:var(--Labels-Tertiary)}.input-field[data-v-37bdf1f0]:focus{background:var(--Fills-F1-hover)}.bottom[data-v-37bdf1f0]{flex-direction:row;justify-content:flex-end;align-items:center;gap:8px;margin-top:16px;display:flex}.fade-enter-active[data-v-37bdf1f0],.fade-leave-active[data-v-37bdf1f0]{transition:opacity .225s cubic-bezier(.4,0,.2,1)}.fade-enter-from[data-v-37bdf1f0],.fade-leave-to[data-v-37bdf1f0]{opacity:0}.modal-button[data-v-37bdf1f0]{border-radius:10px;height:32px}.modal-button.button-secondary[data-v-37bdf1f0]{color:var(--Labels-Primary)}\n/*$vite$:1*/",document.head.appendChild(Ke),Je=e=>e===G.CN?"cn":e===G.OVERSEA?"overseas":void 0,e("m",Ye=ne(()=>{const e=de(Y),{data:t,isLoading:r}=x({queryKey:["user"],queryFn:async()=>{const{user:t}=await e.getCurrentUser({});return t?{id:t.id,region:Je(t.region)}:null}});N(()=>t.value?.region,e=>{e&&me("overseas"===e?"sg":"cn").catch(()=>{})},{immediate:!0});const n=Oe("test.isVIP",!1),a=d(()=>!1),i=Oe("test.isMockOversea",!1),o=d(()=>"overseas"===t.value?.region);return{userInfo:t,isOverseas:o,isSubscriptionPaid:a,isLoading:r,setDevVIP:e=>{n.value=e},setDevOversea:e=>{i.value=e}}})),Xe=a((e,t)=>{!function(r){"object"==typeof e&&void 0!==t?t.exports=r():"function"==typeof define&&define.amd?define([],r):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).JSZip=r()}(function(){return function e(t,r,a){function i(s,l){if(!r[s]){if(!t[s]){var u="function"==typeof n&&n;if(!l&&u)return u(s,!0);if(o)return o(s,!0);var d=new Error("Cannot find module '"+s+"'");throw d.code="MODULE_NOT_FOUND",d}var c=r[s]={exports:{}};t[s][0].call(c.exports,function(e){return i(t[s][1][e]||e)},c,c.exports,e,t,r,a)}return r[s].exports}for(var o="function"==typeof n&&n,s=0;s<a.length;s++)i(a[s]);return i}({1:[function(e,t,r){var n=e("./utils"),a=e("./support"),i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,a,o,s,l,u,d=[],c=0,f=e.length,h=f,p="string"!==n.getTypeOf(e);c<e.length;)h=f-c,a=p?(t=e[c++],r=c<f?e[c++]:0,c<f?e[c++]:0):(t=e.charCodeAt(c++),r=c<f?e.charCodeAt(c++):0,c<f?e.charCodeAt(c++):0),o=t>>2,s=(3&t)<<4|r>>4,l=1<h?(15&r)<<2|a>>6:64,u=2<h?63&a:64,d.push(i.charAt(o)+i.charAt(s)+i.charAt(l)+i.charAt(u));return d.join("")},r.decode=function(e){var t,r,n,o,s,l,u=0,d=0,c="data:";if(e.substr(0,5)===c)throw new Error("Invalid base64 input, it looks like a data url.");var f,h=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===i.charAt(64)&&h--,e.charAt(e.length-2)===i.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(f=a.uint8array?new Uint8Array(0|h):new Array(0|h);u<e.length;)t=i.indexOf(e.charAt(u++))<<2|(o=i.indexOf(e.charAt(u++)))>>4,r=(15&o)<<4|(s=i.indexOf(e.charAt(u++)))>>2,n=(3&s)<<6|(l=i.indexOf(e.charAt(u++))),f[d++]=t,64!==s&&(f[d++]=r),64!==l&&(f[d++]=n);return f}},{"./support":30,"./utils":32}],2:[function(e,t,r){var n=e("./external"),a=e("./stream/DataWorker"),i=e("./stream/Crc32Probe"),o=e("./stream/DataLengthProbe");function s(e,t,r,n,a){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=a}s.prototype={getContentWorker:function(){var e=new a(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new a(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,r){return e.pipe(new i).pipe(new o("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){var n=e("./utils"),a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r){var n=a,i=0+r;e^=-1;for(var o=0;o<i;o++)e=e>>>8^n[255&(e^t[o])];return-1^e}(0|t,e,e.length):function(e,t,r){var n=a,i=0+r;e^=-1;for(var o=0;o<i;o++)e=e>>>8^n[255&(e^t.charCodeAt(o))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,r){r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){var n;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,a=e("pako"),i=e("./utils"),o=e("./stream/GenericWorker"),s=n?"uint8array":"array";function l(e,t){o.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",i.inherits(l,o),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(i.transformTo(s,e.data),!1)},l.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new a[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new l("Deflate",e)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){function n(e,t){var r,n="";for(r=0;r<t;r++)n+=String.fromCharCode(255&e),e>>>=8;return n}function a(e,t,r,a,o,d){var c,f,h=e.file,p=e.compression,m=d!==s.utf8encode,v=i.transformTo("string",d(h.name)),g=i.transformTo("string",s.utf8encode(h.name)),y=h.comment,b=i.transformTo("string",d(y)),_=i.transformTo("string",s.utf8encode(y)),w=g.length!==h.name.length,k=_.length!==y.length,x="",S="",A="",C=h.dir,I=h.date,T={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(T.crc32=e.crc32,T.compressedSize=e.compressedSize,T.uncompressedSize=e.uncompressedSize);var z=0;t&&(z|=8),m||!w&&!k||(z|=2048);var E=0,P=0;C&&(E|=16),"UNIX"===o?(P=798,E|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(h.unixPermissions,C)):(P=20,E|=function(e){return 63&(e||0)}(h.dosPermissions)),c=I.getUTCHours(),c<<=6,c|=I.getUTCMinutes(),c<<=5,c|=I.getUTCSeconds()/2,f=I.getUTCFullYear()-1980,f<<=4,f|=I.getUTCMonth()+1,f<<=5,f|=I.getUTCDate(),w&&(S=n(1,1)+n(l(v),4)+g,x+="up"+n(S.length,2)+S),k&&(A=n(1,1)+n(l(b),4)+_,x+="uc"+n(A.length,2)+A);var O="";return O+="\n\0",O+=n(z,2),O+=p.magic,O+=n(c,2),O+=n(f,2),O+=n(T.crc32,4),O+=n(T.compressedSize,4),O+=n(T.uncompressedSize,4),O+=n(v.length,2),O+=n(x.length,2),{fileRecord:u.LOCAL_FILE_HEADER+O+v+x,dirRecord:u.CENTRAL_FILE_HEADER+n(P,2)+O+n(b.length,2)+"\0\0\0\0"+n(E,4)+n(a,4)+v+x+b}}var i=e("../utils"),o=e("../stream/GenericWorker"),s=e("../utf8"),l=e("../crc32"),u=e("../signature");function d(e,t,r,n){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}i.inherits(d,o),d.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},d.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=a(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=a(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return u.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,a=function(e,t,r,a,o){var s=i.transformTo("string",o(a));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+n(s.length,2)+s}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:a,meta:{percent:100}})},d.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},d.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},d.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},d.prototype.error=function(e){var t=this._sources;if(!o.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},d.prototype.lock=function(){o.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=d},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){var n=e("../compressions"),a=e("./ZipFileWorker");r.generateWorker=function(e,t,r){var i=new a(t.streamFiles,r,t.platform,t.encodeFileName),o=0;try{e.forEach(function(e,r){o++;var a=function(e,t){var r=e||t,a=n[r];if(!a)throw new Error(r+" is not a valid compression method !");return a}(r.options.compression,t.compression),s=r.options.compressionOptions||t.compressionOptions||{},l=r.dir,u=r.date;r._compressWorker(a,s).withStreamInfo("file",{name:e,dir:l,date:u,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(i)}),i.entriesCount=o}catch(e){i.error(e)}return i}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){function n(){if(!(this instanceof n))return new n;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 e=new n;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(n.prototype=e("./object")).loadAsync=e("./load"),n.support=e("./support"),n.defaults=e("./defaults"),n.version="3.10.1",n.loadAsync=function(e,t){return(new n).loadAsync(e,t)},n.external=e("./external"),t.exports=n},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){var n=e("./utils"),a=e("./external"),i=e("./utf8"),o=e("./zipEntries"),s=e("./stream/Crc32Probe"),l=e("./nodejsUtils");function u(e){return new a.Promise(function(t,r){var n=e.decompressed.getContentWorker().pipe(new s);n.on("error",function(e){r(e)}).on("end",function(){n.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}t.exports=function(e,t){var r=this;return t=n.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:i.utf8decode}),l.isNode&&l.isStream(e)?a.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):n.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var r=new o(t);return r.load(e),r}).then(function(e){var r=[a.Promise.resolve(e)],n=e.files;if(t.checkCRC32)for(var i=0;i<n.length;i++)r.push(u(n[i]));return a.Promise.all(r)}).then(function(e){for(var a=e.shift(),i=a.files,o=0;o<i.length;o++){var s=i[o],l=s.fileNameStr,u=n.resolve(s.fileNameStr);r.file(u,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(r.file(u).unsafeOriginalName=l)}return a.zipComment.length&&(r.comment=a.zipComment),r})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){var n=e("../utils"),a=e("../stream/GenericWorker");function i(e,t){a.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}n.inherits(i,a),i.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},i.prototype.pause=function(){return!!a.prototype.pause.call(this)&&(this._stream.pause(),!0)},i.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=i},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){var n=e("readable-stream").Readable;function a(e,t,r){n.call(this,t),this._helper=e;var a=this;e.on("data",function(e,t){a.push(e)||a._helper.pause(),r&&r(t)}).on("error",function(e){a.emit("error",e)}).on("end",function(){a.push(null)})}e("../utils").inherits(a,n),a.prototype._read=function(){this._helper.resume()},t.exports=a},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){function n(e,t,r){var n,a=i.getTypeOf(t),s=i.extend(r||{},l);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=m(e)),s.createFolders&&(n=p(e))&&v.call(this,n,!0);var c,g="string"===a&&!1===s.binary&&!1===s.base64;r&&void 0!==r.binary||(s.binary=!g),(t instanceof u&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",a="string"),c=t instanceof u||t instanceof o?t:f.isNode&&f.isStream(t)?new h(e,t):i.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var y=new d(e,c,s);this.files[e]=y}var a=e("./utf8"),i=e("./utils"),o=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),l=e("./defaults"),u=e("./compressedObject"),d=e("./zipObject"),c=e("./generate"),f=e("./nodejsUtils"),h=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},v=function(e,t){return t=void 0!==t?t:l.createFolders,e=m(e),this.files[e]||n.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function g(e){return"[object RegExp]"===Object.prototype.toString.call(e)}t.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,n;for(t in this.files)n=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,n)},filter:function(e){var t=[];return this.forEach(function(r,n){e(r,n)&&t.push(n)}),t},file:function(e,t,r){if(1!==arguments.length)return e=this.root+e,n.call(this,e,t,r),this;if(g(e)){var a=e;return this.filter(function(e,t){return!t.dir&&a.test(e)})}var i=this.files[this.root+e];return i&&!i.dir?i:null},folder:function(e){if(!e)return this;if(g(e))return this.filter(function(t,r){return r.dir&&e.test(t)});var t=this.root+e,r=v.call(this,t),n=this.clone();return n.root=r.name,n},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(t,r){return r.name.slice(0,e.length)===e}),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=i.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:a.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");i.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var n=r.comment||this.comment||"";t=c.generateWorker(this,r,n)}catch(e){(t=new o("error")).error(e)}return new s(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}}},{"./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(e,t,r){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){var n=e("./DataReader");function a(e){n.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(a,n),a.prototype.byteAt=function(e){return this.data[this.zero+e]},a.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),a=e.charCodeAt(3),i=this.length-4;0<=i;--i)if(this.data[i]===t&&this.data[i+1]===r&&this.data[i+2]===n&&this.data[i+3]===a)return i-this.zero;return-1},a.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),n=e.charCodeAt(2),a=e.charCodeAt(3),i=this.readData(4);return t===i[0]&&r===i[1]&&n===i[2]&&a===i[3]},a.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){var n=e("../utils");function a(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}a.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=a},{"../utils":32}],19:[function(e,t,r){var n=e("./Uint8ArrayReader");function a(e){n.call(this,e)}e("../utils").inherits(a,n),a.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){var n=e("./DataReader");function a(e){n.call(this,e)}e("../utils").inherits(a,n),a.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},a.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},a.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},a.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){var n=e("./ArrayReader");function a(e){n.call(this,e)}e("../utils").inherits(a,n),a.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=a},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){var n=e("../utils"),a=e("../support"),i=e("./ArrayReader"),o=e("./StringReader"),s=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||a.uint8array?"nodebuffer"===t?new s(e):a.uint8array?new l(n.transformTo("uint8array",e)):new i(n.transformTo("array",e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){var n=e("./GenericWorker"),a=e("../utils");function i(e){n.call(this,"ConvertWorker to "+e),this.destType=e}a.inherits(i,n),i.prototype.processChunk=function(e){this.push({data:a.transformTo(this.destType,e.data),meta:e.meta})},t.exports=i},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){var n=e("./GenericWorker"),a=e("../crc32");function i(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(i,n),i.prototype.processChunk=function(e){this.streamInfo.crc32=a(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=i},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){var n=e("../utils"),a=e("./GenericWorker");function i(e){a.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(i,a),i.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}a.prototype.processChunk.call(this,e)},t.exports=i},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){var n=e("../utils"),a=e("./GenericWorker");function i(e){a.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(i,a),i.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this.data=null},i.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},i.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},i.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=i},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){function n(e){this.name=e||"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}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),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 e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},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 e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=n},{}],29:[function(e,t,r){var n=e("../utils"),a=e("./ConvertWorker"),i=e("./GenericWorker"),o=e("../base64"),s=e("../support"),l=e("../external"),u=null;if(s.nodestream)try{u=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function d(e,t,r){var o=t;switch(t){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=t,this._mimeType=r,n.checkSupport(o),this._worker=e.pipe(new a(o)),e.lock()}catch(e){this._worker=new i("error"),this._worker.error(e)}}d.prototype={accumulate:function(e){return function(e,t){return new l.Promise(function(r,a){var i=[],s=e._internalType,l=e._outputType,u=e._mimeType;e.on("data",function(e,r){i.push(e),t&&t(r)}).on("error",function(e){i=[],a(e)}).on("end",function(){try{r(function(e,t,r){switch(e){case"blob":return n.newBlob(n.transformTo("arraybuffer",t),r);case"base64":return o.encode(t);default:return n.transformTo(e,t)}}(l,function(e,t){var r,n=0,a=null,i=0;for(r=0;r<t.length;r++)i+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(a=new Uint8Array(i),r=0;r<t.length;r++)a.set(t[r],n),n+=t[r].length;return a;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,i),u))}catch(e){a(e)}i=[]}).resume()})}(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,function(e){t.call(r,e.data,e.meta)}):this._worker.on(e,function(){n.delay(t,arguments,r)}),this},resume:function(){return n.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(n.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer="undefined"!=typeof Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var n=new ArrayBuffer(0);try{r.blob=0===new Blob([n],{type:"application/zip"}).size}catch(e){try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);a.append(n),r.blob=0===a.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){for(var n=e("./utils"),a=e("./support"),i=e("./nodejsUtils"),o=e("./stream/GenericWorker"),s=new Array(256),l=0;l<256;l++)s[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function u(){o.call(this,"utf-8 decode"),this.leftOver=null}function d(){o.call(this,"utf-8 encode")}s[254]=s[254]=1,r.utf8encode=function(e){return a.nodebuffer?i.newBufferFrom(e,"utf-8"):function(e){var t,r,n,i,o,s=e.length,l=0;for(i=0;i<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=a.uint8array?new Uint8Array(l):new Array(l),i=o=0;o<l;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(n=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(n-56320),i++),r<128?t[o++]=r:(r<2048?t[o++]=192|r>>>6:(r<65536?t[o++]=224|r>>>12:(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63),t[o++]=128|r>>>6&63),t[o++]=128|63&r);return t}(e)},r.utf8decode=function(e){return a.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,a,i,o=e.length,l=new Array(2*o);for(t=r=0;t<o;)if((a=e[t++])<128)l[r++]=a;else if(4<(i=s[a]))l[r++]=65533,t+=i-1;else{for(a&=2===i?31:3===i?15:7;1<i&&t<o;)a=a<<6|63&e[t++],i--;1<i?l[r++]=65533:a<65536?l[r++]=a:(a-=65536,l[r++]=55296|a>>10&1023,l[r++]=56320|1023&a)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),n.applyFromCharCode(l)}(e=n.transformTo(a.uint8array?"uint8array":"array",e))},n.inherits(u,o),u.prototype.processChunk=function(e){var t=n.transformTo(a.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var i=t;(t=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),t.set(i,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}(t),l=t;o!==t.length&&(a.uint8array?(l=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(l=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:r.utf8decode(l),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=u,n.inherits(d,o),d.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){var n=e("./support"),a=e("./base64"),i=e("./nodejsUtils"),o=e("./external");function s(e){return e}function l(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}e("setimmediate"),r.newBlob=function(t,n){r.checkSupport("blob");try{return new Blob([t],{type:n})}catch(e){try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return a.append(t),a.getBlob(n)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(e,t,r){var n=[],a=0,i=e.length;if(i<=r)return String.fromCharCode.apply(null,e);for(;a<i;)"array"===t||"nodebuffer"===t?n.push(String.fromCharCode.apply(null,e.slice(a,Math.min(a+r,i)))):n.push(String.fromCharCode.apply(null,e.subarray(a,Math.min(a+r,i)))),a+=r;return n.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return n.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return n.nodebuffer&&1===String.fromCharCode.apply(null,i.allocBuffer(1)).length}catch(e){return!1}}()}};function d(e){var t=65536,n=r.getTypeOf(e),a=!0;if("uint8array"===n?a=u.applyCanBeUsed.uint8array:"nodebuffer"===n&&(a=u.applyCanBeUsed.nodebuffer),a)for(;1<t;)try{return u.stringifyByChunk(e,n,t)}catch(e){t=Math.floor(t/2)}return u.stringifyByChar(e)}function c(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}r.applyFromCharCode=d;var f={};f.string={string:s,array:function(e){return l(e,new Array(e.length))},arraybuffer:function(e){return f.string.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:function(e){return l(e,i.allocBuffer(e.length))}},f.array={string:d,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i.newBufferFrom(e)}},f.arraybuffer={string:function(e){return d(new Uint8Array(e))},array:function(e){return c(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i.newBufferFrom(new Uint8Array(e))}},f.uint8array={string:d,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return i.newBufferFrom(e)}},f.nodebuffer={string:d,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return f.nodebuffer.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:s},r.transformTo=function(e,t){return t=t||"",e?(r.checkSupport(e),f[r.getTypeOf(t)][e](t)):t},r.resolve=function(e){for(var t=e.split("/"),r=[],n=0;n<t.length;n++){var a=t[n];"."===a||""===a&&0!==n&&n!==t.length-1||(".."===a?r.pop():r.push(a))}return r.join("/")},r.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":n.nodebuffer&&i.isBuffer(e)?"nodebuffer":n.uint8array&&e instanceof Uint8Array?"uint8array":n.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(e){if(!n[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(e){var t,r,n="";for(r=0;r<(e||"").length;r++)n+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return n},r.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[])})},r.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},r.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},r.prepareContent=function(e,t,i,s,u){return o.Promise.resolve(t).then(function(e){return n.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new o.Promise(function(t,r){var n=new FileReader;n.onload=function(e){t(e.target.result)},n.onerror=function(e){r(e.target.error)},n.readAsArrayBuffer(e)}):e}).then(function(t){var d=r.getTypeOf(t);return d?("arraybuffer"===d?t=r.transformTo("uint8array",t):"string"===d&&(u?t=a.decode(t):i&&!0!==s&&(t=function(e){return l(e,n.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):o.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,r){var n=e("./reader/readerFor"),a=e("./utils"),i=e("./signature"),o=e("./zipEntry"),s=e("./support");function l(e){this.files=[],this.loadOptions=e}l.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+a.pretty(t)+", expected "+a.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var n=this.reader.readString(4)===t;return this.reader.setIndex(r),n},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 e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",r=a.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},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 e,t,r,n=this.zip64EndOfCentralSize-44;0<n;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},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 e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(i.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(i.CENTRAL_FILE_HEADER);)(e=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(i.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,i.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(e);var t=e;if(this.checkSignature(i.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===a.MAX_VALUE_16BITS||this.diskWithCentralDirStart===a.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===a.MAX_VALUE_16BITS||this.centralDirRecords===a.MAX_VALUE_16BITS||this.centralDirSize===a.MAX_VALUE_32BITS||this.centralDirOffset===a.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(i.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(i.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,i.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(i.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(i.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=t-r;if(0<n)this.isSignature(t,i.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(e){this.reader=n(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){var n=e("./reader/readerFor"),a=e("./utils"),i=e("./compressedObject"),o=e("./crc32"),s=e("./utf8"),l=e("./compressions"),u=e("./support");function d(e,t){this.options=e,this.loadOptions=t}d.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(Object.prototype.hasOwnProperty.call(l,t)&&l[t].magic===e)return l[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+a.pretty(this.compressionMethod)+" unknown (inner file : "+a.transformTo("string",this.fileName)+")");this.decompressed=new i(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===a.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===a.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===a.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===a.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,a=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<a;)t=e.readInt(2),r=e.readInt(2),n=e.readData(r),this.extraFields[t]={id:t,length:r,value:n};e.setIndex(a)},handleUTF8:function(){var e=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=a.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var i=a.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=n(e.value);return 1!==t.readInt(1)||o(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=n(e.value);return 1!==t.readInt(1)||o(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=d},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){function n(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var a=e("./stream/StreamHelper"),i=e("./stream/DataWorker"),o=e("./utf8"),s=e("./compressedObject"),l=e("./stream/GenericWorker");n.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var i=!this._dataBinary;i&&!n&&(t=t.pipe(new o.Utf8EncodeWorker)),!i&&n&&(t=t.pipe(new o.Utf8DecodeWorker))}catch(e){(t=new l("error")).error(e)}return new a(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof l?this._data:new i(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],d=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<u.length;c++)n.prototype[u[c]]=d;t.exports=n},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,r){(function(e){var r,n,a=e.MutationObserver||e.WebKitMutationObserver;if(a){var i=0,o=new a(d),s=e.document.createTextNode("");o.observe(s,{characterData:!0}),r=function(){s.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){d(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(d,0)};else{var l=new e.MessageChannel;l.port1.onmessage=d,r=function(){l.port2.postMessage(0)}}var u=[];function d(){var e,t;n=!0;for(var r=u.length;r;){for(t=u,u=[],e=-1;++e<r;)t[e]();r=u.length}n=!1}t.exports=function(e){1!==u.push(e)||n||r()}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){var n=e("immediate");function a(){}var i={},o=["REJECTED"],s=["FULFILLED"],l=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==a&&h(this,e)}function d(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(e,t,r){n(function(){var n;try{n=t(r)}catch(n){return i.reject(e,n)}n===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,n)})}function f(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var r=!1;function n(t){r||(r=!0,i.reject(e,t))}function a(t){r||(r=!0,i.resolve(e,t))}var o=p(function(){t(a,n)});"error"===o.status&&n(o.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=u).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})},u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===o)return this;var r=new this.constructor(a);return this.state!==l?c(r,this.state===s?e:t,this.outcome):this.queue.push(new d(r,e,t)),r},d.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},d.prototype.otherCallFulfilled=function(e){c(this.promise,this.onFulfilled,e)},d.prototype.callRejected=function(e){i.reject(this.promise,e)},d.prototype.otherCallRejected=function(e){c(this.promise,this.onRejected,e)},i.resolve=function(e,t){var r=p(f,t);if("error"===r.status)return i.reject(e,r.value);var n=r.value;if(n)h(e,n);else{e.state=s,e.outcome=t;for(var a=-1,o=e.queue.length;++a<o;)e.queue[a].callFulfilled(t)}return e},i.reject=function(e,t){e.state=o,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:i.resolve(new this(a),e)},u.reject=function(e){var t=new this(a);return i.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var o=new Array(r),s=0,l=-1,u=new this(a);++l<r;)d(e[l],l);return u;function d(e,a){t.resolve(e).then(function(e){o[a]=e,++s!==r||n||(n=!0,i.resolve(u,o))},function(e){n||(n=!0,i.reject(u,e))})}},u.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,r=!1;if(!t)return this.resolve([]);for(var n,o=-1,s=new this(a);++o<t;)n=e[o],this.resolve(n).then(function(e){r||(r=!0,i.resolve(s,e))},function(e){r||(r=!0,i.reject(s,e))});return s}},{immediate:36}],38:[function(e,t,r){var n={};(0,e("./lib/utils/common").assign)(n,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=n},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){var n=e("./zlib/deflate"),a=e("./utils/common"),i=e("./utils/strings"),o=e("./zlib/messages"),s=e("./zlib/zstream"),l=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=a.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==r)throw new Error(o[r]);if(t.header&&n.deflateSetHeader(this.strm,t.header),t.dictionary){var d;if(d="string"==typeof t.dictionary?i.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(r=n.deflateSetDictionary(this.strm,d)))throw new Error(o[r]);this._dict_set=!0}}function d(e,t){var r=new u(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}u.prototype.push=function(e,t){var r,o,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=i.string2buf(e):"[object ArrayBuffer]"===l.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new a.Buf8(u),s.next_out=0,s.avail_out=u),1!==(r=n.deflate(s,o))&&0!==r)return this.onEnd(r),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(i.buf2binstring(a.shrinkBuf(s.output,s.next_out))):this.onData(a.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==r);return 4===o?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==o||(this.onEnd(0),!(s.avail_out=0))},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=u,r.deflate=d,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,d(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){var n=e("./zlib/inflate"),a=e("./utils/common"),i=e("./utils/strings"),o=e("./zlib/constants"),s=e("./zlib/messages"),l=e("./zlib/zstream"),u=e("./zlib/gzheader"),d=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=a.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=n.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(s[r]);this.header=new u,n.inflateGetHeader(this.strm,this.header)}function f(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(e,t){var r,s,l,u,c,f,h=this.strm,p=this.options.chunkSize,m=this.options.dictionary,v=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?h.input=i.binstring2buf(e):"[object ArrayBuffer]"===d.call(e)?h.input=new Uint8Array(e):h.input=e,h.next_in=0,h.avail_in=h.input.length;do{if(0===h.avail_out&&(h.output=new a.Buf8(p),h.next_out=0,h.avail_out=p),(r=n.inflate(h,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&m&&(f="string"==typeof m?i.string2buf(m):"[object ArrayBuffer]"===d.call(m)?new Uint8Array(m):m,r=n.inflateSetDictionary(this.strm,f)),r===o.Z_BUF_ERROR&&!0===v&&(r=o.Z_OK,v=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),!(this.ended=!0);h.next_out&&(0!==h.avail_out&&r!==o.Z_STREAM_END&&(0!==h.avail_in||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(l=i.utf8border(h.output,h.next_out),u=h.next_out-l,c=i.buf2string(h.output,l),h.next_out=u,h.avail_out=p-u,u&&a.arraySet(h.output,h.output,l,u,0),this.onData(c)):this.onData(a.shrinkBuf(h.output,h.next_out)))),0===h.avail_in&&0===h.avail_out&&(v=!0)}while((0<h.avail_in||0===h.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(r=n.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(h.avail_out=0))},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=a.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=c,r.inflate=f,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},r.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(e,t,r){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(e[n]=r[n])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var a={arraySet:function(e,t,r,n,a){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),a);else for(var i=0;i<n;i++)e[a+i]=t[r+i]},flattenChunks:function(e){var t,r,n,a,i,o;for(t=n=0,r=e.length;t<r;t++)n+=e[t].length;for(o=new Uint8Array(n),t=a=0,r=e.length;t<r;t++)i=e[t],o.set(i,a),a+=i.length;return o}},i={arraySet:function(e,t,r,n,a){for(var i=0;i<n;i++)e[a+i]=t[r+i]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,a)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,i))},r.setTyped(n)},{}],42:[function(e,t,r){var n=e("./common"),a=!0,i=!0;try{String.fromCharCode.apply(null,[0])}catch(e){a=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){i=!1}for(var o=new n.Buf8(256),s=0;s<256;s++)o[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function l(e,t){if(t<65537&&(e.subarray&&i||!e.subarray&&a))return String.fromCharCode.apply(null,n.shrinkBuf(e,t));for(var r="",o=0;o<t;o++)r+=String.fromCharCode(e[o]);return r}o[254]=o[254]=1,r.string2buf=function(e){var t,r,a,i,o,s=e.length,l=0;for(i=0;i<s;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(a=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(a-56320),i++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new n.Buf8(l),i=o=0;o<l;i++)55296==(64512&(r=e.charCodeAt(i)))&&i+1<s&&56320==(64512&(a=e.charCodeAt(i+1)))&&(r=65536+(r-55296<<10)+(a-56320),i++),r<128?t[o++]=r:(r<2048?t[o++]=192|r>>>6:(r<65536?t[o++]=224|r>>>12:(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63),t[o++]=128|r>>>6&63),t[o++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,a=t.length;r<a;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,n,a,i,s=t||e.length,u=new Array(2*s);for(r=n=0;r<s;)if((a=e[r++])<128)u[n++]=a;else if(4<(i=o[a]))u[n++]=65533,r+=i-1;else{for(a&=2===i?31:3===i?15:7;1<i&&r<s;)a=a<<6|63&e[r++],i--;1<i?u[n++]=65533:a<65536?u[n++]=a:(a-=65536,u[n++]=55296|a>>10&1023,u[n++]=56320|1023&a)}return l(u,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){t.exports=function(e,t,r,n){for(var a=65535&e,i=e>>>16&65535,o=0;0!==r;){for(r-=o=2e3<r?2e3:r;i=i+(a=a+t[n++]|0)|0,--o;);a%=65521,i%=65521}return a|i<<16}},{}],44:[function(e,t,r){t.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(e,t,r){var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,a){var i=n,o=a+r;e^=-1;for(var s=a;s<o;s++)e=e>>>8^i[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,r){var n,a=e("../utils/common"),i=e("./trees"),o=e("./adler32"),s=e("./crc32"),l=e("./messages"),u=-2,d=258,c=262,f=113;function h(e,t){return e.msg=l[t],t}function p(e){return(e<<1)-(4<e?9:0)}function m(e){for(var t=e.length;0<=--t;)e[t]=0}function v(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(a.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function g(e,t){i._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,v(e.strm)}function y(e,t){e.pending_buf[e.pending++]=t}function b(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function _(e,t){var r,n,a=e.max_chain_length,i=e.strstart,o=e.prev_length,s=e.nice_match,l=e.strstart>e.w_size-c?e.strstart-(e.w_size-c):0,u=e.window,f=e.w_mask,h=e.prev,p=e.strstart+d,m=u[i+o-1],v=u[i+o];e.prev_length>=e.good_match&&(a>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(r=t)+o]===v&&u[r+o-1]===m&&u[r]===u[i]&&u[++r]===u[i+1]){i+=2,r++;do{}while(u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&u[++i]===u[++r]&&i<p);if(n=d-(p-i),i=p-d,o<n){if(e.match_start=t,s<=(o=n))break;m=u[i+o-1],v=u[i+o]}}}while((t=h[t&f])>l&&0!=--a);return o<=e.lookahead?o:e.lookahead}function w(e){var t,r,n,i,l,u,d,f,h,p,m=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-c)){for(a.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=r=e.hash_size;n=e.head[--t],e.head[t]=m<=n?n-m:0,--r;);for(t=r=m;n=e.prev[--t],e.prev[t]=m<=n?n-m:0,--r;);i+=m}if(0===e.strm.avail_in)break;if(u=e.strm,d=e.window,f=e.strstart+e.lookahead,p=void 0,(h=i)<(p=u.avail_in)&&(p=h),r=0===p?0:(u.avail_in-=p,a.arraySet(d,u.input,u.next_in,p,f),1===u.state.wrap?u.adler=o(u.adler,d,p,f):2===u.state.wrap&&(u.adler=s(u.adler,d,p,f)),u.next_in+=p,u.total_in+=p,p),e.lookahead+=r,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<c&&0!==e.strm.avail_in)}function k(e,t){for(var r,n;;){if(e.lookahead<c){if(w(e),e.lookahead<c&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-c&&(e.match_length=_(e,r)),e.match_length>=3)if(n=i._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);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 n=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}function x(e,t){for(var r,n,a;;){if(e.lookahead<c){if(w(e),e.lookahead<c&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=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=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-c&&(e.match_length=_(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){for(a=e.strstart+e.lookahead-3,n=i._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),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+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(g(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((n=i._tr_tally(e,0,e.window[e.strstart-1]))&&g(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=i._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}function S(e,t,r,n,a){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=a}function A(){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=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new a.Buf16(1146),this.dyn_dtree=new a.Buf16(122),this.bl_tree=new a.Buf16(78),m(this.dyn_ltree),m(this.dyn_dtree),m(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new a.Buf16(16),this.heap=new a.Buf16(573),m(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new a.Buf16(573),m(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 C(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:f,e.adler=2===t.wrap?0:1,t.last_flush=0,i._tr_init(t),0):h(e,u)}function I(e){var t=C(e);return 0===t&&function(e){e.window_size=2*e.w_size,m(e.head),e.max_lazy_match=n[e.level].max_lazy,e.good_match=n[e.level].good_length,e.nice_match=n[e.level].nice_length,e.max_chain_length=n[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function T(e,t,r,n,i,o){if(!e)return u;var s=1;if(-1===t&&(t=6),n<0?(s=0,n=-n):15<n&&(s=2,n-=16),i<1||9<i||8!==r||n<8||15<n||t<0||9<t||o<0||4<o)return h(e,u);8===n&&(n=9);var l=new A;return(e.state=l).strm=e,l.wrap=s,l.gzhead=null,l.w_bits=n,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=i+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new a.Buf8(2*l.w_size),l.head=new a.Buf16(l.hash_size),l.prev=new a.Buf16(l.w_size),l.lit_bufsize=1<<i+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new a.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=o,l.method=r,I(e)}n=[new S(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,g(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-c&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(g(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(g(e,!1),e.strm.avail_out),1)}),new S(4,4,8,4,k),new S(4,5,16,8,k),new S(4,6,32,32,k),new S(4,4,16,16,x),new S(8,16,32,32,x),new S(8,16,128,128,x),new S(8,32,128,256,x),new S(32,128,258,1024,x),new S(32,258,258,4096,x)],r.deflateInit=function(e,t){return T(e,t,8,15,8,0)},r.deflateInit2=T,r.deflateReset=I,r.deflateResetKeep=C,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?u:(e.state.gzhead=t,0):u},r.deflate=function(e,t){var r,a,o,l;if(!e||!e.state||5<t||t<0)return e?h(e,u):u;if(a=e.state,!e.output||!e.input&&0!==e.avail_in||666===a.status&&4!==t)return h(e,0===e.avail_out?-5:u);if(a.strm=e,r=a.last_flush,a.last_flush=t,42===a.status)if(2===a.wrap)e.adler=0,y(a,31),y(a,139),y(a,8),a.gzhead?(y(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),y(a,255&a.gzhead.time),y(a,a.gzhead.time>>8&255),y(a,a.gzhead.time>>16&255),y(a,a.gzhead.time>>24&255),y(a,9===a.level?2:2<=a.strategy||a.level<2?4:0),y(a,255&a.gzhead.os),a.gzhead.extra&&a.gzhead.extra.length&&(y(a,255&a.gzhead.extra.length),y(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=s(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=69):(y(a,0),y(a,0),y(a,0),y(a,0),y(a,0),y(a,9===a.level?2:2<=a.strategy||a.level<2?4:0),y(a,3),a.status=f);else{var c=8+(a.w_bits-8<<4)<<8;c|=(2<=a.strategy||a.level<2?0:a.level<6?1:6===a.level?2:3)<<6,0!==a.strstart&&(c|=32),c+=31-c%31,a.status=f,b(a,c),0!==a.strstart&&(b(a,e.adler>>>16),b(a,65535&e.adler)),e.adler=1}if(69===a.status)if(a.gzhead.extra){for(o=a.pending;a.gzindex<(65535&a.gzhead.extra.length)&&(a.pending!==a.pending_buf_size||(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),v(e),o=a.pending,a.pending!==a.pending_buf_size));)y(a,255&a.gzhead.extra[a.gzindex]),a.gzindex++;a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=73)}else a.status=73;if(73===a.status)if(a.gzhead.name){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),v(e),o=a.pending,a.pending===a.pending_buf_size)){l=1;break}l=a.gzindex<a.gzhead.name.length?255&a.gzhead.name.charCodeAt(a.gzindex++):0,y(a,l)}while(0!==l);a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),0===l&&(a.gzindex=0,a.status=91)}else a.status=91;if(91===a.status)if(a.gzhead.comment){o=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),v(e),o=a.pending,a.pending===a.pending_buf_size)){l=1;break}l=a.gzindex<a.gzhead.comment.length?255&a.gzhead.comment.charCodeAt(a.gzindex++):0,y(a,l)}while(0!==l);a.gzhead.hcrc&&a.pending>o&&(e.adler=s(e.adler,a.pending_buf,a.pending-o,o)),0===l&&(a.status=103)}else a.status=103;if(103===a.status&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&v(e),a.pending+2<=a.pending_buf_size&&(y(a,255&e.adler),y(a,e.adler>>8&255),e.adler=0,a.status=f)):a.status=f),0!==a.pending){if(v(e),0===e.avail_out)return a.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(r)&&4!==t)return h(e,-5);if(666===a.status&&0!==e.avail_in)return h(e,-5);if(0!==e.avail_in||0!==a.lookahead||0!==t&&666!==a.status){var _=2===a.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}(a,t):3===a.strategy?function(e,t){for(var r,n,a,o,s=e.window;;){if(e.lookahead<=d){if(w(e),e.lookahead<=d&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0<e.strstart&&(n=s[a=e.strstart-1])===s[++a]&&n===s[++a]&&n===s[++a]){o=e.strstart+d;do{}while(n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&n===s[++a]&&a<o);e.match_length=d-(o-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=i._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=i._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(g(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(g(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(g(e,!1),0===e.strm.avail_out)?1:2}(a,t):n[a.level].func(a,t);if(3!==_&&4!==_||(a.status=666),1===_||3===_)return 0===e.avail_out&&(a.last_flush=-1),0;if(2===_&&(1===t?i._tr_align(a):5!==t&&(i._tr_stored_block(a,0,0,!1),3===t&&(m(a.head),0===a.lookahead&&(a.strstart=0,a.block_start=0,a.insert=0))),v(e),0===e.avail_out))return a.last_flush=-1,0}return 4!==t?0:a.wrap<=0?1:(2===a.wrap?(y(a,255&e.adler),y(a,e.adler>>8&255),y(a,e.adler>>16&255),y(a,e.adler>>24&255),y(a,255&e.total_in),y(a,e.total_in>>8&255),y(a,e.total_in>>16&255),y(a,e.total_in>>24&255)):(b(a,e.adler>>>16),b(a,65535&e.adler)),v(e),0<a.wrap&&(a.wrap=-a.wrap),0!==a.pending?0:1)},r.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&t!==f&&666!==t?h(e,u):(e.state=null,t===f?h(e,-3):0):u},r.deflateSetDictionary=function(e,t){var r,n,i,s,l,d,c,f,h=t.length;if(!e||!e.state)return u;if(2===(s=(r=e.state).wrap)||1===s&&42!==r.status||r.lookahead)return u;for(1===s&&(e.adler=o(e.adler,t,h,0)),r.wrap=0,h>=r.w_size&&(0===s&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),f=new a.Buf8(r.w_size),a.arraySet(f,t,h-r.w_size,r.w_size,0),t=f,h=r.w_size),l=e.avail_in,d=e.next_in,c=e.input,e.avail_in=h,e.next_in=0,e.input=t,w(r);r.lookahead>=3;){for(n=r.strstart,i=r.lookahead-2;r.ins_h=(r.ins_h<<r.hash_shift^r.window[n+3-1])&r.hash_mask,r.prev[n&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=n,n++,--i;);r.strstart=n,r.lookahead=2,w(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=d,e.input=c,e.avail_in=l,r.wrap=s,0},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){t.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(e,t,r){t.exports=function(e,t){var r,n,a,i,o,s,l,u,d,c,f,h,p,m,v,g,y,b,_,w,k,x,S=e.state,A=e.next_in,C=e.input;r=A+(e.avail_in-5),n=e.next_out,x=e.output,a=n-(t-e.avail_out),i=n+(e.avail_out-257),o=S.dmax,s=S.wsize,l=S.whave,u=S.wnext,d=S.window,c=S.hold,f=S.bits,h=S.lencode,p=S.distcode,m=(1<<S.lenbits)-1,v=(1<<S.distbits)-1;e:do{f<15&&(c+=C[A++]<<f,f+=8,c+=C[A++]<<f,f+=8),g=h[c&m];t:for(;;){if(c>>>=y=g>>>24,f-=y,0==(y=g>>>16&255))x[n++]=65535&g;else{if(!(16&y)){if(!(64&y)){g=h[(65535&g)+(c&(1<<y)-1)];continue t}if(32&y){S.mode=12;break e}e.msg="invalid literal/length code",S.mode=30;break e}b=65535&g,(y&=15)&&(f<y&&(c+=C[A++]<<f,f+=8),b+=c&(1<<y)-1,c>>>=y,f-=y),f<15&&(c+=C[A++]<<f,f+=8,c+=C[A++]<<f,f+=8),g=p[c&v];r:for(;;){if(c>>>=y=g>>>24,f-=y,!(16&(y=g>>>16&255))){if(!(64&y)){g=p[(65535&g)+(c&(1<<y)-1)];continue r}e.msg="invalid distance code",S.mode=30;break e}if(_=65535&g,f<(y&=15)&&(c+=C[A++]<<f,(f+=8)<y&&(c+=C[A++]<<f,f+=8)),o<(_+=c&(1<<y)-1)){e.msg="invalid distance too far back",S.mode=30;break e}if(c>>>=y,f-=y,(y=n-a)<_){if(l<(y=_-y)&&S.sane){e.msg="invalid distance too far back",S.mode=30;break e}if(k=d,(w=0)===u){if(w+=s-y,y<b){for(b-=y;x[n++]=d[w++],--y;);w=n-_,k=x}}else if(u<y){if(w+=s+u-y,(y-=u)<b){for(b-=y;x[n++]=d[w++],--y;);if(w=0,u<b){for(b-=y=u;x[n++]=d[w++],--y;);w=n-_,k=x}}}else if(w+=u-y,y<b){for(b-=y;x[n++]=d[w++],--y;);w=n-_,k=x}for(;2<b;)x[n++]=k[w++],x[n++]=k[w++],x[n++]=k[w++],b-=3;b&&(x[n++]=k[w++],1<b&&(x[n++]=k[w++]))}else{for(w=n-_;x[n++]=x[w++],x[n++]=x[w++],x[n++]=x[w++],2<(b-=3););b&&(x[n++]=x[w++],1<b&&(x[n++]=x[w++]))}break}}break}}while(A<r&&n<i);A-=b=f>>3,c&=(1<<(f-=b<<3))-1,e.next_in=A,e.next_out=n,e.avail_in=A<r?r-A+5:5-(A-r),e.avail_out=n<i?i-n+257:257-(n-i),S.hold=c,S.bits=f}},{}],49:[function(e,t,r){var n=e("../utils/common"),a=e("./adler32"),i=e("./crc32"),o=e("./inffast"),s=e("./inftrees"),l=-2;function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function d(){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 n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function c(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):l}function f(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,c(e)):l}function h(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?l:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,f(e))):l}function p(e,t){var r,n;return e?(n=new d,(e.state=n).window=null,0!==(r=h(e,t))&&(e.state=null),r):l}var m,v,g=!0;function y(e){if(g){var t;for(m=new n.Buf32(512),v=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,m,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,v,0,e.work,{bits:5}),g=!1}e.lencode=m,e.lenbits=9,e.distcode=v,e.distbits=5}function b(e,t,r,a){var i,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new n.Buf8(o.wsize)),a>=o.wsize?(n.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(a<(i=o.wsize-o.wnext)&&(i=a),n.arraySet(o.window,t,r-a,i,o.wnext),(a-=i)?(n.arraySet(o.window,t,r-a,a,0),o.wnext=a,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}r.inflateReset=f,r.inflateReset2=h,r.inflateResetKeep=c,r.inflateInit=function(e){return p(e,15)},r.inflateInit2=p,r.inflate=function(e,t){var r,d,c,f,h,p,m,v,g,_,w,k,x,S,A,C,I,T,z,E,P,O,F,B,D=0,R=new n.Buf8(4),N=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return l;12===(r=e.state).mode&&(r.mode=13),h=e.next_out,c=e.output,m=e.avail_out,f=e.next_in,d=e.input,p=e.avail_in,v=r.hold,g=r.bits,_=p,w=m,O=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;g<16;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if(2&r.wrap&&35615===v){R[r.check=0]=255&v,R[1]=v>>>8&255,r.check=i(r.check,R,2,0),g=v=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&v)){e.msg="unknown compression method",r.mode=30;break}if(g-=4,P=8+(15&(v>>>=4)),0===r.wbits)r.wbits=P;else if(P>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<P,e.adler=r.check=1,r.mode=512&v?10:12,g=v=0;break;case 2:for(;g<16;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if(r.flags=v,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=v>>8&1),512&r.flags&&(R[0]=255&v,R[1]=v>>>8&255,r.check=i(r.check,R,2,0)),g=v=0,r.mode=3;case 3:for(;g<32;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}r.head&&(r.head.time=v),512&r.flags&&(R[0]=255&v,R[1]=v>>>8&255,R[2]=v>>>16&255,R[3]=v>>>24&255,r.check=i(r.check,R,4,0)),g=v=0,r.mode=4;case 4:for(;g<16;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(R[0]=255&v,R[1]=v>>>8&255,r.check=i(r.check,R,2,0)),g=v=0,r.mode=5;case 5:if(1024&r.flags){for(;g<16;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(R[0]=255&v,R[1]=v>>>8&255,r.check=i(r.check,R,2,0)),g=v=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p<(k=r.length)&&(k=p),k&&(r.head&&(P=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,d,f,k,P)),512&r.flags&&(r.check=i(r.check,d,k,f)),p-=k,f+=k,r.length-=k),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===p)break e;for(k=0;P=d[f+k++],r.head&&P&&r.length<65536&&(r.head.name+=String.fromCharCode(P)),P&&k<p;);if(512&r.flags&&(r.check=i(r.check,d,k,f)),p-=k,f+=k,P)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===p)break e;for(k=0;P=d[f+k++],r.head&&P&&r.length<65536&&(r.head.comment+=String.fromCharCode(P)),P&&k<p;);if(512&r.flags&&(r.check=i(r.check,d,k,f)),p-=k,f+=k,P)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;g<16;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if(v!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}g=v=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;g<32;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}e.adler=r.check=u(v),g=v=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=h,e.avail_out=m,e.next_in=f,e.avail_in=p,r.hold=v,r.bits=g,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){v>>>=7&g,g-=7&g,r.mode=27;break}for(;g<3;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}switch(r.last=1&v,g-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(y(r),r.mode=20,6!==t)break;v>>>=2,g-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}v>>>=2,g-=2;break;case 14:for(v>>>=7&g,g-=7&g;g<32;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if((65535&v)!=(v>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&v,g=v=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(k=r.length){if(p<k&&(k=p),m<k&&(k=m),0===k)break e;n.arraySet(c,d,f,k,h),p-=k,f+=k,m-=k,h+=k,r.length-=k;break}r.mode=12;break;case 17:for(;g<14;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if(r.nlen=257+(31&v),v>>>=5,g-=5,r.ndist=1+(31&v),v>>>=5,g-=5,r.ncode=4+(15&v),v>>>=4,g-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;g<3;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}r.lens[N[r.have++]]=7&v,v>>>=3,g-=3}for(;r.have<19;)r.lens[N[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,F={bits:r.lenbits},O=s(0,r.lens,0,19,r.lencode,0,r.work,F),r.lenbits=F.bits,O){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;C=(D=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,I=65535&D,!((A=D>>>24)<=g);){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if(I<16)v>>>=A,g-=A,r.lens[r.have++]=I;else{if(16===I){for(B=A+2;g<B;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if(v>>>=A,g-=A,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}P=r.lens[r.have-1],k=3+(3&v),v>>>=2,g-=2}else if(17===I){for(B=A+3;g<B;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}g-=A,P=0,k=3+(7&(v>>>=A)),v>>>=3,g-=3}else{for(B=A+7;g<B;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}g-=A,P=0,k=11+(127&(v>>>=A)),v>>>=7,g-=7}if(r.have+k>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;k--;)r.lens[r.have++]=P}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,F={bits:r.lenbits},O=s(1,r.lens,0,r.nlen,r.lencode,0,r.work,F),r.lenbits=F.bits,O){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,F={bits:r.distbits},O=s(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,F),r.distbits=F.bits,O){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=p&&258<=m){e.next_out=h,e.avail_out=m,e.next_in=f,e.avail_in=p,r.hold=v,r.bits=g,o(e,w),h=e.next_out,c=e.output,m=e.avail_out,f=e.next_in,d=e.input,p=e.avail_in,v=r.hold,g=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;C=(D=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,I=65535&D,!((A=D>>>24)<=g);){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if(C&&!(240&C)){for(T=A,z=C,E=I;C=(D=r.lencode[E+((v&(1<<T+z)-1)>>T)])>>>16&255,I=65535&D,!(T+(A=D>>>24)<=g);){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}v>>>=T,g-=T,r.back+=T}if(v>>>=A,g-=A,r.back+=A,r.length=I,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=12;break}if(64&C){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(B=r.extra;g<B;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}r.length+=v&(1<<r.extra)-1,v>>>=r.extra,g-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(D=r.distcode[v&(1<<r.distbits)-1])>>>16&255,I=65535&D,!((A=D>>>24)<=g);){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if(!(240&C)){for(T=A,z=C,E=I;C=(D=r.distcode[E+((v&(1<<T+z)-1)>>T)])>>>16&255,I=65535&D,!(T+(A=D>>>24)<=g);){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}v>>>=T,g-=T,r.back+=T}if(v>>>=A,g-=A,r.back+=A,64&C){e.msg="invalid distance code",r.mode=30;break}r.offset=I,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(B=r.extra;g<B;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}r.offset+=v&(1<<r.extra)-1,v>>>=r.extra,g-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===m)break e;if(k=w-m,r.offset>k){if((k=r.offset-k)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}x=k>r.wnext?(k-=r.wnext,r.wsize-k):r.wnext-k,k>r.length&&(k=r.length),S=r.window}else S=c,x=h-r.offset,k=r.length;for(m<k&&(k=m),m-=k,r.length-=k;c[h++]=S[x++],--k;);0===r.length&&(r.mode=21);break;case 26:if(0===m)break e;c[h++]=r.length,m--,r.mode=21;break;case 27:if(r.wrap){for(;g<32;){if(0===p)break e;p--,v|=d[f++]<<g,g+=8}if(w-=m,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?i(r.check,c,w,h-w):a(r.check,c,w,h-w)),w=m,(r.flags?v:u(v))!==r.check){e.msg="incorrect data check",r.mode=30;break}g=v=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;g<32;){if(0===p)break e;p--,v+=d[f++]<<g,g+=8}if(v!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}g=v=0}r.mode=29;case 29:O=1;break e;case 30:O=-3;break e;case 31:return-4;default:return l}return e.next_out=h,e.avail_out=m,e.next_in=f,e.avail_in=p,r.hold=v,r.bits=g,(r.wsize||w!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&b(e,e.output,e.next_out,w-e.avail_out)?(r.mode=31,-4):(_-=e.avail_in,w-=e.avail_out,e.total_in+=_,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?i(r.check,c,w,e.next_out-w):a(r.check,c,w,e.next_out-w)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0==_&&0===w||4===t)&&0===O&&(O=-5),O)},r.inflateEnd=function(e){if(!e||!e.state)return l;var t=e.state;return t.window&&(t.window=null),e.state=null,0},r.inflateGetHeader=function(e,t){var r;return e&&e.state&&2&(r=e.state).wrap?((r.head=t).done=!1,0):l},r.inflateSetDictionary=function(e,t){var r,n=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?l:11===r.mode&&a(1,t,n,0)!==r.check?-3:b(e,t,n,n)?(r.mode=31,-4):(r.havedict=1,0):l},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){var n=e("../utils/common"),a=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],i=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[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];t.exports=function(e,t,r,l,u,d,c,f){var h,p,m,v,g,y,b,_,w,k=f.bits,x=0,S=0,A=0,C=0,I=0,T=0,z=0,E=0,P=0,O=0,F=null,B=0,D=new n.Buf16(16),R=new n.Buf16(16),N=null,L=0;for(x=0;x<=15;x++)D[x]=0;for(S=0;S<l;S++)D[t[r+S]]++;for(I=k,C=15;1<=C&&0===D[C];C--);if(C<I&&(I=C),0===C)return u[d++]=20971520,u[d++]=20971520,f.bits=1,0;for(A=1;A<C&&0===D[A];A++);for(I<A&&(I=A),x=E=1;x<=15;x++)if(E<<=1,(E-=D[x])<0)return-1;if(0<E&&(0===e||1!==C))return-1;for(R[1]=0,x=1;x<15;x++)R[x+1]=R[x]+D[x];for(S=0;S<l;S++)0!==t[r+S]&&(c[R[t[r+S]]++]=S);if(y=0===e?(F=N=c,19):1===e?(F=a,B-=257,N=i,L-=257,256):(F=o,N=s,-1),x=A,g=d,z=S=O=0,m=-1,v=(P=1<<(T=I))-1,1===e&&852<P||2===e&&592<P)return 1;for(;;){for(b=x-z,w=c[S]<y?(_=0,c[S]):c[S]>y?(_=N[L+c[S]],F[B+c[S]]):(_=96,0),h=1<<x-z,A=p=1<<T;u[g+(O>>z)+(p-=h)]=b<<24|_<<16|w,0!==p;);for(h=1<<x-1;O&h;)h>>=1;if(0!==h?(O&=h-1,O+=h):O=0,S++,0==--D[x]){if(x===C)break;x=t[r+c[S]]}if(I<x&&(O&v)!==m){for(0===z&&(z=I),g+=A,E=1<<(T=x-z);T+z<C&&!((E-=D[T+z])<=0);)T++,E<<=1;if(P+=1<<T,1===e&&852<P||2===e&&592<P)return 1;u[m=O&v]=I<<24|T<<16|g-d}}return 0!==O&&(u[g+O]=x-z<<24|4194304),f.bits=I,0}},{"../utils/common":41}],51:[function(e,t,r){t.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(e,t,r){var n=e("../utils/common");function a(e){for(var t=e.length;0<=--t;)e[t]=0}var i=256,o=286,s=30,l=15,u=[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],d=[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],c=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h=new Array(576);a(h);var p=new Array(60);a(p);var m=new Array(512);a(m);var v=new Array(256);a(v);var g=new Array(29);a(g);var y,b,_,w=new Array(s);function k(e,t,r,n,a){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=a,this.has_stree=e&&e.length}function x(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function S(e){return e<256?m[e]:m[256+(e>>>7)]}function A(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function C(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,A(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function I(e,t,r){C(e,r[2*t],r[2*t+1])}function T(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function z(e,t,r){var n,a,i=new Array(16),o=0;for(n=1;n<=l;n++)i[n]=o=o+r[n-1]<<1;for(a=0;a<=t;a++){var s=e[2*a+1];0!==s&&(e[2*a]=T(i[s]++,s))}}function E(e){var t;for(t=0;t<o;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function P(e){8<e.bi_valid?A(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function O(e,t,r,n){var a=2*t,i=2*r;return e[a]<e[i]||e[a]===e[i]&&n[t]<=n[r]}function F(e,t,r){for(var n=e.heap[r],a=r<<1;a<=e.heap_len&&(a<e.heap_len&&O(t,e.heap[a+1],e.heap[a],e.depth)&&a++,!O(t,n,e.heap[a],e.depth));)e.heap[r]=e.heap[a],r=a,a<<=1;e.heap[r]=n}function B(e,t,r){var n,a,o,s,l=0;if(0!==e.last_lit)for(;n=e.pending_buf[e.d_buf+2*l]<<8|e.pending_buf[e.d_buf+2*l+1],a=e.pending_buf[e.l_buf+l],l++,0===n?I(e,a,t):(I(e,(o=v[a])+i+1,t),0!==(s=u[o])&&C(e,a-=g[o],s),I(e,o=S(--n),r),0!==(s=d[o])&&C(e,n-=w[o],s)),l<e.last_lit;);I(e,256,t)}function D(e,t){var r,n,a,i=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,d=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<u;r++)0!==i[2*r]?(e.heap[++e.heap_len]=d=r,e.depth[r]=0):i[2*r+1]=0;for(;e.heap_len<2;)i[2*(a=e.heap[++e.heap_len]=d<2?++d:0)]=1,e.depth[a]=0,e.opt_len--,s&&(e.static_len-=o[2*a+1]);for(t.max_code=d,r=e.heap_len>>1;1<=r;r--)F(e,i,r);for(a=u;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],F(e,i,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,i[2*a]=i[2*r]+i[2*n],e.depth[a]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,i[2*r+1]=i[2*n+1]=a,e.heap[1]=a++,F(e,i,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,a,i,o,s,u=t.dyn_tree,d=t.max_code,c=t.stat_desc.static_tree,f=t.stat_desc.has_stree,h=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,m=t.stat_desc.max_length,v=0;for(i=0;i<=l;i++)e.bl_count[i]=0;for(u[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)m<(i=u[2*u[2*(n=e.heap[r])+1]+1]+1)&&(i=m,v++),u[2*n+1]=i,d<n||(e.bl_count[i]++,o=0,p<=n&&(o=h[n-p]),s=u[2*n],e.opt_len+=s*(i+o),f&&(e.static_len+=s*(c[2*n+1]+o)));if(0!==v){do{for(i=m-1;0===e.bl_count[i];)i--;e.bl_count[i]--,e.bl_count[i+1]+=2,e.bl_count[m]--,v-=2}while(0<v);for(i=m;0!==i;i--)for(n=e.bl_count[i];0!==n;)d<(a=e.heap[--r])||(u[2*a+1]!==i&&(e.opt_len+=(i-u[2*a+1])*u[2*a],u[2*a+1]=i),n--)}}(e,t),z(i,d,e.bl_count)}function R(e,t,r){var n,a,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)a=o,o=t[2*(n+1)+1],++s<l&&a===o||(s<u?e.bl_tree[2*a]+=s:0!==a?(a!==i&&e.bl_tree[2*a]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,i=a,u=(s=0)===o?(l=138,3):a===o?(l=6,3):(l=7,4))}function N(e,t,r){var n,a,i=-1,o=t[1],s=0,l=7,u=4;for(0===o&&(l=138,u=3),n=0;n<=r;n++)if(a=o,o=t[2*(n+1)+1],!(++s<l&&a===o)){if(s<u)for(;I(e,a,e.bl_tree),0!=--s;);else 0!==a?(a!==i&&(I(e,a,e.bl_tree),s--),I(e,16,e.bl_tree),C(e,s-3,2)):s<=10?(I(e,17,e.bl_tree),C(e,s-3,3)):(I(e,18,e.bl_tree),C(e,s-11,7));i=a,u=(s=0)===o?(l=138,3):a===o?(l=6,3):(l=7,4)}}a(w);var L=!1;function j(e,t,r,a){C(e,0+(a?1:0),3),function(e,t,r){P(e),A(e,r),A(e,~r),n.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r)}r._tr_init=function(e){L||(function(){var e,t,r,n,a,i=new Array(16);for(n=r=0;n<28;n++)for(g[n]=r,e=0;e<1<<u[n];e++)v[r++]=n;for(v[r-1]=n,n=a=0;n<16;n++)for(w[n]=a,e=0;e<1<<d[n];e++)m[a++]=n;for(a>>=7;n<s;n++)for(w[n]=a<<7,e=0;e<1<<d[n]-7;e++)m[256+a++]=n;for(t=0;t<=l;t++)i[t]=0;for(e=0;e<=143;)h[2*e+1]=8,e++,i[8]++;for(;e<=255;)h[2*e+1]=9,e++,i[9]++;for(;e<=279;)h[2*e+1]=7,e++,i[7]++;for(;e<=287;)h[2*e+1]=8,e++,i[8]++;for(z(h,287,i),e=0;e<s;e++)p[2*e+1]=5,p[2*e]=T(e,5);y=new k(h,u,257,o,l),b=new k(p,d,0,s,l),_=new k(new Array(0),c,0,19,7)}(),L=!0),e.l_desc=new x(e.dyn_ltree,y),e.d_desc=new x(e.dyn_dtree,b),e.bl_desc=new x(e.bl_tree,_),e.bi_buf=0,e.bi_valid=0,E(e)},r._tr_stored_block=j,r._tr_flush_block=function(e,t,r,n){var a,o,s=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<i;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),D(e,e.l_desc),D(e,e.d_desc),s=function(e){var t;for(R(e,e.dyn_ltree,e.l_desc.max_code),R(e,e.dyn_dtree,e.d_desc.max_code),D(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*f[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),a=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=a&&(a=o)):a=o=r+5,r+4<=a&&-1!==t?j(e,t,r,n):4===e.strategy||o===a?(C(e,2+(n?1:0),3),B(e,h,p)):(C(e,4+(n?1:0),3),function(e,t,r,n){var a;for(C(e,t-257,5),C(e,r-1,5),C(e,n-4,4),a=0;a<n;a++)C(e,e.bl_tree[2*f[a]+1],3);N(e,e.dyn_ltree,t-1),N(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),B(e,e.dyn_ltree,e.dyn_dtree)),E(e),n&&P(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(v[r]+i+1)]++,e.dyn_dtree[2*S(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){C(e,2,3),I(e,256,h),function(e){16===e.bi_valid?(A(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){t.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(e,t,r){(function(e){!function(e){if(!e.setImmediate){var t,r,n,a,i=1,o={},s=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,t="[object process]"==={}.toString.call(e.process)?function(e){process.nextTick(function(){c(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",f,!1):e.attachEvent("onmessage",f),function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((n=new MessageChannel).port1.onmessage=function(e){c(e.data)},function(e){n.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(r=l.documentElement,function(e){var t=l.createElement("script");t.onreadystatechange=function(){c(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(c,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var r=new Array(arguments.length-1),n=0;n<r.length;n++)r[n]=arguments[n+1];return o[i]={callback:e,args:r},t(i),i++},u.clearImmediate=d}function d(e){delete o[e]}function c(e){if(s)setTimeout(c,0,e);else{var t=o[e];if(t){s=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),s=!1}}}}function f(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&c(+t.data.slice(a.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)})}),e("f",qe=a((e,t)=>{var r,n;r=e,n=function(){function e(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){o(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function r(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function n(t){try{t.dispatchEvent(new MouseEvent("click"))}catch(e){var r=document.createEvent("MouseEvents");r.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof global&&global.global===global?global:void 0,i=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!i?function(t,i,o){var s=a.URL||a.webkitURL,l=document.createElement("a");i=i||t.name||"download",l.download=i,l.rel="noopener","string"==typeof t?(l.href=t,l.origin===location.origin?n(l):r(l.href)?e(t,i,o):n(l,l.target="_blank")):(l.href=s.createObjectURL(t),setTimeout(function(){s.revokeObjectURL(l.href)},4e4),setTimeout(function(){n(l)},0))}:"msSaveOrOpenBlob"in navigator?function(t,a,i){if(a=a||t.name||"download","string"!=typeof t)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(t,i),a);else if(r(t))e(t,a,i);else{var o=document.createElement("a");o.href=t,o.target="_blank",setTimeout(function(){n(o)})}}:function(t,r,n,o){if((o=o||open("","_blank"))&&(o.document.title=o.document.body.innerText="downloading..."),"string"==typeof t)return e(t,r,n);var s="application/octet-stream"===t.type,l=/constructor/i.test(a.HTMLElement)||a.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||s&&l||i)&&"undefined"!=typeof FileReader){var d=new FileReader;d.onloadend=function(){var e=d.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=e:location=e,o=null},d.readAsDataURL(t)}else{var c=a.URL||a.webkitURL,f=c.createObjectURL(t);o?o.location=f:location.href=f,o=null,setTimeout(function(){c.revokeObjectURL(f)},4e4)}});a.saveAs=o.saveAs=o,void 0!==t&&(t.exports=o)},"function"==typeof define&&define.amd?define([],n):void 0!==e?n():(n(),r.FileSaver={})})),e("d",Qe=function(e){return e.MARKDOWN="markdown",e.JSON="json",e.HTML="html",e.BANANA="banana",e.AGENTIC_HTML="agentic_html",e.AGENTIC_BANANA="agentic_banana",e.PPTD="pptd",e.DESIGN="design",e}({})),et=r(Xe(),1),tt=qe(),e("u",rt=()=>{const{exportPPTD:e,meta:t,pages:r,pageOrder:n}=Ne(),{exporting:a}=Le(),{collectSlideImageUrls:o,preloadImageUrls:s,resolveSlideImageUrls:l}=Se(),u=g(),d=async(e,r)=>{const[n,a]=t.value.size,d=r?.width??n,c=r?.height??a,f=document.createElement("div");f.style.width=`${d}px`,f.style.height=`${c}px`,f.style.position="fixed",f.style.top="0",f.style.left="0",f.style.zIndex="-1",f.style.pointerEvents="none";const h=await l(e);return await s(o(h)),document.body.appendChild(f),new Promise((e,o)=>{const s=p({render:()=>i(Me,{slide:h,pageWidth:n,pageHeight:a}),setup(){g().provides=u?.provides,g().root.appContext=u?.root.appContext,D(async()=>{try{await E(),await(n=100,new Promise(e=>setTimeout(e,n))),e(await Ge.toBlob(f,{dpr:r?.dpr??(t.value.mode,Qe.DESIGN,2),type:r?.type??"jpeg",embedFonts:!$,fontStylesheetDomains:xr(),filter:e=>!("IMG"===e.tagName&&!e.getAttribute("src"))}))}catch(a){o(a)}finally{s.unmount(),document.body.removeChild(f)}var n})}});s.mount(f)})},c=async(r,n)=>{n?.(10);const a=await(async e=>{const t=await Promise.all(e.pages.map(e=>l(e)));return await s(t.flatMap(o)),{...e,pages:t}})(e()),i=t.value.title||"未命名演示文稿";n?.(20);const u=await gr(a,{fileName:`${i}.pptx`,embedFonts:r.embedFonts,slideTransition:r.slideTransition,onProgress:n,metadata:{author:"Kimi",company:"Moonshot",title:i,subject:i},aiMetadata:{label:i,slideId:t.value.slideId,chatId:t.value.chatId}});return n?.(100),u},f=e=>async function(...t){a.value=!0;try{return await e(...t)}finally{a.value=!1}};return{exporting:a,exportSlideImageToBlob:d,exportPPTXBlob:c,exportPPTX:f(async(e,r,n)=>{const a=await c(e,r),i=`${t.value.title||"未命名演示文稿"}.pptx`;await(n??((e,t)=>wr(t,e)))(i,a)}),exportImageToZip:f(async(e,a)=>{const i=new et.default,o=n.value.map(e=>r.value.get(e)).filter(kr),s=o.length;await o.reduce(async(t,r,n)=>{await t;const a=await d(r);i.file(`${n+1}.jpeg`,a),e?.(Math.floor((n+1)/s*100))},Promise.resolve());const l=await i.generateAsync({type:"blob"}),u=`${t.value.title||"未命名演示文稿"}.zip`;e?.(100),await(a??((e,t)=>(0,tt.saveAs)(t,e)))(u,l)})}}),nt="slides_file",at=["checked","disabled"],it=k({__name:"Checkbox",props:B({disabled:{type:Boolean,default:!1},shape:{default:"square"},size:{default:"large"}},{checked:{type:Boolean,default:!1},checkedModifiers:{}}),emits:["update:checked"],setup(e){const t=e,r=T(e,"checked"),n=d(()=>"round"===t.shape),a=e=>{r.value=e.target.checked};return(t,i)=>(C(),h("span",{class:o(["kimi-checkbox",[e.size,{checked:r.value,disabled:e.disabled,round:n.value}]])},[b("input",{type:"checkbox",checked:r.value,disabled:e.disabled,onChange:a},null,40,at),b("span",{class:o(["kimi-checkbox-inner",{round:n.value}])},[r.value?(C(),_(O(ve),{key:0,class:"icon",name:"CheckboxIn"})):u("",!0)],2)],2))}}),ot=Z(it,[["__scopeId","data-v-a78725a1"]]),st={class:"header"},lt={class:"title"},ut={class:"body"},dt={class:"bottom"},ct={key:0,class:"remind-label"},ft={class:"button-group"},ht=k({__name:"Confirm",props:{title:{},content:{type:[String,Function]},confirmText:{},cancelText:{},confirmType:{},hideConfirm:{type:Boolean},hideCancel:{type:Boolean},maskClosable:{type:Boolean},remindKey:{},remindLabel:{}},emits:["close"],setup(e,{emit:t}){const r=e,n=d(()=>"function"==typeof r.content?r.content():null),a=t,i=l(!1),o=y(!1);function c(e){i.value=!1,setTimeout(()=>{e&&void 0!==r.remindKey&&o.value&&Be(r.remindKey,"true"),a("close",e)},225)}function p(){!1!==r.maskClosable&&c(void 0)}const v=d(()=>"danger"===r.confirmType);return D(()=>{i.value=!0,R(document,"keydown",e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),c(void 0)),"Enter"===e.key&&(e.preventDefault(),e.stopPropagation(),c(!0))},!0)}),(t,r)=>(C(),_(P,{name:"fade"},{default:A(()=>[i.value?(C(),h("div",{key:0,class:"modal-mask",onClick:p},[b("div",{class:"modal-container auto-rtl",onClick:r[3]||(r[3]=M(()=>{},["stop"]))},[b("div",st,[b("div",lt,m(e.title),1)]),b("div",ut,[n.value?(C(),_(F(n.value),{key:0})):(C(),h(s,{key:1},[f(m(e.content),1)],64))]),b("div",dt,[void 0!==e.remindKey?(C(),h("label",ct,[w(O(ot),{checked:o.value,"onUpdate:checked":r[0]||(r[0]=e=>o.value=e),shape:"round",size:"medium"},null,8,["checked"]),b("span",null,m(e.remindLabel??t.$t("common.dontRemind")),1)])):u("",!0),b("div",ft,[e.hideCancel?u("",!0):(C(),_(O(We),{key:0,class:"modal-button",type:"secondary",onClick:r[1]||(r[1]=e=>c(!1))},{default:A(()=>[f(m(e.cancelText??t.$t("common.cancel")),1)]),_:1})),e.hideConfirm?u("",!0):(C(),_(O(We),{key:1,class:"modal-button",type:"primary",danger:v.value,onClick:r[2]||(r[2]=e=>c(!0))},{default:A(()=>[f(m(e.confirmText??t.$t("common.confirm")),1)]),_:1},8,["danger"]))])])])])):u("",!0)]),_:1}))}}),pt=Z(ht,[["__scopeId","data-v-02f98061"]]),mt={class:"header"},vt={class:"title"},gt={class:"body"},yt=["maxlength","placeholder"],bt={class:"bottom"},_t=Z(k({__name:"InputDialog",props:{title:{},initialValue:{default:""},placeholder:{default:""},confirmText:{default:""},cancelText:{default:""},maxLength:{default:32}},emits:["close"],setup(e,{emit:t}){const r=e,n=t,a=l(!1),i=y(r.initialValue),o=y(null),s=y(!1),d=y(!1);function p(e){a.value=!1,setTimeout(()=>{n("close",e)},225)}function v(){const e=i.value.trim();0!==e.length&&p(e)}function g(){p(void 0)}function k(e){d.value=e.target===e.currentTarget}function x(e){e.target===e.currentTarget&&d.value&&g(),d.value=!1}function S(){s.value=!0}function I(e){s.value=!1,i.value=e.target.value}return D(()=>{a.value=!0,o.value?.focus(),R(document,"keydown",e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),g()),"Enter"!==e.key||s.value||(e.preventDefault(),e.stopPropagation(),v())},!0)}),(t,r)=>(C(),_(P,{name:"fade"},{default:A(()=>[a.value?(C(),h("div",{key:0,class:"modal-mask",onMousedown:k,onClick:x},[b("div",{class:"modal-container",onClick:r[1]||(r[1]=M(()=>{},["stop"]))},[b("div",mt,[b("div",vt,m(e.title),1)]),b("div",gt,[L(b("input",{ref_key:"inputRef",ref:o,"onUpdate:modelValue":r[0]||(r[0]=e=>i.value=e),class:"input-field",type:"text",maxlength:e.maxLength,placeholder:e.placeholder,onCompositionstart:S,onCompositionend:I},null,40,yt),[[c,i.value]])]),b("div",bt,[w(O(We),{class:"modal-button",type:"secondary",onClick:g},{default:A(()=>[f(m(e.cancelText||t.$t("common.cancel")),1)]),_:1}),w(O(We),{class:"modal-button",type:"primary",onClick:v},{default:A(()=>[f(m(e.confirmText||t.$t("common.confirm")),1)]),_:1})])])],32)):u("",!0)]),_:1}))}}),[["__scopeId","data-v-37bdf1f0"]]),e("c",wt=(e={})=>{const{showModal:t}=ie(e);return{showConfirm:async e=>{const r="string"==typeof e.remindKey?e.remindKey:void 0;return void 0!==r&&"true"===Ue(r)?(await X(),!0):await t({component:pt,props:e,immediate:!0})},showPrompt:async e=>await t({component:_t,props:e,immediate:!0})}}),kt=e=>e.endsWith(".page"),xt=e=>"object"==typeof e&&null!==e&&!Array.isArray(e),St=e=>"string"==typeof e&&e.length>0,At=async(e,t)=>{try{await pr("emitSDKEvent",e,t)}catch{}},Ct=[960,540],Tt={type:"solid",color:It="#000000"},zt="sdk",Et={annotation:!0,fullscreen:!0,present:!0,share:!0,export:!0,feedback:!0,close:!0,versionHistory:!0},Pt={annotation:!1,fullscreen:!1,present:!1,share:!1,export:!1,feedback:!1,close:!1,versionHistory:!1},Ot=new Set(Object.keys(Pt)),Ft=r(Ve(),1),Bt=e=>JSON.parse(JSON.stringify(e)),Dt=e=>e?Bt(e):null,Rt=e=>JSON.parse(JSON.stringify(e)),Nt=e=>({originalFSJSON:Dt(e.originalFSJSON),currentFSJSON:Bt(e.currentFSJSON),changes:Rt(e.changes)}),Lt=e=>e instanceof Error?e.message:String(e),jt=e=>(0,Ft.default)(vr(e)).format("YYYY-MM-DD HH:mm"),Mt=(e,t)=>t?ue(e,t,"Save timeout").catch(e=>{le("[Save] Save timeout",e)}):e,Ut=e=>e>0?e:void 0,$t=e=>e?{seconds:"bigint"==typeof e.seconds?e.seconds:BigInt(e.seconds),nanos:e.nanos}:e,Wt=(e,t,r)=>{if(!e)return Bt(t);const n=new Set(t.map(e=>e.path)),a=new Map(e.map(e=>[e.path,e.content]));for(const i of r)"delete"===i.operate?a.delete(i.path):a.set(i.path,i.content??"");return[...t.filter(e=>a.has(e.path)).map(e=>({path:e.path,content:a.get(e.path)})),...[...a.entries()].filter(([e])=>!n.has(e)).map(([e,t])=>({path:e,content:t}))]},Ht=(e,t,r)=>{if("v1"!==e)return t;const n=function(e,t){const r={warnings:[]},n=new Map(t?.map(e=>[e.path,e.content])??[]);return{data:e.map(e=>({...e,content:rn(e.path,e.content,r,n.get(e.path))})),warnings:r.warnings}}(t,r??void 0);return n.warnings.length>0&&le("[Save] PPTD v1 converter warnings",n.warnings),n.data},Zt=(e,t,r,n)=>{const a=Ht(e,n,t);if("v1"!==e)return{currentFSJSON:a,changes:Gt(t,a)};const i=Gt(r,n),o=new Map(a.map(e=>[e.path,e.content]));return{currentFSJSON:a,changes:i.map(e=>"delete"===e.operate?e:{path:e.path,content:o.get(e.path)??e.content??"",operate:"put"})}},Vt=(e,t,r,n)=>{const{currentFSJSON:a,changes:i}=Zt(e,t,r,n);return{originalFSJSON:Dt(t),currentFSJSON:Wt(t,a,i),changes:i}},Gt=(e,t)=>{if(!e)return t.map(e=>({path:e.path,content:e.content,operate:"put"}));const r=[],n=new Map(e.map(e=>[e.path,e.content])),a=new Map(t.map(e=>[e.path,e.content]));for(const[i,o]of a)n.has(i)&&n.get(i)===o||r.push({path:i,content:o,operate:"put"});for(const i of n.keys())a.has(i)||r.push({path:i,operate:"delete"});return r},Kt=(e,t)=>{const r=new Set(e?.map(e=>e.path)??[]);let n=0,a=0,i=0;for(const o of t)"delete"===o.operate?n++:r.has(o.path)?a++:i++;return{page_deleted:Ut(n),page_edited:Ut(a),page_added:Ut(i)}},e("o",Jt=ne(()=>{const{t:e}=ee(),{meta:t,pageOrder:r,pages:n,saveVersion:a,lastModified:i,exportFSJSON:o,originalFSJSON:s,setLastModified:l}=Ne(),u=Le(),c=de(V),f=cn(),{showConfirm:h}=wt(),{exportSlideImageToBlob:p}=rt(),{upload:m}=Sr(),{isSDK:v,mode:g,useExternalSave:b}=dn(),_=y(!1),w=y(null),k=y(null),x=null,A=y(null),C=y(0),I=z({interval:6e4});let T,E=null,P=null,O="",F="",B="",D=!1,R=!1,L=!1;const j=(t,r)=>{f.error(e("save.saveFailed"))},M=async()=>{if(b.value)return!0;const e=t.value.slideId;if(v.value&&!e)return he("[Save] SDK save without slideId, updateSlides was skipped"),!0;if(!e)return ce("[Save] Missing slidesId, updateSlides was skipped"),!1;const a=t.value.title??"",i=r.value[0],o=i?n.value.get(i):void 0,s=o?JSON.stringify(o):"",u=!(!o||F&&s===O);if(a===B&&!u)return!0;let d=F;if(u&&o)try{const[e,r]=t.value.size;d=await m(await p(o,{width:512,height:Math.round(512*r/e),dpr:1,type:"jpeg"}))}catch(f){return ce("[Save] Failed to export or upload cover image",f),!1}try{const t=await c.updateSlides({slides:{payloadUrl:"",coverUrl:d,status:J.COMPLETED,title:a,id:e}});if(!t.slides?.updateTime)return j(),!1;l(t.slides.updateTime)}catch(f){return ce("[Save] Failed to update slides title or cover",f),!1}return B=a,u&&(F=d,O=s),!0},U=async(r,n)=>{const{changes:a}=n;he("save",a);const o=((e,r)=>({saveFrom:e,slideId:t.value.slideId,chatId:t.value.chatId,file:t.value.pptdFileName?{pptdPath:t.value.pptdFileName}:void 0,fileContent:Bt(r.currentFSJSON),changes:Rt(r.changes),title:t.value.title}))(r,n);var s;if(s=o,v.value&&"ppt-editor"===g.value&&At("save",s),b.value)return(async e=>{const t=await pr("onSave",e),r=t&&"object"==typeof t?t:void 0;return void 0!==r?.lastModifiedTime&&l($t(r.lastModifiedTime)),{saved:!0,savedFSJSON:r?.fileContent?Bt(r.fileContent):void 0}})(o);const u=t.value.slideId;if(v.value&&!u)return he("[Save] SDK save without slideId, internal save was skipped"),{saved:!0};if(!W)return le("本地环境不存储哦"),{saved:!0};const d=i.value;if(!u)return j(),{saved:!1};if(null===d)return j(),{saved:!1};const f=await c.updatePPTD({slidesId:u,entries:a.map(e=>({path:e.path,content:e.content??"",op:"delete"===e.operate?K.PPTD_FILE_OPERATOR_DELETE:K.PPTD_FILE_OPERATOR_UPSERT})),lastModifiedTime:d}).catch(e=>(j(),null));return f?f.lastModifiedTime?f.success?(l(f.lastModifiedTime),{saved:!0}):(T="conflict",await(async t=>{D=!0,H();try{const r=await h({title:e("save.conflictTitle"),content:e("save.conflictContent",{time:jt(t)}),confirmText:e("save.conflictRefresh"),cancelText:e("save.conflictApplyChanges"),maskClosable:!1});if(!0===r)return ae("msh_nppt_save_confirm",{result:"refresh"}),L=!0,void(await pr("reenter"));if(!1===r)return ae("msh_nppt_save_confirm",{result:"forceUpdate"}),l(t),void(R=!0);L=!0}finally{D=!1,H()}})(f.lastModifiedTime),{saved:!1}):(j(),{saved:!1}):{saved:!1}},$=d(()=>{if(_.value)return e("topBar.autosaving");const t=C.value||A.value;if(!t)return e("basic.save");const r=Math.floor((I.value.valueOf()-t)/6e4);return r>0?e("topBar.savedMinutesAgo",{minutes:r}):e("topBar.justSaved")}),H=()=>{P&&(clearTimeout(P),P=null)},Z=(t="auto",r={})=>Mt((()=>{if(!u.isEditable.value)return H(),Promise.resolve();if(_.value&&E)return r.immediate?(H(),E.then(()=>Z(t,{immediate:!0}))):E;H();const n=Date.now(),i=a.value,s=o(),l=Vt(u.sourcePPTDVersion.value,w.value,k.value,s),{changes:d}=l,c=Kt(w.value,d),h=d.reduce((e,t)=>e+(t.content?.length??0),0);if(0===d.length)return he("[Save] No changes to save"),Promise.resolve();const p=function(e){for(const t of e){if("put"!==t.operate||!kt(t.path))continue;const e=Ar(t);if(!e.valid)return e}return{valid:!0}}(d);return p.valid?(_.value=!0,T=void 0,E=U(t,l).then(async e=>{if(ae("msh_nppt_save_end",{save_from:t,is_success:e.saved,error_reason:e.saved?void 0:T??"save failed",...c,size:h,duration:Date.now()-n}),!e.saved)return;try{await M()}catch(a){ce("[Save] Unexpected slides summary sync failure",a)}const r=Date.now();x&&(x.value=Nt(l)),w.value=Bt(e.savedFSJSON??l.currentFSJSON),k.value=Bt(s),A.value=r,C.value=r}).catch(e=>{ae("msh_nppt_save_end",{save_from:t,is_success:!1,error_reason:Lt(e),...c,size:h,duration:Date.now()-n}),j()}).finally(()=>{if(_.value=!1,E=null,R)return R=!1,Z(t);L?L=!1:a.value!==i&&G()}),E):(f.error(e("save.invalidData")),ce("changes: ",d,p),ae("msh_nppt_save_end",{save_from:t,is_success:!1,error_reason:"save数据有问题",detail:p.path},["error_reason","detail"]),Promise.resolve())})(),r.timeout),G=()=>{u.isEditable.value&&(D||(H(),P=setTimeout(()=>{P=null,Z()},3e3)))};return N(()=>a.value,()=>{G()},{flush:"post"}),N(()=>u.isEditable.value,e=>{if(!e)return void H();const{changes:t}=Zt(u.sourcePPTDVersion.value,w.value,k.value,o());t.length>0&&G()}),N(()=>t.value.slideId,()=>{O="",F="",B=""}),N([()=>s.value,()=>u.sourcePPTDVersion.value,()=>u.sourcePPTDFSJSON.value],([e,t,r])=>{const n="v1"===t?r:e;if(!n)return w.value=null,k.value=null,x&&(x.value=null),A.value=null,void(C.value=0);const a=Date.now();w.value=Bt(n),k.value=e?Bt(e):null,x&&(x.value=null),A.value=a,C.value=a},{immediate:!0}),S(()=>{H()}),{isSaving:_,lastSavedFSJSON:w,lastSavedEditorFSJSON:k,...x?{lastSaveDiffSnapshot:x}:{},lastSavedAt:A,lastSaveTime:C,saveTip:$,save:Z,syncSlidesSummary:M}})),Yt=e=>e.replace(/\.page$/,""),Xt=e=>({annotationId:e.id,annotation:e.annotation,pageId:e.pageId,pageIndex:e.pageIndex,pageLabel:e.pageLabel,elementId:e.elementId,cx:e.cx,cy:e.cy}),e("a",qt=ne(()=>{const{currentPageId:e,pageOrder:t,setCurrentPage:r}=Ne(),{selectedElementIds:n,handleElementId:a,focusArea:i,creatingElement:o,isTextEditing:s,rightPanelType:l,themePanelFocusTarget:u}=Le(),{showConfirm:c}=wt(),{t:f}=ee(),h=y(!1),p=y([]),m=y(null),v=y(),g=y(!1),b=d(()=>{const t=e.value;return t?p.value.filter(e=>Yt(e.pageId)===t):[]}),_=()=>{p.value=[],m.value=null,v.value=void 0},w=e=>{Promise.resolve(dr.value?.setAnnotationMode(e)).catch(()=>{})},k=e=>{const r=Yt(e),n=t.value.indexOf(r);return n>=0?`${n+1}`:void 0},x=e=>{const r=Yt(e),n=t.value.indexOf(r);return n>=0?n:void 0},S=t=>{const r=t.pageId||e.value||"";return{id:t.id||t.annotationId||`ann_${re(8)}`,annotation:t.annotation,pageId:Yt(r),pageIndex:t.pageIndex??x(r)??0,pageLabel:t.pageLabel||k(r),elementId:t.elementId,cx:t.cx,cy:t.cy}},A=e=>{const t=S(e),r=p.value.findIndex(e=>e.id===t.id);return p.value=r>=0?p.value.map((e,n)=>n===r?t:e):[...p.value,t],v.value=t.id,t},C=e=>{const t=h.value;h.value=!0,o.value=void 0,s.value=!1,u.value=null,"theme"===l.value&&(l.value=null),w(!0),!t&&e&&ae("msh_nppt_comment_mode_click",{comment_mode:"comment",enter_method:e})},I=()=>{h.value=!1,_(),w(!1)},T=async()=>!((p.value.length>0||m.value?.annotation?.trim())&&!(await c({title:f("annotation.exitConfirm.title"),content:f("annotation.exitConfirm.content"),confirmText:f("annotation.exitConfirm.confirmText"),cancelText:f("annotation.exitConfirm.cancelText"),confirmType:"danger"}))||(I(),0)),z=e=>{p.value=p.value.filter(t=>t.id!==e),v.value===e&&(v.value=void 0),m.value?.id===e&&(m.value=null)};return{isAnnotationMode:h,annotations:p,currentPageAnnotations:b,annotationDraft:m,activeAnnotationId:v,isSubmittingAnnotation:g,enterAnnotationMode:C,exitAnnotationMode:I,requestExitAnnotationMode:T,toggleAnnotationMode:async(e="toolbar")=>{if(h.value){const t=await T();return t&&ae("msh_nppt_comment_mode_click",{comment_mode:"edit",enter_method:e}),t}return C(e),!0},startAnnotationDraft:e=>{m.value={...e,pageId:Yt(e.pageId),pageIndex:e.pageIndex??x(e.pageId)??0,pageLabel:e.pageLabel||k(e.pageId)},v.value=void 0},cancelAnnotationDraft:()=>{m.value=null},submitAnnotationDraft:async e=>{const t=e.trim(),r=m.value;if(!r||!t)return!1;const n=!r.id,a=S({...r,id:r.id,annotation:t});g.value=!0;try{return!1!==(!dr.value?.upsertAnnotation||await dr.value.upsertAnnotation(Xt(a)))&&(A(a),n&&ae("msh_nppt_comment_add",{comment_length:t.length,page_index:a.pageIndex,has_element:Boolean(a.elementId)}),m.value=null,!0)}finally{g.value=!1}},upsertLocalAnnotation:A,removeLocalAnnotation:z,removeAnnotation:async e=>{await Promise.resolve(dr.value?.removeAnnotation?.(e)).catch(()=>{}),z(e)},clearAnnotations:async()=>{await Promise.resolve(dr.value?.clearAnnotations()).catch(()=>{}),_(),w(h.value)},clearLocalAnnotations:()=>{h.value=!1,_()},setActiveAnnotation:e=>{v.value=e},jumpToAnnotation:async e=>{const t=A(e);if(r(t.pageId),h.value)return n.value=[],void(a.value=null);t.elementId?(n.value=[t.elementId],a.value=t.elementId,i.value="editor"):(n.value=[],a.value=null)},highlightAnnotation:e=>{v.value=e?A(e).id:void 0},editAnnotation:e=>{const t=A(e);m.value={id:t.id,annotation:t.annotation,pageId:t.pageId,pageIndex:t.pageIndex,pageLabel:t.pageLabel,elementId:t.elementId,cx:t.cx??0,cy:t.cy??0},v.value=void 0}}})),Qt=(e,t=Date.now())=>{const r=(0,Ft.default)(e),n=(0,Ft.default)(t),a=n.diff(r,"minute");return r.isSame(n,"day")&&a>=0&&a<60?{type:"minutesAgo",minutes:Math.max(1,a)}:r.isSame(n.subtract(1,"day"),"day")?{type:"yesterday",time:r.format("HH:mm")}:{type:"full",time:r.format("YYYY-MM-DD HH:mm")}},er=e=>"setPPTD.snapshot"===e.reason||"isCreate"===e.reason||"init"===e.kind?"kimi":"user",e("i",tr=ne(()=>{const{t:e}=ee(),{meta:t,exportPPTD:r,restorePPTD:n,markDirty:a,saveVersion:i}=Ne(),{remoteEditable:o,isHistoryPreview:s,historyPreviewVersionId:l,setHistoryPreview:u}=Le(),{save:c,lastSavedAt:f,lastSaveTime:h}=Jt(),{isAnnotationMode:p}=qt(),m=z({interval:6e4}),v=y([]),g=y(null),b=y(),_=y(),w=y(!1),k=y("user"),x=y(!1);let S=0;const A=d(()=>new Map(v.value.map((e,t)=>[e.id,t+1]))),C=d(()=>v.value.at(-1)),I=d(()=>{const e=C.value,t=b.value??_.value;return!w.value&&!!e&&void 0!==t&&e.contentHash===t}),T=d(()=>I.value&&v.value.length>0?v.value.length:v.value.length+1),E=d(()=>{const e=I.value?C.value?.id:void 0;return void 0===e||l.value===e?v.value:v.value.filter(t=>t.id!==e)}),P=d(()=>o.value&&!p.value),O=e=>JSON.parse(JSON.stringify(e)),F=t=>{const r=Qt(t,m.value.valueOf());switch(r.type){case"minutesAgo":return e("topBar.versionMinutesAgo",{minutes:r.minutes});case"yesterday":return e("topBar.versionYesterday",{time:r.time});default:return r.time}},B=(t,r)=>e("topBar.versionEditedBy",{editor:t,time:F(r)}),D=t=>"kimi"===t?"Kimi":e("common.user"),R=d(()=>h.value||f.value||Date.now()),L=d(()=>[{id:null,version:T.value,title:e("topBar.versionName",{version:T.value}),subtitle:B(D(k.value),R.value),isLatest:!0,isActive:!s.value},...E.value.toReversed().map(t=>({id:t.id??null,version:A.value.get(t.id)??0,title:e("topBar.versionName",{version:A.value.get(t.id)??0}),subtitle:B(D(er(t)),t.createdAt),isLatest:!1,isActive:l.value===t.id}))]),j=(e,t)=>{ae("msh_nppt_version_apply",{action:e,total:L.value.length,...void 0===t?{}:{is_latest:t}})},M=async e=>{const r=e||t.value.slideId;if(!r)return v.value=[],b.value=void 0,void(_.value=void 0);try{const[e,t]=await Promise.all([Te(r),Ee(r)]);v.value=e,_.value=t}catch(n){_.value=void 0,ce("[Version] Failed to list versions",n)}},U=(e="silent")=>{S++,s.value&&(g.value&&n(O(g.value)),g.value=null,u(null),j(e))},$=async()=>{U("cancel"),await M()},W=async e=>{if(!P.value)return;const a=t.value.slideId;if(!a)return;s.value||(g.value=O(r()));const i=++S;x.value=!0;try{const r=await Pe(a,e);if(i!==S||t.value.slideId!==a)return;if(!r)return;n(JSON.parse(r.content)),u(e),j("preview")}catch(o){ce("[Version] Failed to preview version",o)}finally{i===S&&(x.value=!1)}};return N(i,()=>{w.value=!0,k.value="user"}),N(()=>t.value.slideId,e=>{g.value=null,b.value=void 0,_.value=void 0,w.value=!1,k.value="user",u(null),e?M():v.value=[]},{immediate:!0}),{versions:v,versionMenuItems:L,latestVersion:T,canUseVersionHistory:P,isVersionLoading:x,isHistoryPreview:s,historyPreviewVersionId:l,syncVersions:M,selectVersion:async e=>{null!==e?await W(e):await $()},previewVersion:W,returnLatestVersion:$,restoreHistoryVersion:async()=>{if(!P.value||!s.value)return;const e=O(r()),t=++S;j("apply",l.value===C.value?.id),u(null),g.value=null,n(e),a(),await c("button",{immediate:!0}),t===S&&await M()},resetHistoryPreview:U,setLatestVersionEditor:e=>{"kimi"===e&&(w.value=!1),k.value=e},setLatestVersionContentHash:e=>{b.value=e}}})),rr=e=>e instanceof Error?e.message:String(e),nr=e=>{const t={slide_count:0,gen_type_chart:0,gen_type_table:0,gen_type_icon:0,gen_type_image:0,animation_count:0};for(const r of e){t.slide_count++,t.animation_count+=r.animations?.length??0;for(const e of r.elements)"chart"===e.elementType&&t.gen_type_chart++,"table"===e.elementType&&t.gen_type_table++,"icon"===e.elementType&&t.gen_type_icon++,"image"===e.elementType&&t.gen_type_image++}return t},ar=(e,t,r,n={})=>{const a=void 0!==r;ae("msh_nppt_pptd_render_end",{last_slide_count:n.lastSlideCount??0,last_update_time:n.lastUpdateTime??"",...nr(e),update_time:n.updateTime??"",duration:t,is_success:!a,error_reason:a?rr(r):void 0})},ir="pageType: content\nelements: []\n",or=e=>e?{seconds:"bigint"==typeof e.seconds?e.seconds:BigInt(e.seconds),nanos:e.nanos}:e,sr=e=>{if(!e)return"";const t=new Date(1e3*Number(e.seconds)+Math.floor(e.nanos/1e6)),r=String(Math.floor(e.nanos/1e3)).padStart(6,"0");return`${(0,Ft.default)(t).format("YYYY-MM-DD HH:mm:ss")}.${r}`},lr=e=>({pageId:e.replace(/\.page$/,""),pagePath:e,pageType:"content",elements:[]}),ur=()=>{const{getPPTDData:e,importPPTD:t,setCurrentPage:r,setLastModified:n,originalFSJSON:a,pages:i,meta:o,lastModified:s,exportPPTD:l}=Ne(),{syncSlidesSummary:u}=Jt(),{pushUndo:d,isCreate:c,setSourcePPTDFSJSON:f}=Le(),{resetHistoryPreview:h,setLatestVersionEditor:p,setLatestVersionContentHash:m,syncVersions:v}=tr(),{setImageConfig:g}=Se(),y=cn(),{t:b}=ee();let _;const w=new Map,k=new Map;let x,S=0;const A=()=>o.value.pptdFileName||"presentation.pptd",C=()=>{d()},I=(e,t,r,n,a)=>{e.onIssue([{path:t,message:r,action:n,value:a}])},T=(e,t,r)=>{let n;try{n=_e(t)}catch(a){return void I(r,e,"Failed to parse page YAML","drop-page",a)}if(n)return{...n,pageId:e.replace(/\.page$/,""),pagePath:e}},z=(e,t)=>{const r=[{path:A(),content:e},...t.map(e=>{const t=w.get(e);return t?{path:e,content:t}:void 0}).filter(e=>!!e)];a.value=structuredClone(r)},E=(e,t)=>{f([{path:A(),content:e},...t.map(e=>{const t=k.get(e);return t?{path:e,content:t}:void 0}).filter(e=>!!e)])},P=(e,t,r)=>{const[n,...a]=Re(((e,t)=>[{path:A(),content:e},...Object.entries(t).map(([e,t])=>t?{path:e,content:t}:void 0).filter(e=>!!e)])(e,t),{checkerEnabled:!0,onIssue:r.onIssue}).data;if(!n)throw new Error("No PPTD meta");return{pptd:n.content,pages:Object.fromEntries(a.map(e=>[e.path,e.content]))}},O=e=>{i.value.set(e.pageId,e),i.value=new Map(i.value)},F=async(e,n,a)=>{const s=P(e,n,a),u=s.pptd,c=s.pages,f=_!==u,h=!!a.snapshot&&!a.isCreate;if(f){const{metaData:r,modelPPT:i}=((e,t,r)=>{let n;try{n=we(e)}catch(i){throw I(r,A(),"Failed to parse PPTD meta YAML, abort import","fallback",i),i}if(!n)throw new Error("Invalid metaPPTD");const a=[];for(const o of n.pages){const e=t[o];if(void 0===e){I(r,o,"Missing page YAML, fallback to blank page","fallback"),a.push(lr(o));continue}let n;try{n=_e(e)}catch(i){throw I(r,o,"Failed to parse page YAML, abort import","drop-page",i),i}if(!n)throw new Error(`Invalid page: ${o}`);a.push({...n,pageId:o.replace(/\.page$/,""),pagePath:o})}if(0===a.length)throw I(r,A(),"No pages in PPTD meta, abort import","fallback"),new Error("No pages in PPTD meta");return{metaData:n,modelPPT:{version:"v2",title:n.title,customFonts:n.customFonts,theme:n.theme,size:n.size,pages:a,pptdFileName:A()}}})(u,c,a);a.snapshot&&!a.isCreate&&C(),_=u,w.clear(),k.clear(),r.pages.forEach(e=>{const t=c[e]??ir,r=n[e]??ir;w.set(e,t),k.set(e,r)}),E(e,r.pages),z(u,r.pages),t(i)}else{let t;try{t=we(u)}catch(p){I(a,A(),"Failed to parse PPTD meta YAML","fallback",p),t=we("version: v2\nsize: [960, 540]\npages: []\n")}if(!t)throw new Error("Invalid metaPPTD");const r=new Set(t.pages);let i=!1;for(const[e,a]of Object.entries(n))r.has(e)&&a&&k.set(e,a);for(const[e,n]of Object.entries(c)){if(!r.has(e)||!n||w.get(e)===n)continue;const t=T(e,n,a);t&&(!a.snapshot||a.isCreate||i||(C(),i=!0),w.set(e,n),O(t))}E(e,t.pages),z(u,t.pages)}if("string"==typeof a?.locatePage){const e=a.locatePage.replace(/\.page$/,"");i.value.has(e)&&r(e)}else"number"==typeof a?.locatePage&&r(a?.locatePage);a.isCreate&&(()=>{const e=o.value.slideId;e&&x!==e&&(x=e,d({version:{kind:"init",reason:"isCreate",diffLatest:!0,uniqueKind:!0}}))})(),h&&await(async e=>{const t=e||o.value.slideId;if(!t)return;const r=JSON.stringify(l());m(ze(r));try{await ke(t,r,{kind:"snapshot",reason:"setPPTD.snapshot",diffLatest:!0})}catch(p){ce("[Version] Failed to push setPPTD version",p)}})(a.slideId)},B=e=>({lastSlideCount:i.value.size,lastUpdateTime:sr(s.value),updateTime:sr(e)}),D=async(e,t,r)=>{const a=!!t?.isCreate,s=!!t?.snapshot;c.value=a;const l=Date.now();let d=!1;pe();const f=t?.mode??Qe.PPTD;o.value={...o.value,mode:f},fe({mode:f}),a&&ae("msh_nppt_generate_start",{});const h=e=>{if(!a||d)return;const t=void 0!==e;d=!0,ae("msh_nppt_generate_end",{is_success:!t,error_reason:t?rr(e):void 0,duration:Date.now()-l})};try{const a=++S,l=await te(Promise.resolve(e),(e,t)=>{e&&s&&ar([],t,e,B())});if(a!==S)return;const d=B(l.lastModifiedTime);o.value.pptdFileName=l.pptdPath.replace(/^sandbox:\/\//,"").replace(t?.basePath??"",""),g({basePath:t?.basePath,imageReplacerMap:t?.imageReplacerMap}),n(l.lastModifiedTime);const c=e=>{ce("pptd is guilty!",e),s&&ae("msh_nppt_pptd_badcase",{badcase_info:"有脏东西",detail:e.map(e=>`${e.path}: ${e.message}`).join(";;")},"badcase_info")};return te(F(l.content,l.pagesMap,{...t,onIssue:c,slideId:r}),(e,t)=>{s&&ar(void 0===e?i.value.values():[],t,e,d),h(e)}).finally(()=>{u()})}catch(p){throw h(p),y.error(b("common.loadFailedRetry")),p}};return{loadPPTDData:D,async setPPTD(t,r){he("sync pptd data from penpal",{slideId:t,options:r}),h(),o.value.slideId!==t&&(o.value={...o.value,slideId:t}),ae("msh_nppt_set_pptd",{snapshot:r?.snapshot??!1,is_create:r?.isCreate??!1});const n=((e,t)=>t?.pptdContent?{content:t.pptdContent,pagesMap:Object.fromEntries((t.pages??[]).map(e=>[e.path,e.content])),pptdPath:t.pptdPath||A()||`${e||"presentation"}.pptd`,lastModifiedTime:or(t.lastModifiedTime)}:null)(t,r),a=await D(n??e(t),r,t);return p("kimi"),n||await v(t),a}}},dr=l(),cr="",fr=e=>{dr.value=e},hr=e=>({...e,additionParams:{...e?.additionParams,locale:q(),ppt_platform:U(),actual_agent:cr}}),e("n",pr=async(e,...t)=>{if("showFeedback"===e){const r=hr(t[0]);return await(dr.value?.[e](r))}return await(dr.value?.[e](...t))}),e("r",ne(()=>{const{updateSlidesMetaData:e,setCurrentPage:t,currentPageId:r,pageOrder:n,pageSize:a,pages:i,meta:o}=Ne(),{setDevVIP:s,setDevOversea:l}=Ye(),{collapsed:u,selectedElementIds:d,selectedSlideIds:c,setEditable:f}=Le(),{save:h}=Jt(),{enterAnnotationMode:p,exitAnnotationMode:m,clearLocalAnnotations:v}=qt(),{functional:g,isSDK:y,pptPlatform:b,useExternalImage:_,mode:w}=dn(),{setBatchGetImages:k}=Se(),x=new Ze({remoteWindow:window.parent,allowedOrigins:["*"]});let A;const C=ur(),I=async(e,r=!0)=>{const a=(e=>{if("number"==typeof e)return n.value[Math.max(0,Math.floor(e)-1)];const t=e.replace(/\.page$/,"");return n.value.find(e=>e===t)})(e);a&&(t(a),r&&(await E(),requestAnimationFrame(()=>{[...document.querySelectorAll("[data-preview-page-id]")].find(e=>e.dataset.previewPageId===a)?.scrollIntoView({behavior:"smooth",block:"start"})})))},T=()=>{const e=r.value;return e?n.value.indexOf(e):-1};A=He({messenger:x,methods:{async setPPTD(e,t){await C.setPPTD(e,t),y.value&&At("load",{title:o.value.title,pages:n.value.map(e=>i.value.get(e)?.pagePath??e),size:[a.value[0],a.value[1]]})},async preview(e){await I(e,"ppt-player"!==w.value)},async prev(){const e=T();if(e<=0)return;const t=n.value[e-1];t&&await I(t,"ppt-player"!==w.value)},async next(){const e=T();if(e<0||e>=n.value.length-1)return;const t=n.value[e+1];t&&await I(t,"ppt-player"!==w.value)},getSlideSize:async()=>({width:a.value[0],height:a.value[1]}),setEditable(e){f("ppt-player"!==w.value&&e)},async enterAnnotationMode(){p()},async exitAnnotationMode(){m()},async clearAnnotations(){v()},async getSlideStatus(){const e=new Set(n.value),t=c.value.filter(t=>e.has(t));return r.value&&e.has(r.value)&&!t.includes(r.value)&&t.push(r.value),{currentPage:r.value||"",selectedPages:t,selectedElements:[...d.value]}},setSlideConfig(r){if((r.slideId||void 0!==r.actualAgentId)&&(cr=r.actualAgentId??""),(r.slideId||r.chatId)&&e({slideId:r.slideId,chatId:r.chatId,messageId:r.segmentId,actualAgentId:r.actualAgentId,membership_plan:r.membership_plan,pptPlatform:y.value?b.value:void 0}),"ppt-player"===w.value?f(!1):void 0!==r.editable&&f(r.editable),void 0!==r.currentPageId&&t(r.currentPageId),void 0!==r.isFullScreen){const e=!u.value;r.isFullScreen!==e&&ae("msh_nppt_full_screen",{action:r.isFullScreen,from:"kimi"}),u.value=!r.isFullScreen}if(r.accessToken&&localStorage.setItem("access_token",r.accessToken),r.refreshToken&&localStorage.setItem("refresh_token",r.refreshToken),r.theme&&ge(r.theme),void 0!==r.locale){const e=ye(r.locale);e?(localStorage.setItem("kimi-ppt-LOCALE",e),Q(e)):console.error("[usePenpal] unsupported locale:",r.locale)}void 0!==r.isVIP&&s(r.isVIP),void 0!==r.isOversea&&l(r.isOversea)}}});const z=()=>{A.destroy()},P=(e="")=>{g.value.annotation&&Promise.resolve(dr.value?.setAnnotationCurrentPage(e)).catch(()=>{})};return A.promise.then(async e=>{const t=e;fr(t),_.value?k(({chatId:e,filePath:r})=>Promise.resolve(t.getImages({chatId:e,filePath:r})).catch(()=>[])):k(),P(r.value||"")}),N(r,e=>{if(P(e||""),"ppt-preview"===w.value)return;const t=n.value.indexOf(e??"")+1;t>0&&y.value&&At("pageChange",t)}),S(()=>{k(),z()}),{close:async()=>{h("close",{immediate:!0}),(await A.promise).close(),await X(100),z()},toggleFullScreen:async(e=u.value)=>{const t=await(await A.promise).toggleFullScreen(e);return u.value=!t,t},sendPrompt:async e=>{(await A.promise).sendPrompt(e)},loadPPTDData:C.loadPPTDData}})),mr=new Set(["info","success","error"])}}});