import{s as B,ac as E,_ as S}from"./index.1c489121.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{d as A,r as F,bT as R,bI as T,C as D,D as U,aI as o,aH as n,G as y,aN as p,aM as _,a$ as k,b0 as C,bU as V,b8 as H,bi as I,bG as P,bJ as M,bL as N,n as z}from"./arco.c29bba08.js";import{i as G,e as L,b as J,g as K}from"./serial.c6b76da8.js";import{C as O}from"./index.b56ecdeb.js";import"./chart.34708d29.js";import"./vue.437ba699.js";const j={class:"container"},q=["innerHTML"],Q={name:"Chi"},W=A({...Q,setup(X){const u=B(),r=F({status:"\u70B9\u51FB\u5199\u5165\u6309\u94AE\u5199\u5165\u5B57\u5E93\u5230\u8BBE\u5907

",eepromType:"",showHide:0,lang:"Simplified_Chinese"}),g=async(t=0,e)=>{var m;await L(u.connectPort);for(let s=t;s",z(()=>{const f=document==null?void 0:document.getElementById("statusArea");f&&(f.scrollTop=f==null?void 0:f.scrollHeight)});r.status=r.status+"\u5199\u5165\u8FDB\u5EA6\uFF1A100.0%
",await K(u.connectPort)},v=async(t=1)=>{var m,s,f,b,w,h;if(u.connectState!=!0){alert(sessionStorage.getItem("noticeConnectK5"));return}if(((m=u.configuration)==null?void 0:m.uart)=="official"){alert(sessionStorage.getItem("noticeVersionNoSupport"));return}r.status=r.status+"\u6B63\u5728\u4E0B\u8F7D\u5B57\u5E93...
";let e;if(t==4){(s=u.configuration)!=null&&s.newpinyin?e=await fetch("/pinyin_plus.bin"):e=await fetch("/pinyin.bin");const l=e.body.getReader(),a=[];for(;;){const{done:c,value:i}=await l.read();if(c)break;a.push(...i)}const d=new Uint8Array(a);await g(131072,d);return}if(t==5){const l=await G(u.connectPort,(f=u.configuration)==null?void 0:f.uart);if(l!=262144&&l!=524288){r.status=r.status+"\u53EA\u652F\u6301 2Mbit \u4EE5\u4E0A EEPROM \u5199\u5165
";return}e=await fetch("/ssb.bin");const a=e.body.getReader(),d=[];for(;;){const{done:i,value:$}=await a.read();if(i)break;d.push(...$)}const c=new Uint8Array(d);await g(246312,c);return}if(t==1){if(((b=u.configuration)==null?void 0:b.charset)=="losehu"){e=await fetch("/old_font.bin");const l=e.body.getReader(),a=[];for(;;){const{done:c,value:i}=await l.read();if(c)break;a.push(...i)}const d=new Uint8Array(a);await g(8192,d);return}if(((w=u.configuration)==null?void 0:w.charset)=="gb2312"){e=await fetch("/new_font_k.bin");const l=e.body.getReader(),a=[];for(;;){const{done:c,value:i}=await l.read();if(c)break;a.push(...i)}const d=new Uint8Array(a);await g(9344,d);return}}if(t==6)if(((h=u.configuration)==null?void 0:h.charset)=="gb2312"){e=await fetch("/new_font_k_f.bin");const l=e.body.getReader(),a=[];for(;;){const{done:c,value:i}=await l.read();if(c)break;a.push(...i)}const d=new Uint8Array(a);await g(9344,d);return}else alert("\u4E0D\u652F\u6301\u7684\u7248\u672C")};return(t,e)=>{const m=E,s=R,f=V,b=H,w=O,h=I,l=P,a=T,d=M,c=N;return D(),U("div",j,[o(m,{items:[t.$t("menu.list"),t.$t("menu.font")]},null,8,["items"]),o(c,{gutter:20,align:"stretch"},{default:n(()=>[o(d,{span:24},{default:n(()=>[o(a,{class:"general-card"},{title:n(()=>[y("span",{onClick:e[0]||(e[0]=()=>{r.showHide+=1})},p(t.$t("menu.font")+t.$t("global.onStart")),1)]),default:n(()=>[o(h,null,{default:n(()=>[o(w,{bordered:"",style:{width:"420px"}},{header:n(()=>[_(p(t.$t("tool.fontwrite"))+" ",1),y("div",null,[o(f,{type:"button",size:"mini",modelValue:r.lang,"onUpdate:modelValue":e[1]||(e[1]=i=>r.lang=i)},{default:n(()=>[o(s,{value:"Simplified_Chinese"},{default:n(()=>[_(p(t.$t("tool.Simplified_Chinese")),1)]),_:1}),o(s,{value:"Traditional_Chinese"},{default:n(()=>[_(p(t.$t("tool.Traditional_Chinese")),1)]),_:1})]),_:1},8,["modelValue"])])]),default:n(()=>[y("div",null,[k(o(b,{onClick:e[2]||(e[2]=i=>v(1))},{default:n(()=>[_(p(t.$t("tool.writefontwrite")),1)]),_:1},512),[[C,r.lang=="Simplified_Chinese"]]),k(o(b,{onClick:e[3]||(e[3]=i=>v(6))},{default:n(()=>[_(p(t.$t("tool.writefontwrite")),1)]),_:1},512),[[C,r.lang=="Traditional_Chinese"]])])]),_:1}),o(w,{bordered:""},{header:n(()=>[_(p(t.$t("tool.pinyinwrite")),1)]),default:n(()=>[o(h,null,{default:n(()=>[o(b,{onClick:e[4]||(e[4]=i=>v(4))},{default:n(()=>[_(p(t.$t("tool.writepinyin")),1)]),_:1})]),_:1})]),_:1}),o(w,{bordered:""},{header:n(()=>[_(p(t.$t("tool.ssbpatch")),1)]),default:n(()=>[o(h,null,{default:n(()=>[o(b,{onClick:e[5]||(e[5]=i=>v(5))},{default:n(()=>[_(p(t.$t("tool.writessbpatch")),1)]),_:1})]),_:1})]),_:1})]),_:1}),o(l),y("div",{id:"statusArea",style:{height:"20em","background-color":"azure",color:"silver",overflow:"auto",padding:"20px"},innerHTML:r.status},null,8,q)]),_:1})]),_:1})]),_:1})])}}});const ue=S(W,[["__scopeId","data-v-14271e40"]]);export{ue as default};