From 04112053ac1330c9c0c9a453a1db741fe7583533 Mon Sep 17 00:00:00 2001 From: SciLor Date: Sat, 5 Oct 2024 12:58:04 +0000 Subject: [PATCH] Update frontend (make web) --- .../www/web/assets/{index-BO0xKM7M.js => index--Lp_jSwE.js} | 2 +- contrib/data/www/web/index.html | 2 +- teddycloud_web | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename contrib/data/www/web/assets/{index-BO0xKM7M.js => index--Lp_jSwE.js} (97%) diff --git a/contrib/data/www/web/assets/index-BO0xKM7M.js b/contrib/data/www/web/assets/index--Lp_jSwE.js similarity index 97% rename from contrib/data/www/web/assets/index-BO0xKM7M.js rename to contrib/data/www/web/assets/index--Lp_jSwE.js index ffb30960..b9c2be33 100644 --- a/contrib/data/www/web/assets/index-BO0xKM7M.js +++ b/contrib/data/www/web/assets/index--Lp_jSwE.js @@ -610,7 +610,7 @@ html body { URL.revokeObjectURL(link.href); })(); - `),n.append(a.name,new Blob([h.buffer]),`pcmData.${r.indexOf(a)}.pcm`),e(void 0)}catch(c){t(c)}},i.onerror=()=>{t("Failed to read the file")},a.file&&i.readAsArrayBuffer(a.file)}const VBe=e=>Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&"),wh=new _n(Sn()),{useToken:WBe}=go,Ts={id:"1",pId:"-1",value:"1",title:"/"},xh=99,GBe=()=>{const{t:e}=zt(),{token:t}=WBe(),[n,r]=Xe.useMessage(),[a,o]=l.useState(!1),[i,s]=l.useState([]),[c,u]=l.useState(!1),[d,f]=l.useState(!1),[p,g]=l.useState(""),[m,b]=l.useState(Ts.id),[v,y]=l.useState([Ts]),[h,S]=l.useState(!1),[C,x]=l.useState(""),[E,I]=l.useState(!1),[R,T]=l.useState(!1),_=l.useRef(null);let $=0;l.useEffect(()=>{(async()=>{const q=new _n(Sn());let Y=!1;try{const Z=await q.apiGetTeddyCloudSettingRaw("debug.web.pcm_encode_console_url");if(!Z.ok)throw new Error(`HTTP error! status: ${Z.status}`);Y=(await Z.json()).toString()==="true"}catch(Z){console.error("Error fetching debug.web.pcm_encode_console_url: ",Z)}o(Y)})(),(async()=>{const q=L(Ts.id);wh.apiGetTeddyCloudApiRaw(`/api/fileIndexV2?path=${q}&special=library`).then(Y=>Y.json()).then(Y=>{var Z=Y.files;Z=Z.filter(J=>J.isDir&&J.name!=="..").sort((J,ee)=>J.name===ee.name?0:J.name.toLowerCase()>ee.name.toLowerCase()?1:-1).map(J=>({id:Ts.id+"."+Z.indexOf(J),pId:Ts.id,value:Ts.id+"."+Z.indexOf(J),title:J.name})),y(v.concat(Z))})})()},[]),l.useEffect(()=>{h&&setTimeout(()=>{_.current&&_.current.focus()},0)},[h]),l.useEffect(()=>{$=i.length},[i]);const P=PY(_y,{activationConstraint:{distance:10}}),D=({active:G,over:V})=>{G.id!==(V==null?void 0:V.id)&&s(q=>{const Y=q.findIndex(J=>J.uid===G.id),Z=q.findIndex(J=>J.uid===(V==null?void 0:V.id));return Ny(q,Y,Z)})},A=({fileList:G})=>{$++,$>xh&&n.open({type:"error",content:e("tonies.encoder.maxFiles",{maxFiles:xh})}),s(G.slice(0,xh))},O=G=>{const V=i.indexOf(G),q=i.slice();q.splice(V,1),s(q)},N=async()=>{u(!0);const G=new FormData;for(const ee of i)try{await new Promise((le,de)=>UBe(le,de,G,i,ee,a))}catch(le){Xe.error(e("tonies.encoder.errorFileProcessing")+" "+le),u(!1);return}const V=Math.floor(Date.now()/1e3),q={name:p+".taf",audioId:V-1342177280,path:L(m),special:"library"};f(!0);const Y=VBe(q),Z=await wh.apiPostTeddyCloudFormDataRaw(`/api/pcmUpload?${Y}`,G),J=await Z.text();Z.ok?(Xe.success(e("tonies.encoder.uploadSuccessful")),s([]),g(""),y([Ts]),b(Ts.id)):(console.log("Upload failed:",J),Xe.error(e("tonies.encoder.uploadFailed"))),f(!1),u(!1)},k={listType:"picture",multiple:!0,beforeUpload:G=>{const V=G;return V.file=G,i.push(V),s(i),!1},fileList:i,onChange:A,itemRender:(G,V)=>w.jsx(HBe,{originNode:G,fileList:i,file:V,onRemove:O,disabled:c})},M=({id:G})=>new Promise((V,q)=>{const Y=L(G);wh.apiGetTeddyCloudApiRaw(`/api/fileIndexV2?path=${Y}&special=library`).then(Z=>Z.json()).then(Z=>{let J=Z.files;J=J.filter(ee=>ee.isDir&&ee.name!=="..").sort((ee,le)=>ee.name===le.name?0:ee.name.toLowerCase()>le.name.toLowerCase()?1:-1).map(ee=>({id:G+"."+J.indexOf(ee),pId:G,value:G+"."+J.indexOf(ee),title:ee.name})),y(v.concat(J)),V(!0)}).then(()=>{q()})}),L=G=>{const V=v.filter(q=>q.value===G)[0];return V.pId==="-1"?"":L(v.filter(q=>q.id===V.pId)[0].id)+"/"+V.title},F=()=>{s(G=>[...G].sort((V,q)=>V.name.localeCompare(q.name)))},j=()=>{s([])},B=()=>{S(!0)},z=G=>{T(!ku(G.target.value.toString())),x(G.target.value)},H=()=>{const G=L(m),V=`${m}.${v.length}`,q={id:V,pId:m,value:V,title:C};try{wh.apiPostTeddyCloudRaw("/api/dirCreate?special=library",G+"/"+C).then(Y=>Y.text()).then(Y=>{if(Y!=="OK")throw new Error(Y);y([...v,q].sort((Z,J)=>Z.title===J.title?0:Z.title.toLowerCase()>J.title.toLowerCase()?1:-1)),b(V),Xe.success(e("fileBrowser.createDirectory.directoryCreated")),S(!1),x("")}).catch(Y=>{Xe.error(Y.message)})}catch{Xe.error("Error while creating directory")}},U=()=>{S(!1),x(""),T(!1)},te=w.jsxs(En,{title:e("fileBrowser.createDirectory.modalTitle"),open:h,onCancel:U,onOk:H,okText:e("fileBrowser.createDirectory.create"),cancelText:e("fileBrowser.createDirectory.cancel"),okButtonProps:{disabled:R},children:[w.jsxs("p",{children:[e("fileBrowser.createDirectory.inDirectory")," ",w.jsxs("b",{children:[L(m),"/"]})]}),w.jsx(Zt.Item,{validateStatus:R?"error":"",help:R?e("inputValidator.invalidCharactersDetected",{invalidChar:hp}):"",required:!0,children:w.jsx(en,{ref:_,autoFocus:!0,placeholder:e("fileBrowser.createDirectory.placeholder"),value:C,status:R?"error":"",onChange:z})})]}),X=G=>{const V=G.target.value;I(!ku(V)),g(V)};return w.jsxs(w.Fragment,{children:[r,w.jsx(ur,{children:w.jsx(Do,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Do,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("tonies.navigationTitle")},{title:e("tonies.encoder.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("tonies.encoder.title")}),w.jsxs(Ea,{direction:"vertical",style:{display:"flex"},children:[w.jsx(XY,{sensors:[P],onDragEnd:D,children:w.jsx(tX,{items:i.map(G=>G.uid),strategy:QY,disabled:c,children:w.jsxs(Jg.Dragger,{...k,disabled:c,children:[w.jsx("p",{className:"ant-upload-drag-icon",children:w.jsx(NO,{})}),w.jsx("p",{className:"ant-upload-text",children:e("tonies.encoder.uploadText",{maxFiles:xh})}),w.jsx("p",{className:"ant-upload-hint",children:e("tonies.encoder.uploadHint")})]})})}),i.length>0?w.jsxs(w.Fragment,{children:[w.jsxs(Ea,{direction:"horizontal",style:{width:"100%",display:"flex",alignItems:"flex-start",flexWrap:"wrap"},children:[w.jsx(_t,{type:"default",disabled:c,onClick:F,children:e("tonies.encoder.sortAlphabetically")}),w.jsx(_t,{type:"default",disabled:c,style:{marginRight:16},onClick:j,children:e("tonies.encoder.clearList")})]}),w.jsx(ra,{}),w.jsx("div",{style:{width:"100%"},className:"encoder",children:w.jsxs(Ea,{direction:"vertical",style:{width:"100%"},children:[w.jsxs(Ea.Compact,{direction:"horizontal",style:{width:"100%",display:"flex",alignItems:"flex-end",justifyContent:"flex-end"},children:[w.jsx(en,{type:"text",style:{maxWidth:180,borderTopRightRadius:0,borderBottomRightRadius:0},disabled:!0,value:e("tonies.encoder.saveAs")}),w.jsx(xl,{treeLine:!0,treeDataSimpleMode:!0,disabled:c,style:{maxWidth:250},value:m,dropdownStyle:{maxHeight:400,overflow:"auto"},onChange:b,loadData:M,treeData:v}),w.jsx(Qt,{title:e("fileBrowser.createDirectory.createDirectory"),children:w.jsx(_t,{disabled:c,icon:w.jsx(yR,{}),onClick:B,style:{borderRadius:0}})}),w.jsx(en,{addonAfter:".taf",required:!0,style:{maxWidth:300},status:i.length>0&&p===""||E?"error":"",onChange:X,disabled:c})]}),E?w.jsx("div",{style:{textAlign:"end",color:t.colorErrorText},children:e("inputValidator.invalidCharactersDetected",{invalidChar:hp})}):"",w.jsx(Ea.Compact,{style:{display:"flex",justifyContent:"flex-end",marginTop:"8px"},children:w.jsx(_t,{type:"primary",onClick:N,disabled:i.length===0||p===""||E,loading:c,children:e(c?d?"tonies.encoder.processing":"tonies.encoder.uploading":"tonies.encoder.upload")})})]})})]}):w.jsx(w.Fragment,{})]})]})]}),te]})},{Paragraph:qBe}=$n,KBe=()=>{const{t:e}=zt(),[t,n]=l.useState(!1),r=a=>{console.log("Received values of form: ",a),n(!1)};return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Do,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Do,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("tonies.navigationTitle")},{title:e("tonies.tap.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("tonies.tap.title")}),w.jsx(Sr,{message:e("settings.information"),description:w.jsx("div",{children:"Development still in progress - Please be patient or support implementation of this feature!"}),type:"info",showIcon:!0,style:{marginBottom:8}}),w.jsx(JN,{special:"library",filetypeFilter:[".tap"],showColumns:["picture","name","size","date","controls"],isTapList:!0}),w.jsx(qBe,{children:w.jsxs("div",{children:[w.jsx(_t,{type:"primary",style:{marginTop:8},onClick:()=>{n(!0)},children:e("tonies.tapEditor.titleCreate")}),w.jsx(kY,{open:t,onCreate:r,onCancel:()=>{n(!1)}})]})})]})]})]})},Ch=new _n(Sn()),YBe=({overlay:e})=>{var d;const[t,n]=l.useState(),{t:r}=zt(),[a,o]=l.useState(""),[i,s]=l.useState(!1);l.useEffect(()=>{(async()=>{try{const p=await Ch.apiGetTeddyCloudSettingRaw("core.settings_level");if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);const g=await p.json();o(g.toString())}catch(p){console.error("Error fetching settings level: ",p)}})()},[]),l.useEffect(()=>{(async()=>{var g,m;s(!0);const p=await Ch.apiGetIndexGet(e);(g=p==null?void 0:p.options)!=null&&g.length&&((m=p==null?void 0:p.options)==null?void 0:m.length)>0&&n(p),s(!1)})()},[e,a]);const c=async()=>{try{await Ch.apiTriggerWriteConfigGet()}catch{Xe.error("Error while saving config to file.")}},u=async f=>{try{await Ch.apiPostTeddyCloudSetting("core.settings_level",f),c(),o(f)}catch{Xe.error("Error while sending data to server.")}};return w.jsxs(w.Fragment,{children:[w.jsx(Sr,{message:r("settings.warning"),description:w.jsx("div",{children:r("settings.warningHint")}),type:"warning",showIcon:!0,style:{margin:"8px"}}),w.jsx(ra,{children:r("settings.title")}),w.jsx(KK,{initialValues:{test:"test"},onSubmit:f=>{},children:w.jsx(Zt,{labelCol:{span:8},wrapperCol:{span:14},layout:"horizontal",children:(d=t==null?void 0:t.options)==null?void 0:d.map((f,p,g)=>{if(f.iD.includes("core.settings_level")||!f.iD.includes("core.certdir")&&!f.iD.includes("core.client_cert.")&&!f.iD.includes("core.flex_")&&!f.iD.includes("core.contentdir")&&!f.iD.includes("toniebox.")&&!f.iD.includes("cloud.enabled")&&!f.iD.includes("cloud.enableV1Claim")&&!f.iD.includes("cloud.enableV1CloudReset")&&!f.iD.includes("cloud.enableV1FreshnessCheck")&&!f.iD.includes("cloud.enableV1Log")&&!f.iD.includes("cloud.enableV1Time")&&!f.iD.includes("cloud.enableV1Ota")&&!f.iD.includes("cloud.enableV2Content")&&!f.iD.includes("cloud.cacheOta")&&!f.iD.includes("cloud.localOta")&&!f.iD.includes("cloud.cacheContent")&&!f.iD.includes("cloud.cacheToLibrary")&&!f.iD.includes("cloud.markCustomTagByPass")&&!f.iD.includes("cloud.prioCustomContent")&&!f.iD.includes("cloud.updateOnLowerAudioId")&&!f.iD.includes("cloud.dumpRuidAuthContentJson"))return null;const m=f.iD.split("."),b=g[p-1]?g[p-1].iD.split("."):[];return w.jsxs(ce.Fragment,{children:[m.slice(0,-1).map((v,y)=>b[y]!==v?y===0?w.jsxs("h3",{style:{marginLeft:`${y*20}px`,marginBottom:"10px"},children:["Category ",v]},`category-${v}`):w.jsxs("h4",{style:{marginLeft:`${y*10}px`,marginTop:"10px",marginBottom:"10px"},children:[".",v]},`category-${v}`):null),w.jsx(YK,{option:f,overlayId:e},`option-item-${f.iD}`)]},`option-${f.iD}`)})})}),w.jsx(ra,{children:r("settings.levelLabel")}),w.jsxs(ao.Group,{value:a,onChange:f=>u(f.target.value),style:{display:"flex",justifyContent:"center",marginTop:8},disabled:i,children:[w.jsx(ao.Button,{value:"1",children:"Basic"}),w.jsx(ao.Button,{value:"2",children:"Detail"}),w.jsx(ao.Button,{value:"3",children:"Expert"})]})]})},kj=new _n(Sn());function oX(){const[e,t]=l.useState([]);return l.useEffect(()=>{async function n(){var r=[];try{const i=await(await kj.apiGetTeddyCloudApiRaw("/api/tonieboxesJson")).json();r=[...r,...i]}catch(o){console.error("Error fetching and transforming toniebox data:",o)}try{const i=await(await kj.apiGetTeddyCloudApiRaw("/api/tonieboxesCustomJson")).json();r=[...r,...i]}catch(o){console.error("Error fetching and transforming custom toniebox data:",o)}const a=r.map(o=>({id:o.id,name:o.name,img_src:o.img_src,crop:o.crop||null}));t(a)}n()},[]),e}const fa=new _n(Sn()),{Paragraph:z2,Text:XBe}=$n,{Meta:ZBe}=Fd,{useToken:QBe}=go,JBe=({tonieboxCard:e,tonieboxImages:t})=>{var Ce,ye,ke,nt,Me;const{t:n}=zt(),{token:r}=QBe(),[a,o]=Xe.useMessage(),[i,s]=l.useState(!1),[c,u]=l.useState(""),[d,f]=l.useState(""),[p,g]=l.useState(""),[m,b]=l.useState(!1),[v,y]=l.useState(null),[h,S]=l.useState(),[C,x]=l.useState(!1),[E,I]=l.useState(!1),[R,T]=l.useState(!1),[_,$]=l.useState(e.boxModel),[P,D]=l.useState(e.boxModel),[A,O]=l.useState(e.boxName),[N,k]=l.useState(e.boxName),[M,L]=l.useState(null),[F,j]=l.useState(!1),[B,z]=l.useState(!0),[H,U]=l.useState(0);l.useEffect(()=>{(async()=>{const Oe=await fa.apiGetTonieboxApiAccess(e.ID);z(Oe)})()},[e.ID,C]),l.useEffect(()=>{(async()=>{const He=await fa.apiGetTonieboxStatus(e.ID);s(He)})(),(async()=>{const He=await fa.apiGetTonieboxVersion(e.ID),ze={0:"UNKNOWN",1:"CC3200",2:"CC3235",3:"ESP32"};if(He in ze){const Ye=ze[He];u(Ye)}else u("UNKNOWN")})(),(async()=>{const He=await fa.apiGetTonieboxLastRUID(e.ID);if(He!=="ffffffffffffffff"&&He!==""){const ze=await fa.apiGetTonieboxLastRUIDTime(e.ID);(async()=>{const Fe=await fa.apiGetTagIndex(e.ID);V(Fe.filter(Qe=>Qe.ruid===He),ze)})()}})(),i||(async()=>{const ze=await fa.apiGetLastOnline(e.ID);f(ze)})(),(async()=>{const ze=await(await fa.apiGetTeddyCloudSettingRaw("internal.ip",e.ID)).text();g(ze)})(),G(e.boxModel),D(e.boxModel)},[e.ID,e.boxModel]),l.useEffect(()=>{if(p&&c==="CC3200")try{fetch(`http://${p}/api/ajax?cmd=box-battery&sub=stats`).then(xe=>xe.text()).then(xe=>{console.log("Battery Stats fetched --> assume CFW active"),b(!0)}).catch(xe=>{console.log("No Battery Stats fetched --> assume CFW not active"),b(!1)})}catch{console.log("No Battery Stats fetched --> assume CFW not active"),b(!1)}},[p,c]);const te=oX(),X=[{label:n("tonieboxes.editModelModal.unsetBoxName"),value:"-1"}].concat(te.map(xe=>({label:xe.name,value:xe.id}))),G=xe=>{const Oe=t.find(je=>je.id===xe);L(Oe?w.jsx("img",{src:Oe.img_src,alt:"",style:{...ie(xe),position:"absolute",top:"0",left:"0"}}):w.jsx("img",{src:"https://cdn.tonies.de/thumbnails/03-0009-i.png",alt:"",style:{filter:"opacity(0.20)",width:"100%",height:"auto",position:"absolute",top:"0",left:"0"}}))},V=(xe,Oe)=>{y(w.jsx(w.Fragment,{children:w.jsx(Mt,{to:"/tonies?tonieRUID="+xe[0].ruid+"&overlay="+e.ID,children:w.jsx(Qt,{placement:"top",zIndex:2,title:n("tonieboxes.lastPlayedTonie")+xe[0].tonieInfo.series+(xe[0].tonieInfo.episode?" - "+xe[0].tonieInfo.episode:"")+(Oe?" ("+Oe+")":""),children:w.jsx("img",{src:xe[0].tonieInfo.picture,alt:"Tonie",style:{position:"absolute",bottom:0,right:0,zIndex:1,padding:8,borderRadius:4,height:"60%"}})})})}))},q=()=>{(async()=>{var je,qe;const Oe=await fa.apiGetIndexGet(e.ID);(je=Oe==null?void 0:Oe.options)!=null&&je.length&&((qe=Oe==null?void 0:Oe.options)==null?void 0:qe.length)>0&&S(Oe)})(),Y()},Y=()=>{I(!0)},Z=async()=>{I(!1)},J=()=>{I(!1)},ee=()=>{x(!0)},le=async()=>{x(!1)},de=()=>{x(!1)},ge=()=>{U(xe=>xe+1),ee()},fe=()=>{D(P===void 0?_:P),T(!0)},Ee=()=>{D(_),k(N),O(N),T(!1)},be=async()=>{G(P),$(P);const xe=async()=>{await fa.apiTriggerWriteConfigGet()};try{fa.apiPostTeddyCloudSetting("boxModel",P,e.ID).then(()=>{xe()}).catch(Oe=>{Xe.error(n("tonieboxes.editModelModal.errorWhileSavingConfig"))}),Xe.success(n("tonieboxes.editModelModal.successOnModelChange"))}catch(Oe){Xe.error(n("tonieboxes.editModelModal.errorOnModelChange",{error:Oe}))}},he=async()=>{k(A);const xe=async()=>{await fa.apiTriggerWriteConfigGet()};try{fa.apiPostTeddyCloudSetting("boxName",A.toString(),e.ID).then(()=>{xe()}).catch(Oe=>{Xe.error(n("tonieboxes.editModelModal.errorWhileSavingConfig"))}),Xe.success(n("tonieboxes.editModelModal.successOnNameChange"))}catch(Oe){Xe.error(n("tonieboxes.editModelModal.errorOnNameChange",{error:Oe}))}},ie=xe=>{const Oe=t.find(je=>je.id===xe);if(Oe&&Oe.crop){const[je,qe,He]=Oe.crop;return{width:"100%",height:"auto",transform:`scale(${He}) translateX(${je}px) translateY(${qe}px)`}}else return{width:"100%",height:"auto"}},ne=()=>e.ID.replace(/(.{2})(?=.)/g,"$1:"),oe=async()=>{T(!1),A!==N&&he(),_!==P&&be()},ae=w.jsx(w.Fragment,{children:w.jsxs(_t,{type:"primary",onClick:oe,disabled:A===N&&_===P,children:[w.jsx(AG,{},"saveClick")," ",n("tonies.editModal.save")]})}),ue=w.jsxs(En,{title:w.jsx(w.Fragment,{children:w.jsxs("h3",{children:[n("tonieboxes.editModelModal.editModel",{name:e.boxName}),w.jsx("br",{}),w.jsx(XBe,{type:"secondary",children:(c!=="UNKNOWN"?c:"MAC")+": "+ne()})]})}),open:R,footer:ae,onCancel:Ee,children:[w.jsx(ra,{orientation:"left",orientationMargin:"0",children:n("tonieboxes.editModelModal.name")}),w.jsx(z2,{children:w.jsx(en,{name:"boxName",value:A,onChange:xe=>O(xe.target.value),addonBefore:w.jsx(ba,{onClick:()=>O(N),style:{color:A===N?r.colorTextDisabled:r.colorText,cursor:A===N?"default":"pointer"}})})}),w.jsx(ra,{orientation:"left",orientationMargin:"0",children:n("tonieboxes.editModelModal.model")}),w.jsx(z2,{children:w.jsx(Nr,{options:X,value:P,onChange:xe=>D(xe)})})]}),Se=w.jsxs(En,{title:n("tonieboxes.uploadTonieboxCertificatesModal.uploadTonieboxCertificates",{name:e.boxName}),open:E,onOk:Z,onCancel:J,children:[w.jsxs(z2,{children:[n("tonieboxes.uploadTonieboxCertificatesModal.uploadPath")," ",w.jsx("i",{children:(ye=(Ce=h==null?void 0:h.options)==null?void 0:Ce.find(xe=>xe.iD==="core.certdir"))==null?void 0:ye.value})," ",w.jsx("small",{children:(nt=(ke=h==null?void 0:h.options)==null?void 0:ke.find(xe=>xe.iD==="core.certdir"))!=null&&nt.overlayed?n("tonieboxes.uploadTonieboxCertificatesModal.boxSpecific"):n("tonieboxes.uploadTonieboxCertificatesModal.AttentionGeneralPath")})]}),w.jsx(OY,{overlay:e.ID})]}),Te=w.jsx(En,{title:n("tonieboxes.editTonieboxSettingsModal.editTonieboxSettings",{name:e.boxName}),width:"auto",open:C,onOk:le,onCancel:de,children:w.jsx(YBe,{overlay:e.ID},H)}),Le=()=>{try{a.open({type:"loading",content:n("tonieboxes.messages.deleting"),duration:0}),fa.apiPostTeddyCloudSetting("removeOverlay",null,e.ID).then(xe=>xe.text()).then(xe=>{a.destroy(),xe==="OK"?(a.open({type:"success",content:n("tonieboxes.messages.deleteSuccessful")}),window.location.reload()):a.open({type:"error",content:n("tonieboxes.messages.deleteFailed")+xe})}).catch(xe=>{a.destroy(),a.open({type:"error",content:n("tonieboxes.messages.deleteFailed")+xe})})}catch(xe){a.destroy(),a.open({type:"error",content:n("tonieboxes.messages.deleteFailed")+xe})}},_e=()=>{j(!0)},Re=()=>{Le(),j(!1)},Pe=()=>{j(!1)},$e=w.jsx(yd,{title:n("tonieboxes.confirmDeleteModal"),open:F,okText:n("tonieboxes.delete"),cancelText:n("tonieboxes.cancel"),content:n("tonieboxes.confirmDeleteDialog",{tonieboxToDelete:N}),handleOk:Re,handleCancel:Pe}),ve=async()=>{try{await fa.apiTriggerWriteConfigGet()}catch{Xe.error("Error while saving config to file.")}},Ne=async()=>{try{fa.apiPostTeddyCloudSetting("toniebox.api_access",!B,e.ID).then(()=>{ve(),z(!B),B?Xe.success(n("tonieboxes.messages.apiAccessDisabled")):Xe.success(n("tonieboxes.messages.apiAccessEnabled"))}).catch(xe=>{throw new Error(xe.status+" "+xe.statusText)})}catch(xe){Xe.error(n("tonieboxes.messages.apiAccessNotChangedError")+xe)}};return w.jsxs(w.Fragment,{children:[o,w.jsx(Fd,{hoverable:!1,size:"default",style:{background:r.colorBgContainerDisabled,cursor:"default"},title:w.jsx("span",{children:N}),cover:w.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[v,w.jsx("img",{src:(Me=t.find(xe=>xe.id==="03-0009"))==null?void 0:Me.img_src,alt:"",style:{position:"relative",filter:"opacity(0)",width:"100%",height:"auto"}}),M]}),actions:[w.jsx(w.Fragment,{children:B?i?w.jsx(Qt,{title:n("tonieboxes.online"),children:w.jsx(SR,{style:{color:"green",cursor:"default"}})}):w.jsx(Qt,{title:n("tonieboxes.offline")+(d?" - "+n("tonieboxes.lastOnline")+": "+d:""),children:w.jsx(SR,{style:{color:r.colorTextDescription,cursor:"default"}})}):w.jsx(Qt,{title:n("tonieboxes.accessApiDisabled"),children:w.jsx(uwe,{style:{color:"red",cursor:"pointer"},onClick:Ne})})}),w.jsx(ag,{onClick:()=>fe()},"edit"),w.jsx(kO,{style:{marginRight:8},onClick:q},"certificate"),w.jsx(AO,{style:{marginRight:8},onClick:ge},"edit"),w.jsx(ud,{style:{marginRight:8},onClick:_e},"delete")],children:w.jsx(ZBe,{description:[(c!=="UNKNOWN"&&c!==void 0&&c!==null?c:"MAC")+" ",m?w.jsx(Qt,{title:n("tonieboxes.linkToBoxCFW"),children:w.jsxs(Mt,{to:"http://"+p,target:"_blank",children:[ne()," ",w.jsx(swe,{})]})}):ne()]})}),Te,Se,ue,$e]})},e7e=({tonieboxCards:e})=>{const[t,n]=l.useState(!0),r=oX();return r.length===0&&t?w.jsx("div",{children:"Loading..."}):w.jsx(ll,{grid:{gutter:16,xs:1,sm:2,md:2,lg:3,xl:3,xxl:4},dataSource:e,renderItem:a=>w.jsx(ll.Item,{id:a.ID,children:w.jsx(JBe,{tonieboxCard:a,tonieboxImages:r})})})},t7e=()=>w.jsx("svg",{version:"1.0",xmlns:"http://www.w3.org/2000/svg",width:"12.000000pt",height:"12.000000pt",viewBox:"0 0 900.000000 900.000000",preserveAspectRatio:"xMidYMid meet",children:w.jsxs("g",{transform:"translate(0.000000,900.000000) scale(0.100000,-0.100000)",fill:"currentColor",stroke:"none",children:[w.jsx("path",{d:"M5895 8380 c-4 -6 -21 -16 -38 -24 -60 -25 -301 -236 -416 -363 -42 -46 -101 -103 -131 -127 -30 -24 -116 -104 -190 -177 -75 -74 -167 -163 -205 -199 -39 -36 -132 -124 -208 -195 -186 -175 -194 -179 -368 -195 -138 -13 -274 -10 -303 7 -45 25 -385 357 -446 434 -65 84 -279 313 -345 369 -17 14 -58 40 -91 58 -59 31 -67 32 -177 32 -87 0 -117 -3 -127 -14 -6 -8 -23 -16 -37 -18 -28 -3 -61 -47 -62 -83 -1 -12 -5 -25 -10 -30 -5 -6 -28 -64 -50 -130 -51 -151 -94 -274 -121 -345 -12 -30 -32 -86 -45 -125 -13 -38 -38 -108 -54 -154 -17 -46 -31 -85 -31 -87 0 -2 -181 -4 -402 -4 -362 0 -410 -2 -473 -19 -93 -25 -147 -55 -209 -117 -62 -62 -92 -116 -117 -209 -18 -68 -19 -160 -19 -2724 0 -2915 -4 -2713 58 -2836 31 -62 127 -155 189 -185 109 -52 -33 -49 2843 -49 2835 0 2752 -2 2840 44 111 57 194 152 230 266 20 61 20 110 20 2759 0 2673 0 2697 -20 2755 -50 147 -153 247 -300 294 -33 10 -131 15 -370 20 l-325 6 -2 50 c-9 210 -37 703 -49 855 -8 102 -14 239 -14 306 0 171 9 164 -233 164 -115 0 -188 -4 -192 -10z m-1 -652 c3 -13 6 -68 6 -123 0 -55 7 -174 15 -265 8 -91 15 -202 15 -247 l0 -83 -420 0 c-356 0 -420 2 -420 14 0 8 4 16 9 18 5 2 34 26 63 53 29 28 118 111 198 185 147 137 229 213 402 378 53 51 103 92 111 92 8 0 17 -10 21 -22z m-2697 -470 c65 -61 146 -138 181 -171 34 -32 62 -63 62 -68 0 -5 -107 -9 -255 -9 -169 0 -255 3 -255 10 0 10 30 104 49 152 18 47 40 104 56 151 9 26 23 47 31 47 7 0 66 -50 131 -112z m3746 -698 c16 0 17 -130 15 -2622 l-3 -2623 -2642 -3 -2643 -2 -2 2617 c-2 1850 0 2620 8 2627 7 8 777 10 2630 9 1440 -2 2627 -3 2637 -3z"}),w.jsx("path",{d:"M5735 6087 c-54 -22 -72 -36 -104 -83 -27 -41 -31 -57 -31 -111 0 -129 77 -205 206 -205 90 0 154 42 188 126 66 160 -100 335 -259 273z"}),w.jsx("path",{d:"M2842 5359 c-52 -16 -118 -90 -132 -148 -36 -150 102 -286 252 -250 61 14 129 75 148 134 29 86 -9 195 -83 242 -45 29 -131 39 -185 22z"}),w.jsx("path",{d:"M5035 5362 c-90 -32 -145 -106 -145 -197 0 -96 68 -183 161 -205 39 -10 57 -9 101 4 63 19 75 28 116 85 28 39 32 52 32 110 0 120 -72 199 -186 206 -32 2 -68 1 -79 -3z"}),w.jsx("path",{d:"M5730 5359 c-85 -36 -130 -105 -130 -202 0 -56 4 -70 32 -108 40 -56 52 -65 112 -85 43 -15 57 -15 100 -4 235 59 212 392 -28 406 -33 2 -72 -1 -86 -7z"}),w.jsx("path",{d:"M2818 4620 c-48 -26 -93 -82 -108 -135 -29 -103 38 -216 147 -250 54 -17 58 -17 112 0 36 12 69 33 93 57 92 94 68 260 -47 325 -52 29 -144 31 -197 3z"}),w.jsx("path",{d:"M3506 4609 c-150 -100 -116 -315 59 -375 54 -18 56 -18 109 0 89 30 156 116 156 199 0 73 -68 172 -137 198 -13 5 -50 9 -82 9 -48 0 -66 -5 -105 -31z"}),w.jsx("path",{d:"M4258 4610 c-152 -101 -119 -316 57 -376 54 -18 56 -18 109 0 89 31 156 116 156 200 0 73 -66 170 -133 195 -16 6 -54 11 -86 11 -47 0 -66 -5 -103 -30z"}),w.jsx("path",{d:"M4984 4607 c-149 -103 -115 -318 60 -373 55 -17 59 -17 111 0 52 18 92 51 128 106 22 33 23 140 1 183 -40 78 -103 117 -193 117 -50 0 -66 -5 -107 -33z"}),w.jsx("path",{d:"M5715 4623 c-79 -41 -115 -103 -115 -195 0 -42 6 -72 17 -88 36 -55 76 -88 129 -106 53 -18 55 -18 109 1 121 41 182 154 143 266 -15 46 -42 79 -90 112 -34 22 -52 27 -102 27 -36 -1 -74 -7 -91 -17z"}),w.jsx("path",{d:"M2841 3901 c-60 -24 -107 -74 -127 -134 -15 -44 -15 -57 -4 -101 41 -161 208 -217 339 -114 48 37 65 78 66 155 0 63 -3 76 -30 115 -34 49 -120 98 -169 97 -17 0 -51 -8 -75 -18z"}),w.jsx("path",{d:"M3532 3894 c-162 -80 -161 -292 0 -375 46 -24 127 -25 171 -3 73 37 127 119 127 193 -1 77 -59 158 -138 192 -59 26 -98 24 -160 -7z"}),w.jsx("path",{d:"M4279 3892 c-99 -51 -148 -176 -103 -265 86 -170 309 -169 385 2 35 80 19 159 -47 225 -36 35 -105 66 -149 66 -18 0 -57 -13 -86 -28z"}),w.jsx("path",{d:"M5015 3896 c-60 -28 -94 -63 -112 -114 -28 -81 -10 -163 48 -220 104 -102 265 -77 330 50 22 42 26 146 8 181 -34 65 -128 127 -193 127 -17 0 -53 -11 -81 -24z"}),w.jsx("path",{d:"M5727 3901 c-45 -21 -93 -65 -113 -103 -21 -40 -18 -141 5 -186 37 -72 102 -112 181 -112 151 0 251 153 191 292 -23 52 -52 80 -111 107 -54 25 -102 25 -153 2z"}),w.jsx("path",{d:"M2855 3201 c-70 -17 -128 -80 -146 -159 -25 -105 47 -216 156 -242 49 -12 62 -11 110 4 148 46 194 226 86 337 -60 62 -122 80 -206 60z"}),w.jsx("path",{d:"M3546 3196 c-181 -67 -179 -326 3 -391 69 -24 127 -15 194 29 44 29 87 112 87 166 -1 59 -43 136 -95 172 -50 34 -132 45 -189 24z"}),w.jsx("path",{d:"M4296 3196 c-145 -54 -180 -230 -69 -348 27 -29 99 -58 142 -58 71 1 142 46 182 114 38 67 38 123 1 191 -51 93 -161 136 -256 101z"}),w.jsx("path",{d:"M5038 3203 c-36 -6 -115 -77 -133 -120 -45 -107 14 -239 124 -278 52 -18 84 -19 131 -2 49 17 72 35 108 86 28 39 32 52 32 110 0 80 -26 132 -85 173 -41 28 -117 42 -177 31z"}),w.jsx("path",{d:"M5737 3200 c-44 -14 -95 -58 -117 -100 -31 -61 -28 -153 8 -207 36 -55 69 -80 126 -95 129 -34 261 76 253 212 -4 71 -21 104 -78 152 -38 32 -54 39 -105 43 -32 2 -72 0 -87 -5z"}),w.jsx("path",{d:"M3535 2463 c-44 -23 -84 -63 -106 -105 -48 -94 -2 -219 100 -270 64 -33 103 -35 163 -9 79 34 137 115 138 192 0 74 -54 156 -127 193 -41 20 -129 20 -168 -1z"}),w.jsx("path",{d:"M4285 2463 c-44 -23 -84 -63 -106 -105 -48 -94 -2 -219 100 -270 64 -33 103 -35 163 -9 79 34 137 115 138 192 0 74 -54 156 -127 193 -41 20 -129 20 -168 -1z"}),w.jsx("path",{d:"M5012 2463 c-69 -38 -104 -83 -123 -162 -10 -46 20 -134 61 -176 32 -33 107 -65 151 -65 61 0 156 64 188 127 6 12 11 49 11 83 0 94 -42 161 -122 195 -50 20 -126 19 -166 -2z"})]})}),pl=()=>{const{t:e}=zt(),t=[{key:"tonieboxes",label:w.jsx(Mt,{to:"/tonieboxes",style:{marginLeft:8},children:e("tonieboxes.navigationTitle")}),icon:ce.createElement(t7e),title:e("tonieboxes.navigationTitle")},{key:"esp32boxflashing",label:w.jsx(Mt,{to:"/tonieboxes/esp32boxflashing",children:e("tonieboxes.esp32BoxFlashing.navigationTitle")}),icon:ce.createElement(r1),title:e("tonieboxes.esp32BoxFlashing.navigationTitle")},{key:"cc3200boxflashing",label:w.jsx(Mt,{to:"/tonieboxes/cc3200boxflashing",children:e("tonieboxes.cc3200BoxFlashing.navigationTitle")}),icon:ce.createElement(r1),title:e("tonieboxes.cc3200BoxFlashing.navigationTitle")},{key:"cc3235boxflashing",label:w.jsx(Mt,{to:"/tonieboxes/cc3235boxflashing",children:e("tonieboxes.cc3235BoxFlashing.navigationTitle")}),icon:ce.createElement(r1),title:e("tonieboxes.cc3235BoxFlashing.navigationTitle")}];return w.jsx(nm,{mode:"inline",defaultOpenKeys:["sub"],items:t})},Aj=new _n(Sn()),n7e=()=>{const{t:e}=zt(),[t,n]=l.useState([]),[r,a]=l.useState(!1);l.useEffect(()=>{(async()=>{const c=await Aj.apiGetTonieboxesIndex();n(c)})(),(async()=>{try{const c=await Aj.apiGetNewBoxesAllowed();a(c)}catch(c){Xe.error("Fetching new box allowed: "+c)}})()},[]);const o=r?w.jsx(Sr,{message:e("tonieboxes.newBoxesAllowed"),description:e("tonieboxes.newBoxesAllowedText"),type:"warning",showIcon:!0,style:{margin:"16px 0"}}):"";return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(pl,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(pl,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("tonieboxes.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("tonieboxes.title")}),o,w.jsx(e7e,{tonieboxCards:t})]})]})]})},Po=()=>{const{t:e}=zt(),t=[{key:"community",label:w.jsx(Mt,{to:"/community",children:e("community.navigationTitle")}),icon:ce.createElement(awe),title:e("community.navigationTitle")},{key:"faq",label:w.jsx(Mt,{to:"/community/faq",children:e("community.faq.navigationTitle")}),icon:ce.createElement(pG),title:e("community.faq.navigationTitle")},{key:"contribution",label:w.jsx(Mt,{to:"/community/contribution",style:{color:"currentColor"},children:e("community.contribution.navigationTitle")}),icon:ce.createElement(n1e),title:e("community.contribution.navigationTitle"),children:[{key:"toniesJson",label:w.jsx(Mt,{to:"/community/contribution/tonies-json",children:e("community.contribution.toniesJson.navigationTitle")}),icon:ce.createElement(Ybe),title:e("community.contribution.toniesJson.navigationTitle")}]},{key:"contributors",label:w.jsx(Mt,{to:"/community/contributors",children:e("community.contributors.navigationTitle")}),icon:ce.createElement(T1e),title:e("community.contributors.navigationTitle")},{key:"changelog",label:w.jsx(Mt,{to:"/community/changelog",children:e("community.changelog.navigationTitle")}),icon:ce.createElement(gSe),title:e("community.changelog.navigationTitle")},{key:"Forum",label:w.jsx(Mt,{to:"https://forum.revvox.de/",target:"_blank",children:e("community.forum.navigationTitle")}),icon:ce.createElement(VSe),title:e("community.forum.navigationTitle")}];return w.jsx(nm,{mode:"inline",defaultOpenKeys:["sub"],items:t})},{Paragraph:Mj}=$n,r7e=()=>{const{t:e}=zt();return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.title")}),w.jsxs(Mj,{children:[w.jsx("h2",{children:"Get involved"}),"Be a part of our global contributor community by writing code, commenting on issues, or participate in discussons in our telegram group."]}),w.jsxs(Mj,{children:["Your best points of contact are the following locations",w.jsxs("ul",{children:[w.jsxs("li",{children:[w.jsx(Mt,{to:"https://github.com/toniebox-reverse-engineering",target:"_blank",children:"GitHub"}),w.jsx("ul",{children:w.jsx("li",{children:"The place where all sources are stored for this and related projects. Where you can fork the repositories, contribute new or improved features, create issues or just give some feedback on already existing issues."})})]}),w.jsxs("li",{children:[w.jsx(Mt,{to:"https://t.me/toniebox_reverse_engineering",target:"_blank",children:"Telegram Chat"}),w.jsx("ul",{children:w.jsx("li",{children:"The first level support if you need help or if you are interested in getting involved in the development of TeddyCloud."})})]}),w.jsxs("li",{children:[w.jsx(Mt,{to:"https://forum.revvox.de/",target:"_blank",children:"Discourse Forum"}),w.jsx("ul",{children:w.jsx("li",{children:"The lively knowledge base for the project, a place to ask questions whose answers can be helpful for others."})})]}),w.jsxs("li",{children:[w.jsx(Mt,{to:"https://tonies-wiki.revvox.de/docs/tools/teddycloud/",target:"_blank",children:"TeddyCloud Wiki"}),w.jsx("ul",{children:w.jsx("li",{children:"A Wiki contains, among other things, how to install TeddyCloud and how to solve possible problems."})})]})]})]})]})]})]})},{Paragraph:su}=$n,a7e=()=>{const{t:e}=zt(),t=["Use welcome and inclusive language.","Be respectful of differing viewpoints and experiences.","Gracefully accept constructive criticism.","Foster what's best for the community.","Show empathy for other community members.","Decisions are made based on technical merit and consensus. The Teddycloud community aspires to treat everyone equally, and to value all contributions."],n=["Write code.","Improve documentation.","Answer questions on our telegram group.","Investigate bugs and issues on GitHub.","Review and comment on pull requests from other developers.","Report an issue.","Give a “thumbs up” 👍 on issues that are relevant to you."];return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")},{title:e("community.contribution.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.contribution.title")}),w.jsxs(su,{children:[w.jsx(su,{children:"The Teddycloud can only grow through the contributions of this community. Thanks so much for your enthusiasm and your work - we appreciate everything you do!"}),w.jsxs(su,{children:[w.jsx("h2",{children:"Community values"}),w.jsx(su,{children:"In the interest of fostering an open and welcoming environment, contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone - regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation."}),w.jsx(su,{children:"Examples of behaviors that contribute to creating a positive environment include:"}),w.jsx("ul",{children:t.map((r,a)=>w.jsx("li",{children:r},a))})]}),w.jsxs(su,{children:[w.jsx("h2",{children:"Make your first contribution"}),"There are many ways to contribute to Teddycloud! You can contribute code and make improvements to the Teddycloud documentation. Our most common contributions include code, documentation, and community support.",w.jsx("ul",{children:n.map((r,a)=>w.jsx("li",{children:r},a))})]})]})]})]})]})},o7e=new _n(Sn()),{Paragraph:Dj}=$n,{Panel:i7e}=j0,s7e=()=>{const{t:e}=zt(),[t,n]=l.useState({});return l.useEffect(()=>{async function r(){try{const s=(await(await o7e.apiGetTeddyCloudApiRaw("/api/toniesJson")).json()).filter(u=>u.audio_id&&u.audio_id.length===0&&!["creative-tonie","system"].includes(u.category)&&!u.model.includes("20000")).map(u=>({model:u.model,series:u.series,episodes:u.episodes,pic:u.pic,audio_id:u.audio_id||[],category:u.category,language:u.language})),c={};s.forEach(u=>{c[u.language]||(c[u.language]=[]),c[u.language].push(u)}),n(c)}catch(a){console.error("Error fetching and transforming data:",a)}}r()},[]),w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")},{title:e("community.contribution.navigationTitle")},{title:e("community.contribution.toniesJson.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.contribution.toniesJson.title")}),w.jsx(Dj,{children:e("community.contribution.toniesJson.text")}),w.jsx(Dj,{children:w.jsx(j0,{accordion:!0,children:Object.keys(t).map((r,a)=>w.jsx(i7e,{header:r,children:w.jsx(ll,{children:Array.isArray(t[r])&&t[r].map((o,i)=>w.jsx(ll.Item,{id:o.model,children:w.jsxs("div",{children:[w.jsx("img",{src:o.pic,alt:"",style:{width:"100px",height:"auto"}}),o.model," - ",o.series," -"," ",o.episodes]})},i))})},a))})})]})]})]})},{Paragraph:Tf}=$n,l7e=()=>{const{t:e}=zt();return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")},{title:e("community.contributors.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.contributors.title")}),w.jsxs(Tf,{children:["This project relies on the tireless contributors who offer their free time and skills. Directly related to TeddyCloud are the contributors of the two projects teddycloud and teddycloud_web:",w.jsxs(Tf,{children:[w.jsx("h3",{children:"teddycloud"}),w.jsx("div",{children:"The most neccessary, but mostly invisible part of your TeddyCloud Server."}),w.jsx(Mt,{to:"https://github.com/toniebox-reverse-engineering/teddycloud/graphs/contributors",target:"_blank",children:"https://github.com/toniebox-reverse-engineering/teddycloud/graphs/contributors"})]}),w.jsxs(Tf,{children:[w.jsx("h3",{children:"teddycloud_web"}),w.jsx("div",{children:"Which is actually this frontend you are using and seeing here."}),w.jsx(Mt,{to:"https://github.com/toniebox-reverse-engineering/teddycloud_web/graphs/contributors",target:"_blank",children:"https://github.com/toniebox-reverse-engineering/teddycloud_web/graphs/contributors"})]}),w.jsxs(Tf,{children:["You can find more contributors to the entire topic complex in the other GitHub repositories at"," ",w.jsx(Mt,{to:"https://github.com/orgs/toniebox-reverse-engineering/repositories",target:"_blank",children:"https://github.com/orgs/toniebox-reverse-engineering/repositories"})]})]}),w.jsx(Ea,{}),w.jsxs(Tf,{children:[w.jsx("div",{style:{marginBottom:24},children:"A big round of applause for them!"}),w.jsx(VN,{maxNoOfGuests:100,toniesSize:150,showQuestionMark:!1,height:150})]})]})]})]})},{Paragraph:Pj,Text:H2}=$n,c7e=()=>{const{t:e}=zt(),t=[{version:"0.6.1",changes:["Stabilization backend","Changed default for setting cloud.prioCustomContent to false","Disabled prioCustomContent if lower audio id is allowed","Added reload tonies(.custom).json api https://github.com/toniebox-reverse-engineering/teddycloud/issues/177","Added moveFile api https://github.com/toniebox-reverse-engineering/teddycloud/issues/198","Added server side taf file encoding","Support TAF files in taps and server side taf file encoding","Added API to extract certificates https://github.com/toniebox-reverse-engineering/teddycloud/issues/103","Initial cert generation generates now a 4096bit long cert https://github.com/toniebox-reverse-engineering/teddycloud/issues/138","Extended settings api","Fixed some bugs","gui: Fixed bug storing source with html special chars","gui: Fixed bug saving model and source of a tonie/tag at once","gui: Fixed display bug sourceInfo with unknown content","gui: Integrated new reload tonies.json api","gui: Added Moving and renaming of files in library and content","gui: Fixing security weaknesses","gui: Added file upload to library",`gui: If setting "Category frontend: Split content / model" is disabled, don't show the source info in Tonies list and details modal`,"gui: Added encoding functionality in library","gui: Allow playing all encodable files in teddyCloud","gui: ESP32 flash process - integrated remaining manual steps. Certificate extraction is now also automated","gui: Added Spanish language - feel free to improve translations as current translation is completely done by ChatGPT."],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/compare/tc_v0.6.0...tc_v0.6.1","https://github.com/toniebox-reverse-engineering/teddycloud_web/compare/tcw_v0.6.0...tcw_v0.6.1"],discussionLink:"https://forum.revvox.de/t/release-notes-0-6-1/701",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.6.1"},{version:"0.6.0",changes:["Stabilization backend","store last played time of last played tag","extend getTagIndex API, provide language in tonieInfos","PoC Toniebox api access (explicitly allow access to teddy cloud api on tonebox level)","Added enable/disable new Tonieboxes: prohibit registration of new tonieboxes if not enabled","Added removal of overlays (= removal of Tonieboxes from TeddyCloud)","add hide tonie/tag functionality (hide using new /web gui, present to box to unhide)","fixed locking bug, reworked locking.","fixed bug not storing cloud auth in some circumstances","fixed bug not storing source in json file: https://github.com/toniebox-reverse-engineering/teddycloud/issues/165","added limit to tempfile creation for radiostreams, default: 240mb (~6h) (configurable if expert mode is activated) https://github.com/toniebox-reverse-engineering/teddycloud/issues/180","added possibility to set WiFi Credentials on ESP32 Firmware patching","introduced second HTTPS port for WebFrontend only, which allows using https for webfrontend (Default: 8443)","tonie images from boxine can now be cached locally (PoC)","new /web gui is now default web gui: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/47","new /web gui: enhanced Toniecard, added search for Radiostream in Edit Modal","new /web gui: Tonies - Content section - added Migrate Content to Lib button on TAF files","new /web gui: added RTNL Log Page: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/48","new /web gui: added show Json File when double click on json file (File browser view)","new /web gui: added show TAP File when double click on tap file (File browser view)","new /web gui: added show TAF Header (including AudioID + Hash) when double click on a taf file (File browser view)","new /web gui: show date time of last played tag (toniecard + toniboxcard)","new /web gui: added Tonie Audio Playlist page (WIP - Implementation not yet finished), rearranged menu entries tonies section: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/52","new /web gui: added delete feature in content, library and audio playlist page","new /web gui: improved changelog page, parse links and open links in new tab; completed contributors page: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/27","new /web gui: added language flag to tonies card if it's not the same as the most owned language ones, added language filter","new /web gui: deletion of tonieboxes","new /web gui: info if add new boxes is enabled on homepage and tonieboxes page","new /web gui: enable/disable API access for toniebox added on tonieboxes page","new /web gui: add hide tonie/tag in tonies list (in info modal)","new /web gui: PoC Tonies Custom Json Editor (WiP, not working, but you get the json part to copy into the tonies.custom.json)","new /web gui: PoC Tonie Audio Playlist Editor (WiP, not working, but you get the json to copy and save as a TAP file) ","new /web gui: allow TAP files to be selected on Edit Tag Modal","new /web gui: new 404 page","new /web gui: hidden feature Tonie meeting. Search for it!","new /web gui: added link to Toniebox if the box is version cc3200, an ip is available and cfw is installed: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/28","new /web gui: hide audioplayer if no source is set, when clicking on play icon of a tonie/taf/... the player is shown: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/40","new /web gui: added minimize/maximize audioplayer https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/40","new /web gui: show Tonie on tonie article search","new /web gui: improved audioplayer, added volume control to custom one, hide doubled audioplayer","new /web gui: added French translation. Feel free to check if chatGPT is a good translator. If something is wrong, give us a shout at telegram!","new /weg gui: overworked filebrowser to be responsive","new /web gui: overworked tonie information modal, now also available in file browser (library + content)","new /web gui: added Create Directory functionality in file browser","new /web gui: added better breadcrumb to filebrowser (clickable for easy directory switching) https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/78","new /web gui: set nocloud to true if source of a tag is changed https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/77","new /web gui: show image and information from set source if different from model https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/80","new /web gui: tonie overview: filter now also considers information from set source","new /web gui: fixed bugs after updating tonies in tonies overview","new /web gui: added FAQ page in community section","new /web gui: support web streams in audioplayer","new /web gui: improved filebrowser, added filter field and made buttons sticky","new /web gui: integrated ESP32 Firmware Flashing https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/46","new /web gui: integrated setting of WiFi credentials in ESP32 Firmware Flashing","new /web gui: show hint on ESP32 Firmware Flashing page if browser does not support WebSerial","new /web gui: allow multiselection in file browser for file deletion","new /web gui: limit audio encoder to 99 files (as Toniebox only supports 99 chapters)","new /web gui: fixed image fetch loop when playing a tonie","new /web gui: fixed poor audio quality in some case when using audio encoder","new /web gui: migrated gui from create-react-app to vite","new /web gui: fixed some bugs and minor refactoring"],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/compare/tc_v0.5.2...tc_v0.6.0","https://github.com/toniebox-reverse-engineering/teddycloud_web/compare/tcw_v0.5.2...tcw_v0.6.0"],discussionLink:"https://forum.revvox.de/t/release-notes-0-6-0/468",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.6.0"},{version:"0.5.2",changes:["Stabilization backend","Several fixes and changes regards backend crashes and emptied config files when changing any tonie setting","Fix for random directories in library (and everywhere)","Fixed bug storing last played tonie per box","Fixed bug clearing text settings (like paths or flex tonie)","API for searching models is now case insensitive","Save IP of Toniebox as prepartion for linking CFW Tonieboxes","Introduced Settings level - 1: Basic, 2: Detail, 3: Expert (1 Default - if you are missing settings, increase level!)","new /web gui: enhanced Tonies Card, added editable content source","new /web gui: enhanced Toniebox Card, improved UX","new /web gui: Dark theme (Last used Theme stored in localStorage in Browser)","new /web gui: Show All (Hide Pagination on Tonies List, stored in localStorage in Browser)","new /web gui: Support of overlayed content folder. More details can be found here: https://forum.revvox.de/t/teddycloud-supporting-multiple-tonieboxes/451/1","new /web gui: Text inputs in Settings must be saved explicitly. (only Textinputs, other types are still autosaved.) Expect changes in future releases.","new /web gui: fixed various state bugs","new /web gui: show last online date of offline tonieboxes","new /web gui: Messages on successful setting updates","new /web gui: some refactoring"],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/compare/tc_v0.5.1...tc_v0.5.2","https://github.com/toniebox-reverse-engineering/teddycloud_web/compare/tcw_v0.5.1...tcw_v0.5.2"],discussionLink:"https://forum.revvox.de/t/release-notes-0-5-2/450",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.5.2"},{version:"0.5.1",changes:["Stabilization Backend (added locks to prevent crashes, removed memory leaks)","Creating dirs when uploading certificates to a not yet existing path","Moving Tafs from Content to Library on click (not yet available in (new?) frontend)","new /web gui: Pagination + Filtering on Tonies List ( Paging Tonies · Issue #24 · toniebox-reverse-engineering/teddycloud_web · GitHub 2 )","new /web gui: Extend Box Management: Certificate upload now box specific possible, overworked certificate upload ( Certificate upload box related · Issue #26 · toniebox-reverse-engineering/teddycloud_web · GitHub )","new /web gui: Show last played Tonie on Box Management, link to prefiltered Tonieslist, added marking of the Last played Tonies on each box in Tonieslist ( Make use of internal.last_ruid · Issue #30 · toniebox-reverse-engineering/teddycloud_web · GitHub 1 )","new /web gui: adapted cursor on cards to default as cards not really clickable ( TonieCard Cursor · Issue #25 · toniebox-reverse-engineering/teddycloud_web · GitHub )","new /web gui: fixed navigation item marking","new /web gui: updated box models, added pseudomodels of the official tonies covers (sleepy bear, sheep and rabbit). They are now placed in a json in the config folder. Custom tonieboxes are now also possible. Add your customised one in tonieboxes.custom.json and choose it in the box mgmt.","new /web gui: added community section (WIP) ( Add Changelog and contribution page · Issue #27 · toniebox-reverse-engineering/teddycloud_web · GitHub 1 )","new /web gui: fixed warnings"],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/compare/tc_v0.5.0...tc_v0.5.1","https://github.com/toniebox-reverse-engineering/teddycloud_web/compare/tcw_v0.5.0...tcw_v0.5.1"],discussionLink:"https://forum.revvox.de/t/release-notes-0-5-1/447",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.5.1"},{version:"0.5.0",changes:["security mitigations on public instances as it‘s definitely not recommended to host teddycloud in public accessible for all","prepared authentication for frontend (backend adaptions)","linked new /web gui on teddycloud administration gui","overworked header, reordered menu items, new icons, better readable status in new /web gui","fixed modals (still some display problems on small devices like mobiles exists)","added audio encoder to new /web gui, you are now able to select files and encode them to a taf","This lets you bring your own content easily on an existing tonie.","added toniebox management to new /web gui, improved backend functions for that","only at least once connected boxes are listed, model must be set manually","enriched homepage in new /web gui with 5 randomly selected tonies of yours","adapt tonie card list to different cover image sizes in new /web gui (all cards within one row have now the same height)","added no cloud and live icon (Toggle to enable/disable) on tonie card in new /web gui","fixed several bugs"],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/pull/154","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/8","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/9","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/19","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/21","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/22"],discussionLink:"https://forum.revvox.de/t/release-notes-0-5-0/444",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.5.0"},{version:"0.4.5 and older",changes:["A lot more. See Github for details!"],commits:[]}],n=r=>{const a=/(https?:\/\/[^\s]+)/g;return r.split(a).map((i,s)=>a.test(i)?w.jsx(Mt,{to:i,target:"_blank",rel:"noopener noreferrer",children:i},s):i)};return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")},{title:e("community.changelog.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.changelog.title")}),w.jsx(Pj,{children:w.jsx(ll,{dataSource:t,renderItem:r=>w.jsxs(w.Fragment,{children:[w.jsxs("h2",{children:["Version ",r.version]}),w.jsxs(Pj,{children:[w.jsx("h3",{children:"Changes"}),w.jsx("ul",{children:r.changes.map((a,o)=>w.jsx("li",{children:n(a)},o))})]}),r.commits&&r.commits.length>0&&w.jsxs(w.Fragment,{children:[w.jsx(H2,{strong:!0,children:"All contained commits can be found here (teddy cloud repo):"}),w.jsx("ul",{children:r.commits.map((a,o)=>w.jsx("li",{children:w.jsx(Mt,{to:a,target:"_blank",children:a})},o))})]}),r.discussionLink&&w.jsxs(w.Fragment,{children:[w.jsx(H2,{strong:!0,children:"Discussion:"}),w.jsx("ul",{children:w.jsx("li",{children:w.jsx(Mt,{to:r.discussionLink,target:"_blank",children:r.discussionLink})})})]}),r.githubReleaseLink&&w.jsxs(w.Fragment,{children:[w.jsx(H2,{strong:!0,children:"GitHub Release:"}),w.jsx("ul",{children:w.jsx("li",{children:w.jsx(Mt,{to:r.githubReleaseLink,target:"_blank",children:r.githubReleaseLink})})})]})]})})})]})]})]})};class xa extends Error{}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const u7e=4,Lj=0,Fj=1,d7e=2;function Xd(e){let t=e.length;for(;--t>=0;)e[t]=0}const f7e=0,iX=1,p7e=2,g7e=3,m7e=258,ek=29,dm=256,mg=dm+1+ek,Wu=30,tk=19,sX=2*mg+1,ql=15,U2=16,h7e=7,nk=256,lX=16,cX=17,uX=18,i_=new Uint8Array([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]),lv=new Uint8Array([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]),v7e=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),dX=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),b7e=512,Xi=new Array((mg+2)*2);Xd(Xi);const vp=new Array(Wu*2);Xd(vp);const hg=new Array(b7e);Xd(hg);const vg=new Array(m7e-g7e+1);Xd(vg);const rk=new Array(ek);Xd(rk);const wb=new Array(Wu);Xd(wb);function V2(e,t,n,r,a){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=a,this.has_stree=e&&e.length}let fX,pX,gX;function W2(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const mX=e=>e<256?hg[e]:hg[256+(e>>>7)],bg=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},ja=(e,t,n)=>{e.bi_valid>U2-n?(e.bi_buf|=t<>U2-e.bi_valid,e.bi_valid+=n-U2):(e.bi_buf|=t<{ja(e,n[t*2],n[t*2+1])},hX=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},y7e=e=>{e.bi_valid===16?(bg(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},S7e=(e,t)=>{const n=t.dyn_tree,r=t.max_code,a=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,d,f,p,g,m,b=0;for(p=0;p<=ql;p++)e.bl_count[p]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;uc&&(p=c,b++),n[d*2+1]=p,!(d>r)&&(e.bl_count[p]++,g=0,d>=s&&(g=i[d-s]),m=n[d*2],e.opt_len+=m*(p+g),o&&(e.static_len+=m*(a[d*2+1]+g)));if(b!==0){do{for(p=c-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[c]--,b-=2}while(b>0);for(p=c;p!==0;p--)for(d=e.bl_count[p];d!==0;)f=e.heap[--u],!(f>r)&&(n[f*2+1]!==p&&(e.opt_len+=(p-n[f*2+1])*n[f*2],n[f*2+1]=p),d--)}},vX=(e,t,n)=>{const r=new Array(ql+1);let a=0,o,i;for(o=1;o<=ql;o++)a=a+n[o-1]<<1,r[o]=a;for(i=0;i<=t;i++){let s=e[i*2+1];s!==0&&(e[i*2]=hX(r[s]++,s))}},w7e=()=>{let e,t,n,r,a;const o=new Array(ql+1);for(n=0,r=0;r>=7;r{let t;for(t=0;t{e.bi_valid>8?bg(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},jj=(e,t,n,r)=>{const a=t*2,o=n*2;return e[a]{const r=e.heap[n];let a=n<<1;for(;a<=e.heap_len&&(a{let r,a,o=0,i,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,a=e.pending_buf[e.sym_buf+o++],r===0?xi(e,a,t):(i=vg[a],xi(e,i+dm+1,t),s=i_[i],s!==0&&(a-=rk[i],ja(e,a,s)),r--,i=mX(r),xi(e,i,n),s=lv[i],s!==0&&(r-=wb[i],ja(e,r,s)));while(o{const n=t.dyn_tree,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.elems;let i,s,c=-1,u;for(e.heap_len=0,e.heap_max=sX,i=0;i>1;i>=1;i--)G2(e,n,i);u=o;do i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G2(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=s,n[u*2]=n[i*2]+n[s*2],e.depth[u]=(e.depth[i]>=e.depth[s]?e.depth[i]:e.depth[s])+1,n[i*2+1]=n[s*2+1]=u,e.heap[1]=u++,G2(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],S7e(e,t),vX(n,c,e.bl_count)},zj=(e,t,n)=>{let r,a=-1,o,i=t[0*2+1],s=0,c=7,u=4;for(i===0&&(c=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)o=i,i=t[(r+1)*2+1],!(++s{let r,a=-1,o,i=t[0*2+1],s=0,c=7,u=4;for(i===0&&(c=138,u=3),r=0;r<=n;r++)if(o=i,i=t[(r+1)*2+1],!(++s{let t;for(zj(e,e.dyn_ltree,e.l_desc.max_code),zj(e,e.dyn_dtree,e.d_desc.max_code),s_(e,e.bl_desc),t=tk-1;t>=3&&e.bl_tree[dX[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},C7e=(e,t,n,r)=>{let a;for(ja(e,t-257,5),ja(e,n-1,5),ja(e,r-4,4),a=0;a{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Lj;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Fj;for(n=32;n{Uj||(w7e(),Uj=!0),e.l_desc=new W2(e.dyn_ltree,fX),e.d_desc=new W2(e.dyn_dtree,pX),e.bl_desc=new W2(e.bl_tree,gX),e.bi_buf=0,e.bi_valid=0,bX(e)},SX=(e,t,n,r)=>{ja(e,(f7e<<1)+(r?1:0),3),yX(e),bg(e,n),bg(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},T7e=e=>{ja(e,iX<<1,3),xi(e,nk,Xi),y7e(e)},R7e=(e,t,n,r)=>{let a,o,i=0;e.level>0?(e.strm.data_type===d7e&&(e.strm.data_type=E7e(e)),s_(e,e.l_desc),s_(e,e.d_desc),i=x7e(e),a=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=a&&(a=o)):a=o=n+5,n+4<=a&&t!==-1?SX(e,t,n,r):e.strategy===u7e||o===a?(ja(e,(iX<<1)+(r?1:0),3),Bj(e,Xi,vp)):(ja(e,(p7e<<1)+(r?1:0),3),C7e(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),Bj(e,e.dyn_ltree,e.dyn_dtree)),bX(e),r&&yX(e)},_7e=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(vg[n]+dm+1)*2]++,e.dyn_dtree[mX(t)*2]++),e.sym_next===e.sym_end);var $7e=I7e,O7e=SX,N7e=R7e,k7e=_7e,A7e=T7e,M7e={_tr_init:$7e,_tr_stored_block:O7e,_tr_flush_block:N7e,_tr_tally:k7e,_tr_align:A7e};const D7e=(e,t,n,r)=>{let a=e&65535|0,o=e>>>16&65535|0,i=0;for(;n!==0;){i=n>2e3?2e3:n,n-=i;do a=a+t[r++]|0,o=o+a|0;while(--i);a%=65521,o%=65521}return a|o<<16|0};var yg=D7e;const P7e=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},L7e=new Uint32Array(P7e()),F7e=(e,t,n,r)=>{const a=L7e,o=r+n;e^=-1;for(let i=r;i>>8^a[(e^t[i])&255];return e^-1};var Ur=F7e,xc={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"},Zd={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_MEM_ERROR:-4,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};const{_tr_init:j7e,_tr_stored_block:l_,_tr_flush_block:B7e,_tr_tally:nl,_tr_align:z7e}=M7e,{Z_NO_FLUSH:rl,Z_PARTIAL_FLUSH:H7e,Z_FULL_FLUSH:U7e,Z_FINISH:To,Z_BLOCK:Vj,Z_OK:na,Z_STREAM_END:Wj,Z_STREAM_ERROR:Ri,Z_DATA_ERROR:V7e,Z_BUF_ERROR:q2,Z_DEFAULT_COMPRESSION:W7e,Z_FILTERED:G7e,Z_HUFFMAN_ONLY:Eh,Z_RLE:q7e,Z_FIXED:K7e,Z_DEFAULT_STRATEGY:Y7e,Z_UNKNOWN:X7e,Z_DEFLATED:ky}=Zd,Z7e=9,Q7e=15,J7e=8,eze=29,tze=256,c_=tze+1+eze,nze=30,rze=19,aze=2*c_+1,oze=15,mn=3,Vs=258,_i=Vs+mn+1,ize=32,wd=42,ak=57,u_=69,d_=73,f_=91,p_=103,Kl=113,Hf=666,Ia=1,Qd=2,Cc=3,Jd=4,sze=3,Yl=(e,t)=>(e.msg=xc[t],t),Gj=e=>e*2-(e>4?9:0),Ps=e=>{let t=e.length;for(;--t>=0;)e[t]=0},lze=e=>{let t,n,r,a=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=a?n-a:0;while(--t);t=a,r=t;do n=e.prev[--r],e.prev[r]=n>=a?n-a:0;while(--t)};let cze=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},oo=(e,t)=>{B7e(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Za(e.strm)},Cn=(e,t)=>{e.pending_buf[e.pending++]=t},Rf=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},g_=(e,t,n,r)=>{let a=e.avail_in;return a>r&&(a=r),a===0?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),n),e.state.wrap===1?e.adler=yg(e.adler,t,a,n):e.state.wrap===2&&(e.adler=Ur(e.adler,t,a,n)),e.next_in+=a,e.total_in+=a,a)},wX=(e,t)=>{let n=e.max_chain_length,r=e.strstart,a,o,i=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-_i?e.strstart-(e.w_size-_i):0,u=e.window,d=e.w_mask,f=e.prev,p=e.strstart+Vs;let g=u[r+i-1],m=u[r+i];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(a=t,!(u[a+i]!==m||u[a+i-1]!==g||u[a]!==u[r]||u[++a]!==u[r+1])){r+=2,a++;do;while(u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&ri){if(e.match_start=t,i=o,o>=s)break;g=u[r+i-1],m=u[r+i]}}while((t=f[t&d])>c&&--n!==0);return i<=e.lookahead?i:e.lookahead},xd=e=>{const t=e.w_size;let n,r,a;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-_i)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),lze(e),r+=t),e.strm.avail_in===0)break;if(n=g_(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=mn)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=al(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=al(e,e.ins_h,e.window[a+mn-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,a,o,i=0,s=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_outa+e.strm.avail_in&&(r=a+e.strm.avail_in),r>o&&(r=o),r>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Za(e.strm),a&&(a>r&&(a=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,r-=a),r&&(g_(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(i===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(g_(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,a=e.strstart-e.block_start,(a>=n||(a||t===To)&&t!==rl&&e.strm.avail_in===0&&a<=o)&&(r=a>o?o:a,i=t===To&&e.strm.avail_in===0&&r===a?1:0,l_(e,e.block_start,r,i),e.block_start+=r,Za(e.strm)),i?Cc:Ia)},K2=(e,t)=>{let n,r;for(;;){if(e.lookahead<_i){if(xd(e),e.lookahead<_i&&t===rl)return Ia;if(e.lookahead===0)break}if(n=0,e.lookahead>=mn&&(e.ins_h=al(e,e.ins_h,e.window[e.strstart+mn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-_i&&(e.match_length=wX(e,n)),e.match_length>=mn)if(r=nl(e,e.strstart-e.match_start,e.match_length-mn),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=mn){e.match_length--;do e.strstart++,e.ins_h=al(e,e.ins_h,e.window[e.strstart+mn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=al(e,e.ins_h,e.window[e.strstart+1]);else r=nl(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(oo(e,!1),e.strm.avail_out===0))return Ia}return e.insert=e.strstart{let n,r,a;for(;;){if(e.lookahead<_i){if(xd(e),e.lookahead<_i&&t===rl)return Ia;if(e.lookahead===0)break}if(n=0,e.lookahead>=mn&&(e.ins_h=al(e,e.ins_h,e.window[e.strstart+mn-1]),n=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=mn-1,n!==0&&e.prev_length4096)&&(e.match_length=mn-1)),e.prev_length>=mn&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-mn,r=nl(e,e.strstart-1-e.prev_match,e.prev_length-mn),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=al(e,e.ins_h,e.window[e.strstart+mn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=mn-1,e.strstart++,r&&(oo(e,!1),e.strm.avail_out===0))return Ia}else if(e.match_available){if(r=nl(e,0,e.window[e.strstart-1]),r&&oo(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Ia}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=nl(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let n,r,a,o;const i=e.window;for(;;){if(e.lookahead<=Vs){if(xd(e),e.lookahead<=Vs&&t===rl)return Ia;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=mn&&e.strstart>0&&(a=e.strstart-1,r=i[a],r===i[++a]&&r===i[++a]&&r===i[++a])){o=e.strstart+Vs;do;while(r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=mn?(n=nl(e,1,e.match_length-mn),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=nl(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(oo(e,!1),e.strm.avail_out===0))return Ia}return e.insert=0,t===To?(oo(e,!0),e.strm.avail_out===0?Cc:Jd):e.sym_next&&(oo(e,!1),e.strm.avail_out===0)?Ia:Qd},dze=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(xd(e),e.lookahead===0)){if(t===rl)return Ia;break}if(e.match_length=0,n=nl(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(oo(e,!1),e.strm.avail_out===0))return Ia}return e.insert=0,t===To?(oo(e,!0),e.strm.avail_out===0?Cc:Jd):e.sym_next&&(oo(e,!1),e.strm.avail_out===0)?Ia:Qd};function mi(e,t,n,r,a){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=a}const Uf=[new mi(0,0,0,0,xX),new mi(4,4,8,4,K2),new mi(4,5,16,8,K2),new mi(4,6,32,32,K2),new mi(4,4,16,16,lu),new mi(8,16,32,32,lu),new mi(8,16,128,128,lu),new mi(8,32,128,256,lu),new mi(32,128,258,1024,lu),new mi(32,258,258,4096,lu)],fze=e=>{e.window_size=2*e.w_size,Ps(e.head),e.max_lazy_match=Uf[e.level].max_lazy,e.good_match=Uf[e.level].good_length,e.nice_match=Uf[e.level].nice_length,e.max_chain_length=Uf[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=mn-1,e.match_available=0,e.ins_h=0};function pze(){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=ky,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 Uint16Array(aze*2),this.dyn_dtree=new Uint16Array((2*nze+1)*2),this.bl_tree=new Uint16Array((2*rze+1)*2),Ps(this.dyn_ltree),Ps(this.dyn_dtree),Ps(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(oze+1),this.heap=new Uint16Array(2*c_+1),Ps(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*c_+1),Ps(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const fm=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==wd&&t.status!==ak&&t.status!==u_&&t.status!==d_&&t.status!==f_&&t.status!==p_&&t.status!==Kl&&t.status!==Hf?1:0},CX=e=>{if(fm(e))return Yl(e,Ri);e.total_in=e.total_out=0,e.data_type=X7e;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?ak:t.wrap?wd:Kl,e.adler=t.wrap===2?0:1,t.last_flush=-2,j7e(t),na},EX=e=>{const t=CX(e);return t===na&&fze(e.state),t},gze=(e,t)=>fm(e)||e.state.wrap!==2?Ri:(e.state.gzhead=t,na),IX=(e,t,n,r,a,o)=>{if(!e)return Ri;let i=1;if(t===W7e&&(t=6),r<0?(i=0,r=-r):r>15&&(i=2,r-=16),a<1||a>Z7e||n!==ky||r<8||r>15||t<0||t>9||o<0||o>K7e||r===8&&i!==1)return Yl(e,Ri);r===8&&(r=9);const s=new pze;return e.state=s,s.strm=e,s.status=wd,s.wrap=i,s.gzhead=null,s.w_bits=r,s.w_size=1<IX(e,t,ky,Q7e,J7e,Y7e),hze=(e,t)=>{if(fm(e)||t>Vj||t<0)return e?Yl(e,Ri):Ri;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Hf&&t!==To)return Yl(e,e.avail_out===0?q2:Ri);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Za(e),e.avail_out===0)return n.last_flush=-1,na}else if(e.avail_in===0&&Gj(t)<=Gj(r)&&t!==To)return Yl(e,q2);if(n.status===Hf&&e.avail_in!==0)return Yl(e,q2);if(n.status===wd&&n.wrap===0&&(n.status=Kl),n.status===wd){let a=ky+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=Eh||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,a|=o<<6,n.strstart!==0&&(a|=ize),a+=31-a%31,Rf(n,a),n.strstart!==0&&(Rf(n,e.adler>>>16),Rf(n,e.adler&65535)),e.adler=1,n.status=Kl,Za(e),n.pending!==0)return n.last_flush=-1,na}if(n.status===ak){if(e.adler=0,Cn(n,31),Cn(n,139),Cn(n,8),n.gzhead)Cn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Cn(n,n.gzhead.time&255),Cn(n,n.gzhead.time>>8&255),Cn(n,n.gzhead.time>>16&255),Cn(n,n.gzhead.time>>24&255),Cn(n,n.level===9?2:n.strategy>=Eh||n.level<2?4:0),Cn(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Cn(n,n.gzhead.extra.length&255),Cn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ur(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=u_;else if(Cn(n,0),Cn(n,0),Cn(n,0),Cn(n,0),Cn(n,0),Cn(n,n.level===9?2:n.strategy>=Eh||n.level<2?4:0),Cn(n,sze),n.status=Kl,Za(e),n.pending!==0)return n.last_flush=-1,na}if(n.status===u_){if(n.gzhead.extra){let a=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>a&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),n.gzindex+=s,Za(e),n.pending!==0)return n.last_flush=-1,na;a=0,o-=s}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>a&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),n.gzindex=0}n.status=d_}if(n.status===d_){if(n.gzhead.name){let a=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>a&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),Za(e),n.pending!==0)return n.last_flush=-1,na;a=0}n.gzindexa&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),n.gzindex=0}n.status=f_}if(n.status===f_){if(n.gzhead.comment){let a=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>a&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),Za(e),n.pending!==0)return n.last_flush=-1,na;a=0}n.gzindexa&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a))}n.status=p_}if(n.status===p_){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Za(e),n.pending!==0))return n.last_flush=-1,na;Cn(n,e.adler&255),Cn(n,e.adler>>8&255),e.adler=0}if(n.status=Kl,Za(e),n.pending!==0)return n.last_flush=-1,na}if(e.avail_in!==0||n.lookahead!==0||t!==rl&&n.status!==Hf){let a=n.level===0?xX(n,t):n.strategy===Eh?dze(n,t):n.strategy===q7e?uze(n,t):Uf[n.level].func(n,t);if((a===Cc||a===Jd)&&(n.status=Hf),a===Ia||a===Cc)return e.avail_out===0&&(n.last_flush=-1),na;if(a===Qd&&(t===H7e?z7e(n):t!==Vj&&(l_(n,0,0,!1),t===U7e&&(Ps(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Za(e),e.avail_out===0))return n.last_flush=-1,na}return t!==To?na:n.wrap<=0?Wj:(n.wrap===2?(Cn(n,e.adler&255),Cn(n,e.adler>>8&255),Cn(n,e.adler>>16&255),Cn(n,e.adler>>24&255),Cn(n,e.total_in&255),Cn(n,e.total_in>>8&255),Cn(n,e.total_in>>16&255),Cn(n,e.total_in>>24&255)):(Rf(n,e.adler>>>16),Rf(n,e.adler&65535)),Za(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?na:Wj)},vze=e=>{if(fm(e))return Ri;const t=e.state.status;return e.state=null,t===Kl?Yl(e,V7e):na},bze=(e,t)=>{let n=t.length;if(fm(e))return Ri;const r=e.state,a=r.wrap;if(a===2||a===1&&r.status!==wd||r.lookahead)return Ri;if(a===1&&(e.adler=yg(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){a===0&&(Ps(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(t.subarray(n-r.w_size,n),0),t=c,n=r.w_size}const o=e.avail_in,i=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,xd(r);r.lookahead>=mn;){let c=r.strstart,u=r.lookahead-(mn-1);do r.ins_h=al(r,r.ins_h,r.window[c+mn-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--u);r.strstart=c,r.lookahead=mn-1,xd(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=mn-1,r.match_available=0,e.next_in=i,e.input=s,e.avail_in=o,r.wrap=a,na};var yze=mze,Sze=IX,wze=EX,xze=CX,Cze=gze,Eze=hze,Ize=vze,Tze=bze,Rze="pako deflate (from Nodeca project)",bp={deflateInit:yze,deflateInit2:Sze,deflateReset:wze,deflateResetKeep:xze,deflateSetHeader:Cze,deflate:Eze,deflateEnd:Ize,deflateSetDictionary:Tze,deflateInfo:Rze};const _ze=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var $ze=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)_ze(n,r)&&(e[r]=n[r])}}return e},Oze=e=>{let t=0;for(let r=0,a=e.length;r=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Sg[254]=Sg[254]=1;var Nze=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,a,o,i=e.length,s=0;for(a=0;a>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const kze=(e,t)=>{if(t<65534&&e.subarray&&TX)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,a;const o=new Array(n*2);for(a=0,r=0;r4){o[a++]=65533,r+=s-1;continue}for(i&=s===2?31:s===3?15:7;s>1&&r1){o[a++]=65533;continue}i<65536?o[a++]=i:(i-=65536,o[a++]=55296|i>>10&1023,o[a++]=56320|i&1023)}return kze(o,a)},Mze=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Sg[e[n]]>t?n:t},wg={string2buf:Nze,buf2string:Aze,utf8border:Mze};function Dze(){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}var RX=Dze;const _X=Object.prototype.toString,{Z_NO_FLUSH:Pze,Z_SYNC_FLUSH:Lze,Z_FULL_FLUSH:Fze,Z_FINISH:jze,Z_OK:xb,Z_STREAM_END:Bze,Z_DEFAULT_COMPRESSION:zze,Z_DEFAULT_STRATEGY:Hze,Z_DEFLATED:Uze}=Zd;function pm(e){this.options=Ay.assign({level:zze,method:Uze,chunkSize:16384,windowBits:15,memLevel:8,strategy:Hze},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new RX,this.strm.avail_out=0;let n=bp.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==xb)throw new Error(xc[n]);if(t.header&&bp.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=wg.string2buf(t.dictionary):_X.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=bp.deflateSetDictionary(this.strm,r),n!==xb)throw new Error(xc[n]);this._dict_set=!0}}pm.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let a,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?jze:Pze,typeof e=="string"?n.input=wg.string2buf(e):_X.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===Lze||o===Fze)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(a=bp.deflate(n,o),a===Bze)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=bp.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===xb;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};pm.prototype.onData=function(e){this.chunks.push(e)};pm.prototype.onEnd=function(e){e===xb&&(this.result=Ay.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ok(e,t){const n=new pm(t);if(n.push(e,!0),n.err)throw n.msg||xc[n.err];return n.result}function Vze(e,t){return t=t||{},t.raw=!0,ok(e,t)}function Wze(e,t){return t=t||{},t.gzip=!0,ok(e,t)}var Gze=pm,qze=ok,Kze=Vze,Yze=Wze,Xze=Zd,Zze={Deflate:Gze,deflate:qze,deflateRaw:Kze,gzip:Yze,constants:Xze};const Ih=16209,Qze=16191;var Jze=function(t,n){let r,a,o,i,s,c,u,d,f,p,g,m,b,v,y,h,S,C,x,E,I,R,T,_;const $=t.state;r=t.next_in,T=t.input,a=r+(t.avail_in-5),o=t.next_out,_=t.output,i=o-(n-t.avail_out),s=o+(t.avail_out-257),c=$.dmax,u=$.wsize,d=$.whave,f=$.wnext,p=$.window,g=$.hold,m=$.bits,b=$.lencode,v=$.distcode,y=(1<<$.lenbits)-1,h=(1<<$.distbits)-1;e:do{m<15&&(g+=T[r++]<>>24,g>>>=C,m-=C,C=S>>>16&255,C===0)_[o++]=S&65535;else if(C&16){x=S&65535,C&=15,C&&(m>>=C,m-=C),m<15&&(g+=T[r++]<>>24,g>>>=C,m-=C,C=S>>>16&255,C&16){if(E=S&65535,C&=15,mc){t.msg="invalid distance too far back",$.mode=Ih;break e}if(g>>>=C,m-=C,C=o-i,E>C){if(C=E-C,C>d&&$.sane){t.msg="invalid distance too far back",$.mode=Ih;break e}if(I=0,R=p,f===0){if(I+=u-C,C2;)_[o++]=R[I++],_[o++]=R[I++],_[o++]=R[I++],x-=3;x&&(_[o++]=R[I++],x>1&&(_[o++]=R[I++]))}else{I=o-E;do _[o++]=_[I++],_[o++]=_[I++],_[o++]=_[I++],x-=3;while(x>2);x&&(_[o++]=_[I++],x>1&&(_[o++]=_[I++]))}}else if(C&64){t.msg="invalid distance code",$.mode=Ih;break e}else{S=v[(S&65535)+(g&(1<>3,r-=x,m-=x<<3,g&=(1<{const c=s.bits;let u=0,d=0,f=0,p=0,g=0,m=0,b=0,v=0,y=0,h=0,S,C,x,E,I,R=null,T;const _=new Uint16Array(cu+1),$=new Uint16Array(cu+1);let P=null,D,A,O;for(u=0;u<=cu;u++)_[u]=0;for(d=0;d=1&&_[p]===0;p--);if(g>p&&(g=p),p===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f0&&(e===Yj||p!==1))return-1;for($[1]=0,u=1;uqj||e===Xj&&y>Kj)return 1;for(;;){D=u-b,i[d]+1=T?(A=P[i[d]-T],O=R[i[d]-T]):(A=96,O=0),S=1<>b)+C]=D<<24|A<<16|O|0;while(C!==0);for(S=1<>=1;if(S!==0?(h&=S-1,h+=S):h=0,d++,--_[u]===0){if(u===p)break;u=t[n+i[d]]}if(u>g&&(h&E)!==x){for(b===0&&(b=g),I+=f,m=u-b,v=1<qj||e===Xj&&y>Kj)return 1;x=h&E,a[x]=g<<24|m<<16|I-o|0}}return h!==0&&(a[I+h]=u-b<<24|64<<16|0),s.bits=g,0};var yp=a9e;const o9e=0,$X=1,OX=2,{Z_FINISH:Zj,Z_BLOCK:i9e,Z_TREES:Th,Z_OK:Ec,Z_STREAM_END:s9e,Z_NEED_DICT:l9e,Z_STREAM_ERROR:Lo,Z_DATA_ERROR:NX,Z_MEM_ERROR:kX,Z_BUF_ERROR:c9e,Z_DEFLATED:Qj}=Zd,My=16180,Jj=16181,eB=16182,tB=16183,nB=16184,rB=16185,aB=16186,oB=16187,iB=16188,sB=16189,Cb=16190,Ui=16191,X2=16192,lB=16193,Z2=16194,cB=16195,uB=16196,dB=16197,fB=16198,Rh=16199,_h=16200,pB=16201,gB=16202,mB=16203,hB=16204,vB=16205,Q2=16206,bB=16207,yB=16208,er=16209,AX=16210,MX=16211,u9e=852,d9e=592,f9e=15,p9e=f9e,SB=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function g9e(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const zc=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.modeMX?1:0},DX=e=>{if(zc(e))return Lo;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=My,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(u9e),t.distcode=t.distdyn=new Int32Array(d9e),t.sane=1,t.back=-1,Ec},PX=e=>{if(zc(e))return Lo;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,DX(e)},LX=(e,t)=>{let n;if(zc(e))return Lo;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Lo:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,PX(e))},FX=(e,t)=>{if(!e)return Lo;const n=new g9e;e.state=n,n.strm=e,n.window=null,n.mode=My;const r=LX(e,t);return r!==Ec&&(e.state=null),r},m9e=e=>FX(e,p9e);let wB=!0,J2,eI;const h9e=e=>{if(wB){J2=new Int32Array(512),eI=new Int32Array(32);let t=0;for(;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(yp($X,e.lens,0,288,J2,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;yp(OX,e.lens,0,32,eI,0,e.work,{bits:5}),wB=!1}e.lencode=J2,e.lenbits=9,e.distcode=eI,e.distbits=5},jX=(e,t,n,r)=>{let a;const o=e.state;return o.window===null&&(o.wsize=1<=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>r&&(a=r),o.window.set(t.subarray(n-r,n-r+a),o.wnext),r-=a,r?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave{let n,r,a,o,i,s,c,u,d,f,p,g,m,b,v=0,y,h,S,C,x,E,I,R;const T=new Uint8Array(4);let _,$;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(zc(e)||!e.output||!e.input&&e.avail_in!==0)return Lo;n=e.state,n.mode===Ui&&(n.mode=X2),i=e.next_out,a=e.output,c=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,d=n.bits,f=s,p=c,R=Ec;e:for(;;)switch(n.mode){case My:if(n.wrap===0){n.mode=X2;break}for(;d<16;){if(s===0)break e;s--,u+=r[o++]<>>8&255,n.check=Ur(n.check,T,2,0),u=0,d=0,n.mode=Jj;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=er;break}if((u&15)!==Qj){e.msg="unknown compression method",n.mode=er;break}if(u>>>=4,d-=4,I=(u&15)+8,n.wbits===0&&(n.wbits=I),I>15||I>n.wbits){e.msg="invalid window size",n.mode=er;break}n.dmax=1<>8&1),n.flags&512&&n.wrap&4&&(T[0]=u&255,T[1]=u>>>8&255,n.check=Ur(n.check,T,2,0)),u=0,d=0,n.mode=eB;case eB:for(;d<32;){if(s===0)break e;s--,u+=r[o++]<>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,n.check=Ur(n.check,T,4,0)),u=0,d=0,n.mode=tB;case tB:for(;d<16;){if(s===0)break e;s--,u+=r[o++]<>8),n.flags&512&&n.wrap&4&&(T[0]=u&255,T[1]=u>>>8&255,n.check=Ur(n.check,T,2,0)),u=0,d=0,n.mode=nB;case nB:if(n.flags&1024){for(;d<16;){if(s===0)break e;s--,u+=r[o++]<>>8&255,n.check=Ur(n.check,T,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=rB;case rB:if(n.flags&1024&&(g=n.length,g>s&&(g=s),g&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+g),I)),n.flags&512&&n.wrap&4&&(n.check=Ur(n.check,r,g,o)),s-=g,o+=g,n.length-=g),n.length))break e;n.length=0,n.mode=aB;case aB:if(n.flags&2048){if(s===0)break e;g=0;do I=r[o+g++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I));while(I&&g>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Ui;break;case sB:for(;d<32;){if(s===0)break e;s--,u+=r[o++]<>>=d&7,d-=d&7,n.mode=Q2;break}for(;d<3;){if(s===0)break e;s--,u+=r[o++]<>>=1,d-=1,u&3){case 0:n.mode=lB;break;case 1:if(h9e(n),n.mode=Rh,t===Th){u>>>=2,d-=2;break e}break;case 2:n.mode=uB;break;case 3:e.msg="invalid block type",n.mode=er}u>>>=2,d-=2;break;case lB:for(u>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,u+=r[o++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=er;break}if(n.length=u&65535,u=0,d=0,n.mode=Z2,t===Th)break e;case Z2:n.mode=cB;case cB:if(g=n.length,g){if(g>s&&(g=s),g>c&&(g=c),g===0)break e;a.set(r.subarray(o,o+g),i),s-=g,o+=g,c-=g,i+=g,n.length-=g;break}n.mode=Ui;break;case uB:for(;d<14;){if(s===0)break e;s--,u+=r[o++]<>>=5,d-=5,n.ndist=(u&31)+1,u>>>=5,d-=5,n.ncode=(u&15)+4,u>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=er;break}n.have=0,n.mode=dB;case dB:for(;n.have>>=3,d-=3}for(;n.have<19;)n.lens[P[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,_={bits:n.lenbits},R=yp(o9e,n.lens,0,19,n.lencode,0,n.work,_),n.lenbits=_.bits,R){e.msg="invalid code lengths set",n.mode=er;break}n.have=0,n.mode=fB;case fB:for(;n.have>>24,h=v>>>16&255,S=v&65535,!(y<=d);){if(s===0)break e;s--,u+=r[o++]<>>=y,d-=y,n.lens[n.have++]=S;else{if(S===16){for($=y+2;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=y,d-=y,n.have===0){e.msg="invalid bit length repeat",n.mode=er;break}I=n.lens[n.have-1],g=3+(u&3),u>>>=2,d-=2}else if(S===17){for($=y+3;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=y,d-=y,I=0,g=3+(u&7),u>>>=3,d-=3}else{for($=y+7;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=y,d-=y,I=0,g=11+(u&127),u>>>=7,d-=7}if(n.have+g>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=er;break}for(;g--;)n.lens[n.have++]=I}}if(n.mode===er)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=er;break}if(n.lenbits=9,_={bits:n.lenbits},R=yp($X,n.lens,0,n.nlen,n.lencode,0,n.work,_),n.lenbits=_.bits,R){e.msg="invalid literal/lengths set",n.mode=er;break}if(n.distbits=6,n.distcode=n.distdyn,_={bits:n.distbits},R=yp(OX,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,_),n.distbits=_.bits,R){e.msg="invalid distances set",n.mode=er;break}if(n.mode=Rh,t===Th)break e;case Rh:n.mode=_h;case _h:if(s>=6&&c>=258){e.next_out=i,e.avail_out=c,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=d,Jze(e,p),i=e.next_out,a=e.output,c=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,d=n.bits,n.mode===Ui&&(n.back=-1);break}for(n.back=0;v=n.lencode[u&(1<>>24,h=v>>>16&255,S=v&65535,!(y<=d);){if(s===0)break e;s--,u+=r[o++]<>C)],y=v>>>24,h=v>>>16&255,S=v&65535,!(C+y<=d);){if(s===0)break e;s--,u+=r[o++]<>>=C,d-=C,n.back+=C}if(u>>>=y,d-=y,n.back+=y,n.length=S,h===0){n.mode=vB;break}if(h&32){n.back=-1,n.mode=Ui;break}if(h&64){e.msg="invalid literal/length code",n.mode=er;break}n.extra=h&15,n.mode=pB;case pB:if(n.extra){for($=n.extra;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=gB;case gB:for(;v=n.distcode[u&(1<>>24,h=v>>>16&255,S=v&65535,!(y<=d);){if(s===0)break e;s--,u+=r[o++]<>C)],y=v>>>24,h=v>>>16&255,S=v&65535,!(C+y<=d);){if(s===0)break e;s--,u+=r[o++]<>>=C,d-=C,n.back+=C}if(u>>>=y,d-=y,n.back+=y,h&64){e.msg="invalid distance code",n.mode=er;break}n.offset=S,n.extra=h&15,n.mode=mB;case mB:if(n.extra){for($=n.extra;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=er;break}n.mode=hB;case hB:if(c===0)break e;if(g=p-c,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=er;break}g>n.wnext?(g-=n.wnext,m=n.wsize-g):m=n.wnext-g,g>n.length&&(g=n.length),b=n.window}else b=a,m=i-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do a[i++]=b[m++];while(--g);n.length===0&&(n.mode=_h);break;case vB:if(c===0)break e;a[i++]=n.length,c--,n.mode=_h;break;case Q2:if(n.wrap){for(;d<32;){if(s===0)break e;s--,u|=r[o++]<{if(zc(e))return Lo;let t=e.state;return t.window&&(t.window=null),e.state=null,Ec},y9e=(e,t)=>{if(zc(e))return Lo;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Ec):Lo},S9e=(e,t)=>{const n=t.length;let r,a,o;return zc(e)||(r=e.state,r.wrap!==0&&r.mode!==Cb)?Lo:r.mode===Cb&&(a=1,a=yg(a,t,n,0),a!==r.check)?NX:(o=jX(e,t,n,n),o?(r.mode=AX,kX):(r.havedict=1,Ec))};var w9e=PX,x9e=LX,C9e=DX,E9e=m9e,I9e=FX,T9e=v9e,R9e=b9e,_9e=y9e,$9e=S9e,O9e="pako inflate (from Nodeca project)",Zi={inflateReset:w9e,inflateReset2:x9e,inflateResetKeep:C9e,inflateInit:E9e,inflateInit2:I9e,inflate:T9e,inflateEnd:R9e,inflateGetHeader:_9e,inflateSetDictionary:$9e,inflateInfo:O9e};function N9e(){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}var k9e=N9e;const BX=Object.prototype.toString,{Z_NO_FLUSH:A9e,Z_FINISH:M9e,Z_OK:xg,Z_STREAM_END:tI,Z_NEED_DICT:nI,Z_STREAM_ERROR:D9e,Z_DATA_ERROR:xB,Z_MEM_ERROR:P9e}=Zd;function gm(e){this.options=Ay.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new RX,this.strm.avail_out=0;let n=Zi.inflateInit2(this.strm,t.windowBits);if(n!==xg)throw new Error(xc[n]);if(this.header=new k9e,Zi.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wg.string2buf(t.dictionary):BX.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Zi.inflateSetDictionary(this.strm,t.dictionary),n!==xg)))throw new Error(xc[n])}gm.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,a=this.options.dictionary;let o,i,s;if(this.ended)return!1;for(t===~~t?i=t:i=t===!0?M9e:A9e,BX.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=Zi.inflate(n,i),o===nI&&a&&(o=Zi.inflateSetDictionary(n,a),o===xg?o=Zi.inflate(n,i):o===xB&&(o=nI));n.avail_in>0&&o===tI&&n.state.wrap>0&&e[n.next_in]!==0;)Zi.inflateReset(n),o=Zi.inflate(n,i);switch(o){case D9e:case xB:case nI:case P9e:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||o===tI))if(this.options.to==="string"){let c=wg.utf8border(n.output,n.next_out),u=n.next_out-c,d=wg.buf2string(n.output,c);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(c,c+u),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===xg&&s===0)){if(o===tI)return o=Zi.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};gm.prototype.onData=function(e){this.chunks.push(e)};gm.prototype.onEnd=function(e){e===xg&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ay.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ik(e,t){const n=new gm(t);if(n.push(e),n.err)throw n.msg||xc[n.err];return n.result}function L9e(e,t){return t=t||{},t.raw=!0,ik(e,t)}var F9e=gm,j9e=ik,B9e=L9e,z9e=ik,H9e=Zd,U9e={Inflate:F9e,inflate:j9e,inflateRaw:B9e,ungzip:z9e,constants:H9e};const{Deflate:gHe,deflate:V9e,deflateRaw:mHe,gzip:hHe}=Zze,{Inflate:W9e,inflate:vHe,inflateRaw:bHe,ungzip:yHe}=U9e;var G9e=V9e,q9e=W9e;class cv{constructor(t,n=!1,r=!0){this.device=t,this.tracing=n,this.slipReaderEnabled=!1,this.leftOver=new Uint8Array(0),this.baudrate=0,this.traceLog="",this.lastTraceTime=Date.now(),this._DTR_state=!1,this.slipReaderEnabled=r}getInfo(){const t=this.device.getInfo();return t.usbVendorId&&t.usbProductId?`WebSerial VendorID 0x${t.usbVendorId.toString(16)} ProductID 0x${t.usbProductId.toString(16)}`:""}getPid(){return this.device.getInfo().usbProductId}trace(t){const a=`${`TRACE ${(Date.now()-this.lastTraceTime).toFixed(3)}`} ${t}`;console.log(a),this.traceLog+=a+` + `),n.append(a.name,new Blob([h.buffer]),`pcmData.${r.indexOf(a)}.pcm`),e(void 0)}catch(c){t(c)}},i.onerror=()=>{t("Failed to read the file")},a.file&&i.readAsArrayBuffer(a.file)}const VBe=e=>Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&"),wh=new _n(Sn()),{useToken:WBe}=go,Ts={id:"1",pId:"-1",value:"1",title:"/"},xh=99,GBe=()=>{const{t:e}=zt(),{token:t}=WBe(),[n,r]=Xe.useMessage(),[a,o]=l.useState(!1),[i,s]=l.useState([]),[c,u]=l.useState(!1),[d,f]=l.useState(!1),[p,g]=l.useState(""),[m,b]=l.useState(Ts.id),[v,y]=l.useState([Ts]),[h,S]=l.useState(!1),[C,x]=l.useState(""),[E,I]=l.useState(!1),[R,T]=l.useState(!1),_=l.useRef(null);let $=0;l.useEffect(()=>{(async()=>{const q=new _n(Sn());let Y=!1;try{const Z=await q.apiGetTeddyCloudSettingRaw("debug.web.pcm_encode_console_url");if(!Z.ok)throw new Error(`HTTP error! status: ${Z.status}`);Y=(await Z.json()).toString()==="true"}catch(Z){console.error("Error fetching debug.web.pcm_encode_console_url: ",Z)}o(Y)})(),(async()=>{const q=L(Ts.id);wh.apiGetTeddyCloudApiRaw(`/api/fileIndexV2?path=${q}&special=library`).then(Y=>Y.json()).then(Y=>{var Z=Y.files;Z=Z.filter(J=>J.isDir&&J.name!=="..").sort((J,ee)=>J.name===ee.name?0:J.name.toLowerCase()>ee.name.toLowerCase()?1:-1).map(J=>({id:Ts.id+"."+Z.indexOf(J),pId:Ts.id,value:Ts.id+"."+Z.indexOf(J),title:J.name})),y(v.concat(Z))})})()},[]),l.useEffect(()=>{h&&setTimeout(()=>{_.current&&_.current.focus()},0)},[h]),l.useEffect(()=>{$=i.length},[i]);const P=PY(_y,{activationConstraint:{distance:10}}),D=({active:G,over:V})=>{G.id!==(V==null?void 0:V.id)&&s(q=>{const Y=q.findIndex(J=>J.uid===G.id),Z=q.findIndex(J=>J.uid===(V==null?void 0:V.id));return Ny(q,Y,Z)})},A=({fileList:G})=>{$++,$>xh&&n.open({type:"error",content:e("tonies.encoder.maxFiles",{maxFiles:xh})}),s(G.slice(0,xh))},O=G=>{const V=i.indexOf(G),q=i.slice();q.splice(V,1),s(q)},N=async()=>{u(!0);const G=new FormData;for(const ee of i)try{await new Promise((le,de)=>UBe(le,de,G,i,ee,a))}catch(le){Xe.error(e("tonies.encoder.errorFileProcessing")+" "+le),u(!1);return}const V=Math.floor(Date.now()/1e3),q={name:p+".taf",audioId:V-1342177280,path:L(m),special:"library"};f(!0);const Y=VBe(q),Z=await wh.apiPostTeddyCloudFormDataRaw(`/api/pcmUpload?${Y}`,G),J=await Z.text();Z.ok?(Xe.success(e("tonies.encoder.uploadSuccessful")),s([]),g(""),y([Ts]),b(Ts.id)):(console.log("Upload failed:",J),Xe.error(e("tonies.encoder.uploadFailed"))),f(!1),u(!1)},k={listType:"picture",multiple:!0,beforeUpload:G=>{const V=G;return V.file=G,i.push(V),s(i),!1},fileList:i,onChange:A,itemRender:(G,V)=>w.jsx(HBe,{originNode:G,fileList:i,file:V,onRemove:O,disabled:c})},M=({id:G})=>new Promise((V,q)=>{const Y=L(G);wh.apiGetTeddyCloudApiRaw(`/api/fileIndexV2?path=${Y}&special=library`).then(Z=>Z.json()).then(Z=>{let J=Z.files;J=J.filter(ee=>ee.isDir&&ee.name!=="..").sort((ee,le)=>ee.name===le.name?0:ee.name.toLowerCase()>le.name.toLowerCase()?1:-1).map(ee=>({id:G+"."+J.indexOf(ee),pId:G,value:G+"."+J.indexOf(ee),title:ee.name})),y(v.concat(J)),V(!0)}).then(()=>{q()})}),L=G=>{const V=v.filter(q=>q.value===G)[0];return V.pId==="-1"?"":L(v.filter(q=>q.id===V.pId)[0].id)+"/"+V.title},F=()=>{s(G=>[...G].sort((V,q)=>V.name.localeCompare(q.name)))},j=()=>{s([])},B=()=>{S(!0)},z=G=>{T(!ku(G.target.value.toString())),x(G.target.value)},H=()=>{const G=L(m),V=`${m}.${v.length}`,q={id:V,pId:m,value:V,title:C};try{wh.apiPostTeddyCloudRaw("/api/dirCreate?special=library",G+"/"+C).then(Y=>Y.text()).then(Y=>{if(Y!=="OK")throw new Error(Y);y([...v,q].sort((Z,J)=>Z.title===J.title?0:Z.title.toLowerCase()>J.title.toLowerCase()?1:-1)),b(V),Xe.success(e("fileBrowser.createDirectory.directoryCreated")),S(!1),x("")}).catch(Y=>{Xe.error(Y.message)})}catch{Xe.error("Error while creating directory")}},U=()=>{S(!1),x(""),T(!1)},te=w.jsxs(En,{title:e("fileBrowser.createDirectory.modalTitle"),open:h,onCancel:U,onOk:H,okText:e("fileBrowser.createDirectory.create"),cancelText:e("fileBrowser.createDirectory.cancel"),okButtonProps:{disabled:R},children:[w.jsxs("p",{children:[e("fileBrowser.createDirectory.inDirectory")," ",w.jsxs("b",{children:[L(m),"/"]})]}),w.jsx(Zt.Item,{validateStatus:R?"error":"",help:R?e("inputValidator.invalidCharactersDetected",{invalidChar:hp}):"",required:!0,children:w.jsx(en,{ref:_,autoFocus:!0,placeholder:e("fileBrowser.createDirectory.placeholder"),value:C,status:R?"error":"",onChange:z})})]}),X=G=>{const V=G.target.value;I(!ku(V)),g(V)};return w.jsxs(w.Fragment,{children:[r,w.jsx(ur,{children:w.jsx(Do,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Do,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("tonies.navigationTitle")},{title:e("tonies.encoder.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("tonies.encoder.title")}),w.jsxs(Ea,{direction:"vertical",style:{display:"flex"},children:[w.jsx(XY,{sensors:[P],onDragEnd:D,children:w.jsx(tX,{items:i.map(G=>G.uid),strategy:QY,disabled:c,children:w.jsxs(Jg.Dragger,{...k,disabled:c,children:[w.jsx("p",{className:"ant-upload-drag-icon",children:w.jsx(NO,{})}),w.jsx("p",{className:"ant-upload-text",children:e("tonies.encoder.uploadText",{maxFiles:xh})}),w.jsx("p",{className:"ant-upload-hint",children:e("tonies.encoder.uploadHint")})]})})}),i.length>0?w.jsxs(w.Fragment,{children:[w.jsxs(Ea,{direction:"horizontal",style:{width:"100%",display:"flex",alignItems:"flex-start",flexWrap:"wrap"},children:[w.jsx(_t,{type:"default",disabled:c,onClick:F,children:e("tonies.encoder.sortAlphabetically")}),w.jsx(_t,{type:"default",disabled:c,style:{marginRight:16},onClick:j,children:e("tonies.encoder.clearList")})]}),w.jsx(ra,{}),w.jsx("div",{style:{width:"100%"},className:"encoder",children:w.jsxs(Ea,{direction:"vertical",style:{width:"100%"},children:[w.jsxs(Ea.Compact,{direction:"horizontal",style:{width:"100%",display:"flex",alignItems:"flex-end",justifyContent:"flex-end"},children:[w.jsx(en,{type:"text",style:{maxWidth:180,borderTopRightRadius:0,borderBottomRightRadius:0},disabled:!0,value:e("tonies.encoder.saveAs")}),w.jsx(xl,{treeLine:!0,treeDataSimpleMode:!0,disabled:c,style:{maxWidth:250},value:m,dropdownStyle:{maxHeight:400,overflow:"auto"},onChange:b,loadData:M,treeData:v}),w.jsx(Qt,{title:e("fileBrowser.createDirectory.createDirectory"),children:w.jsx(_t,{disabled:c,icon:w.jsx(yR,{}),onClick:B,style:{borderRadius:0}})}),w.jsx(en,{addonAfter:".taf",required:!0,style:{maxWidth:300},status:i.length>0&&p===""||E?"error":"",onChange:X,disabled:c})]}),E?w.jsx("div",{style:{textAlign:"end",color:t.colorErrorText},children:e("inputValidator.invalidCharactersDetected",{invalidChar:hp})}):"",w.jsx(Ea.Compact,{style:{display:"flex",justifyContent:"flex-end",marginTop:"8px"},children:w.jsx(_t,{type:"primary",onClick:N,disabled:i.length===0||p===""||E,loading:c,children:e(c?d?"tonies.encoder.processing":"tonies.encoder.uploading":"tonies.encoder.upload")})})]})})]}):w.jsx(w.Fragment,{})]})]})]}),te]})},{Paragraph:qBe}=$n,KBe=()=>{const{t:e}=zt(),[t,n]=l.useState(!1),r=a=>{console.log("Received values of form: ",a),n(!1)};return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Do,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Do,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("tonies.navigationTitle")},{title:e("tonies.tap.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("tonies.tap.title")}),w.jsx(Sr,{message:e("settings.information"),description:w.jsx("div",{children:"Development still in progress - Please be patient or support implementation of this feature!"}),type:"info",showIcon:!0,style:{marginBottom:8}}),w.jsx(JN,{special:"library",filetypeFilter:[".tap"],showColumns:["picture","name","size","date","controls"],isTapList:!0}),w.jsx(qBe,{children:w.jsxs("div",{children:[w.jsx(_t,{type:"primary",style:{marginTop:8},onClick:()=>{n(!0)},children:e("tonies.tapEditor.titleCreate")}),w.jsx(kY,{open:t,onCreate:r,onCancel:()=>{n(!1)}})]})})]})]})]})},Ch=new _n(Sn()),YBe=({overlay:e})=>{var d;const[t,n]=l.useState(),{t:r}=zt(),[a,o]=l.useState(""),[i,s]=l.useState(!1);l.useEffect(()=>{(async()=>{try{const p=await Ch.apiGetTeddyCloudSettingRaw("core.settings_level");if(!p.ok)throw new Error(`HTTP error! status: ${p.status}`);const g=await p.json();o(g.toString())}catch(p){console.error("Error fetching settings level: ",p)}})()},[]),l.useEffect(()=>{(async()=>{var g,m;s(!0);const p=await Ch.apiGetIndexGet(e);(g=p==null?void 0:p.options)!=null&&g.length&&((m=p==null?void 0:p.options)==null?void 0:m.length)>0&&n(p),s(!1)})()},[e,a]);const c=async()=>{try{await Ch.apiTriggerWriteConfigGet()}catch{Xe.error("Error while saving config to file.")}},u=async f=>{try{await Ch.apiPostTeddyCloudSetting("core.settings_level",f),c(),o(f)}catch{Xe.error("Error while sending data to server.")}};return w.jsxs(w.Fragment,{children:[w.jsx(Sr,{message:r("settings.warning"),description:w.jsx("div",{children:r("settings.warningHint")}),type:"warning",showIcon:!0,style:{margin:"8px"}}),w.jsx(ra,{children:r("settings.title")}),w.jsx(KK,{initialValues:{test:"test"},onSubmit:f=>{},children:w.jsx(Zt,{labelCol:{span:8},wrapperCol:{span:14},layout:"horizontal",children:(d=t==null?void 0:t.options)==null?void 0:d.map((f,p,g)=>{if(f.iD.includes("core.settings_level")||!f.iD.includes("core.certdir")&&!f.iD.includes("core.client_cert.")&&!f.iD.includes("core.flex_")&&!f.iD.includes("core.contentdir")&&!f.iD.includes("toniebox.")&&!f.iD.includes("cloud.enabled")&&!f.iD.includes("cloud.enableV1Claim")&&!f.iD.includes("cloud.enableV1CloudReset")&&!f.iD.includes("cloud.enableV1FreshnessCheck")&&!f.iD.includes("cloud.enableV1Log")&&!f.iD.includes("cloud.enableV1Time")&&!f.iD.includes("cloud.enableV1Ota")&&!f.iD.includes("cloud.enableV2Content")&&!f.iD.includes("cloud.cacheOta")&&!f.iD.includes("cloud.localOta")&&!f.iD.includes("cloud.cacheContent")&&!f.iD.includes("cloud.cacheToLibrary")&&!f.iD.includes("cloud.markCustomTagByPass")&&!f.iD.includes("cloud.prioCustomContent")&&!f.iD.includes("cloud.updateOnLowerAudioId")&&!f.iD.includes("cloud.dumpRuidAuthContentJson"))return null;const m=f.iD.split("."),b=g[p-1]?g[p-1].iD.split("."):[];return w.jsxs(ce.Fragment,{children:[m.slice(0,-1).map((v,y)=>b[y]!==v?y===0?w.jsxs("h3",{style:{marginLeft:`${y*20}px`,marginBottom:"10px"},children:["Category ",v]},`category-${v}`):w.jsxs("h4",{style:{marginLeft:`${y*10}px`,marginTop:"10px",marginBottom:"10px"},children:[".",v]},`category-${v}`):null),w.jsx(YK,{option:f,overlayId:e},`option-item-${f.iD}`)]},`option-${f.iD}`)})})}),w.jsx(ra,{children:r("settings.levelLabel")}),w.jsxs(ao.Group,{value:a,onChange:f=>u(f.target.value),style:{display:"flex",justifyContent:"center",marginTop:8},disabled:i,children:[w.jsx(ao.Button,{value:"1",children:"Basic"}),w.jsx(ao.Button,{value:"2",children:"Detail"}),w.jsx(ao.Button,{value:"3",children:"Expert"})]})]})},kj=new _n(Sn());function oX(){const[e,t]=l.useState([]);return l.useEffect(()=>{async function n(){var r=[];try{const i=await(await kj.apiGetTeddyCloudApiRaw("/api/tonieboxesJson")).json();r=[...r,...i]}catch(o){console.error("Error fetching and transforming toniebox data:",o)}try{const i=await(await kj.apiGetTeddyCloudApiRaw("/api/tonieboxesCustomJson")).json();r=[...r,...i]}catch(o){console.error("Error fetching and transforming custom toniebox data:",o)}const a=r.map(o=>({id:o.id,name:o.name,img_src:o.img_src,crop:o.crop||null}));t(a)}n()},[]),e}const fa=new _n(Sn()),{Paragraph:z2,Text:XBe}=$n,{Meta:ZBe}=Fd,{useToken:QBe}=go,JBe=({tonieboxCard:e,tonieboxImages:t})=>{var Ce,ye,ke,nt,Me;const{t:n}=zt(),{token:r}=QBe(),[a,o]=Xe.useMessage(),[i,s]=l.useState(!1),[c,u]=l.useState(""),[d,f]=l.useState(""),[p,g]=l.useState(""),[m,b]=l.useState(!1),[v,y]=l.useState(null),[h,S]=l.useState(),[C,x]=l.useState(!1),[E,I]=l.useState(!1),[R,T]=l.useState(!1),[_,$]=l.useState(e.boxModel),[P,D]=l.useState(e.boxModel),[A,O]=l.useState(e.boxName),[N,k]=l.useState(e.boxName),[M,L]=l.useState(null),[F,j]=l.useState(!1),[B,z]=l.useState(!0),[H,U]=l.useState(0);l.useEffect(()=>{(async()=>{const Oe=await fa.apiGetTonieboxApiAccess(e.ID);z(Oe)})()},[e.ID,C]),l.useEffect(()=>{(async()=>{const He=await fa.apiGetTonieboxStatus(e.ID);s(He)})(),(async()=>{const He=await fa.apiGetTonieboxVersion(e.ID),ze={0:"UNKNOWN",1:"CC3200",2:"CC3235",3:"ESP32"};if(He in ze){const Ye=ze[He];u(Ye)}else u("UNKNOWN")})(),(async()=>{const He=await fa.apiGetTonieboxLastRUID(e.ID);if(He!=="ffffffffffffffff"&&He!==""){const ze=await fa.apiGetTonieboxLastRUIDTime(e.ID);(async()=>{const Fe=await fa.apiGetTagIndex(e.ID);V(Fe.filter(Qe=>Qe.ruid===He),ze)})()}})(),i||(async()=>{const ze=await fa.apiGetLastOnline(e.ID);f(ze)})(),(async()=>{const ze=await(await fa.apiGetTeddyCloudSettingRaw("internal.ip",e.ID)).text();g(ze)})(),G(e.boxModel),D(e.boxModel)},[e.ID,e.boxModel]),l.useEffect(()=>{if(p&&c==="CC3200")try{fetch(`http://${p}/api/ajax?cmd=box-battery&sub=stats`).then(xe=>xe.text()).then(xe=>{console.log("Battery Stats fetched --> assume CFW active"),b(!0)}).catch(xe=>{console.log("No Battery Stats fetched --> assume CFW not active"),b(!1)})}catch{console.log("No Battery Stats fetched --> assume CFW not active"),b(!1)}},[p,c]);const te=oX(),X=[{label:n("tonieboxes.editModelModal.unsetBoxName"),value:"-1"}].concat(te.map(xe=>({label:xe.name,value:xe.id}))),G=xe=>{const Oe=t.find(je=>je.id===xe);L(Oe?w.jsx("img",{src:Oe.img_src,alt:"",style:{...ie(xe),position:"absolute",top:"0",left:"0"}}):w.jsx("img",{src:"https://cdn.tonies.de/thumbnails/03-0009-i.png",alt:"",style:{filter:"opacity(0.20)",width:"100%",height:"auto",position:"absolute",top:"0",left:"0"}}))},V=(xe,Oe)=>{y(w.jsx(w.Fragment,{children:w.jsx(Mt,{to:"/tonies?tonieRUID="+xe[0].ruid+"&overlay="+e.ID,children:w.jsx(Qt,{placement:"top",zIndex:2,title:n("tonieboxes.lastPlayedTonie")+xe[0].tonieInfo.series+(xe[0].tonieInfo.episode?" - "+xe[0].tonieInfo.episode:"")+(Oe?" ("+Oe+")":""),children:w.jsx("img",{src:xe[0].tonieInfo.picture,alt:"Tonie",style:{position:"absolute",bottom:0,right:0,zIndex:1,padding:8,borderRadius:4,height:"60%"}})})})}))},q=()=>{(async()=>{var je,qe;const Oe=await fa.apiGetIndexGet(e.ID);(je=Oe==null?void 0:Oe.options)!=null&&je.length&&((qe=Oe==null?void 0:Oe.options)==null?void 0:qe.length)>0&&S(Oe)})(),Y()},Y=()=>{I(!0)},Z=async()=>{I(!1)},J=()=>{I(!1)},ee=()=>{x(!0)},le=async()=>{x(!1)},de=()=>{x(!1)},ge=()=>{U(xe=>xe+1),ee()},fe=()=>{D(P===void 0?_:P),T(!0)},Ee=()=>{D(_),k(N),O(N),T(!1)},be=async()=>{G(P),$(P);const xe=async()=>{await fa.apiTriggerWriteConfigGet()};try{fa.apiPostTeddyCloudSetting("boxModel",P,e.ID).then(()=>{xe()}).catch(Oe=>{Xe.error(n("tonieboxes.editModelModal.errorWhileSavingConfig"))}),Xe.success(n("tonieboxes.editModelModal.successOnModelChange"))}catch(Oe){Xe.error(n("tonieboxes.editModelModal.errorOnModelChange",{error:Oe}))}},he=async()=>{k(A);const xe=async()=>{await fa.apiTriggerWriteConfigGet()};try{fa.apiPostTeddyCloudSetting("boxName",A.toString(),e.ID).then(()=>{xe()}).catch(Oe=>{Xe.error(n("tonieboxes.editModelModal.errorWhileSavingConfig"))}),Xe.success(n("tonieboxes.editModelModal.successOnNameChange"))}catch(Oe){Xe.error(n("tonieboxes.editModelModal.errorOnNameChange",{error:Oe}))}},ie=xe=>{const Oe=t.find(je=>je.id===xe);if(Oe&&Oe.crop){const[je,qe,He]=Oe.crop;return{width:"100%",height:"auto",transform:`scale(${He}) translateX(${je}px) translateY(${qe}px)`}}else return{width:"100%",height:"auto"}},ne=()=>e.ID.replace(/(.{2})(?=.)/g,"$1:"),oe=async()=>{T(!1),A!==N&&he(),_!==P&&be()},ae=w.jsx(w.Fragment,{children:w.jsxs(_t,{type:"primary",onClick:oe,disabled:A===N&&_===P,children:[w.jsx(AG,{},"saveClick")," ",n("tonies.editModal.save")]})}),ue=w.jsxs(En,{title:w.jsx(w.Fragment,{children:w.jsxs("h3",{children:[n("tonieboxes.editModelModal.editModel",{name:e.boxName}),w.jsx("br",{}),w.jsx(XBe,{type:"secondary",children:(c!=="UNKNOWN"?c:"MAC")+": "+ne()})]})}),open:R,footer:ae,onCancel:Ee,children:[w.jsx(ra,{orientation:"left",orientationMargin:"0",children:n("tonieboxes.editModelModal.name")}),w.jsx(z2,{children:w.jsx(en,{name:"boxName",value:A,onChange:xe=>O(xe.target.value),addonBefore:w.jsx(ba,{onClick:()=>O(N),style:{color:A===N?r.colorTextDisabled:r.colorText,cursor:A===N?"default":"pointer"}})})}),w.jsx(ra,{orientation:"left",orientationMargin:"0",children:n("tonieboxes.editModelModal.model")}),w.jsx(z2,{children:w.jsx(Nr,{options:X,value:P,onChange:xe=>D(xe)})})]}),Se=w.jsxs(En,{title:n("tonieboxes.uploadTonieboxCertificatesModal.uploadTonieboxCertificates",{name:e.boxName}),open:E,onOk:Z,onCancel:J,children:[w.jsxs(z2,{children:[n("tonieboxes.uploadTonieboxCertificatesModal.uploadPath")," ",w.jsx("i",{children:(ye=(Ce=h==null?void 0:h.options)==null?void 0:Ce.find(xe=>xe.iD==="core.certdir"))==null?void 0:ye.value})," ",w.jsx("small",{children:(nt=(ke=h==null?void 0:h.options)==null?void 0:ke.find(xe=>xe.iD==="core.certdir"))!=null&&nt.overlayed?n("tonieboxes.uploadTonieboxCertificatesModal.boxSpecific"):n("tonieboxes.uploadTonieboxCertificatesModal.AttentionGeneralPath")})]}),w.jsx(OY,{overlay:e.ID})]}),Te=w.jsx(En,{title:n("tonieboxes.editTonieboxSettingsModal.editTonieboxSettings",{name:e.boxName}),width:"auto",open:C,onOk:le,onCancel:de,children:w.jsx(YBe,{overlay:e.ID},H)}),Le=()=>{try{a.open({type:"loading",content:n("tonieboxes.messages.deleting"),duration:0}),fa.apiPostTeddyCloudSetting("removeOverlay",null,e.ID).then(xe=>xe.text()).then(xe=>{a.destroy(),xe==="OK"?(a.open({type:"success",content:n("tonieboxes.messages.deleteSuccessful")}),window.location.reload()):a.open({type:"error",content:n("tonieboxes.messages.deleteFailed")+xe})}).catch(xe=>{a.destroy(),a.open({type:"error",content:n("tonieboxes.messages.deleteFailed")+xe})})}catch(xe){a.destroy(),a.open({type:"error",content:n("tonieboxes.messages.deleteFailed")+xe})}},_e=()=>{j(!0)},Re=()=>{Le(),j(!1)},Pe=()=>{j(!1)},$e=w.jsx(yd,{title:n("tonieboxes.confirmDeleteModal"),open:F,okText:n("tonieboxes.delete"),cancelText:n("tonieboxes.cancel"),content:n("tonieboxes.confirmDeleteDialog",{tonieboxToDelete:N}),handleOk:Re,handleCancel:Pe}),ve=async()=>{try{await fa.apiTriggerWriteConfigGet()}catch{Xe.error("Error while saving config to file.")}},Ne=async()=>{try{fa.apiPostTeddyCloudSetting("toniebox.api_access",!B,e.ID).then(()=>{ve(),z(!B),B?Xe.success(n("tonieboxes.messages.apiAccessDisabled")):Xe.success(n("tonieboxes.messages.apiAccessEnabled"))}).catch(xe=>{throw new Error(xe.status+" "+xe.statusText)})}catch(xe){Xe.error(n("tonieboxes.messages.apiAccessNotChangedError")+xe)}};return w.jsxs(w.Fragment,{children:[o,w.jsx(Fd,{hoverable:!1,size:"default",style:{background:r.colorBgContainerDisabled,cursor:"default"},title:w.jsx("span",{children:N}),cover:w.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[v,w.jsx("img",{src:(Me=t.find(xe=>xe.id==="03-0009"))==null?void 0:Me.img_src,alt:"",style:{position:"relative",filter:"opacity(0)",width:"100%",height:"auto"}}),M]}),actions:[w.jsx(w.Fragment,{children:B?i?w.jsx(Qt,{title:n("tonieboxes.online"),children:w.jsx(SR,{style:{color:"green",cursor:"default"}})}):w.jsx(Qt,{title:n("tonieboxes.offline")+(d?" - "+n("tonieboxes.lastOnline")+": "+d:""),children:w.jsx(SR,{style:{color:r.colorTextDescription,cursor:"default"}})}):w.jsx(Qt,{title:n("tonieboxes.accessApiDisabled"),children:w.jsx(uwe,{style:{color:"red",cursor:"pointer"},onClick:Ne})})}),w.jsx(ag,{onClick:()=>fe()},"edit"),w.jsx(kO,{style:{marginRight:8},onClick:q},"certificate"),w.jsx(AO,{style:{marginRight:8},onClick:ge},"edit"),w.jsx(ud,{style:{marginRight:8},onClick:_e},"delete")],children:w.jsx(ZBe,{description:[(c!=="UNKNOWN"&&c!==void 0&&c!==null?c:"MAC")+" ",m?w.jsx(Qt,{title:n("tonieboxes.linkToBoxCFW"),children:w.jsxs(Mt,{to:"http://"+p,target:"_blank",children:[ne()," ",w.jsx(swe,{})]})}):ne()]})}),Te,Se,ue,$e]})},e7e=({tonieboxCards:e})=>{const[t,n]=l.useState(!0),r=oX();return r.length===0&&t?w.jsx("div",{children:"Loading..."}):w.jsx(ll,{grid:{gutter:16,xs:1,sm:2,md:2,lg:3,xl:3,xxl:4},dataSource:e,renderItem:a=>w.jsx(ll.Item,{id:a.ID,children:w.jsx(JBe,{tonieboxCard:a,tonieboxImages:r})})})},t7e=()=>w.jsx("svg",{version:"1.0",xmlns:"http://www.w3.org/2000/svg",width:"12.000000pt",height:"12.000000pt",viewBox:"0 0 900.000000 900.000000",preserveAspectRatio:"xMidYMid meet",children:w.jsxs("g",{transform:"translate(0.000000,900.000000) scale(0.100000,-0.100000)",fill:"currentColor",stroke:"none",children:[w.jsx("path",{d:"M5895 8380 c-4 -6 -21 -16 -38 -24 -60 -25 -301 -236 -416 -363 -42 -46 -101 -103 -131 -127 -30 -24 -116 -104 -190 -177 -75 -74 -167 -163 -205 -199 -39 -36 -132 -124 -208 -195 -186 -175 -194 -179 -368 -195 -138 -13 -274 -10 -303 7 -45 25 -385 357 -446 434 -65 84 -279 313 -345 369 -17 14 -58 40 -91 58 -59 31 -67 32 -177 32 -87 0 -117 -3 -127 -14 -6 -8 -23 -16 -37 -18 -28 -3 -61 -47 -62 -83 -1 -12 -5 -25 -10 -30 -5 -6 -28 -64 -50 -130 -51 -151 -94 -274 -121 -345 -12 -30 -32 -86 -45 -125 -13 -38 -38 -108 -54 -154 -17 -46 -31 -85 -31 -87 0 -2 -181 -4 -402 -4 -362 0 -410 -2 -473 -19 -93 -25 -147 -55 -209 -117 -62 -62 -92 -116 -117 -209 -18 -68 -19 -160 -19 -2724 0 -2915 -4 -2713 58 -2836 31 -62 127 -155 189 -185 109 -52 -33 -49 2843 -49 2835 0 2752 -2 2840 44 111 57 194 152 230 266 20 61 20 110 20 2759 0 2673 0 2697 -20 2755 -50 147 -153 247 -300 294 -33 10 -131 15 -370 20 l-325 6 -2 50 c-9 210 -37 703 -49 855 -8 102 -14 239 -14 306 0 171 9 164 -233 164 -115 0 -188 -4 -192 -10z m-1 -652 c3 -13 6 -68 6 -123 0 -55 7 -174 15 -265 8 -91 15 -202 15 -247 l0 -83 -420 0 c-356 0 -420 2 -420 14 0 8 4 16 9 18 5 2 34 26 63 53 29 28 118 111 198 185 147 137 229 213 402 378 53 51 103 92 111 92 8 0 17 -10 21 -22z m-2697 -470 c65 -61 146 -138 181 -171 34 -32 62 -63 62 -68 0 -5 -107 -9 -255 -9 -169 0 -255 3 -255 10 0 10 30 104 49 152 18 47 40 104 56 151 9 26 23 47 31 47 7 0 66 -50 131 -112z m3746 -698 c16 0 17 -130 15 -2622 l-3 -2623 -2642 -3 -2643 -2 -2 2617 c-2 1850 0 2620 8 2627 7 8 777 10 2630 9 1440 -2 2627 -3 2637 -3z"}),w.jsx("path",{d:"M5735 6087 c-54 -22 -72 -36 -104 -83 -27 -41 -31 -57 -31 -111 0 -129 77 -205 206 -205 90 0 154 42 188 126 66 160 -100 335 -259 273z"}),w.jsx("path",{d:"M2842 5359 c-52 -16 -118 -90 -132 -148 -36 -150 102 -286 252 -250 61 14 129 75 148 134 29 86 -9 195 -83 242 -45 29 -131 39 -185 22z"}),w.jsx("path",{d:"M5035 5362 c-90 -32 -145 -106 -145 -197 0 -96 68 -183 161 -205 39 -10 57 -9 101 4 63 19 75 28 116 85 28 39 32 52 32 110 0 120 -72 199 -186 206 -32 2 -68 1 -79 -3z"}),w.jsx("path",{d:"M5730 5359 c-85 -36 -130 -105 -130 -202 0 -56 4 -70 32 -108 40 -56 52 -65 112 -85 43 -15 57 -15 100 -4 235 59 212 392 -28 406 -33 2 -72 -1 -86 -7z"}),w.jsx("path",{d:"M2818 4620 c-48 -26 -93 -82 -108 -135 -29 -103 38 -216 147 -250 54 -17 58 -17 112 0 36 12 69 33 93 57 92 94 68 260 -47 325 -52 29 -144 31 -197 3z"}),w.jsx("path",{d:"M3506 4609 c-150 -100 -116 -315 59 -375 54 -18 56 -18 109 0 89 30 156 116 156 199 0 73 -68 172 -137 198 -13 5 -50 9 -82 9 -48 0 -66 -5 -105 -31z"}),w.jsx("path",{d:"M4258 4610 c-152 -101 -119 -316 57 -376 54 -18 56 -18 109 0 89 31 156 116 156 200 0 73 -66 170 -133 195 -16 6 -54 11 -86 11 -47 0 -66 -5 -103 -30z"}),w.jsx("path",{d:"M4984 4607 c-149 -103 -115 -318 60 -373 55 -17 59 -17 111 0 52 18 92 51 128 106 22 33 23 140 1 183 -40 78 -103 117 -193 117 -50 0 -66 -5 -107 -33z"}),w.jsx("path",{d:"M5715 4623 c-79 -41 -115 -103 -115 -195 0 -42 6 -72 17 -88 36 -55 76 -88 129 -106 53 -18 55 -18 109 1 121 41 182 154 143 266 -15 46 -42 79 -90 112 -34 22 -52 27 -102 27 -36 -1 -74 -7 -91 -17z"}),w.jsx("path",{d:"M2841 3901 c-60 -24 -107 -74 -127 -134 -15 -44 -15 -57 -4 -101 41 -161 208 -217 339 -114 48 37 65 78 66 155 0 63 -3 76 -30 115 -34 49 -120 98 -169 97 -17 0 -51 -8 -75 -18z"}),w.jsx("path",{d:"M3532 3894 c-162 -80 -161 -292 0 -375 46 -24 127 -25 171 -3 73 37 127 119 127 193 -1 77 -59 158 -138 192 -59 26 -98 24 -160 -7z"}),w.jsx("path",{d:"M4279 3892 c-99 -51 -148 -176 -103 -265 86 -170 309 -169 385 2 35 80 19 159 -47 225 -36 35 -105 66 -149 66 -18 0 -57 -13 -86 -28z"}),w.jsx("path",{d:"M5015 3896 c-60 -28 -94 -63 -112 -114 -28 -81 -10 -163 48 -220 104 -102 265 -77 330 50 22 42 26 146 8 181 -34 65 -128 127 -193 127 -17 0 -53 -11 -81 -24z"}),w.jsx("path",{d:"M5727 3901 c-45 -21 -93 -65 -113 -103 -21 -40 -18 -141 5 -186 37 -72 102 -112 181 -112 151 0 251 153 191 292 -23 52 -52 80 -111 107 -54 25 -102 25 -153 2z"}),w.jsx("path",{d:"M2855 3201 c-70 -17 -128 -80 -146 -159 -25 -105 47 -216 156 -242 49 -12 62 -11 110 4 148 46 194 226 86 337 -60 62 -122 80 -206 60z"}),w.jsx("path",{d:"M3546 3196 c-181 -67 -179 -326 3 -391 69 -24 127 -15 194 29 44 29 87 112 87 166 -1 59 -43 136 -95 172 -50 34 -132 45 -189 24z"}),w.jsx("path",{d:"M4296 3196 c-145 -54 -180 -230 -69 -348 27 -29 99 -58 142 -58 71 1 142 46 182 114 38 67 38 123 1 191 -51 93 -161 136 -256 101z"}),w.jsx("path",{d:"M5038 3203 c-36 -6 -115 -77 -133 -120 -45 -107 14 -239 124 -278 52 -18 84 -19 131 -2 49 17 72 35 108 86 28 39 32 52 32 110 0 80 -26 132 -85 173 -41 28 -117 42 -177 31z"}),w.jsx("path",{d:"M5737 3200 c-44 -14 -95 -58 -117 -100 -31 -61 -28 -153 8 -207 36 -55 69 -80 126 -95 129 -34 261 76 253 212 -4 71 -21 104 -78 152 -38 32 -54 39 -105 43 -32 2 -72 0 -87 -5z"}),w.jsx("path",{d:"M3535 2463 c-44 -23 -84 -63 -106 -105 -48 -94 -2 -219 100 -270 64 -33 103 -35 163 -9 79 34 137 115 138 192 0 74 -54 156 -127 193 -41 20 -129 20 -168 -1z"}),w.jsx("path",{d:"M4285 2463 c-44 -23 -84 -63 -106 -105 -48 -94 -2 -219 100 -270 64 -33 103 -35 163 -9 79 34 137 115 138 192 0 74 -54 156 -127 193 -41 20 -129 20 -168 -1z"}),w.jsx("path",{d:"M5012 2463 c-69 -38 -104 -83 -123 -162 -10 -46 20 -134 61 -176 32 -33 107 -65 151 -65 61 0 156 64 188 127 6 12 11 49 11 83 0 94 -42 161 -122 195 -50 20 -126 19 -166 -2z"})]})}),pl=()=>{const{t:e}=zt(),t=[{key:"tonieboxes",label:w.jsx(Mt,{to:"/tonieboxes",style:{marginLeft:8},children:e("tonieboxes.navigationTitle")}),icon:ce.createElement(t7e),title:e("tonieboxes.navigationTitle")},{key:"esp32boxflashing",label:w.jsx(Mt,{to:"/tonieboxes/esp32boxflashing",children:e("tonieboxes.esp32BoxFlashing.navigationTitle")}),icon:ce.createElement(r1),title:e("tonieboxes.esp32BoxFlashing.navigationTitle")},{key:"cc3200boxflashing",label:w.jsx(Mt,{to:"/tonieboxes/cc3200boxflashing",children:e("tonieboxes.cc3200BoxFlashing.navigationTitle")}),icon:ce.createElement(r1),title:e("tonieboxes.cc3200BoxFlashing.navigationTitle")},{key:"cc3235boxflashing",label:w.jsx(Mt,{to:"/tonieboxes/cc3235boxflashing",children:e("tonieboxes.cc3235BoxFlashing.navigationTitle")}),icon:ce.createElement(r1),title:e("tonieboxes.cc3235BoxFlashing.navigationTitle")}];return w.jsx(nm,{mode:"inline",defaultOpenKeys:["sub"],items:t})},Aj=new _n(Sn()),n7e=()=>{const{t:e}=zt(),[t,n]=l.useState([]),[r,a]=l.useState(!1);l.useEffect(()=>{(async()=>{const c=await Aj.apiGetTonieboxesIndex();n(c)})(),(async()=>{try{const c=await Aj.apiGetNewBoxesAllowed();a(c)}catch(c){Xe.error("Fetching new box allowed: "+c)}})()},[]);const o=r?w.jsx(Sr,{message:e("tonieboxes.newBoxesAllowed"),description:e("tonieboxes.newBoxesAllowedText"),type:"warning",showIcon:!0,style:{margin:"16px 0"}}):"";return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(pl,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(pl,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("tonieboxes.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("tonieboxes.title")}),o,w.jsx(e7e,{tonieboxCards:t})]})]})]})},Po=()=>{const{t:e}=zt(),t=[{key:"community",label:w.jsx(Mt,{to:"/community",children:e("community.navigationTitle")}),icon:ce.createElement(awe),title:e("community.navigationTitle")},{key:"faq",label:w.jsx(Mt,{to:"/community/faq",children:e("community.faq.navigationTitle")}),icon:ce.createElement(pG),title:e("community.faq.navigationTitle")},{key:"contribution",label:w.jsx(Mt,{to:"/community/contribution",style:{color:"currentColor"},children:e("community.contribution.navigationTitle")}),icon:ce.createElement(n1e),title:e("community.contribution.navigationTitle"),children:[{key:"toniesJson",label:w.jsx(Mt,{to:"/community/contribution/tonies-json",children:e("community.contribution.toniesJson.navigationTitle")}),icon:ce.createElement(Ybe),title:e("community.contribution.toniesJson.navigationTitle")}]},{key:"contributors",label:w.jsx(Mt,{to:"/community/contributors",children:e("community.contributors.navigationTitle")}),icon:ce.createElement(T1e),title:e("community.contributors.navigationTitle")},{key:"changelog",label:w.jsx(Mt,{to:"/community/changelog",children:e("community.changelog.navigationTitle")}),icon:ce.createElement(gSe),title:e("community.changelog.navigationTitle")},{key:"Forum",label:w.jsx(Mt,{to:"https://forum.revvox.de/",target:"_blank",children:e("community.forum.navigationTitle")}),icon:ce.createElement(VSe),title:e("community.forum.navigationTitle")}];return w.jsx(nm,{mode:"inline",defaultOpenKeys:["sub"],items:t})},{Paragraph:Mj}=$n,r7e=()=>{const{t:e}=zt();return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.title")}),w.jsxs(Mj,{children:[w.jsx("h2",{children:"Get involved"}),"Be a part of our global contributor community by writing code, commenting on issues, or participate in discussons in our telegram group."]}),w.jsxs(Mj,{children:["Your best points of contact are the following locations",w.jsxs("ul",{children:[w.jsxs("li",{children:[w.jsx(Mt,{to:"https://github.com/toniebox-reverse-engineering",target:"_blank",children:"GitHub"}),w.jsx("ul",{children:w.jsx("li",{children:"The place where all sources are stored for this and related projects. Where you can fork the repositories, contribute new or improved features, create issues or just give some feedback on already existing issues."})})]}),w.jsxs("li",{children:[w.jsx(Mt,{to:"https://t.me/toniebox_reverse_engineering",target:"_blank",children:"Telegram Chat"}),w.jsx("ul",{children:w.jsx("li",{children:"The first level support if you need help or if you are interested in getting involved in the development of TeddyCloud."})})]}),w.jsxs("li",{children:[w.jsx(Mt,{to:"https://forum.revvox.de/",target:"_blank",children:"Discourse Forum"}),w.jsx("ul",{children:w.jsx("li",{children:"The lively knowledge base for the project, a place to ask questions whose answers can be helpful for others."})})]}),w.jsxs("li",{children:[w.jsx(Mt,{to:"https://tonies-wiki.revvox.de/docs/tools/teddycloud/",target:"_blank",children:"TeddyCloud Wiki"}),w.jsx("ul",{children:w.jsx("li",{children:"A Wiki contains, among other things, how to install TeddyCloud and how to solve possible problems."})})]})]})]})]})]})]})},{Paragraph:su}=$n,a7e=()=>{const{t:e}=zt(),t=["Use welcome and inclusive language.","Be respectful of differing viewpoints and experiences.","Gracefully accept constructive criticism.","Foster what's best for the community.","Show empathy for other community members.","Decisions are made based on technical merit and consensus. The Teddycloud community aspires to treat everyone equally, and to value all contributions."],n=["Write code.","Improve documentation.","Answer questions on our telegram group.","Investigate bugs and issues on GitHub.","Review and comment on pull requests from other developers.","Report an issue.","Give a “thumbs up” 👍 on issues that are relevant to you."];return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")},{title:e("community.contribution.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.contribution.title")}),w.jsxs(su,{children:[w.jsx(su,{children:"The Teddycloud can only grow through the contributions of this community. Thanks so much for your enthusiasm and your work - we appreciate everything you do!"}),w.jsxs(su,{children:[w.jsx("h2",{children:"Community values"}),w.jsx(su,{children:"In the interest of fostering an open and welcoming environment, contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone - regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation."}),w.jsx(su,{children:"Examples of behaviors that contribute to creating a positive environment include:"}),w.jsx("ul",{children:t.map((r,a)=>w.jsx("li",{children:r},a))})]}),w.jsxs(su,{children:[w.jsx("h2",{children:"Make your first contribution"}),"There are many ways to contribute to Teddycloud! You can contribute code and make improvements to the Teddycloud documentation. Our most common contributions include code, documentation, and community support.",w.jsx("ul",{children:n.map((r,a)=>w.jsx("li",{children:r},a))})]})]})]})]})]})},o7e=new _n(Sn()),{Paragraph:Dj}=$n,{Panel:i7e}=j0,s7e=()=>{const{t:e}=zt(),[t,n]=l.useState({});return l.useEffect(()=>{async function r(){try{const s=(await(await o7e.apiGetTeddyCloudApiRaw("/api/toniesJson")).json()).filter(u=>u.audio_id&&u.audio_id.length===0&&!["creative-tonie","system"].includes(u.category)&&!u.model.includes("20000")).map(u=>({model:u.model,series:u.series,episodes:u.episodes,pic:u.pic,audio_id:u.audio_id||[],category:u.category,language:u.language})),c={};s.forEach(u=>{c[u.language]||(c[u.language]=[]),c[u.language].push(u)}),n(c)}catch(a){console.error("Error fetching and transforming data:",a)}}r()},[]),w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")},{title:e("community.contribution.navigationTitle")},{title:e("community.contribution.toniesJson.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.contribution.toniesJson.title")}),w.jsx(Dj,{children:e("community.contribution.toniesJson.text")}),w.jsx(Dj,{children:w.jsx(j0,{accordion:!0,children:Object.keys(t).map((r,a)=>w.jsx(i7e,{header:r,children:w.jsx(ll,{children:Array.isArray(t[r])&&t[r].map((o,i)=>w.jsx(ll.Item,{id:o.model,children:w.jsxs("div",{children:[w.jsx("img",{src:o.pic,alt:"",style:{width:"100px",height:"auto"}}),o.model," - ",o.series," -"," ",o.episodes]})},i))})},a))})})]})]})]})},{Paragraph:Tf}=$n,l7e=()=>{const{t:e}=zt();return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")},{title:e("community.contributors.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.contributors.title")}),w.jsxs(Tf,{children:["This project relies on the tireless contributors who offer their free time and skills. Directly related to TeddyCloud are the contributors of the two projects teddycloud and teddycloud_web:",w.jsxs(Tf,{children:[w.jsx("h3",{children:"teddycloud"}),w.jsx("div",{children:"The most neccessary, but mostly invisible part of your TeddyCloud Server."}),w.jsx(Mt,{to:"https://github.com/toniebox-reverse-engineering/teddycloud/graphs/contributors",target:"_blank",children:"https://github.com/toniebox-reverse-engineering/teddycloud/graphs/contributors"})]}),w.jsxs(Tf,{children:[w.jsx("h3",{children:"teddycloud_web"}),w.jsx("div",{children:"Which is actually this frontend you are using and seeing here."}),w.jsx(Mt,{to:"https://github.com/toniebox-reverse-engineering/teddycloud_web/graphs/contributors",target:"_blank",children:"https://github.com/toniebox-reverse-engineering/teddycloud_web/graphs/contributors"})]}),w.jsxs(Tf,{children:["You can find more contributors to the entire topic complex in the other GitHub repositories at"," ",w.jsx(Mt,{to:"https://github.com/orgs/toniebox-reverse-engineering/repositories",target:"_blank",children:"https://github.com/orgs/toniebox-reverse-engineering/repositories"})]})]}),w.jsx(Ea,{}),w.jsxs(Tf,{children:[w.jsx("div",{style:{marginBottom:24},children:"A big round of applause for them!"}),w.jsx(VN,{maxNoOfGuests:100,toniesSize:150,showQuestionMark:!1,height:150})]})]})]})]})},{Paragraph:Pj,Text:H2}=$n,c7e=()=>{const{t:e}=zt(),t=[{version:"0.6.1",changes:["Stabilization backend","Changed default for setting cloud.prioCustomContent to false","Disabled prioCustomContent if lower audio id is allowed","Added reload tonies(.custom).json api https://github.com/toniebox-reverse-engineering/teddycloud/issues/177","Added moveFile api https://github.com/toniebox-reverse-engineering/teddycloud/issues/198","Added server side taf file encoding","Support TAF files in taps and server side taf file encoding","Added API to extract certificates https://github.com/toniebox-reverse-engineering/teddycloud/issues/103","Initial cert generation generates now a 4096bit long cert https://github.com/toniebox-reverse-engineering/teddycloud/issues/138","Extended settings api","Fixed bug updating empty model information if entry was added in tonies.json https://github.com/toniebox-reverse-engineering/teddycloud/issues/215","Fixed some bugs","gui: Fixed bug storing source with html special chars","gui: Fixed bug saving model and source of a tonie/tag at once","gui: Fixed display bug sourceInfo with unknown content","gui: Integrated new reload tonies.json api","gui: Added Moving and renaming of files in library and content","gui: Fixing security weaknesses","gui: Added file upload to library",`gui: If setting "Category frontend: Split content / model" is disabled, don't show the source info in Tonies list and details modal`,"gui: Added encoding functionality in library","gui: Allow playing all encodable files in teddyCloud","gui: ESP32 flash process - integrated remaining manual steps. Certificate extraction is now also automated","gui: Fixed bug tonieboxes if tonieboxes.custom.json was empty or not available https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/133","gui: Added Spanish language - feel free to improve translations as current translation is completely done by ChatGPT."],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/compare/tc_v0.6.0...tc_v0.6.1","https://github.com/toniebox-reverse-engineering/teddycloud_web/compare/tcw_v0.6.0...tcw_v0.6.1"],discussionLink:"https://forum.revvox.de/t/release-notes-0-6-1/701",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.6.1"},{version:"0.6.0",changes:["Stabilization backend","store last played time of last played tag","extend getTagIndex API, provide language in tonieInfos","PoC Toniebox api access (explicitly allow access to teddy cloud api on tonebox level)","Added enable/disable new Tonieboxes: prohibit registration of new tonieboxes if not enabled","Added removal of overlays (= removal of Tonieboxes from TeddyCloud)","add hide tonie/tag functionality (hide using new /web gui, present to box to unhide)","fixed locking bug, reworked locking.","fixed bug not storing cloud auth in some circumstances","fixed bug not storing source in json file: https://github.com/toniebox-reverse-engineering/teddycloud/issues/165","added limit to tempfile creation for radiostreams, default: 240mb (~6h) (configurable if expert mode is activated) https://github.com/toniebox-reverse-engineering/teddycloud/issues/180","added possibility to set WiFi Credentials on ESP32 Firmware patching","introduced second HTTPS port for WebFrontend only, which allows using https for webfrontend (Default: 8443)","tonie images from boxine can now be cached locally (PoC)","new /web gui is now default web gui: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/47","new /web gui: enhanced Toniecard, added search for Radiostream in Edit Modal","new /web gui: Tonies - Content section - added Migrate Content to Lib button on TAF files","new /web gui: added RTNL Log Page: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/48","new /web gui: added show Json File when double click on json file (File browser view)","new /web gui: added show TAP File when double click on tap file (File browser view)","new /web gui: added show TAF Header (including AudioID + Hash) when double click on a taf file (File browser view)","new /web gui: show date time of last played tag (toniecard + toniboxcard)","new /web gui: added Tonie Audio Playlist page (WIP - Implementation not yet finished), rearranged menu entries tonies section: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/52","new /web gui: added delete feature in content, library and audio playlist page","new /web gui: improved changelog page, parse links and open links in new tab; completed contributors page: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/27","new /web gui: added language flag to tonies card if it's not the same as the most owned language ones, added language filter","new /web gui: deletion of tonieboxes","new /web gui: info if add new boxes is enabled on homepage and tonieboxes page","new /web gui: enable/disable API access for toniebox added on tonieboxes page","new /web gui: add hide tonie/tag in tonies list (in info modal)","new /web gui: PoC Tonies Custom Json Editor (WiP, not working, but you get the json part to copy into the tonies.custom.json)","new /web gui: PoC Tonie Audio Playlist Editor (WiP, not working, but you get the json to copy and save as a TAP file) ","new /web gui: allow TAP files to be selected on Edit Tag Modal","new /web gui: new 404 page","new /web gui: hidden feature Tonie meeting. Search for it!","new /web gui: added link to Toniebox if the box is version cc3200, an ip is available and cfw is installed: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/28","new /web gui: hide audioplayer if no source is set, when clicking on play icon of a tonie/taf/... the player is shown: https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/40","new /web gui: added minimize/maximize audioplayer https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/40","new /web gui: show Tonie on tonie article search","new /web gui: improved audioplayer, added volume control to custom one, hide doubled audioplayer","new /web gui: added French translation. Feel free to check if chatGPT is a good translator. If something is wrong, give us a shout at telegram!","new /weg gui: overworked filebrowser to be responsive","new /web gui: overworked tonie information modal, now also available in file browser (library + content)","new /web gui: added Create Directory functionality in file browser","new /web gui: added better breadcrumb to filebrowser (clickable for easy directory switching) https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/78","new /web gui: set nocloud to true if source of a tag is changed https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/77","new /web gui: show image and information from set source if different from model https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/80","new /web gui: tonie overview: filter now also considers information from set source","new /web gui: fixed bugs after updating tonies in tonies overview","new /web gui: added FAQ page in community section","new /web gui: support web streams in audioplayer","new /web gui: improved filebrowser, added filter field and made buttons sticky","new /web gui: integrated ESP32 Firmware Flashing https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/46","new /web gui: integrated setting of WiFi credentials in ESP32 Firmware Flashing","new /web gui: show hint on ESP32 Firmware Flashing page if browser does not support WebSerial","new /web gui: allow multiselection in file browser for file deletion","new /web gui: limit audio encoder to 99 files (as Toniebox only supports 99 chapters)","new /web gui: fixed image fetch loop when playing a tonie","new /web gui: fixed poor audio quality in some case when using audio encoder","new /web gui: migrated gui from create-react-app to vite","new /web gui: fixed some bugs and minor refactoring"],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/compare/tc_v0.5.2...tc_v0.6.0","https://github.com/toniebox-reverse-engineering/teddycloud_web/compare/tcw_v0.5.2...tcw_v0.6.0"],discussionLink:"https://forum.revvox.de/t/release-notes-0-6-0/468",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.6.0"},{version:"0.5.2",changes:["Stabilization backend","Several fixes and changes regards backend crashes and emptied config files when changing any tonie setting","Fix for random directories in library (and everywhere)","Fixed bug storing last played tonie per box","Fixed bug clearing text settings (like paths or flex tonie)","API for searching models is now case insensitive","Save IP of Toniebox as prepartion for linking CFW Tonieboxes","Introduced Settings level - 1: Basic, 2: Detail, 3: Expert (1 Default - if you are missing settings, increase level!)","new /web gui: enhanced Tonies Card, added editable content source","new /web gui: enhanced Toniebox Card, improved UX","new /web gui: Dark theme (Last used Theme stored in localStorage in Browser)","new /web gui: Show All (Hide Pagination on Tonies List, stored in localStorage in Browser)","new /web gui: Support of overlayed content folder. More details can be found here: https://forum.revvox.de/t/teddycloud-supporting-multiple-tonieboxes/451/1","new /web gui: Text inputs in Settings must be saved explicitly. (only Textinputs, other types are still autosaved.) Expect changes in future releases.","new /web gui: fixed various state bugs","new /web gui: show last online date of offline tonieboxes","new /web gui: Messages on successful setting updates","new /web gui: some refactoring"],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/compare/tc_v0.5.1...tc_v0.5.2","https://github.com/toniebox-reverse-engineering/teddycloud_web/compare/tcw_v0.5.1...tcw_v0.5.2"],discussionLink:"https://forum.revvox.de/t/release-notes-0-5-2/450",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.5.2"},{version:"0.5.1",changes:["Stabilization Backend (added locks to prevent crashes, removed memory leaks)","Creating dirs when uploading certificates to a not yet existing path","Moving Tafs from Content to Library on click (not yet available in (new?) frontend)","new /web gui: Pagination + Filtering on Tonies List ( Paging Tonies · Issue #24 · toniebox-reverse-engineering/teddycloud_web · GitHub 2 )","new /web gui: Extend Box Management: Certificate upload now box specific possible, overworked certificate upload ( Certificate upload box related · Issue #26 · toniebox-reverse-engineering/teddycloud_web · GitHub )","new /web gui: Show last played Tonie on Box Management, link to prefiltered Tonieslist, added marking of the Last played Tonies on each box in Tonieslist ( Make use of internal.last_ruid · Issue #30 · toniebox-reverse-engineering/teddycloud_web · GitHub 1 )","new /web gui: adapted cursor on cards to default as cards not really clickable ( TonieCard Cursor · Issue #25 · toniebox-reverse-engineering/teddycloud_web · GitHub )","new /web gui: fixed navigation item marking","new /web gui: updated box models, added pseudomodels of the official tonies covers (sleepy bear, sheep and rabbit). They are now placed in a json in the config folder. Custom tonieboxes are now also possible. Add your customised one in tonieboxes.custom.json and choose it in the box mgmt.","new /web gui: added community section (WIP) ( Add Changelog and contribution page · Issue #27 · toniebox-reverse-engineering/teddycloud_web · GitHub 1 )","new /web gui: fixed warnings"],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/compare/tc_v0.5.0...tc_v0.5.1","https://github.com/toniebox-reverse-engineering/teddycloud_web/compare/tcw_v0.5.0...tcw_v0.5.1"],discussionLink:"https://forum.revvox.de/t/release-notes-0-5-1/447",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.5.1"},{version:"0.5.0",changes:["security mitigations on public instances as it‘s definitely not recommended to host teddycloud in public accessible for all","prepared authentication for frontend (backend adaptions)","linked new /web gui on teddycloud administration gui","overworked header, reordered menu items, new icons, better readable status in new /web gui","fixed modals (still some display problems on small devices like mobiles exists)","added audio encoder to new /web gui, you are now able to select files and encode them to a taf","This lets you bring your own content easily on an existing tonie.","added toniebox management to new /web gui, improved backend functions for that","only at least once connected boxes are listed, model must be set manually","enriched homepage in new /web gui with 5 randomly selected tonies of yours","adapt tonie card list to different cover image sizes in new /web gui (all cards within one row have now the same height)","added no cloud and live icon (Toggle to enable/disable) on tonie card in new /web gui","fixed several bugs"],commits:["https://github.com/toniebox-reverse-engineering/teddycloud/pull/154","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/8","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/9","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/19","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/21","https://github.com/toniebox-reverse-engineering/teddycloud_web/pull/22"],discussionLink:"https://forum.revvox.de/t/release-notes-0-5-0/444",githubReleaseLink:"https://github.com/toniebox-reverse-engineering/teddycloud/releases/tag/tc_v0.5.0"},{version:"0.4.5 and older",changes:["A lot more. See Github for details!"],commits:[]}],n=r=>{const a=/(https?:\/\/[^\s]+)/g;return r.split(a).map((i,s)=>a.test(i)?w.jsx(Mt,{to:i,target:"_blank",rel:"noopener noreferrer",children:i},s):i)};return w.jsxs(w.Fragment,{children:[w.jsx(ur,{children:w.jsx(Po,{})}),w.jsxs(dr,{children:[w.jsx(Pn,{children:w.jsx(Po,{})}),w.jsx(fr,{items:[{title:e("home.navigationTitle")},{title:e("community.navigationTitle")},{title:e("community.changelog.navigationTitle")}]}),w.jsxs(rr,{children:[w.jsx("h1",{children:e("community.changelog.title")}),w.jsx(Pj,{children:w.jsx(ll,{dataSource:t,renderItem:r=>w.jsxs(w.Fragment,{children:[w.jsxs("h2",{children:["Version ",r.version]}),w.jsxs(Pj,{children:[w.jsx("h3",{children:"Changes"}),w.jsx("ul",{children:r.changes.map((a,o)=>w.jsx("li",{children:n(a)},o))})]}),r.commits&&r.commits.length>0&&w.jsxs(w.Fragment,{children:[w.jsx(H2,{strong:!0,children:"All contained commits can be found here (teddy cloud repo):"}),w.jsx("ul",{children:r.commits.map((a,o)=>w.jsx("li",{children:w.jsx(Mt,{to:a,target:"_blank",children:a})},o))})]}),r.discussionLink&&w.jsxs(w.Fragment,{children:[w.jsx(H2,{strong:!0,children:"Discussion:"}),w.jsx("ul",{children:w.jsx("li",{children:w.jsx(Mt,{to:r.discussionLink,target:"_blank",children:r.discussionLink})})})]}),r.githubReleaseLink&&w.jsxs(w.Fragment,{children:[w.jsx(H2,{strong:!0,children:"GitHub Release:"}),w.jsx("ul",{children:w.jsx("li",{children:w.jsx(Mt,{to:r.githubReleaseLink,target:"_blank",children:r.githubReleaseLink})})})]})]})})})]})]})]})};class xa extends Error{}/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */const u7e=4,Lj=0,Fj=1,d7e=2;function Xd(e){let t=e.length;for(;--t>=0;)e[t]=0}const f7e=0,iX=1,p7e=2,g7e=3,m7e=258,ek=29,dm=256,mg=dm+1+ek,Wu=30,tk=19,sX=2*mg+1,ql=15,U2=16,h7e=7,nk=256,lX=16,cX=17,uX=18,i_=new Uint8Array([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]),lv=new Uint8Array([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]),v7e=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),dX=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),b7e=512,Xi=new Array((mg+2)*2);Xd(Xi);const vp=new Array(Wu*2);Xd(vp);const hg=new Array(b7e);Xd(hg);const vg=new Array(m7e-g7e+1);Xd(vg);const rk=new Array(ek);Xd(rk);const wb=new Array(Wu);Xd(wb);function V2(e,t,n,r,a){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=a,this.has_stree=e&&e.length}let fX,pX,gX;function W2(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}const mX=e=>e<256?hg[e]:hg[256+(e>>>7)],bg=(e,t)=>{e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255},ja=(e,t,n)=>{e.bi_valid>U2-n?(e.bi_buf|=t<>U2-e.bi_valid,e.bi_valid+=n-U2):(e.bi_buf|=t<{ja(e,n[t*2],n[t*2+1])},hX=(e,t)=>{let n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1},y7e=e=>{e.bi_valid===16?(bg(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},S7e=(e,t)=>{const n=t.dyn_tree,r=t.max_code,a=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length;let u,d,f,p,g,m,b=0;for(p=0;p<=ql;p++)e.bl_count[p]=0;for(n[e.heap[e.heap_max]*2+1]=0,u=e.heap_max+1;uc&&(p=c,b++),n[d*2+1]=p,!(d>r)&&(e.bl_count[p]++,g=0,d>=s&&(g=i[d-s]),m=n[d*2],e.opt_len+=m*(p+g),o&&(e.static_len+=m*(a[d*2+1]+g)));if(b!==0){do{for(p=c-1;e.bl_count[p]===0;)p--;e.bl_count[p]--,e.bl_count[p+1]+=2,e.bl_count[c]--,b-=2}while(b>0);for(p=c;p!==0;p--)for(d=e.bl_count[p];d!==0;)f=e.heap[--u],!(f>r)&&(n[f*2+1]!==p&&(e.opt_len+=(p-n[f*2+1])*n[f*2],n[f*2+1]=p),d--)}},vX=(e,t,n)=>{const r=new Array(ql+1);let a=0,o,i;for(o=1;o<=ql;o++)a=a+n[o-1]<<1,r[o]=a;for(i=0;i<=t;i++){let s=e[i*2+1];s!==0&&(e[i*2]=hX(r[s]++,s))}},w7e=()=>{let e,t,n,r,a;const o=new Array(ql+1);for(n=0,r=0;r>=7;r{let t;for(t=0;t{e.bi_valid>8?bg(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},jj=(e,t,n,r)=>{const a=t*2,o=n*2;return e[a]{const r=e.heap[n];let a=n<<1;for(;a<=e.heap_len&&(a{let r,a,o=0,i,s;if(e.sym_next!==0)do r=e.pending_buf[e.sym_buf+o++]&255,r+=(e.pending_buf[e.sym_buf+o++]&255)<<8,a=e.pending_buf[e.sym_buf+o++],r===0?xi(e,a,t):(i=vg[a],xi(e,i+dm+1,t),s=i_[i],s!==0&&(a-=rk[i],ja(e,a,s)),r--,i=mX(r),xi(e,i,n),s=lv[i],s!==0&&(r-=wb[i],ja(e,r,s)));while(o{const n=t.dyn_tree,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.elems;let i,s,c=-1,u;for(e.heap_len=0,e.heap_max=sX,i=0;i>1;i>=1;i--)G2(e,n,i);u=o;do i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],G2(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=s,n[u*2]=n[i*2]+n[s*2],e.depth[u]=(e.depth[i]>=e.depth[s]?e.depth[i]:e.depth[s])+1,n[i*2+1]=n[s*2+1]=u,e.heap[1]=u++,G2(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],S7e(e,t),vX(n,c,e.bl_count)},zj=(e,t,n)=>{let r,a=-1,o,i=t[0*2+1],s=0,c=7,u=4;for(i===0&&(c=138,u=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)o=i,i=t[(r+1)*2+1],!(++s{let r,a=-1,o,i=t[0*2+1],s=0,c=7,u=4;for(i===0&&(c=138,u=3),r=0;r<=n;r++)if(o=i,i=t[(r+1)*2+1],!(++s{let t;for(zj(e,e.dyn_ltree,e.l_desc.max_code),zj(e,e.dyn_dtree,e.d_desc.max_code),s_(e,e.bl_desc),t=tk-1;t>=3&&e.bl_tree[dX[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t},C7e=(e,t,n,r)=>{let a;for(ja(e,t-257,5),ja(e,n-1,5),ja(e,r-4,4),a=0;a{let t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return Lj;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Fj;for(n=32;n{Uj||(w7e(),Uj=!0),e.l_desc=new W2(e.dyn_ltree,fX),e.d_desc=new W2(e.dyn_dtree,pX),e.bl_desc=new W2(e.bl_tree,gX),e.bi_buf=0,e.bi_valid=0,bX(e)},SX=(e,t,n,r)=>{ja(e,(f7e<<1)+(r?1:0),3),yX(e),bg(e,n),bg(e,~n),n&&e.pending_buf.set(e.window.subarray(t,t+n),e.pending),e.pending+=n},T7e=e=>{ja(e,iX<<1,3),xi(e,nk,Xi),y7e(e)},R7e=(e,t,n,r)=>{let a,o,i=0;e.level>0?(e.strm.data_type===d7e&&(e.strm.data_type=E7e(e)),s_(e,e.l_desc),s_(e,e.d_desc),i=x7e(e),a=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=a&&(a=o)):a=o=n+5,n+4<=a&&t!==-1?SX(e,t,n,r):e.strategy===u7e||o===a?(ja(e,(iX<<1)+(r?1:0),3),Bj(e,Xi,vp)):(ja(e,(p7e<<1)+(r?1:0),3),C7e(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),Bj(e,e.dyn_ltree,e.dyn_dtree)),bX(e),r&&yX(e)},_7e=(e,t,n)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=n,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(vg[n]+dm+1)*2]++,e.dyn_dtree[mX(t)*2]++),e.sym_next===e.sym_end);var $7e=I7e,O7e=SX,N7e=R7e,k7e=_7e,A7e=T7e,M7e={_tr_init:$7e,_tr_stored_block:O7e,_tr_flush_block:N7e,_tr_tally:k7e,_tr_align:A7e};const D7e=(e,t,n,r)=>{let a=e&65535|0,o=e>>>16&65535|0,i=0;for(;n!==0;){i=n>2e3?2e3:n,n-=i;do a=a+t[r++]|0,o=o+a|0;while(--i);a%=65521,o%=65521}return a|o<<16|0};var yg=D7e;const P7e=()=>{let e,t=[];for(var n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t},L7e=new Uint32Array(P7e()),F7e=(e,t,n,r)=>{const a=L7e,o=r+n;e^=-1;for(let i=r;i>>8^a[(e^t[i])&255];return e^-1};var Ur=F7e,xc={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"},Zd={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_MEM_ERROR:-4,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};const{_tr_init:j7e,_tr_stored_block:l_,_tr_flush_block:B7e,_tr_tally:nl,_tr_align:z7e}=M7e,{Z_NO_FLUSH:rl,Z_PARTIAL_FLUSH:H7e,Z_FULL_FLUSH:U7e,Z_FINISH:To,Z_BLOCK:Vj,Z_OK:na,Z_STREAM_END:Wj,Z_STREAM_ERROR:Ri,Z_DATA_ERROR:V7e,Z_BUF_ERROR:q2,Z_DEFAULT_COMPRESSION:W7e,Z_FILTERED:G7e,Z_HUFFMAN_ONLY:Eh,Z_RLE:q7e,Z_FIXED:K7e,Z_DEFAULT_STRATEGY:Y7e,Z_UNKNOWN:X7e,Z_DEFLATED:ky}=Zd,Z7e=9,Q7e=15,J7e=8,eze=29,tze=256,c_=tze+1+eze,nze=30,rze=19,aze=2*c_+1,oze=15,mn=3,Vs=258,_i=Vs+mn+1,ize=32,wd=42,ak=57,u_=69,d_=73,f_=91,p_=103,Kl=113,Hf=666,Ia=1,Qd=2,Cc=3,Jd=4,sze=3,Yl=(e,t)=>(e.msg=xc[t],t),Gj=e=>e*2-(e>4?9:0),Ps=e=>{let t=e.length;for(;--t>=0;)e[t]=0},lze=e=>{let t,n,r,a=e.w_size;t=e.hash_size,r=t;do n=e.head[--r],e.head[r]=n>=a?n-a:0;while(--t);t=a,r=t;do n=e.prev[--r],e.prev[r]=n>=a?n-a:0;while(--t)};let cze=(e,t,n)=>(t<{const t=e.state;let n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+n),e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))},oo=(e,t)=>{B7e(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Za(e.strm)},Cn=(e,t)=>{e.pending_buf[e.pending++]=t},Rf=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255},g_=(e,t,n,r)=>{let a=e.avail_in;return a>r&&(a=r),a===0?0:(e.avail_in-=a,t.set(e.input.subarray(e.next_in,e.next_in+a),n),e.state.wrap===1?e.adler=yg(e.adler,t,a,n):e.state.wrap===2&&(e.adler=Ur(e.adler,t,a,n)),e.next_in+=a,e.total_in+=a,a)},wX=(e,t)=>{let n=e.max_chain_length,r=e.strstart,a,o,i=e.prev_length,s=e.nice_match;const c=e.strstart>e.w_size-_i?e.strstart-(e.w_size-_i):0,u=e.window,d=e.w_mask,f=e.prev,p=e.strstart+Vs;let g=u[r+i-1],m=u[r+i];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do if(a=t,!(u[a+i]!==m||u[a+i-1]!==g||u[a]!==u[r]||u[++a]!==u[r+1])){r+=2,a++;do;while(u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&u[++r]===u[++a]&&ri){if(e.match_start=t,i=o,o>=s)break;g=u[r+i-1],m=u[r+i]}}while((t=f[t&d])>c&&--n!==0);return i<=e.lookahead?i:e.lookahead},xd=e=>{const t=e.w_size;let n,r,a;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-_i)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),lze(e),r+=t),e.strm.avail_in===0)break;if(n=g_(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=n,e.lookahead+e.insert>=mn)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=al(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=al(e,e.ins_h,e.window[a+mn-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert{let n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,r,a,o,i=0,s=e.strm.avail_in;do{if(r=65535,o=e.bi_valid+42>>3,e.strm.avail_outa+e.strm.avail_in&&(r=a+e.strm.avail_in),r>o&&(r=o),r>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,Za(e.strm),a&&(a>r&&(a=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+a),e.strm.next_out),e.strm.next_out+=a,e.strm.avail_out-=a,e.strm.total_out+=a,e.block_start+=a,r-=a),r&&(g_(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(i===0);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_watero&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,o+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),o>e.strm.avail_in&&(o=e.strm.avail_in),o&&(g_(e.strm,e.window,e.strstart,o),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.high_water>3,o=e.pending_buf_size-o>65535?65535:e.pending_buf_size-o,n=o>e.w_size?e.w_size:o,a=e.strstart-e.block_start,(a>=n||(a||t===To)&&t!==rl&&e.strm.avail_in===0&&a<=o)&&(r=a>o?o:a,i=t===To&&e.strm.avail_in===0&&r===a?1:0,l_(e,e.block_start,r,i),e.block_start+=r,Za(e.strm)),i?Cc:Ia)},K2=(e,t)=>{let n,r;for(;;){if(e.lookahead<_i){if(xd(e),e.lookahead<_i&&t===rl)return Ia;if(e.lookahead===0)break}if(n=0,e.lookahead>=mn&&(e.ins_h=al(e,e.ins_h,e.window[e.strstart+mn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-_i&&(e.match_length=wX(e,n)),e.match_length>=mn)if(r=nl(e,e.strstart-e.match_start,e.match_length-mn),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=mn){e.match_length--;do e.strstart++,e.ins_h=al(e,e.ins_h,e.window[e.strstart+mn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=al(e,e.ins_h,e.window[e.strstart+1]);else r=nl(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(oo(e,!1),e.strm.avail_out===0))return Ia}return e.insert=e.strstart{let n,r,a;for(;;){if(e.lookahead<_i){if(xd(e),e.lookahead<_i&&t===rl)return Ia;if(e.lookahead===0)break}if(n=0,e.lookahead>=mn&&(e.ins_h=al(e,e.ins_h,e.window[e.strstart+mn-1]),n=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=mn-1,n!==0&&e.prev_length4096)&&(e.match_length=mn-1)),e.prev_length>=mn&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-mn,r=nl(e,e.strstart-1-e.prev_match,e.prev_length-mn),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=al(e,e.ins_h,e.window[e.strstart+mn-1]),n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=mn-1,e.strstart++,r&&(oo(e,!1),e.strm.avail_out===0))return Ia}else if(e.match_available){if(r=nl(e,0,e.window[e.strstart-1]),r&&oo(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return Ia}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=nl(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart{let n,r,a,o;const i=e.window;for(;;){if(e.lookahead<=Vs){if(xd(e),e.lookahead<=Vs&&t===rl)return Ia;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=mn&&e.strstart>0&&(a=e.strstart-1,r=i[a],r===i[++a]&&r===i[++a]&&r===i[++a])){o=e.strstart+Vs;do;while(r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&r===i[++a]&&ae.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=mn?(n=nl(e,1,e.match_length-mn),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=nl(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(oo(e,!1),e.strm.avail_out===0))return Ia}return e.insert=0,t===To?(oo(e,!0),e.strm.avail_out===0?Cc:Jd):e.sym_next&&(oo(e,!1),e.strm.avail_out===0)?Ia:Qd},dze=(e,t)=>{let n;for(;;){if(e.lookahead===0&&(xd(e),e.lookahead===0)){if(t===rl)return Ia;break}if(e.match_length=0,n=nl(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(oo(e,!1),e.strm.avail_out===0))return Ia}return e.insert=0,t===To?(oo(e,!0),e.strm.avail_out===0?Cc:Jd):e.sym_next&&(oo(e,!1),e.strm.avail_out===0)?Ia:Qd};function mi(e,t,n,r,a){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=a}const Uf=[new mi(0,0,0,0,xX),new mi(4,4,8,4,K2),new mi(4,5,16,8,K2),new mi(4,6,32,32,K2),new mi(4,4,16,16,lu),new mi(8,16,32,32,lu),new mi(8,16,128,128,lu),new mi(8,32,128,256,lu),new mi(32,128,258,1024,lu),new mi(32,258,258,4096,lu)],fze=e=>{e.window_size=2*e.w_size,Ps(e.head),e.max_lazy_match=Uf[e.level].max_lazy,e.good_match=Uf[e.level].good_length,e.nice_match=Uf[e.level].nice_length,e.max_chain_length=Uf[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=mn-1,e.match_available=0,e.ins_h=0};function pze(){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=ky,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 Uint16Array(aze*2),this.dyn_dtree=new Uint16Array((2*nze+1)*2),this.bl_tree=new Uint16Array((2*rze+1)*2),Ps(this.dyn_ltree),Ps(this.dyn_dtree),Ps(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(oze+1),this.heap=new Uint16Array(2*c_+1),Ps(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*c_+1),Ps(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const fm=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==wd&&t.status!==ak&&t.status!==u_&&t.status!==d_&&t.status!==f_&&t.status!==p_&&t.status!==Kl&&t.status!==Hf?1:0},CX=e=>{if(fm(e))return Yl(e,Ri);e.total_in=e.total_out=0,e.data_type=X7e;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap===2?ak:t.wrap?wd:Kl,e.adler=t.wrap===2?0:1,t.last_flush=-2,j7e(t),na},EX=e=>{const t=CX(e);return t===na&&fze(e.state),t},gze=(e,t)=>fm(e)||e.state.wrap!==2?Ri:(e.state.gzhead=t,na),IX=(e,t,n,r,a,o)=>{if(!e)return Ri;let i=1;if(t===W7e&&(t=6),r<0?(i=0,r=-r):r>15&&(i=2,r-=16),a<1||a>Z7e||n!==ky||r<8||r>15||t<0||t>9||o<0||o>K7e||r===8&&i!==1)return Yl(e,Ri);r===8&&(r=9);const s=new pze;return e.state=s,s.strm=e,s.status=wd,s.wrap=i,s.gzhead=null,s.w_bits=r,s.w_size=1<IX(e,t,ky,Q7e,J7e,Y7e),hze=(e,t)=>{if(fm(e)||t>Vj||t<0)return e?Yl(e,Ri):Ri;const n=e.state;if(!e.output||e.avail_in!==0&&!e.input||n.status===Hf&&t!==To)return Yl(e,e.avail_out===0?q2:Ri);const r=n.last_flush;if(n.last_flush=t,n.pending!==0){if(Za(e),e.avail_out===0)return n.last_flush=-1,na}else if(e.avail_in===0&&Gj(t)<=Gj(r)&&t!==To)return Yl(e,q2);if(n.status===Hf&&e.avail_in!==0)return Yl(e,q2);if(n.status===wd&&n.wrap===0&&(n.status=Kl),n.status===wd){let a=ky+(n.w_bits-8<<4)<<8,o=-1;if(n.strategy>=Eh||n.level<2?o=0:n.level<6?o=1:n.level===6?o=2:o=3,a|=o<<6,n.strstart!==0&&(a|=ize),a+=31-a%31,Rf(n,a),n.strstart!==0&&(Rf(n,e.adler>>>16),Rf(n,e.adler&65535)),e.adler=1,n.status=Kl,Za(e),n.pending!==0)return n.last_flush=-1,na}if(n.status===ak){if(e.adler=0,Cn(n,31),Cn(n,139),Cn(n,8),n.gzhead)Cn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Cn(n,n.gzhead.time&255),Cn(n,n.gzhead.time>>8&255),Cn(n,n.gzhead.time>>16&255),Cn(n,n.gzhead.time>>24&255),Cn(n,n.level===9?2:n.strategy>=Eh||n.level<2?4:0),Cn(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(Cn(n,n.gzhead.extra.length&255),Cn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Ur(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=u_;else if(Cn(n,0),Cn(n,0),Cn(n,0),Cn(n,0),Cn(n,0),Cn(n,n.level===9?2:n.strategy>=Eh||n.level<2?4:0),Cn(n,sze),n.status=Kl,Za(e),n.pending!==0)return n.last_flush=-1,na}if(n.status===u_){if(n.gzhead.extra){let a=n.pending,o=(n.gzhead.extra.length&65535)-n.gzindex;for(;n.pending+o>n.pending_buf_size;){let s=n.pending_buf_size-n.pending;if(n.pending_buf.set(n.gzhead.extra.subarray(n.gzindex,n.gzindex+s),n.pending),n.pending=n.pending_buf_size,n.gzhead.hcrc&&n.pending>a&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),n.gzindex+=s,Za(e),n.pending!==0)return n.last_flush=-1,na;a=0,o-=s}let i=new Uint8Array(n.gzhead.extra);n.pending_buf.set(i.subarray(n.gzindex,n.gzindex+o),n.pending),n.pending+=o,n.gzhead.hcrc&&n.pending>a&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),n.gzindex=0}n.status=d_}if(n.status===d_){if(n.gzhead.name){let a=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>a&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),Za(e),n.pending!==0)return n.last_flush=-1,na;a=0}n.gzindexa&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),n.gzindex=0}n.status=f_}if(n.status===f_){if(n.gzhead.comment){let a=n.pending,o;do{if(n.pending===n.pending_buf_size){if(n.gzhead.hcrc&&n.pending>a&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a)),Za(e),n.pending!==0)return n.last_flush=-1,na;a=0}n.gzindexa&&(e.adler=Ur(e.adler,n.pending_buf,n.pending-a,a))}n.status=p_}if(n.status===p_){if(n.gzhead.hcrc){if(n.pending+2>n.pending_buf_size&&(Za(e),n.pending!==0))return n.last_flush=-1,na;Cn(n,e.adler&255),Cn(n,e.adler>>8&255),e.adler=0}if(n.status=Kl,Za(e),n.pending!==0)return n.last_flush=-1,na}if(e.avail_in!==0||n.lookahead!==0||t!==rl&&n.status!==Hf){let a=n.level===0?xX(n,t):n.strategy===Eh?dze(n,t):n.strategy===q7e?uze(n,t):Uf[n.level].func(n,t);if((a===Cc||a===Jd)&&(n.status=Hf),a===Ia||a===Cc)return e.avail_out===0&&(n.last_flush=-1),na;if(a===Qd&&(t===H7e?z7e(n):t!==Vj&&(l_(n,0,0,!1),t===U7e&&(Ps(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Za(e),e.avail_out===0))return n.last_flush=-1,na}return t!==To?na:n.wrap<=0?Wj:(n.wrap===2?(Cn(n,e.adler&255),Cn(n,e.adler>>8&255),Cn(n,e.adler>>16&255),Cn(n,e.adler>>24&255),Cn(n,e.total_in&255),Cn(n,e.total_in>>8&255),Cn(n,e.total_in>>16&255),Cn(n,e.total_in>>24&255)):(Rf(n,e.adler>>>16),Rf(n,e.adler&65535)),Za(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?na:Wj)},vze=e=>{if(fm(e))return Ri;const t=e.state.status;return e.state=null,t===Kl?Yl(e,V7e):na},bze=(e,t)=>{let n=t.length;if(fm(e))return Ri;const r=e.state,a=r.wrap;if(a===2||a===1&&r.status!==wd||r.lookahead)return Ri;if(a===1&&(e.adler=yg(e.adler,t,n,0)),r.wrap=0,n>=r.w_size){a===0&&(Ps(r.head),r.strstart=0,r.block_start=0,r.insert=0);let c=new Uint8Array(r.w_size);c.set(t.subarray(n-r.w_size,n),0),t=c,n=r.w_size}const o=e.avail_in,i=e.next_in,s=e.input;for(e.avail_in=n,e.next_in=0,e.input=t,xd(r);r.lookahead>=mn;){let c=r.strstart,u=r.lookahead-(mn-1);do r.ins_h=al(r,r.ins_h,r.window[c+mn-1]),r.prev[c&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=c,c++;while(--u);r.strstart=c,r.lookahead=mn-1,xd(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=mn-1,r.match_available=0,e.next_in=i,e.input=s,e.avail_in=o,r.wrap=a,na};var yze=mze,Sze=IX,wze=EX,xze=CX,Cze=gze,Eze=hze,Ize=vze,Tze=bze,Rze="pako deflate (from Nodeca project)",bp={deflateInit:yze,deflateInit2:Sze,deflateReset:wze,deflateResetKeep:xze,deflateSetHeader:Cze,deflate:Eze,deflateEnd:Ize,deflateSetDictionary:Tze,deflateInfo:Rze};const _ze=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var $ze=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const n=t.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)_ze(n,r)&&(e[r]=n[r])}}return e},Oze=e=>{let t=0;for(let r=0,a=e.length;r=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Sg[254]=Sg[254]=1;var Nze=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let t,n,r,a,o,i=e.length,s=0;for(a=0;a>>6,t[o++]=128|n&63):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|n&63):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|n&63);return t};const kze=(e,t)=>{if(t<65534&&e.subarray&&TX)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let n="";for(let r=0;r{const n=t||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,t));let r,a;const o=new Array(n*2);for(a=0,r=0;r4){o[a++]=65533,r+=s-1;continue}for(i&=s===2?31:s===3?15:7;s>1&&r1){o[a++]=65533;continue}i<65536?o[a++]=i:(i-=65536,o[a++]=55296|i>>10&1023,o[a++]=56320|i&1023)}return kze(o,a)},Mze=(e,t)=>{t=t||e.length,t>e.length&&(t=e.length);let n=t-1;for(;n>=0&&(e[n]&192)===128;)n--;return n<0||n===0?t:n+Sg[e[n]]>t?n:t},wg={string2buf:Nze,buf2string:Aze,utf8border:Mze};function Dze(){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}var RX=Dze;const _X=Object.prototype.toString,{Z_NO_FLUSH:Pze,Z_SYNC_FLUSH:Lze,Z_FULL_FLUSH:Fze,Z_FINISH:jze,Z_OK:xb,Z_STREAM_END:Bze,Z_DEFAULT_COMPRESSION:zze,Z_DEFAULT_STRATEGY:Hze,Z_DEFLATED:Uze}=Zd;function pm(e){this.options=Ay.assign({level:zze,method:Uze,chunkSize:16384,windowBits:15,memLevel:8,strategy:Hze},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new RX,this.strm.avail_out=0;let n=bp.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==xb)throw new Error(xc[n]);if(t.header&&bp.deflateSetHeader(this.strm,t.header),t.dictionary){let r;if(typeof t.dictionary=="string"?r=wg.string2buf(t.dictionary):_X.call(t.dictionary)==="[object ArrayBuffer]"?r=new Uint8Array(t.dictionary):r=t.dictionary,n=bp.deflateSetDictionary(this.strm,r),n!==xb)throw new Error(xc[n]);this._dict_set=!0}}pm.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize;let a,o;if(this.ended)return!1;for(t===~~t?o=t:o=t===!0?jze:Pze,typeof e=="string"?n.input=wg.string2buf(e):_X.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){if(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),(o===Lze||o===Fze)&&n.avail_out<=6){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(a=bp.deflate(n,o),a===Bze)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),a=bp.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===xb;if(n.avail_out===0){this.onData(n.output);continue}if(o>0&&n.next_out>0){this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;continue}if(n.avail_in===0)break}return!0};pm.prototype.onData=function(e){this.chunks.push(e)};pm.prototype.onEnd=function(e){e===xb&&(this.result=Ay.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ok(e,t){const n=new pm(t);if(n.push(e,!0),n.err)throw n.msg||xc[n.err];return n.result}function Vze(e,t){return t=t||{},t.raw=!0,ok(e,t)}function Wze(e,t){return t=t||{},t.gzip=!0,ok(e,t)}var Gze=pm,qze=ok,Kze=Vze,Yze=Wze,Xze=Zd,Zze={Deflate:Gze,deflate:qze,deflateRaw:Kze,gzip:Yze,constants:Xze};const Ih=16209,Qze=16191;var Jze=function(t,n){let r,a,o,i,s,c,u,d,f,p,g,m,b,v,y,h,S,C,x,E,I,R,T,_;const $=t.state;r=t.next_in,T=t.input,a=r+(t.avail_in-5),o=t.next_out,_=t.output,i=o-(n-t.avail_out),s=o+(t.avail_out-257),c=$.dmax,u=$.wsize,d=$.whave,f=$.wnext,p=$.window,g=$.hold,m=$.bits,b=$.lencode,v=$.distcode,y=(1<<$.lenbits)-1,h=(1<<$.distbits)-1;e:do{m<15&&(g+=T[r++]<>>24,g>>>=C,m-=C,C=S>>>16&255,C===0)_[o++]=S&65535;else if(C&16){x=S&65535,C&=15,C&&(m>>=C,m-=C),m<15&&(g+=T[r++]<>>24,g>>>=C,m-=C,C=S>>>16&255,C&16){if(E=S&65535,C&=15,mc){t.msg="invalid distance too far back",$.mode=Ih;break e}if(g>>>=C,m-=C,C=o-i,E>C){if(C=E-C,C>d&&$.sane){t.msg="invalid distance too far back",$.mode=Ih;break e}if(I=0,R=p,f===0){if(I+=u-C,C2;)_[o++]=R[I++],_[o++]=R[I++],_[o++]=R[I++],x-=3;x&&(_[o++]=R[I++],x>1&&(_[o++]=R[I++]))}else{I=o-E;do _[o++]=_[I++],_[o++]=_[I++],_[o++]=_[I++],x-=3;while(x>2);x&&(_[o++]=_[I++],x>1&&(_[o++]=_[I++]))}}else if(C&64){t.msg="invalid distance code",$.mode=Ih;break e}else{S=v[(S&65535)+(g&(1<>3,r-=x,m-=x<<3,g&=(1<{const c=s.bits;let u=0,d=0,f=0,p=0,g=0,m=0,b=0,v=0,y=0,h=0,S,C,x,E,I,R=null,T;const _=new Uint16Array(cu+1),$=new Uint16Array(cu+1);let P=null,D,A,O;for(u=0;u<=cu;u++)_[u]=0;for(d=0;d=1&&_[p]===0;p--);if(g>p&&(g=p),p===0)return a[o++]=1<<24|64<<16|0,a[o++]=1<<24|64<<16|0,s.bits=1,0;for(f=1;f0&&(e===Yj||p!==1))return-1;for($[1]=0,u=1;uqj||e===Xj&&y>Kj)return 1;for(;;){D=u-b,i[d]+1=T?(A=P[i[d]-T],O=R[i[d]-T]):(A=96,O=0),S=1<>b)+C]=D<<24|A<<16|O|0;while(C!==0);for(S=1<>=1;if(S!==0?(h&=S-1,h+=S):h=0,d++,--_[u]===0){if(u===p)break;u=t[n+i[d]]}if(u>g&&(h&E)!==x){for(b===0&&(b=g),I+=f,m=u-b,v=1<qj||e===Xj&&y>Kj)return 1;x=h&E,a[x]=g<<24|m<<16|I-o|0}}return h!==0&&(a[I+h]=u-b<<24|64<<16|0),s.bits=g,0};var yp=a9e;const o9e=0,$X=1,OX=2,{Z_FINISH:Zj,Z_BLOCK:i9e,Z_TREES:Th,Z_OK:Ec,Z_STREAM_END:s9e,Z_NEED_DICT:l9e,Z_STREAM_ERROR:Lo,Z_DATA_ERROR:NX,Z_MEM_ERROR:kX,Z_BUF_ERROR:c9e,Z_DEFLATED:Qj}=Zd,My=16180,Jj=16181,eB=16182,tB=16183,nB=16184,rB=16185,aB=16186,oB=16187,iB=16188,sB=16189,Cb=16190,Ui=16191,X2=16192,lB=16193,Z2=16194,cB=16195,uB=16196,dB=16197,fB=16198,Rh=16199,_h=16200,pB=16201,gB=16202,mB=16203,hB=16204,vB=16205,Q2=16206,bB=16207,yB=16208,er=16209,AX=16210,MX=16211,u9e=852,d9e=592,f9e=15,p9e=f9e,SB=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function g9e(){this.strm=null,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 Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const zc=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.modeMX?1:0},DX=e=>{if(zc(e))return Lo;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=My,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(u9e),t.distcode=t.distdyn=new Int32Array(d9e),t.sane=1,t.back=-1,Ec},PX=e=>{if(zc(e))return Lo;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,DX(e)},LX=(e,t)=>{let n;if(zc(e))return Lo;const r=e.state;return t<0?(n=0,t=-t):(n=(t>>4)+5,t<48&&(t&=15)),t&&(t<8||t>15)?Lo:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,PX(e))},FX=(e,t)=>{if(!e)return Lo;const n=new g9e;e.state=n,n.strm=e,n.window=null,n.mode=My;const r=LX(e,t);return r!==Ec&&(e.state=null),r},m9e=e=>FX(e,p9e);let wB=!0,J2,eI;const h9e=e=>{if(wB){J2=new Int32Array(512),eI=new Int32Array(32);let t=0;for(;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(yp($X,e.lens,0,288,J2,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;yp(OX,e.lens,0,32,eI,0,e.work,{bits:5}),wB=!1}e.lencode=J2,e.lenbits=9,e.distcode=eI,e.distbits=5},jX=(e,t,n,r)=>{let a;const o=e.state;return o.window===null&&(o.wsize=1<=o.wsize?(o.window.set(t.subarray(n-o.wsize,n),0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>r&&(a=r),o.window.set(t.subarray(n-r,n-r+a),o.wnext),r-=a,r?(o.window.set(t.subarray(n-r,n),0),o.wnext=r,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave{let n,r,a,o,i,s,c,u,d,f,p,g,m,b,v=0,y,h,S,C,x,E,I,R;const T=new Uint8Array(4);let _,$;const P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(zc(e)||!e.output||!e.input&&e.avail_in!==0)return Lo;n=e.state,n.mode===Ui&&(n.mode=X2),i=e.next_out,a=e.output,c=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,d=n.bits,f=s,p=c,R=Ec;e:for(;;)switch(n.mode){case My:if(n.wrap===0){n.mode=X2;break}for(;d<16;){if(s===0)break e;s--,u+=r[o++]<>>8&255,n.check=Ur(n.check,T,2,0),u=0,d=0,n.mode=Jj;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((u&255)<<8)+(u>>8))%31){e.msg="incorrect header check",n.mode=er;break}if((u&15)!==Qj){e.msg="unknown compression method",n.mode=er;break}if(u>>>=4,d-=4,I=(u&15)+8,n.wbits===0&&(n.wbits=I),I>15||I>n.wbits){e.msg="invalid window size",n.mode=er;break}n.dmax=1<>8&1),n.flags&512&&n.wrap&4&&(T[0]=u&255,T[1]=u>>>8&255,n.check=Ur(n.check,T,2,0)),u=0,d=0,n.mode=eB;case eB:for(;d<32;){if(s===0)break e;s--,u+=r[o++]<>>8&255,T[2]=u>>>16&255,T[3]=u>>>24&255,n.check=Ur(n.check,T,4,0)),u=0,d=0,n.mode=tB;case tB:for(;d<16;){if(s===0)break e;s--,u+=r[o++]<>8),n.flags&512&&n.wrap&4&&(T[0]=u&255,T[1]=u>>>8&255,n.check=Ur(n.check,T,2,0)),u=0,d=0,n.mode=nB;case nB:if(n.flags&1024){for(;d<16;){if(s===0)break e;s--,u+=r[o++]<>>8&255,n.check=Ur(n.check,T,2,0)),u=0,d=0}else n.head&&(n.head.extra=null);n.mode=rB;case rB:if(n.flags&1024&&(g=n.length,g>s&&(g=s),g&&(n.head&&(I=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(o,o+g),I)),n.flags&512&&n.wrap&4&&(n.check=Ur(n.check,r,g,o)),s-=g,o+=g,n.length-=g),n.length))break e;n.length=0,n.mode=aB;case aB:if(n.flags&2048){if(s===0)break e;g=0;do I=r[o+g++],n.head&&I&&n.length<65536&&(n.head.name+=String.fromCharCode(I));while(I&&g>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=Ui;break;case sB:for(;d<32;){if(s===0)break e;s--,u+=r[o++]<>>=d&7,d-=d&7,n.mode=Q2;break}for(;d<3;){if(s===0)break e;s--,u+=r[o++]<>>=1,d-=1,u&3){case 0:n.mode=lB;break;case 1:if(h9e(n),n.mode=Rh,t===Th){u>>>=2,d-=2;break e}break;case 2:n.mode=uB;break;case 3:e.msg="invalid block type",n.mode=er}u>>>=2,d-=2;break;case lB:for(u>>>=d&7,d-=d&7;d<32;){if(s===0)break e;s--,u+=r[o++]<>>16^65535)){e.msg="invalid stored block lengths",n.mode=er;break}if(n.length=u&65535,u=0,d=0,n.mode=Z2,t===Th)break e;case Z2:n.mode=cB;case cB:if(g=n.length,g){if(g>s&&(g=s),g>c&&(g=c),g===0)break e;a.set(r.subarray(o,o+g),i),s-=g,o+=g,c-=g,i+=g,n.length-=g;break}n.mode=Ui;break;case uB:for(;d<14;){if(s===0)break e;s--,u+=r[o++]<>>=5,d-=5,n.ndist=(u&31)+1,u>>>=5,d-=5,n.ncode=(u&15)+4,u>>>=4,d-=4,n.nlen>286||n.ndist>30){e.msg="too many length or distance symbols",n.mode=er;break}n.have=0,n.mode=dB;case dB:for(;n.have>>=3,d-=3}for(;n.have<19;)n.lens[P[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,_={bits:n.lenbits},R=yp(o9e,n.lens,0,19,n.lencode,0,n.work,_),n.lenbits=_.bits,R){e.msg="invalid code lengths set",n.mode=er;break}n.have=0,n.mode=fB;case fB:for(;n.have>>24,h=v>>>16&255,S=v&65535,!(y<=d);){if(s===0)break e;s--,u+=r[o++]<>>=y,d-=y,n.lens[n.have++]=S;else{if(S===16){for($=y+2;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=y,d-=y,n.have===0){e.msg="invalid bit length repeat",n.mode=er;break}I=n.lens[n.have-1],g=3+(u&3),u>>>=2,d-=2}else if(S===17){for($=y+3;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=y,d-=y,I=0,g=3+(u&7),u>>>=3,d-=3}else{for($=y+7;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=y,d-=y,I=0,g=11+(u&127),u>>>=7,d-=7}if(n.have+g>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=er;break}for(;g--;)n.lens[n.have++]=I}}if(n.mode===er)break;if(n.lens[256]===0){e.msg="invalid code -- missing end-of-block",n.mode=er;break}if(n.lenbits=9,_={bits:n.lenbits},R=yp($X,n.lens,0,n.nlen,n.lencode,0,n.work,_),n.lenbits=_.bits,R){e.msg="invalid literal/lengths set",n.mode=er;break}if(n.distbits=6,n.distcode=n.distdyn,_={bits:n.distbits},R=yp(OX,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,_),n.distbits=_.bits,R){e.msg="invalid distances set",n.mode=er;break}if(n.mode=Rh,t===Th)break e;case Rh:n.mode=_h;case _h:if(s>=6&&c>=258){e.next_out=i,e.avail_out=c,e.next_in=o,e.avail_in=s,n.hold=u,n.bits=d,Jze(e,p),i=e.next_out,a=e.output,c=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,u=n.hold,d=n.bits,n.mode===Ui&&(n.back=-1);break}for(n.back=0;v=n.lencode[u&(1<>>24,h=v>>>16&255,S=v&65535,!(y<=d);){if(s===0)break e;s--,u+=r[o++]<>C)],y=v>>>24,h=v>>>16&255,S=v&65535,!(C+y<=d);){if(s===0)break e;s--,u+=r[o++]<>>=C,d-=C,n.back+=C}if(u>>>=y,d-=y,n.back+=y,n.length=S,h===0){n.mode=vB;break}if(h&32){n.back=-1,n.mode=Ui;break}if(h&64){e.msg="invalid literal/length code",n.mode=er;break}n.extra=h&15,n.mode=pB;case pB:if(n.extra){for($=n.extra;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=gB;case gB:for(;v=n.distcode[u&(1<>>24,h=v>>>16&255,S=v&65535,!(y<=d);){if(s===0)break e;s--,u+=r[o++]<>C)],y=v>>>24,h=v>>>16&255,S=v&65535,!(C+y<=d);){if(s===0)break e;s--,u+=r[o++]<>>=C,d-=C,n.back+=C}if(u>>>=y,d-=y,n.back+=y,h&64){e.msg="invalid distance code",n.mode=er;break}n.offset=S,n.extra=h&15,n.mode=mB;case mB:if(n.extra){for($=n.extra;d<$;){if(s===0)break e;s--,u+=r[o++]<>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=er;break}n.mode=hB;case hB:if(c===0)break e;if(g=p-c,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=er;break}g>n.wnext?(g-=n.wnext,m=n.wsize-g):m=n.wnext-g,g>n.length&&(g=n.length),b=n.window}else b=a,m=i-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do a[i++]=b[m++];while(--g);n.length===0&&(n.mode=_h);break;case vB:if(c===0)break e;a[i++]=n.length,c--,n.mode=_h;break;case Q2:if(n.wrap){for(;d<32;){if(s===0)break e;s--,u|=r[o++]<{if(zc(e))return Lo;let t=e.state;return t.window&&(t.window=null),e.state=null,Ec},y9e=(e,t)=>{if(zc(e))return Lo;const n=e.state;return n.wrap&2?(n.head=t,t.done=!1,Ec):Lo},S9e=(e,t)=>{const n=t.length;let r,a,o;return zc(e)||(r=e.state,r.wrap!==0&&r.mode!==Cb)?Lo:r.mode===Cb&&(a=1,a=yg(a,t,n,0),a!==r.check)?NX:(o=jX(e,t,n,n),o?(r.mode=AX,kX):(r.havedict=1,Ec))};var w9e=PX,x9e=LX,C9e=DX,E9e=m9e,I9e=FX,T9e=v9e,R9e=b9e,_9e=y9e,$9e=S9e,O9e="pako inflate (from Nodeca project)",Zi={inflateReset:w9e,inflateReset2:x9e,inflateResetKeep:C9e,inflateInit:E9e,inflateInit2:I9e,inflate:T9e,inflateEnd:R9e,inflateGetHeader:_9e,inflateSetDictionary:$9e,inflateInfo:O9e};function N9e(){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}var k9e=N9e;const BX=Object.prototype.toString,{Z_NO_FLUSH:A9e,Z_FINISH:M9e,Z_OK:xg,Z_STREAM_END:tI,Z_NEED_DICT:nI,Z_STREAM_ERROR:D9e,Z_DATA_ERROR:xB,Z_MEM_ERROR:P9e}=Zd;function gm(e){this.options=Ay.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new RX,this.strm.avail_out=0;let n=Zi.inflateInit2(this.strm,t.windowBits);if(n!==xg)throw new Error(xc[n]);if(this.header=new k9e,Zi.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=wg.string2buf(t.dictionary):BX.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=Zi.inflateSetDictionary(this.strm,t.dictionary),n!==xg)))throw new Error(xc[n])}gm.prototype.push=function(e,t){const n=this.strm,r=this.options.chunkSize,a=this.options.dictionary;let o,i,s;if(this.ended)return!1;for(t===~~t?i=t:i=t===!0?M9e:A9e,BX.call(e)==="[object ArrayBuffer]"?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),o=Zi.inflate(n,i),o===nI&&a&&(o=Zi.inflateSetDictionary(n,a),o===xg?o=Zi.inflate(n,i):o===xB&&(o=nI));n.avail_in>0&&o===tI&&n.state.wrap>0&&e[n.next_in]!==0;)Zi.inflateReset(n),o=Zi.inflate(n,i);switch(o){case D9e:case xB:case nI:case P9e:return this.onEnd(o),this.ended=!0,!1}if(s=n.avail_out,n.next_out&&(n.avail_out===0||o===tI))if(this.options.to==="string"){let c=wg.utf8border(n.output,n.next_out),u=n.next_out-c,d=wg.buf2string(n.output,c);n.next_out=u,n.avail_out=r-u,u&&n.output.set(n.output.subarray(c,c+u),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(o===xg&&s===0)){if(o===tI)return o=Zi.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};gm.prototype.onData=function(e){this.chunks.push(e)};gm.prototype.onEnd=function(e){e===xg&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=Ay.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function ik(e,t){const n=new gm(t);if(n.push(e),n.err)throw n.msg||xc[n.err];return n.result}function L9e(e,t){return t=t||{},t.raw=!0,ik(e,t)}var F9e=gm,j9e=ik,B9e=L9e,z9e=ik,H9e=Zd,U9e={Inflate:F9e,inflate:j9e,inflateRaw:B9e,ungzip:z9e,constants:H9e};const{Deflate:gHe,deflate:V9e,deflateRaw:mHe,gzip:hHe}=Zze,{Inflate:W9e,inflate:vHe,inflateRaw:bHe,ungzip:yHe}=U9e;var G9e=V9e,q9e=W9e;class cv{constructor(t,n=!1,r=!0){this.device=t,this.tracing=n,this.slipReaderEnabled=!1,this.leftOver=new Uint8Array(0),this.baudrate=0,this.traceLog="",this.lastTraceTime=Date.now(),this._DTR_state=!1,this.slipReaderEnabled=r}getInfo(){const t=this.device.getInfo();return t.usbVendorId&&t.usbProductId?`WebSerial VendorID 0x${t.usbVendorId.toString(16)} ProductID 0x${t.usbProductId.toString(16)}`:""}getPid(){return this.device.getInfo().usbProductId}trace(t){const a=`${`TRACE ${(Date.now()-this.lastTraceTime).toFixed(3)}`} ${t}`;console.log(a),this.traceLog+=a+` `}async returnTrace(){try{await navigator.clipboard.writeText(this.traceLog),console.log("Text copied to clipboard!")}catch(t){console.error("Failed to copy text:",t)}}hexify(t){return Array.from(t).map(n=>n.toString(16).padStart(2,"0")).join("").padEnd(16," ")}hexConvert(t,n=!0){if(n&&t.length>16){let r="",a=t;for(;a.length>0;){const o=a.slice(0,16),i=String.fromCharCode(...o).split("").map(s=>s===" "||s>=" "&&s<="~"&&s!==" "?s:".").join("");a=a.slice(16),r+=` ${this.hexify(o.slice(0,8))} ${this.hexify(o.slice(8))} | ${i}`}return r}else return this.hexify(t)}slipWriter(t){const n=[];n.push(192);for(let r=0;r0)return o;a=this.leftOver,this.leftOver=new Uint8Array(0)}if(this.device.readable==null)return this.leftOver;this.reader=this.device.readable.getReader();try{t>0&&(r=setTimeout(()=>{this.reader&&this.reader.cancel()},t));do{const{value:o,done:i}=await this.reader.read();if(i)throw this.leftOver=a,new Error("Timeout");a=new Uint8Array(this._appendBuffer(a.buffer,o.buffer))}while(a.length0&&clearTimeout(r),this.reader.releaseLock()}if(this.tracing&&(console.log("Read bytes"),this.trace(`Read ${a.length} bytes: ${this.hexConvert(a)}`)),this.slipReaderEnabled){const o=this.slipReader(a);return this.tracing&&(console.log("Slip reader results"),this.trace(`Read ${o.length} bytes: ${this.hexConvert(o)}`)),o}return a}async rawRead(t=0){if(this.leftOver.length!=0){const r=this.leftOver;return this.leftOver=new Uint8Array(0),r}if(!this.device.readable)return this.leftOver;this.reader=this.device.readable.getReader();let n;try{t>0&&(n=setTimeout(()=>{this.reader&&this.reader.cancel()},t));const{value:r,done:a}=await this.reader.read();return a||this.tracing&&(console.log("Raw Read bytes"),this.trace(`Read ${r.length} bytes: ${this.hexConvert(r)}`)),r}finally{t>0&&clearTimeout(n),this.reader.releaseLock()}}async setRTS(t){await this.device.setSignals({requestToSend:t}),await this.setDTR(this._DTR_state)}async setDTR(t){this._DTR_state=t,await this.device.setSignals({dataTerminalReady:t})}async connect(t=115200,n={}){await this.device.open({baudRate:t,dataBits:n==null?void 0:n.dataBits,stopBits:n==null?void 0:n.stopBits,bufferSize:n==null?void 0:n.bufferSize,parity:n==null?void 0:n.parity,flowControl:n==null?void 0:n.flowControl}),this.baudrate=t,this.leftOver=new Uint8Array(0)}async sleep(t){return new Promise(n=>setTimeout(n,t))}async waitForUnlock(t){for(;this.device.readable&&this.device.readable.locked||this.device.writable&&this.device.writable.locked;)await this.sleep(t)}async disconnect(){var t,n;!((t=this.device.readable)===null||t===void 0)&&t.locked&&await((n=this.reader)===null||n===void 0?void 0:n.cancel()),await this.waitForUnlock(400),this.reader=void 0,await this.device.close()}}function uv(e){return new Promise(t=>setTimeout(t,e))}async function K9e(e){await e.setRTS(!1),await e.setDTR(!1),await uv(100),await e.setDTR(!0),await e.setRTS(!1),await uv(100),await e.setRTS(!0),await e.setDTR(!1),await e.setRTS(!0),await uv(100),await e.setRTS(!1),await e.setDTR(!1)}function Y9e(e){const t=["D","R","W"],n=e.split("|");for(const r of n){const a=r[0],o=r.slice(1);if(!t.includes(a))return!1;if(a==="D"||a==="R"){if(o!=="0"&&o!=="1")return!1}else if(a==="W"){const i=parseInt(o);if(isNaN(i)||i<=0)return!1}}return!0}async function X9e(e,t){const n={D:async r=>await e.setDTR(r),R:async r=>await e.setRTS(r),W:async r=>await uv(r)};try{if(!Y9e(t))return;const a=t.split("|");for(const o of a){const i=o[0],s=o.slice(1);i==="W"?await n.W(Number(s)):(i==="D"||i==="R")&&await n[i](s==="1")}}catch{throw new Error("Invalid custom reset sequence")}}var Z9e=function(t){return atob(t)};const CB=Ra(Z9e);async function Q9e(e){switch(e){case 15736195:{const{ESP32ROM:t}=await Hi(async()=>{const{ESP32ROM:n}=await import("./esp32-BPYaDt9v.js");return{ESP32ROM:n}},__vite__mapDeps([0,1]));return new t}case 1867591791:case 2084675695:{const{ESP32C2ROM:t}=await Hi(async()=>{const{ESP32C2ROM:n}=await import("./esp32c2-CtjOOsCE.js");return{ESP32C2ROM:n}},__vite__mapDeps([2,3,1]));return new t}case 1763790959:case 456216687:case 1216438383:case 1130455151:{const{ESP32C3ROM:t}=await Hi(async()=>{const{ESP32C3ROM:n}=await import("./esp32c3-DDsZSfEd.js");return{ESP32C3ROM:n}},__vite__mapDeps([3,1]));return new t}case 752910447:{const{ESP32C6ROM:t}=await Hi(async()=>{const{ESP32C6ROM:n}=await import("./esp32c6-BRG5ZpJ8.js");return{ESP32C6ROM:n}},__vite__mapDeps([4,1]));return new t}case 3619110528:{const{ESP32H2ROM:t}=await Hi(async()=>{const{ESP32H2ROM:n}=await import("./esp32h2-Cf8JbGZQ.js");return{ESP32H2ROM:n}},__vite__mapDeps([5,1]));return new t}case 9:{const{ESP32S3ROM:t}=await Hi(async()=>{const{ESP32S3ROM:n}=await import("./esp32s3-DkgZlzv1.js");return{ESP32S3ROM:n}},__vite__mapDeps([6,1]));return new t}case 1990:{const{ESP32S2ROM:t}=await Hi(async()=>{const{ESP32S2ROM:n}=await import("./esp32s2-BOsRKhcm.js");return{ESP32S2ROM:n}},__vite__mapDeps([7,1]));return new t}case 4293968129:{const{ESP8266ROM:t}=await Hi(async()=>{const{ESP8266ROM:n}=await import("./esp8266-8VKmCx7J.js");return{ESP8266ROM:n}},__vite__mapDeps([8,1]));return new t}case 0:case 182303440:case 117676761:{const{ESP32P4ROM:t}=await Hi(async()=>{const{ESP32P4ROM:n}=await import("./esp32p4-DfBdIAkh.js");return{ESP32P4ROM:n}},__vite__mapDeps([9,0,1]));return new t}default:return null}}class rI{constructor(t){this.ESP_RAM_BLOCK=6144,this.ESP_FLASH_BEGIN=2,this.ESP_FLASH_DATA=3,this.ESP_FLASH_END=4,this.ESP_MEM_BEGIN=5,this.ESP_MEM_END=6,this.ESP_MEM_DATA=7,this.ESP_WRITE_REG=9,this.ESP_READ_REG=10,this.ESP_SPI_ATTACH=13,this.ESP_CHANGE_BAUDRATE=15,this.ESP_FLASH_DEFL_BEGIN=16,this.ESP_FLASH_DEFL_DATA=17,this.ESP_FLASH_DEFL_END=18,this.ESP_SPI_FLASH_MD5=19,this.ESP_ERASE_FLASH=208,this.ESP_ERASE_REGION=209,this.ESP_READ_FLASH=210,this.ESP_RUN_USER_CODE=211,this.ESP_IMAGE_MAGIC=233,this.ESP_CHECKSUM_MAGIC=239,this.ROM_INVALID_RECV_MSG=5,this.ERASE_REGION_TIMEOUT_PER_MB=3e4,this.ERASE_WRITE_TIMEOUT_PER_MB=4e4,this.MD5_TIMEOUT_PER_MB=8e3,this.CHIP_ERASE_TIMEOUT=12e4,this.FLASH_READ_TIMEOUT=1e5,this.MAX_TIMEOUT=this.CHIP_ERASE_TIMEOUT*2,this.CHIP_DETECT_MAGIC_REG_ADDR=1073745920,this.DETECTED_FLASH_SIZES={18:"256KB",19:"512KB",20:"1MB",21:"2MB",22:"4MB",23:"8MB",24:"16MB"},this.DETECTED_FLASH_SIZES_NUM={18:256,19:512,20:1024,21:2048,22:4096,23:8192,24:16384},this.USB_JTAG_SERIAL_PID=4097,this.romBaudrate=115200,this.debugLogging=!1,this.syncStubDetected=!1,this.checksum=function(n){let r,a=239;for(r=0;rsetTimeout(n,t))}write(t,n=!0){this.terminal?n?this.terminal.writeLine(t):this.terminal.write(t):console.log(t)}error(t,n=!0){this.write(`Error: ${t}`,n)}info(t,n=!0){this.write(t,n)}debug(t,n=!0){this.debugLogging&&this.write(`Debug: ${t}`,n)}_shortToBytearray(t){return new Uint8Array([t&255,t>>8&255])}_intToByteArray(t){return new Uint8Array([t&255,t>>8&255,t>>16&255,t>>24&255])}_byteArrayToShort(t,n){return t|n>>8}_byteArrayToInt(t,n,r,a){return t|n<<8|r<<16|a<<24}_appendBuffer(t,n){const r=new Uint8Array(t.byteLength+n.byteLength);return r.set(new Uint8Array(t),0),r.set(new Uint8Array(n),t.byteLength),r.buffer}_appendArray(t,n){const r=new Uint8Array(t.length+n.length);return r.set(t,0),r.set(n,t.length),r}ui8ToBstr(t){let n="";for(let r=0;r0&&(i=this._appendArray(i,this._intToByteArray(this.chip.UART_DATE_REG_ADDR)),i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(0)),i=this._appendArray(i,this._intToByteArray(o))),await this.checkCommand("write target memory",this.ESP_WRITE_REG,i)}async sync(){this.debug("Sync");const t=new Uint8Array(36);let n;for(t[0]=7,t[1]=7,t[2]=18,t[3]=32,n=0;n<32;n++)t[4+n]=85;try{const r=await this.command(8,t,void 0,void 0,100);return this.syncStubDetected=this.syncStubDetected&&r[0]===0,r}catch(r){throw this.debug("Sync err "+r),r}}async _connectAttempt(t="default_reset",n=!1){if(this.debug("_connect_attempt "+t+" "+n),t!=="no_reset")if(this.transport.getPid()===this.USB_JTAG_SERIAL_PID)await K9e(this.transport);else{const o=n?"D0|R1|W100|W2000|D1|R0|W50|D0":"D0|R1|W100|D1|R0|W50|D0";await X9e(this.transport,o)}let r=0,a=!0;for(;a;){try{const o=await this.transport.read(1e3);r+=o.length}catch(o){if(this.debug(o.message),o instanceof Error){a=!1;break}}await this._sleep(50)}for(this.transport.slipReaderEnabled=!0,this.syncStubDetected=!0,r=7;r--;){try{const o=await this.sync();return this.debug(o[0].toString()),"success"}catch(o){o instanceof Error&&(n?this.info("_",!1):this.info(".",!1))}await this._sleep(50)}return"error"}async connect(t="default_reset",n=7,r=!1){let a,o;for(this.info("Connecting...",!1),await this.transport.connect(this.romBaudrate,this.serialOptions),a=0;a>>0;this.debug("Chip Magic "+i.toString(16));const s=await Q9e(i);if(this.chip===null)throw new xa(`Unexpected CHIP magic value ${i}. Failed to autodetect chip type.`);this.chip=s}}async detectChip(t="default_reset"){await this.connect(t),this.info("Detecting chip type... ",!1),this.chip!=null?this.info(this.chip.CHIP_NAME):this.info("unknown!")}async checkCommand(t="",n=null,r=new Uint8Array(0),a=0,o=3e3){this.debug("check_command "+t);const i=await this.command(n,r,a,void 0,o);return i[1].length>4?i[1]:i[0]}async memBegin(t,n,r,a){this.debug("mem_begin "+t+" "+n+" "+r+" "+a.toString(16));let o=this._appendArray(this._intToByteArray(t),this._intToByteArray(n));o=this._appendArray(o,this._intToByteArray(r)),o=this._appendArray(o,this._intToByteArray(a)),await this.checkCommand("enter RAM download mode",this.ESP_MEM_BEGIN,o)}async memBlock(t,n){let r=this._appendArray(this._intToByteArray(t.length),this._intToByteArray(n));r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,this._intToByteArray(0)),r=this._appendArray(r,t);const a=this.checksum(t);await this.checkCommand("write to target RAM",this.ESP_MEM_DATA,r,a)}async memFinish(t){const n=t===0?1:0,r=this._appendArray(this._intToByteArray(n),this._intToByteArray(t));await this.checkCommand("leave RAM download mode",this.ESP_MEM_END,r,void 0,50)}async flashSpiAttach(t){const n=this._intToByteArray(t);await this.checkCommand("configure SPI flash pins",this.ESP_SPI_ATTACH,n)}async flashBegin(t,n){const r=Math.floor((t+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),a=this.chip.getEraseSize(n,t),o=new Date,i=o.getTime();let s=3e3;this.IS_STUB==!1&&(s=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,t)),this.debug("flash begin "+a+" "+r+" "+this.FLASH_WRITE_SIZE+" "+n+" "+t);let c=this._appendArray(this._intToByteArray(a),this._intToByteArray(r));c=this._appendArray(c,this._intToByteArray(this.FLASH_WRITE_SIZE)),c=this._appendArray(c,this._intToByteArray(n)),this.IS_STUB==!1&&(c=this._appendArray(c,this._intToByteArray(0))),await this.checkCommand("enter Flash download mode",this.ESP_FLASH_BEGIN,c,void 0,s);const u=o.getTime();return t!=0&&this.IS_STUB==!1&&this.info("Took "+(u-i)/1e3+"."+(u-i)%1e3+"s to erase flash block"),r}async flashDeflBegin(t,n,r){const a=Math.floor((n+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),o=Math.floor((t+this.FLASH_WRITE_SIZE-1)/this.FLASH_WRITE_SIZE),i=new Date,s=i.getTime();let c,u;this.IS_STUB?(c=t,u=3e3):(c=o*this.FLASH_WRITE_SIZE,u=this.timeoutPerMb(this.ERASE_REGION_TIMEOUT_PER_MB,c)),this.info("Compressed "+t+" bytes to "+n+"...");let d=this._appendArray(this._intToByteArray(c),this._intToByteArray(a));d=this._appendArray(d,this._intToByteArray(this.FLASH_WRITE_SIZE)),d=this._appendArray(d,this._intToByteArray(r)),(this.chip.CHIP_NAME==="ESP32-S2"||this.chip.CHIP_NAME==="ESP32-S3"||this.chip.CHIP_NAME==="ESP32-C3"||this.chip.CHIP_NAME==="ESP32-C2")&&this.IS_STUB===!1&&(d=this._appendArray(d,this._intToByteArray(0))),await this.checkCommand("enter compressed flash mode",this.ESP_FLASH_DEFL_BEGIN,d,void 0,u);const f=i.getTime();return t!=0&&this.IS_STUB===!1&&this.info("Took "+(f-s)/1e3+"."+(f-s)%1e3+"s to erase flash block"),a}async flashBlock(t,n,r){let a=this._appendArray(this._intToByteArray(t.length),this._intToByteArray(n));a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,t);const o=this.checksum(t);await this.checkCommand("write to target Flash after seq "+n,this.ESP_FLASH_DATA,a,o,r)}async flashDeflBlock(t,n,r){let a=this._appendArray(this._intToByteArray(t.length),this._intToByteArray(n));a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,t);const o=this.checksum(t);this.debug("flash_defl_block "+t[0].toString(16)+" "+t[1].toString(16)),await this.checkCommand("write compressed data to flash after seq "+n,this.ESP_FLASH_DEFL_DATA,a,o,r)}async flashFinish(t=!1){const n=t?0:1,r=this._intToByteArray(n);await this.checkCommand("leave Flash mode",this.ESP_FLASH_END,r)}async flashDeflFinish(t=!1){const n=t?0:1,r=this._intToByteArray(n);await this.checkCommand("leave compressed flash mode",this.ESP_FLASH_DEFL_END,r)}async runSpiflashCommand(t,n,r){const s=this.chip.SPI_REG_BASE,c=s+0,u=s+this.chip.SPI_USR_OFFS,d=s+this.chip.SPI_USR1_OFFS,f=s+this.chip.SPI_USR2_OFFS,p=s+this.chip.SPI_W0_OFFS;let g;this.chip.SPI_MOSI_DLEN_OFFS!=null?g=async(I,R)=>{const T=s+this.chip.SPI_MOSI_DLEN_OFFS,_=s+this.chip.SPI_MISO_DLEN_OFFS;I>0&&await this.writeReg(T,I-1),R>0&&await this.writeReg(_,R-1)}:g=async(I,R)=>{const T=d,_=17,$=8,P=I===0?0:I-1,A=(R===0?0:R-1)<<$|P<<_;await this.writeReg(T,A)};const m=1<<18,b=28;if(r>32)throw new xa("Reading more than 32 bits back from a SPI flash operation is unsupported");if(n.length>64)throw new xa("Writing more than 64 bytes of data with one SPI command is unsupported");const v=n.length*8,y=await this.readReg(u),h=await this.readReg(f);let S=-2147483648,C;r>0&&(S|=268435456),v>0&&(S|=134217728),await g(v,r),await this.writeReg(u,S);let x=7<("00"+n.toString(16)).slice(-2)).join("")}async flashMd5sum(t,n){const r=this.timeoutPerMb(this.MD5_TIMEOUT_PER_MB,n);let a=this._appendArray(this._intToByteArray(t),this._intToByteArray(n));a=this._appendArray(a,this._intToByteArray(0)),a=this._appendArray(a,this._intToByteArray(0));let o=await this.checkCommand("calculate md5sum",this.ESP_SPI_FLASH_MD5,a,void 0,r);return o instanceof Uint8Array&&o.length>16&&(o=o.slice(0,16)),this.toHex(o)}async readFlash(t,n,r=null){let a=this._appendArray(this._intToByteArray(t),this._intToByteArray(n));a=this._appendArray(a,this._intToByteArray(4096)),a=this._appendArray(a,this._intToByteArray(1024));const o=await this.checkCommand("read flash",this.ESP_READ_FLASH,a);if(o!=0)throw new xa("Failed to read memory: "+o);let i=new Uint8Array(0);for(;i.length0&&(i=this._appendArray(i,s),await this.transport.write(this._intToByteArray(i.length)),r&&r(s,i.length,n));else throw new xa("Failed to read memory: "+s)}return i}async runStub(){if(this.syncStubDetected)return this.info("Stub is already running. No upload is necessary."),this.chip;this.info("Uploading stub...");let t=CB(this.chip.ROM_TEXT),n=t.split("").map(function(s){return s.charCodeAt(0)});const r=new Uint8Array(n);t=CB(this.chip.ROM_DATA),n=t.split("").map(function(s){return s.charCodeAt(0)});const a=new Uint8Array(n);let o=Math.floor((r.length+this.ESP_RAM_BLOCK-1)/this.ESP_RAM_BLOCK),i;for(await this.memBegin(r.length,o,this.ESP_RAM_BLOCK,this.chip.TEXT_START),i=0;i"u")throw new xa("Flash size "+t+" is not supported by this chip type. Supported sizes: "+this.chip.FLASH_SIZES);return this.chip.FLASH_SIZES[t]}_updateImageFlashParams(t,n,r,a,o){if(this.debug("_update_image_flash_params "+r+" "+a+" "+o),t.length<8||n!=this.chip.BOOTLOADER_FLASH_OFFSET)return t;if(r==="keep"&&a==="keep"&&o==="keep")return this.info("Not changing the image"),t;const i=parseInt(t[0]);let s=parseInt(t[2]);const c=parseInt(t[3]);if(i!==this.ESP_IMAGE_MAGIC)return this.info("Warning: Image file at 0x"+n.toString(16)+" doesn't look like an image file, so not changing any flash settings."),t;a!=="keep"&&(s={qio:0,qout:1,dio:2,dout:3}[a]);let u=c&15;o!=="keep"&&(u={"40m":0,"26m":1,"20m":2,"80m":15}[o]);let d=c&240;r!=="keep"&&(d=this.parseFlashSizeArg(r));const f=s<<8|u+d;return this.info("Flash params set to "+f.toString(16)),parseInt(t[2])!==s<<8&&(t=t.substring(0,2)+(s<<8).toString()+t.substring(3)),parseInt(t[3])!==u+d&&(t=t.substring(0,3)+(u+d).toString()+t.substring(4)),t}async writeFlash(t){if(this.debug("EspLoader program"),t.flashSize!=="keep"){const a=this.flashSizeBytes(t.flashSize);for(let o=0;oa)throw new xa(`File ${o+1} doesn't fit in the available flash`)}this.IS_STUB===!0&&t.eraseAll===!0&&await this.eraseFlash();let n,r;for(let a=0;a0&&(n+="ÿÿÿÿ".substring(4-o)),r=t.fileArray[a].address,this.debug("Image Length "+n.length),n.length===0){this.debug("Warning: File is empty");continue}n=this._updateImageFlashParams(n,r,t.flashSize,t.flashMode,t.flashFreq);let i=null;t.calculateMD5Hash&&(i=t.calculateMD5Hash(n),this.debug("Image MD5 "+i));const s=n.length;let c;if(t.compress){const h=this.bstrToUi8(n);n=this.ui8ToBstr(G9e(h,{level:9})),c=await this.flashDeflBegin(s,n.length,r)}else c=await this.flashBegin(s,r);let u=0,d=0;const f=n.length;t.reportProgress&&t.reportProgress(a,0,f);let p=new Date;const g=p.getTime();let m=5e3;const b=new q9e({chunkSize:1});let v=0;for(b.onData=function(h){v+=h.byteLength};n.length>0;){this.debug("Write loop "+r+" "+u+" "+c),this.info("Writing at 0x"+(r+v).toString(16)+"... ("+Math.floor(100*(u+1)/c)+"%)");const h=this.bstrToUi8(n.slice(0,this.FLASH_WRITE_SIZE));if(t.compress){const S=v;b.push(h,!1);const C=v-S;let x=3e3;this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,C)>3e3&&(x=this.timeoutPerMb(this.ERASE_WRITE_TIMEOUT_PER_MB,C)),this.IS_STUB===!1&&(m=x),await this.flashDeflBlock(h,u,m),this.IS_STUB&&(m=x)}else throw new xa("Yet to handle Non Compressed writes");d+=h.length,n=n.slice(this.FLASH_WRITE_SIZE,n.length),u++,t.reportProgress&&t.reportProgress(a,d,f)}this.IS_STUB&&await this.readReg(this.CHIP_DETECT_MAGIC_REG_ADDR,m),p=new Date;const y=p.getTime()-g;if(t.compress&&this.info("Wrote "+s+" bytes ("+d+" compressed) at 0x"+r.toString(16)+" in "+y/1e3+" seconds."),i){const h=await this.flashMd5sum(r,s);if(new String(h).valueOf()!=new String(i).valueOf())throw this.info("File md5: "+i),this.info("Flash md5: "+h),new xa("MD5 of file does not match data in flash!");this.info("Hash of data verified.")}}this.info("Leaving..."),this.IS_STUB&&(await this.flashBegin(0,0),t.compress?await this.flashDeflFinish():await this.flashFinish())}async flashId(){this.debug("flash_id");const t=await this.readFlashId();this.info("Manufacturer: "+(t&255).toString(16));const n=t>>16&255;this.info("Device: "+(t>>8&255).toString(16)+n.toString(16)),this.info("Detected flash size: "+this.DETECTED_FLASH_SIZES[n])}async getFlashSize(){this.debug("flash_id");const n=await this.readFlashId()>>16&255;return this.DETECTED_FLASH_SIZES_NUM[n]}async hardReset(){await this.transport.setRTS(!0),await this._sleep(100),await this.transport.setRTS(!1)}async softReset(){if(!this.IS_STUB)await this.flashBegin(0,0),await this.flashFinish(!1);else{if(this.chip.CHIP_NAME!="ESP8266")throw new xa("Soft resetting is currently only supported on ESP8266");await this.command(this.ESP_RUN_USER_CODE,void 0,void 0,!1)}}}const J9e=()=>{const[e,t]=l.useState(0),n=["",".","..","...","....","....."];return l.useEffect(()=>{const r=setInterval(()=>{t(a=>(a+1)%n.length)},666);return()=>clearInterval(r)},[]),w.jsx(w.Fragment,{children:n[e]})},eHe=()=>"serial"in navigator,uu=new _n(Sn()),{Paragraph:Er,Text:tHe}=$n,{Step:nHe}=DO,rHe=()=>{const{t:e}=zt(),t=ca.language,n=l.useRef(null),[r,a]=l.useState(!1),[o,i]=l.useState(""),[s,c]=l.useState(!1),[u,d]=l.useState(!1),[f,p]=l.useState(!1),[g,m]=l.useState("certs/client"),[b,v]=l.useState(""),[y,h]=l.useState(0),[S,C]=l.useState([w.jsx(w.Fragment,{}),w.jsx(w.Fragment,{}),w.jsx(w.Fragment,{}),w.jsx(w.Fragment,{})]),[x,E]=l.useState({progress:0,chipMac:"",chipType:"",flashId:"",flashManuf:"",flashDevice:"",flashSize:"",state:"",filename:"",flashName:"",port:null,originalFlash:null,patchedFlash:null,showStatus:!1,showProgress:!1,showDownload:!1,showFlash:!1,connected:!1,hostname:window.location.hostname,wifi_ssid:"",wifi_pass:"",proceed:!1,actionInProgress:!1,warningTextHostname:"",warningTextWifi:"",downloadLink:"",downloadLinkPatched:"",error:!1}),[I,R]=l.useState(!1),T=921600,_=115200;function $(ne){const oe=new Uint8Array(ne);let ae="";for(let ue=0;ue{(async()=>{const ae=await(await uu.apiGetTeddyCloudSettingRaw("core.certdir")).text();m(ae)})()},[]),l.useEffect(()=>{R(eHe())},[]),l.useEffect(()=>{if(window.location.protocol!=="https:"){a(!1);const ne=async()=>{try{return await(await uu.apiGetTeddyCloudSettingRaw("core.server.https_web_port")).text()}catch(ue){console.error("Error fetching https port: ",ue)}},oe=async()=>{try{return await(await uu.apiGetTeddyCloudSettingRaw("core.server.http_port")).text()}catch(ue){console.error("Error fetching http port: ",ue)}};(async()=>{const ue=await ne()||"",Se=await oe()||"",Te=new URL(window.location.href);Te.protocol="https:",Te.port?Te.port=Te.port===Se?ue:Te.port:Te.port=ue,i(Te.toString())})()}else a(!0)},[]),l.useEffect(()=>{F(y,(()=>{switch(y){case 0:return X;case 1:return G;case 2:return V;case 3:return Y;default:return w.jsx("div",{})}})())},[x,t]),l.useEffect(()=>{x.proceed&&ge()},[x.proceed]),l.useEffect(()=>{c(x.actionInProgress)},[x.actionInProgress]);const P=()=>{o&&(window.location.href=o)},D=async ne=>{if(x.port)return console.log(x.port.getInfo),x.port;E(ae=>({...ae,showStatus:!0,showProgress:!1,progress:0,state:ne||"Open serial port"}));let oe=null;try{oe=await navigator.serial.requestPort(),await oe.open({baudRate:115200}),await oe.close()}catch(ae){return ae==="NetworkError"?(E(ue=>({...ue,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.portOpenFailedInUse"),error:!0})),alert(e("tonieboxes.esp32BoxFlashing.esp32flasher.portOpenFailedInUse"))):ae==="NotFoundError"?E(ue=>({...ue,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.noPortAvailable"),error:!0})):(E(ue=>({...ue,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.error")+ae,error:!0})),alert(e("tonieboxes.esp32BoxFlashing.esp32flasher.error")+` ${ae}`)),null}return oe?(console.log("port done"),E(ae=>({...ae,port:oe})),oe):(E(ae=>({...ae,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.invalidSerialPort"),error:!0})),null)},A=async ne=>{if(console.log("loadFlashFile"),!ne.target.files)return;const oe=ne.target.files[0];if(!oe)return;E(ue=>({...ue,state:"",chipMac:"",chipType:"",flashId:"",flashManuf:"",flashDevice:"",flashSize:"",error:!1,actionInProgress:!0})),console.log("Read file '"+oe+"'");const ae=new FileReader;ae.onload=async ue=>{var Le;console.log("Connecting to ESP32");const Se=await D(e("tonieboxes.esp32BoxFlashing.esp32flasher.connectingReadMac"));if(Se===null||x.connected){E(_e=>({..._e,actionInProgress:!1}));return}E(_e=>({..._e,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.connectingTo")+` ${x.port}`,showFlash:!1,connected:!0}));let Te=null;try{const _e=new cv(Se);Te=new rI({transport:_e,baudrate:T,romBaudrate:_})}catch(_e){E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.failedToConnect")+` ${_e}`,connected:!1,actionInProgress:!1,error:!0})),alert(_e),await Se.close();return}try{E(Ce=>({...Ce,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.retrievingMac"),actionInProgress:!0})),await Te.main();let _e=await Te.chip.readMac(Te);E(Ce=>({...Ce,chipMac:_e})),console.log("Chip MAC: "+_e),await Se.close();const Re=(Le=ue.target)==null?void 0:Le.result,Pe=new Uint8Array(Re),$e=`ESP32_${_e.replace(/:/g,"")}`,ve=new Blob([Pe],{type:"application/octet-stream"}),Ne=URL.createObjectURL(ve);await N(Pe,$e),ue.target&&E(Ce=>{var ye;return{...Ce,patchedFlash:(ye=ue.target)==null?void 0:ye.result,showFlash:!0,connected:!1,flashName:"from file",downloadLink:Ne}}),console.log("Done")}catch(_e){E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.failedToCommunicate")+` ${_e}`,connected:!1,actionInProgress:!1,error:!0})),console.error(_e),alert(_e),await Se.close();return}},ae.readAsArrayBuffer(oe),E(ue=>({...ue,actionInProgress:!1})),ne.target.value=""},O=async()=>{let ne=null,oe=null,ae="";oe=new Uint8Array(1024);const ue=await D(e("tonieboxes.esp32BoxFlashing.esp32flasher.connectingReadFlash"));if(ue===null||x.connected)return;E(_e=>({..._e,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.connectingTo")+` ${ue.getInfo()}`,chipMac:"",chipType:"",flashId:"",flashManuf:"",flashDevice:"",flashSize:"",showFlash:!1,connected:!0,actionInProgress:!0,error:!1}));try{const _e=new cv(ue);ne=new rI({transport:_e,baudrate:T,romBaudrate:_})}catch(_e){E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.failedToConnect")+` ${_e}`,connected:!1,actionInProgress:!1,error:!0})),alert(_e),await ue.close();return}try{E($e=>({...$e,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.connectingToESP")})),await ne.main(),E($e=>({...$e,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.connected")})),ae=await ne.chip.readMac(ne),E($e=>({...$e,chipMac:ae})),console.log("Chip MAC: "+ae);const _e=await ne.chip.getChipDescription(ne);E($e=>({...$e,chipType:_e}));let Re=await ne.readFlashId();E($e=>({...$e,flashId:""+Re,flashManuf:""+(Re&255),flashDevice:""+(Re>>8&255)}));let Pe=await ne.getFlashSize();if(E($e=>({...$e,flashSize:""+Pe})),Pe<0||Pe>16384){E($e=>({...$e,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.flashSizeError"),connected:!1,actionInProgress:!1,error:!0})),await ue.close();return}E($e=>({...$e,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.readingFlash"),showProgress:!0,progress:0})),oe=await ne.readFlash(0,Pe*1024,($e,ve,Ne)=>{const Ce=100*ve/Ne;E(ye=>({...ye,progress:Ce}))}),await ue.close(),E($e=>({...$e,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.readingFinished"),progress:100,originalFlash:oe,connected:!1}))}catch(_e){E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.failedToCommunicate")+` ${_e}`,connected:!1,actionInProgress:!1,error:!0})),console.error(_e),alert(_e),await ue.close();return}const Se=`ESP32_${ae.replace(/:/g,"")}`,Te=new Blob([oe],{type:"application/octet-stream"}),Le=URL.createObjectURL(Te);E(_e=>({..._e,downloadLink:Le,showProgress:!1})),await N(oe,Se),console.log("Done")},N=async(ne,oe)=>{try{E(Se=>({...Se,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.uploading"),error:!1}));const ae=new FormData;ae.append(oe,new Blob([ne.buffer]),oe);const ue=await uu.apiPostTeddyCloudFormDataRaw("/api/esp32/uploadFirmware",ae);if(ue.ok&&ue.status===200){const Se=await ue.text();E(Te=>({...Te,showDownload:!0,filename:Se,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.uploadSuccessful")+` ${Se}`+e("tonieboxes.esp32BoxFlashing.esp32flasher.readyToProceed"),proceed:!0,actionInProgress:!1}))}else E(Se=>({...Se,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.uploadFailed"),actionInProgress:!1,error:!0}))}catch(ae){console.error("There was an error when uploading!",ae),E(ue=>({...ue,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.uploadFailed"),actionInProgress:!1,error:!0}))}},k=async()=>{if(x.wifi_ssid&&!x.wifi_pass||!x.wifi_ssid&&x.wifi_pass){E(oe=>({...oe,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.wifiCredentialsIncomplete"),showStatus:!0,warningTextWifi:e("tonieboxes.esp32BoxFlashing.esp32flasher.wifiCredentialsIncomplete"),error:!0}));return}E(oe=>({...oe,actionInProgress:!0})),E(oe=>({...oe,showProgress:!1,showFlash:!1,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.patchingFlashImage"),error:!1}));const ne=await uu.apiGetTeddyCloudApiRaw(`/api/esp32/patchFirmware?filename=${x.filename}&hostname=${encodeURIComponent(x.hostname)}`+(x.wifi_ssid&&x.wifi_pass?`&wifi_ssid=${encodeURIComponent(x.wifi_ssid)}&wifi_pass=${encodeURIComponent(x.wifi_pass)}`:""));if(E(oe=>({...oe,showProgress:!1,showFlash:!1,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.patchingFlashImage")})),ne.ok&&ne.status===200){const oe=await ne.arrayBuffer();E(Se=>({...Se,patchedFlash:oe,showFlash:!0,flashName:"patched"}));const ae=new Blob([oe],{type:"application/octet-stream"}),ue=URL.createObjectURL(ae);E(Se=>({...Se,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.patchingSuccessful",{size:(oe.byteLength/1024/1024).toFixed(0)}),downloadLinkPatched:ue})),ge()}else E(oe=>({...oe,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.patchingFailed"),error:!0}));E(oe=>({...oe,actionInProgress:!1}))},M=async()=>{const ne=await D(e("tonieboxes.esp32BoxFlashing.esp32flasher.connectingWriteFlash"));if(ne===null||x.connected)return;E(ae=>({...ae,actionInProgress:!0,error:!1})),E(ae=>({...ae,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.connectingTo")+` ${ne.getInfo()}`,connected:!0}));let oe=null;try{const ae=new cv(ne);oe=new rI({transport:ae,baudrate:T,romBaudrate:_})}catch(ae){E(ue=>({...ue,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.failedToConnect")+` ${ae}`,connected:!1,actionInProgress:!1,error:!0})),alert(ae),await ne.close();return}try{E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.connectingToESP")})),await oe.main(),E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.connected"),progress:0,showProgress:!0}));let ae=await oe.chip.readMac(oe);E(Re=>({...Re,chipMac:ae})),console.log("Chip MAC: "+ae);const ue=await oe.chip.getChipDescription(oe);E(Re=>({...Re,chipType:ue}));let Se=await oe.readFlashId();E(Re=>({...Re,flashId:""+Se,flashManuf:""+(Se&255),flashDevice:""+(Se>>8&255)}));let Te=await oe.getFlashSize();if(E(Re=>({...Re,flashSize:""+Te})),Te<0||Te>16384){E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.flashSizeError"),connected:!1,actionInProgress:!1,error:!0})),await ne.close();return}E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.preparingFlash",{size:(x.patchedFlash.byteLength/1024/1024).toFixed(0)})}));let Le=[];Le.push({data:$(x.patchedFlash),address:0});let _e={fileArray:Le,flashSize:"keep",flashMode:"keep",flashFreq:"keep",eraseAll:!1,compress:!0,reportProgress:(Re,Pe,$e)=>{const ve=100*Pe/$e;E(Ne=>({...Ne,progress:ve}))}};E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.writingFlash",{size:(x.patchedFlash.byteLength/1024/1024).toFixed(0)})})),await oe.writeFlash(_e),await ne.close(),E(Re=>({...Re,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.writingFinished"),connected:!1,actionInProgress:!1,proceed:!0}))}catch(ae){E(ue=>({...ue,state:e("tonieboxes.esp32BoxFlashing.esp32flasher.failedToCommunicate")+` ${ae}`,connected:!1,actionInProgress:!1,error:!0})),console.error(ae),alert(ae),await ne.close();return}},L=async ne=>{const oe=Xe.loading(e("tonieboxes.esp32BoxFlashing.esp32flasher.extractingCertificates"),0);ne&&p(!1);try{const ae=await uu.apiPostTeddyCloudRaw(`/api/esp32/extractCerts?filename=${x.filename}`+(ne?"&overwrite=true":""));if(ae.ok&&ae.status===200)oe(),Xe.success(e("tonieboxes.esp32BoxFlashing.esp32flasher.extractingCertificatesSuccessful",{file:x.filename}));else if(!ae.ok&&ae.status===409){oe();const ue=await ae.text();Xe.error(e("tonieboxes.esp32BoxFlashing.esp32flasher.extractingCertificatesFailed",{file:x.filename})+": "+ue),v(ue),p(!0)}else oe(),Xe.error(e("tonieboxes.esp32BoxFlashing.esp32flasher.extractingCertificatesFailed",{file:x.filename})+": "+await ae.text())}catch(ae){oe(),Xe.error(e("tonieboxes.esp32BoxFlashing.esp32flasher.extractingCertificatesFailed",{file:x.filename})+": "+ae)}},F=(ne,oe)=>{C(ae=>{const ue=[...ae];return ue[ne]=oe,ue})},j=[{title:e("tonieboxes.esp32BoxFlashing.esp32flasher.titleReadESP32ImportFlash")},{title:e("tonieboxes.esp32BoxFlashing.esp32flasher.titlePatchFlash")},{title:e("tonieboxes.esp32BoxFlashing.esp32flasher.titleFlashESP32")},{title:e("tonieboxes.esp32BoxFlashing.esp32flasher.titleESP32FirmwareFlashed")}],B=w.jsx(w.Fragment,{children:x.showProgress&&w.jsx("div",{children:w.jsx("div",{children:w.jsx(G0,{percent:x.progress||0,format:ne=>`${(ne??0).toFixed(2)}%`})})})}),z=w.jsx(w.Fragment,{children:(x.chipType||x.chipMac)&&w.jsxs("div",{children:[w.jsx(ra,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.infoTable")}),w.jsx("table",{className:"info-table",children:w.jsxs("tbody",{children:[x.chipType&&w.jsxs("tr",{children:[w.jsx("td",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.chipType")}),w.jsx("td",{children:x.chipType})]}),x.chipMac&&w.jsxs("tr",{children:[w.jsx("td",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.chipMAC")}),w.jsx("td",{children:x.chipMac})]}),x.flashId&&w.jsxs("tr",{children:[w.jsx("td",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.flashId")}),w.jsxs("td",{children:["0x",x.flashId.toString()]})]}),x.flashManuf&&w.jsxs("tr",{children:[w.jsx("td",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.flashManuf")}),w.jsxs("td",{children:["0x",x.flashManuf.toString()]})]}),x.flashDevice&&w.jsxs("tr",{children:[w.jsx("td",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.flashDevice")}),w.jsxs("td",{children:["0x",x.flashDevice.toString()]})]}),x.flashSize&&w.jsxs("tr",{children:[w.jsx("td",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.flashSize")}),w.jsxs("td",{children:[x.flashSize," KiB"]})]})]})})]})}),H=ne=>ne.replace(/[^a-zA-Z0-9-.]/g,"").trim(),U=ne=>{if(ne.endsWith("...")){const oe=ne.slice(0,-3);return w.jsxs("div",{style:{display:"flex"},children:[oe,w.jsx(J9e,{})]})}return ne},te=x.showStatus&&w.jsx("div",{className:"status",style:{marginBottom:16,color:x.error?"#CC3010":"unset"},children:w.jsx("i",{children:U(x.state)})}),X=w.jsxs(w.Fragment,{children:[w.jsx("h3",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.titleReadESP32ImportFlash")}),!x.actionInProgress&&w.jsxs(w.Fragment,{children:[w.jsx(Sr,{type:"warning",closeIcon:!0,showIcon:!0,message:e("tonieboxes.hintLatestFirmwareTitle"),description:e("tonieboxes.hintLatestFirmware")}),w.jsx(Er,{style:{marginTop:16},children:e("tonieboxes.esp32BoxFlashing.esp32flasher.hintReadESP32ImportFlash")})]}),te,w.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:A}),B]}),G=w.jsxs(w.Fragment,{children:[w.jsx("h3",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.titlePatchFlash")}),w.jsxs("div",{children:[!x.actionInProgress&&w.jsx(Er,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.hintPatchFlash")}),te,!x.actionInProgress&&x.downloadLink?w.jsxs("div",{style:{marginBottom:16},children:[" ",w.jsx("a",{href:x.downloadLink,download:x.filename,title:x.filename,children:e("tonieboxes.esp32BoxFlashing.esp32flasher.downloadLink")})]}):"",w.jsxs(Zt,{children:[w.jsx(ra,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.hostnameSettings")}),w.jsx(Er,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.hintPatchHost")}),w.jsxs(Zt.Item,{children:[w.jsxs(Ja,{align:"middle",style:{display:"flex",alignItems:"center"},children:[w.jsx(Mn,{style:{flex:"0 0 200px",color:x.warningTextHostname?"#CC3010":"unset"},children:w.jsx("label",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.hostname")})}),w.jsx(Mn,{style:{flex:"1 1 auto"},children:w.jsx(en,{type:"text",value:x.hostname,onChange:ne=>{let oe=H(ne.target.value),ae="";oe.length>12?ae=e("tonieboxes.esp32BoxFlashing.esp32flasher.hostnameToLong"):ae="",E(ue=>({...ue,hostname:oe,warningTextHostname:ae}))}})})]}),x.warningTextHostname&&w.jsx("p",{style:{color:"#CC3010"},children:e("tonieboxes.esp32BoxFlashing.esp32flasher.hostnameToLong")})]}),w.jsx(ra,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.wifiSettings")}),w.jsx(Er,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.hintPatchWifi")}),w.jsx(Zt.Item,{children:w.jsxs(Ja,{align:"middle",style:{display:"flex",alignItems:"center"},children:[w.jsx(Mn,{style:{flex:"0 0 200px",color:x.warningTextWifi?"#CC3010":"unset"},children:w.jsx("label",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.wifiSSID")})}),w.jsx(Mn,{style:{flex:"1 1 auto"},children:w.jsx(en,{type:"text",defaultValue:x.wifi_ssid,onChange:ne=>{let oe=ne.target.value;E(ae=>({...ae,wifi_ssid:oe,warningTextWifi:ne.target.value&&x.wifi_pass||!ne.target.value&&!x.wifi_pass?"":e("tonieboxes.esp32BoxFlashing.esp32flasher.wifiCredentialsIncomplete")}))}})})]})}),w.jsxs(Zt.Item,{children:[w.jsxs(Ja,{align:"middle",style:{display:"flex",alignItems:"center"},children:[w.jsx(Mn,{style:{flex:"0 0 200px",color:x.warningTextWifi?"#CC3010":"unset"},children:w.jsx("label",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.wifiPassword")})}),w.jsx(Mn,{style:{flex:"1 1 auto"},children:w.jsx(en.Password,{defaultValue:x.wifi_pass,onChange:ne=>{let oe=ne.target.value;E(ae=>({...ae,wifi_pass:oe,warningTextWifi:ne.target.value&&x.wifi_ssid||!ne.target.value&&!x.wifi_ssid?"":e("tonieboxes.esp32BoxFlashing.esp32flasher.wifiCredentialsIncomplete")}))}})})]}),x.warningTextWifi&&w.jsx("p",{style:{color:"#CC3010"},children:e("tonieboxes.esp32BoxFlashing.esp32flasher.wifiCredentialsIncomplete")})]})]})]}),B]}),V=w.jsxs(w.Fragment,{children:[w.jsx("h3",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.titleFlashESP32")}),!x.actionInProgress&&w.jsx(Er,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.hintFlashESP32")}),te,!x.actionInProgress&&x.downloadLinkPatched?w.jsxs("div",{style:{marginBottom:16},children:[" ",w.jsx("a",{href:x.downloadLinkPatched,download:"patched_"+x.filename,title:"patched_"+x.filename,children:e("tonieboxes.esp32BoxFlashing.esp32flasher.downloadLinkPatched")})]}):"",B]}),q=`${g}/${x.chipMac?x.chipMac.replaceAll(":","").toLowerCase():""}`,Y=w.jsxs(w.Fragment,{children:[w.jsx("h3",{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.titleESP32FirmwareFlashed")}),w.jsx(Er,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.hintESP32FirmwareFlashed")}),te,B,(x.downloadLink||x.downloadLinkPatched)&&w.jsxs(w.Fragment,{children:[w.jsx(Sr,{type:"info",style:{marginTop:16},showIcon:!0,message:e("tonieboxes.esp32BoxFlashing.esp32flasher.extractCertificates"),description:w.jsxs("div",{children:[w.jsxs($n,{children:[w.jsx(ra,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.automatically")}),w.jsx(Er,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.extractCertificatesAutomaticallyHint")}),w.jsx(_t,{icon:w.jsx(kO,{}),disabled:s,type:"primary",onClick:()=>de(),style:{marginBottom:8},children:e("tonieboxes.esp32BoxFlashing.esp32flasher.extractCertificates")}),w.jsx(Er,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.extractCertificatesAutomaticallyHint2",{certDir:g,mac:x.chipMac.replaceAll(":","").toLocaleLowerCase()})})]}),w.jsx(ra,{children:e("tonieboxes.esp32BoxFlashing.esp32flasher.manually")}),w.jsx($n,{style:{marginBottom:8},children:e("tonieboxes.esp32BoxFlashing.esp32flasher.extractCertificatesManuallyHint")}),w.jsx($n,{children:w.jsx(j0,{size:"small",items:[{key:"1",label:e("tonieboxes.esp32BoxFlashing.esp32flasher.extractCertificatesManually"),children:w.jsxs($n,{children:[w.jsxs(Er,{children:[e("tonieboxes.esp32BoxFlashing.esp32flasher.extractCertificatesManuallyHintP1")," ",w.jsx(tHe,{code:!0,children:"docker exec -it bash"}),"."]}),w.jsx(Er,{children:w.jsx("pre",{style:{fontSize:12},children:`# Please check the filename of your backup diff --git a/contrib/data/www/web/index.html b/contrib/data/www/web/index.html index 32fc9f0b..7d2b67af 100644 --- a/contrib/data/www/web/index.html +++ b/contrib/data/www/web/index.html @@ -12,7 +12,7 @@ --> TeddyCloud - + diff --git a/teddycloud_web b/teddycloud_web index 7d149a52..c2fc01d0 160000 --- a/teddycloud_web +++ b/teddycloud_web @@ -1 +1 @@ -Subproject commit 7d149a529c59a2ff9283d55035d78a64814009c9 +Subproject commit c2fc01d01225c2426aa4197d9a1605c3bc921a16