import{q as oe,s as ce,t as ie,L as j,S as A,$ as z,G as J,z as R,y as x,F as H,V as _e,W as he,e as Oe,ag as we,_ as je}from"./index.832d54dc.js";/* empty css *//* empty css *//* empty css *//* empty css */import{d as I,c as p,o as Ce,b as Se,f as Pe,t as xe,p as Ee,r as ue,aI as u,aU as K,i as Fe,bP as De,bH as Ne,bN as Ae,C as B,D as W,aH as w,aK as ke,aJ as Ie,aE as L,G as U,u as X,aM as q,bI as Be,bM as $e,bQ as Te,b7 as Le,bi as Me,bm as ze,bn as Re}from"./arco.93f0afda.js";import{e as He,b as Ke,g as Ue}from"./serial.bad97c4e.js";import{b as k,L as Ve,B as Ge}from"./index.f1bec257.js";import{i as T,P as Je}from"./index.57de0a28.js";import"./chart.c383733a.js";import"./vue.ded74ca2.js";function Z(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function Q(t){for(var e=1;et.size),{className:o,style:d}=oe(a),i=p(()=>["t-icon","t-icon-check-double",o.value]),r=p(()=>Q(Q({},d.value),n.style)),s=p(()=>({class:i.value,style:r.value,onClick:f=>{var c;return(c=t.onClick)===null||c===void 0?void 0:c.call(t,{e:f})}}));return()=>ce(We,s.value)}});const qe=Xe;function Y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function ee(t){for(var e=1;et.size),{className:o,style:d}=oe(a),i=p(()=>["t-icon","t-icon-thumb-up",o.value]),r=p(()=>ee(ee({},d.value),n.style)),s=p(()=>({class:i.value,style:r.value,onClick:f=>{var c;return(c=t.onClick)===null||c===void 0?void 0:c.call(t,{e:f})}}));return()=>ce(Ze,s.value)}});const Ye=Qe;/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */var et={align:{type:String,default:"top",validator:function(e){return e?["start","end","center","stretch","baseline","top","middle","bottom"].includes(e):!0}},gutter:{type:[Number,Object,Array],default:0},justify:{type:String,default:"start",validator:function(e){return e?["start","end","center","space-around","space-between"].includes(e):!0}},tag:{type:String,default:"div"}};/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */var te=function(e){var n="xs";return e<768?n="xs":e>=768&&e<992?n="sm":e>=992&&e<1200?n="md":e>=1200&&e<1400?n="lg":e>=1400&&e<1880?n="xl":n="xxl",n};/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */function tt(t,e){Ce(function(){window.addEventListener(t,e)}),Se(function(){window.removeEventListener(t,e)})}/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */function ne(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function M(t){for(var e=1;e=0),"".concat(t,"-").concat(c,"-offset-").concat(l.offset),parseInt(l.offset,10)>=0),"".concat(t,"-").concat(c,"-push-").concat(l.push),parseInt(l.push,10)>=0),"".concat(t,"-").concat(c,"-pull-").concat(l.pull),parseInt(l.pull,10)>=0))},{});return M(j(j(j(j(j(j({},"".concat(t),!0),"".concat(t,"-").concat(n),!T(n)),"".concat(t,"-order-").concat(a),a),"".concat(t,"-offset-").concat(o),o),"".concat(t,"-push-").concat(d),d),"".concat(t,"-pull-").concat(i),i),s)}/** * tdesign v1.9.4 * (c) 2024 tdesign * @license MIT */function ae(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,a)}return n}function it(t){for(var e=1;e(ze("data-v-764a475c"),t=t(),Re(),t),ht={class:"container"},Ot=["title","src"],wt=le(()=>U("div",{id:"canvasDiv",style:{zoom:"250%"}},null,-1)),jt=le(()=>U("br",null,null,-1)),Ct={name:"Backup"},St=I({...Ct,setup(t){const e=Oe(),n=ue({activeKey:1,binaryFile:void 0,loading:!1}),a=r=>{alert("\u56FE\u7247\u5DE5\u574A\u5373\u5C06\u63A8\u51FA")},o=r=>{const s=document.createElement("canvas");s.width=128,s.height=64;const f=s.cloneNode(),c=document.getElementById("canvasDiv");c.innerHTML="",c==null||c.append(s,f);const g=new Image;g.src=r.url,g.onload=()=>{const l=s.getContext("2d");l==null||l.drawImage(g,0,0,128,64);const O=l==null?void 0:l.getImageData(0,0,s.width,s.height).data;function C(m,y){const v=(y*128+m)*4;return O[v]+O[v+1]+O[v+2]>128*3?0:1}const P=f.getContext("2d"),E=P.getImageData(0,0,f.width,f.height);for(let m=0;m<64;m++)for(let y=0;y<128;y++){const v=(m*128+y)*4,_=!C(y,m);E.data[v]=_*255,E.data[v+1]=_*255,E.data[v+2]=_*255,E.data[v+3]=255}P.putImageData(E,0,0);const D=new Uint8Array(1024);let F=0;for(let m=0;m<64;m+=8)for(let y=0;y<128;y++){let b=0;for(let v=0;v<8;v++)b|=C(y,m+v)<{const r=document.createElement("input");r.type="file",r.onchange=async()=>{const s=new Blob([r.files[0]],{type:"application/octet-stream"}),f=URL.createObjectURL(s),c=document.createElement("canvas");c.width=128,c.height=64;const g=c.cloneNode(),l=document.getElementById("canvasDiv");l.innerHTML="",l==null||l.append(c,g);const O=new Image;O.src=f,O.onload=()=>{const C=c.getContext("2d");C==null||C.drawImage(O,0,0,128,64);const P=C==null?void 0:C.getImageData(0,0,c.width,c.height).data;function E(b,v){const h=(v*128+b)*4;return P[h]+P[h+1]+P[h+2]>128*3?0:1}const D=g.getContext("2d"),F=D.getImageData(0,0,g.width,g.height);for(let b=0;b<64;b++)for(let v=0;v<128;v++){const h=(b*128+v)*4,N=!E(v,b);F.data[h]=N*255,F.data[h+1]=N*255,F.data[h+2]=N*255,F.data[h+3]=255}D.putImageData(F,0,0);const m=new Uint8Array(1024);let y=0;for(let b=0;b<64;b+=8)for(let v=0;v<128;v++){let _=0;for(let h=0;h<8;h++)_|=E(v,b+h)<{var f,c,g,l;if(e.connectState!=!0){alert("\u8BF7\u5148\u8FDE\u63A5\u624B\u53F0\uFF01");return}if(((f=e.configuration)==null?void 0:f.uart)=="official"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(n.activeKey==2&&((c=e.configuration)==null?void 0:c.charset)!="gb2312"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}if(n.activeKey==1&&((g=e.configuration)==null?void 0:g.charset)!="losehu"){alert("\u56FA\u4EF6\u7248\u672C\u4E0D\u5339\u914D");return}n.loading=!0;let r=123728;n.activeKey==2&&(r=8320),await He(e.connectPort);const s=n.binaryFile;for(let O=r;O{const f=we,c=Ge,g=gt,l=pt,O=_t,C=Be,P=$e,E=Je,D=Te,F=De,m=Le,y=Me,b=Ne,v=Ae;return B(),W("div",ht,[u(f,{items:["\u5C0F\u5DE5\u5177","\u5F00\u673A\u56FE\u7247"]}),u(P,{gutter:20,align:"stretch"},{default:w(()=>[u(C,{span:24},{default:w(()=>[u(v,{loading:n.loading,tip:"\u5199\u5165\u4E2D...",style:{width:"100%"}},{default:w(()=>[u(b,{class:"general-card",title:"\u5F00\u673A\u56FE\u7247"},{default:w(()=>[u(P,{gutter:20},{default:w(()=>[(B(!0),W(ke,null,Ie([{name:"\u7F57\u72EE\u864E",url:"/img1.png"},{name:"\u79BB\u7EBF\u5C0F\u6050\u9F99",url:"/img2.png"},{name:"\u4E0D\u5FD8\u521D\u5FC3\u7262\u8BB0\u4F7F\u547D",url:"/img3.png"},{name:"\u4E3A\u4EBA\u6C11\u670D\u52A1",url:"/img4.png"},{name:"\u4E25\u7981\u6536\u542C\u654C\u53F0\u5E7F\u64AD",url:"/img5.png"},{name:"\u7231\u56E0\u65AF\u5766",url:"/img6.png"}],_=>(B(),L(C,{span:4},{default:w(()=>[u(O,{style:{width:"100%"}},{cover:w(()=>[U("img",{title:_.name,src:_.url},null,8,Ot)]),footer:w(()=>[u(l,{align:"middle",justify:"center",style:{gap:"24px"}},{default:w(()=>[u(g,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:w(()=>[u(c,{variant:"text",shape:"square",onClick:h=>a(_)},{default:w(()=>[u(X(Ye))]),_:2},1032,["onClick"])]),_:2},1024),u(g,{flex:"auto",style:{display:"inline-flex","justify-content":"center"}},{default:w(()=>[u(c,{variant:"text",shape:"square",onClick:h=>o(_)},{default:w(()=>[u(X(qe))]),_:2},1032,["onClick"])]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))),256))]),_:1}),u(E,{style:{margin:"10px"},total:6,showPageNumber:"",showPageSize:!1}),u(F,{"active-key":n.activeKey,onChange:s[0]||(s[0]=_=>{n.activeKey=_})},{default:w(()=>[(B(),L(D,{key:1,title:"LOSEHU 117"})),(B(),L(D,{key:2,title:"LOSEHU 118+"}))]),_:1},8,["active-key"]),wt,jt,u(y,null,{default:w(()=>[u(m,{onClick:d},{default:w(()=>[q("\u9009\u62E9\u56FE\u7247")]),_:1}),u(m,{type:"primary",disabled:!n.binaryFile,onClick:i},{default:w(()=>[q("\u5199\u5165")]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["loading"])]),_:1})]),_:1})])}}});const Tt=je(St,[["__scopeId","data-v-764a475c"]]);export{Tt as default};