diff --git a/ble_api/css/jodash.css b/ble_api/css/jodash.css index 29a0d55..738cd81 100644 --- a/ble_api/css/jodash.css +++ b/ble_api/css/jodash.css @@ -200,7 +200,16 @@ input[type=checkbox] { 0 0 30px #f77, 0 0 100px #f33; } + + .back-white { + background-color: var(--white100); +} + +.back-black { + background-color: var(--black0); +} + /* === Bei Icons Hintergrundfarb im ::before festgelegt, kann nur via class gesetzt werden (z.B. fuer Animationen) ===*/ .jo-icon-back-white { &::before { diff --git a/ble_api/index.html b/ble_api/index.html index 03cfdb6..815c30e 100644 --- a/ble_api/index.html +++ b/ble_api/index.html @@ -69,7 +69,6 @@ -
@@ -295,10 +294,13 @@ Offline
+ - + diff --git a/ble_api/js/blx.js b/ble_api/js/blx.js index cab5b4c..2ffa747 100644 --- a/ble_api/js/blx.js +++ b/ble_api/js/blx.js @@ -1 +1 @@ -let blx=(()=>{let se="V1.25 / 12.12.2024",le="(C)JoEmbedded.de",a="";async function L(t=1){return new Promise(e=>setTimeout(e,t))}let c=3988292384;function ce(t){let a=4294967295;for(let e=0;e>>0;for(let e=0;e<8;e++)1&a?a=a>>>1^c:a>>>=1}return a>>>0}let P={},g=!1,U,de="5c170001-b5a3-f393-e0a9-a37f42997c22",d="5c170002-b5a3-f393-e0a9-a37f42997c22",f="5c170003-b5a3-f393-e0a9-a37f42997c22",K,R,u,V=!1,fe=!1,z="",G=!1,h,W=!1,H=!1,X=0,q,o="?",Y={total:0,incnew:0,max:-1,mode:0},k=!1,S=0,v=3,b=16,E=17,O=32,C=33,I=34,x=35,A=1e4,D="unknown.dat",m,T,F,N,_,B,w,p,y,M,ue,j,ve=20,Re=40,be,ge,me=!1,we=!1,J="3",Z="15",$;function pe(){R=void 0,u=void 0,V=!1,g=!1,fe=!1,G=!1,h=void 0,!(W=!1)===H&&"R"!==o?(re("Disconnected while Busy('"+o+"')"),X="ERROR: Disconnected ('"+o+"')"):re("Disconnected"),H=!1,U&&(void 0!==K?U("CON",1,"Reconnectable"):U("CON",0,"Disconnected"))}function ye(e){var e=new Uint8Array(e.target.value.buffer),r=e.length;if(r<2)re("ERROR(Data): NUS RX blocklen: "+r),console.log(e);else{var o=e[0];if(o+2!==r)re("ERROR(Data): NUS RX blocklen/dlen(0): "+r+"/"+o),console.log(e);else{var s,r=e[1],l=e.subarray(2);let a,i,n,t;switch(r){case x:if(ze(),"~"===(a=(new TextDecoder).decode(l)).charAt(0)&&1=ve&&i<250?(re("BLE Blocksize: "+(be=i)+" Bytes"),ii)X="ERROR: Too many data";else{p.set(l,y),y+=o;var b=Date.now();if(1e3=i)break;var o="Failed, Retry to connect ("+(i-t+1)+" left)...";U&&U("WARN",5,o),re(o)}V&&(a&&await xe(!1),await ee(),!0===G)&&We(500)}}async function ke(){if(g){g=!1;var e=P.deviceMAC+"_#BlxIDs";try{await blStore.set(e,P)}catch(e){X="ERROR(CheckIDs): "+e}}}async function Q(e,t=A){if(!0===H)console.warn("*** BLX BUSY (Since "+(Date.now()-q).toFixed(0)+" msec) ***");else{if(!0!==V){if(void 0===K)return void(X="ERROR(DeviceCmd): Not Connected!");if(await he(0,1),X)return}!1===(W=e.startsWith("#")?!0:W)&&(H=!0),o=e,q=Date.now();var[e,a=b]=[e],i=e.length,n=new Uint8Array(i+2),r=n.subarray(2),i=(n[0]=i,n[1]=a,(new TextEncoder).encodeInto(e,r));if(void 0!==i)try{R.writeValue(n.buffer)}catch(e){let t;t=!1===V?"Connection lost":e,X="ERROR(DeviceSend): "+t}if(await 0,!1===W){a=t;for(S=a;!0===H;)if(await L(10),(S-=10)<0){X="ERROR(DeviceCmd): Timeout ('"+o+"')";break}await 0,H=!1}}}function s(t){let a=-1;for(let e=0;em?X="ERROR(SysCmd): Out of range of File":(B=t,U&&U("GET",e,n),await Ae(t,e,i),X||(async()=>{if(void 0!==y&&y)if(void 0===p||p.length!==w)X="ERROR(Store): Inconsistent Data";else{var e=P.deviceMAC+"_"+D,t=[];t.total_len=m,t.pos0=B,t.akt_len=w,t.ctime=T,t.crc32=F,t.ucl_flag=N,t.esync_flag=_,t.bytebuf=p,t.tssync=void 0;try{await blStore.set(e,t)}catch(e){return X="ERROR(Store): "+e}re("Save to Store '"+e+"'"),p=void 0,j=e}else X="ERROR(Store): No Data to store"})())}}}async function Ee(e,t){var a,i,n=s(e);if(0<=n){if(await blStore.get(P.deviceMAC+"_"+e),void 0===(a=blStore.result())||!0===t)await Se([0,e],!1),X;else if(0<(t=P.disk.files[n].len-a.v.akt_len)&&(U&&U("GET",t,e),re('Get File (Missing Part) "'+e+'": Len: '+t+" Bytes"),n=e,e=a.v.akt_len,i=t,m=-1,D=void 0,j=void 0,await Q("N:"+n),await(!X&&!(m<0?X="ERROR(SysCmd): No File '"+n+"'":(F=0,N=!0,_=!1,await Ae(B=e,m=i,!1)))),!X))if(p.length!==t)X="ERROR(upload): Read Len";else{(n=new Uint8Array(a.v.bytebuf.length+t)).set(a.v.bytebuf),n.set(p,a.v.bytebuf.length),a.v.bytebuf=n,a.v.total_len+=t,a.v.akt_len+=t,a.v.tssync=void 0;try{await blStore.set(a.k,a.v)}catch(e){X="ERROR(upload): "+e}}}else X=""}async function ee(){for(let e=0;e<3&&(await L(1e3),$=-1,void 0===R?X="Disconnected":await Q("CS",32e3),!X)&&!(0<$);e++);}async function te(){for(let e=0;e<4&&(await L(1e3),$=-1,await Q("C"+J,32e3),!X)&&!($<=50);e++){var t=parseInt(J);if(isNaN(t))break;0'data.edt.old'"),!0===e))try{await blStore.remove(P.deviceMAC+"_data.edt"),await blStore.set(i.k,i.v)}catch(e){return void(X="ERROR(Store): "+e)}if(null!=i&&(a<0||P.disk.files[a].date.getTime()!==i.v.ctime.getTime())&&(a=-1,!(i=void 0)===e))try{await blStore.remove(P.deviceMAC+"_data.edt.old")}catch(e){return void(X="ERROR(Store): "+e)}if(null!=n&&(t<0||P.disk.files[t].date.getTime()!==n.v.ctime.getTime())&&!(n=void 0)===e)try{await blStore.remove(P.deviceMAC+"_data.edt")}catch(e){return void(X="ERROR(Store): "+e)}0<=t&&(Y.total+=P.disk.files[t].len),0<=a&&(Y.total+=P.disk.files[a].len),Y.incnew=Y.total,null!=n&&(Y.incnew-=n.v.akt_len),null!=i&&(Y.incnew-=i.v.akt_len),X=0}async function Ie(e){var i=e.split(" ");let t,a;var n,r,o,s,l,c,d=i[0].toLowerCase();if(!0===W)X='ERROR(Modem): Exit Modem Terminal ("~")!';else switch(d){case"?":re(`Blx Terminal Version: ${se}, `+le);break;case"q":case"quit":Le();break;case"cls":ne=[],void 0!==ie&&(document.getElementById("blxTerminalOut").innerText="(cleared)");break;case"s":case"store":try{if(i.length<=1){await blStore.count();let n=0,r=Date.now();re("Store: "+blStore.result()+" Items"),await blStore.iterate(function(e){a=r-e.ts,t="",86400<=(a/=1e3)&&(a-=86400*(i=Math.floor(a/86400)),t+=i+"d"),a-=3600*(i=Math.floor(a/3600)),i<10&&(t+="0"),t+=i+"h",(i=Math.floor(a/60))<10&&(t+="0"),t+=i+"m",(a-=60*i)<10&&(t+="0");var t,a,i=t+=Math.floor(a)+"s";void 0!==e.v.akt_len?(a=e.v.akt_len,n+=a,re("'"+e.k+"' ("+i+")': "+a+" Bytes")):re("'"+e.k+"' ("+i+")'")}),re("Total Data: "+(n/1024).toFixed(0)+" kB")}else switch(i[1]){case"c":case"clear":await blStore.clearStore(),re("Store cleared");break;case"r":case"remove":{let e;e=i.length<3?j:i[2],await blStore.remove(e),re("Removed '"+e+"' from Store")}break;case"v":case"var":3===i.length?(s=i[2],await blStore.get(s),re("Key:'"+s+"' => '"+blStore.result().v+"'")):4===i.length?(l=i[2],c=i[3],await blStore.set(l,c),re("Set Key:'"+l+"' to:'"+c+"'")):re("Syntax Error");break;case"l":case"list":try{let e;if(void 0===(e=i.length<3?j:i[2])){X="ERROR(Store): No Key";break}await blStore.get(e);var f=blStore.result();if(void 0===f){X="ERROR(Store): No Value for this Key";break}var u,v=(new TextDecoder).decode(f.v.bytebuf),R=v.replace(/\r/g,"").split(/\n/),b=(R.pop(),ae);ae "+R.length+" Lines");let t=0;for(u of R)re(t+": "+(u.length?u:"(empty)")),t++;ae=b}catch(e){X="ERROR(Store): "+e}break;case"m":case"modify":try{let e;var g=i[2];if(void 0===g){X="ERROR(Store): No Index";break}var m=i[3];if(void 0===(e=i.length<5?j:i[4])){X="ERROR(Store): No Key";break}await blStore.get(e);var w=blStore.result();if(void 0===w){X="ERROR(Store): No Value for this Key";break}var p=(new TextDecoder).decode(w.v.bytebuf).replace(/\r/g,"").split(/\n/);if(p.pop(),g<0||g>p.length){X="ERROR(Store): Index Range";break}var y=p[g],h=(re("Old: "+g+": "+(y.length?y:"(empty)")),p[g]=m,re("New: "+g+": "+((y=p[g]).length?y:"(empty)")),new TextEncoder),k=(w.v.bytebuf=h.encode(p.join("\n")+"\n"),w.v.bytebuf.length);w.v.akt_len=k,w.v.crc32=ce(w.v.bytebuf),w.v.ctime=new Date,w.v.pos0=0,w.v.total_len=k,w.v.ucl_flag=!1,w.v.tssync=void 0,await blStore.set(e,w.v)}catch(e){X="ERROR(Store): "+e}break;default:X="ERROR(Store): Unknown Cmd"}}catch(e){X="ERROR(Store): "+e}break;case"e":case"export":try{let e;e=i.length<2?j:i[1],await blStore.get(e);var S=blStore.result();if(void 0===S){X="ERROR(StoreExport): Key not found";break}var E=S;try{if(void 0!==E.v&&void 0!==E.v.total_len&&E.v.total_len){var O=E.k.lastIndexOf(".");let e="application/octet-binary";if(1{var t=document.createElement("input");t.type="file";let a,i=!0;for(void 0!==e&&(t.accept=e),t.oncancel=e=>{i=!1},t.onchange=e=>{e=e.target.files[0];re('Selected File:"'+e.name+'" Size:'+e.size+" LastModified: ["+e.lastModifiedDate.toLocaleDateString()+" "+e.lastModifiedDate.toLocaleTimeString()+"]");let t=new FileReader;t.onabort=t.onerror=function(){i=!1},t.onload=async function(){a=t.result,i=!1},t.readAsText(e)},re("Select File or Cancel"),t.click();i;)await L(10);return a})(".crun");if(void 0!==S){var x=S.replace(/\r/g,"").trim().split(/\n/);for(let e=0;e{e=e.target.files[0];re('Selected File:"'+e.name+'" Size:'+e.size+" LastModified: ["+e.lastModifiedDate.toLocaleDateString()+" "+e.lastModifiedDate.toLocaleTimeString()+"]");let t=new FileReader;t.onload=async function(){var e=new Uint8Array(t.result);e.length?rd&&(e=d);var f=new Uint8Array(e+2),u=(f[0]=e,f[1]=E,t.subarray(r,r+e));if(f.set(u,2),await R.writeValue(f.buffer),n-=e,r+=e,!n){var v=Date.now()-s;re("Transfer OK ("+v/1e3+" sec, "+(t.length/v*1e3).toFixed(0)+" Bytes/sec)");break}1e3<(o=Date.now())-l&&(l=o,re((100*r/t.length).toFixed(0)+"% / "+r+" Bytes"))}}catch(e){return void(X=!1===V?"ERROR: Connection lost":"ERROR: Transfer "+e)}await Q("L",5e3),X||1e3{let a=e.target.files[0];if(re('Selected File:"'+a.name+'" Size:'+a.size+" LastModified: ["+a.lastModifiedDate.toLocaleDateString()+" "+a.lastModifiedDate.toLocaleTimeString()+"]"),void 0!==r&&".sec"==r){e="firmware_typ"+P.deviceType+"_";if(!a.name.startsWith(e)&&"_firmware.sec"==!a.name)return void re(X="ERROR: No Firmware File for this Device")}let i=new FileReader;i.onload=async function(){var t=new Uint8Array(i.result);if(t.length){let e=a.name;await De(t,e=void 0!==r&&".sec"==r?"_firmware.sec":e,n),X&&re(X),void 0!==r&&".sec"==r&&(re("Reset Device"),await Q("R",2e3),await L(1e3),X=0)}else re(X="ERROR: File is empty")},i.readAsArrayBuffer(a)},re("Select File or Cancel"),e.click()}let Fe=25,ae,ie,ne=[];function re(e){for(void 0!==e?ne.push(e):ne[0]="*** BLX Terminal ***";ne.length>ae;)ne.shift();void 0!==ie&&(document.getElementById("blxTerminalOut").innerText=ne.join("\n"))}function Ne(e){13===e.keyCode||10===e.keycode?(e.preventDefault(),document.getElementById("blxTerminalSend").click()):27===e.keyCode&&(e.preventDefault(),document.getElementById("blxTerminalCmd").value="")}function _e(e){void 0!==ie&&(document.getElementById("blxTerminalSend").disabled=!e)}let Be="";async function Me(){var e=document.getElementById("blxTerminalCmd");let t=e.value.trim();e.value="",e.focus(),re("> "+t),_e(!1),oe(1e3,.05,.1),X=0,"*"==t&&Be.length?t=Be:t.length&&(Be=t),"help"==t||"-h"==t||"/h"==t||"-?"==t||"/?"==t?(re(se+" - "+le),re(a)):(t.startsWith(".")?await Ie(t.substring(1)):await Q(t),await ke(),X&&(Ge(),re(X))),_e(!0)}function Le(e,t,a=Fe){void 0!==e?(ae=a,(ie=document.getElementById(e)).innerHTML="
",document.getElementById("blxTerminalCmd").addEventListener("keyup",Ne),document.getElementById("blxTerminalSend").addEventListener("click",Me),re(),_e(!0)):(void 0!==ie&&(ie.innerHTML=""),ie=void 0),void 0!==t&&(U="function"==typeof t?t:void 0)}function l(t,e){var a="@"+e;for(let e=0;e 14 Parameters/Channel!";return e}function i(e,t,a){e=parseInt(e);return!!(isNaN(e)||e "+e),X=0,e.startsWith(".")?await Ie(e.substring(1)):null!=t?await Q(e,t):await Q(e),await ke(),X&&(re(X),U)&&U("ERR",0,X)}var e;return"https:"!==location.protocol&&"file:"!==location.protocol&&"content:"!==location.protocol&&"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname?(e="https://"+location.hostname+location.pathname,alert("BLX-API: HTTPS required. Jump to '"+e+"'"),window.location.assign(e)):void 0===navigator.bluetooth&&alert("BLX-API: Browser does not support Bluetooth!"),{setTerminal:Le,userSendCmd:async(e,t)=>{if(await He(e,t),X)throw X;if(!0===H)throw new Error("*** BLX BUSY (Since "+(Date.now()-q).toFixed(0)+" msec) ***")},terminalPrint:re,getDevice:()=>P,getMemory:()=>Y,getPinOK:()=>G,frq_ping:oe,chordsound:We,getCrc32:ce,IparamAddChannel:function(t,a){let e=0;var i=parseInt(t[2]);let n;for(;;){var r=l(t,e);if(r<0)break;if(e++,n=r,e>=i)return!1}var o=Pe(t);t.push("@"+e);for(let e=0;e{let se="V1.25 / 12.12.2024",le="(C)JoEmbedded.de",a="";async function L(t=1){return new Promise(e=>setTimeout(e,t))}let c=3988292384;function ce(t){let a=4294967295;for(let e=0;e>>0;for(let e=0;e<8;e++)1&a?a=a>>>1^c:a>>>=1}return a>>>0}let P={},g=!1,U,de="5c170001-b5a3-f393-e0a9-a37f42997c22",d="5c170002-b5a3-f393-e0a9-a37f42997c22",f="5c170003-b5a3-f393-e0a9-a37f42997c22",K,R,u,V=!1,fe=!1,z="",G=!1,h,W=!1,H=!1,X=0,q,o="?",Y={total:0,incnew:0,max:-1,mode:0},k=!1,S=0,v=3,b=16,E=17,O=32,C=33,I=34,x=35,A=1e4,D="unknown.dat",m,T,N,F,_,B,w,p,y,M,ue,j,ve=20,Re=40,be,ge,me=!1,we=!1,J="3",Z="15",$;function pe(){R=void 0,u=void 0,V=!1,g=!1,fe=!1,G=!1,h=void 0,!(W=!1)===H&&"R"!==o?(re("Disconnected while Busy('"+o+"')"),X="ERROR: Disconnected ('"+o+"')"):re("Disconnected"),H=!1,U&&(void 0!==K?U("CON",1,"Reconnectable"):U("CON",0,"Disconnected"))}function ye(e){var e=new Uint8Array(e.target.value.buffer),r=e.length;if(r<2)re("ERROR(Data): NUS RX blocklen: "+r),console.log(e);else{var o=e[0];if(o+2!==r)re("ERROR(Data): NUS RX blocklen/dlen(0): "+r+"/"+o),console.log(e);else{var s,r=e[1],l=e.subarray(2);let a,i,n,t;switch(r){case x:if(ze(),"~"===(a=(new TextDecoder).decode(l)).charAt(0)&&1=ve&&i<250?(re("BLE Blocksize: "+(be=i)+" Bytes"),ii)X="ERROR: Too many data";else{p.set(l,y),y+=o;var b=Date.now();if(1e3=i)break;var o="Failed, Retry to connect ("+(i-t+1)+" left)...";U&&U("WARN",5,o),re(o)}V&&(a&&await xe(!1),await ee(),!0===G)&&We(500)}}async function ke(){if(g){g=!1;var e=P.deviceMAC+"_#BlxIDs";try{await blStore.set(e,P)}catch(e){X="ERROR(CheckIDs): "+e}}}async function Q(e,t=A){if(!0===H)console.warn("*** BLX BUSY (Since "+(Date.now()-q).toFixed(0)+" msec) ***");else{if(!0!==V){if(void 0===K)return void(X="ERROR(DeviceCmd): Not Connected!");if(await he(0,1),X)return}!1===(W=e.startsWith("#")?!0:W)&&(H=!0),o=e,q=Date.now();var[e,a=b]=[e],i=e.length,n=new Uint8Array(i+2),r=n.subarray(2),i=(n[0]=i,n[1]=a,(new TextEncoder).encodeInto(e,r));if(void 0!==i)try{R.writeValue(n.buffer)}catch(e){let t;t=!1===V?"Connection lost":e,X="ERROR(DeviceSend): "+t}if(await 0,!1===W){a=t;for(S=a;!0===H;)if(await L(10),(S-=10)<0){X="ERROR(DeviceCmd): Timeout ('"+o+"')";break}await 0,H=!1}}}function s(t){let a=-1;for(let e=0;em?X="ERROR(SysCmd): Out of range of File":(B=t,U&&U("GET",e,n),await Ae(t,e,i),X||(async()=>{if(void 0!==y&&y)if(void 0===p||p.length!==w)X="ERROR(Store): Inconsistent Data";else{var e=P.deviceMAC+"_"+D,t=[];t.total_len=m,t.pos0=B,t.akt_len=w,t.ctime=T,t.crc32=N,t.ucl_flag=F,t.esync_flag=_,t.bytebuf=p,t.tssync=void 0;try{await blStore.set(e,t)}catch(e){return X="ERROR(Store): "+e}re("Save to Store '"+e+"'"),p=void 0,j=e}else X="ERROR(Store): No Data to store"})())}}}async function Ee(e,t){var a,i,n=s(e);if(0<=n){if(await blStore.get(P.deviceMAC+"_"+e),void 0===(a=blStore.result())||!0===t)await Se([0,e],!1),X;else if(0<(t=P.disk.files[n].len-a.v.akt_len)&&(U&&U("GET",t,e),re('Get File (Missing Part) "'+e+'": Len: '+t+" Bytes"),n=e,e=a.v.akt_len,i=t,m=-1,D=void 0,j=void 0,await Q("N:"+n),await(!X&&!(m<0?X="ERROR(SysCmd): No File '"+n+"'":(N=0,F=!0,_=!1,await Ae(B=e,m=i,!1)))),!X))if(p.length!==t)X="ERROR(upload): Read Len";else{(n=new Uint8Array(a.v.bytebuf.length+t)).set(a.v.bytebuf),n.set(p,a.v.bytebuf.length),a.v.bytebuf=n,a.v.total_len+=t,a.v.akt_len+=t,a.v.tssync=void 0;try{await blStore.set(a.k,a.v)}catch(e){X="ERROR(upload): "+e}}}else X=""}async function ee(){for(let e=0;e<3&&(await L(1e3),$=-1,void 0===R?X="Disconnected":await Q("CS",32e3),!X)&&!(0<$);e++);}async function te(){for(let e=0;e<4&&(await L(1e3),$=-1,await Q("C"+J,32e3),!X)&&!($<=50);e++){var t=parseInt(J);if(isNaN(t))break;0'data.edt.old'"),!0===e))try{await blStore.remove(P.deviceMAC+"_data.edt"),await blStore.set(i.k,i.v)}catch(e){return void(X="ERROR(Store): "+e)}if(null!=i&&(a<0||P.disk.files[a].date.getTime()!==i.v.ctime.getTime())&&(a=-1,!(i=void 0)===e))try{await blStore.remove(P.deviceMAC+"_data.edt.old")}catch(e){return void(X="ERROR(Store): "+e)}if(null!=n&&(t<0||P.disk.files[t].date.getTime()!==n.v.ctime.getTime())&&!(n=void 0)===e)try{await blStore.remove(P.deviceMAC+"_data.edt")}catch(e){return void(X="ERROR(Store): "+e)}0<=t&&(Y.total+=P.disk.files[t].len),0<=a&&(Y.total+=P.disk.files[a].len),Y.incnew=Y.total,null!=n&&(Y.incnew-=n.v.akt_len),null!=i&&(Y.incnew-=i.v.akt_len),X=0}async function Ie(e){var i=e.split(" ");let t,a;var n,r,o,s,l,c,d=i[0].toLowerCase();if(!0===W)X='ERROR(Modem): Exit Modem Terminal ("~")!';else switch(d){case"?":re(`Blx Terminal Version: ${se}, `+le);break;case"q":case"quit":Le();break;case"cls":ne=[],void 0!==ie&&(document.getElementById("blxTerminalOut").innerText="(cleared)");break;case"s":case"store":try{if(i.length<=1){await blStore.count();let n=0,r=Date.now();re("Store: "+blStore.result()+" Items"),await blStore.iterate(function(e){a=r-e.ts,t="",86400<=(a/=1e3)&&(a-=86400*(i=Math.floor(a/86400)),t+=i+"d"),a-=3600*(i=Math.floor(a/3600)),i<10&&(t+="0"),t+=i+"h",(i=Math.floor(a/60))<10&&(t+="0"),t+=i+"m",(a-=60*i)<10&&(t+="0");var t,a,i=t+=Math.floor(a)+"s";void 0!==e.v.akt_len?(a=e.v.akt_len,n+=a,re("'"+e.k+"' ("+i+")': "+a+" Bytes")):re("'"+e.k+"' ("+i+")'")}),re("Total Data: "+(n/1024).toFixed(0)+" kB")}else switch(i[1]){case"c":case"clear":await blStore.clearStore(),re("Store cleared");break;case"r":case"remove":{let e;e=i.length<3?j:i[2],await blStore.remove(e),re("Removed '"+e+"' from Store")}break;case"v":case"var":3===i.length?(s=i[2],await blStore.get(s),re("Key:'"+s+"' => '"+blStore.result().v+"'")):4===i.length?(l=i[2],c=i[3],await blStore.set(l,c),re("Set Key:'"+l+"' to:'"+c+"'")):re("Syntax Error");break;case"l":case"list":try{let e;if(void 0===(e=i.length<3?j:i[2])){X="ERROR(Store): No Key";break}await blStore.get(e);var f=blStore.result();if(void 0===f){X="ERROR(Store): No Value for this Key";break}var u,v=(new TextDecoder).decode(f.v.bytebuf),R=v.replace(/\r/g,"").split(/\n/),b=(R.pop(),ae);ae "+R.length+" Lines");let t=0;for(u of R)re(t+": "+(u.length?u:"(empty)")),t++;ae=b}catch(e){X="ERROR(Store): "+e}break;case"m":case"modify":try{let e;var g=i[2];if(void 0===g){X="ERROR(Store): No Index";break}var m=i[3];if(void 0===(e=i.length<5?j:i[4])){X="ERROR(Store): No Key";break}await blStore.get(e);var w=blStore.result();if(void 0===w){X="ERROR(Store): No Value for this Key";break}var p=(new TextDecoder).decode(w.v.bytebuf).replace(/\r/g,"").split(/\n/);if(p.pop(),g<0||g>p.length){X="ERROR(Store): Index Range";break}var y=p[g],h=(re("Old: "+g+": "+(y.length?y:"(empty)")),p[g]=m,re("New: "+g+": "+((y=p[g]).length?y:"(empty)")),new TextEncoder),k=(w.v.bytebuf=h.encode(p.join("\n")+"\n"),w.v.bytebuf.length);w.v.akt_len=k,w.v.crc32=ce(w.v.bytebuf),w.v.ctime=new Date,w.v.pos0=0,w.v.total_len=k,w.v.ucl_flag=!1,w.v.tssync=void 0,await blStore.set(e,w.v)}catch(e){X="ERROR(Store): "+e}break;default:X="ERROR(Store): Unknown Cmd"}}catch(e){X="ERROR(Store): "+e}break;case"e":case"export":try{let e;e=i.length<2?j:i[1],await blStore.get(e);var S=blStore.result();if(void 0===S){X="ERROR(StoreExport): Key not found";break}var E=S;try{if(void 0!==E.v&&void 0!==E.v.total_len&&E.v.total_len){var O=E.k.lastIndexOf(".");let e="application/octet-binary";if(1{var t=document.createElement("input");t.type="file";let a,i=!0;for(void 0!==e&&(t.accept=e),t.oncancel=e=>{i=!1},t.onchange=e=>{e=e.target.files[0];re('Selected File:"'+e.name+'" Size:'+e.size+" LastModified: ["+e.lastModifiedDate.toLocaleDateString()+" "+e.lastModifiedDate.toLocaleTimeString()+"]");let t=new FileReader;t.onabort=t.onerror=function(){i=!1},t.onload=async function(){a=t.result,i=!1},t.readAsText(e)},re("Select File or Cancel"),t.click();i;)await L(10);return a})(".crun");if(void 0!==S){var x=S.replace(/\r/g,"").trim().split(/\n/);for(let e=0;e{e=e.target.files[0];re('Selected File:"'+e.name+'" Size:'+e.size+" LastModified: ["+e.lastModifiedDate.toLocaleDateString()+" "+e.lastModifiedDate.toLocaleTimeString()+"]");let t=new FileReader;t.onload=async function(){var e=new Uint8Array(t.result);e.length?rd&&(e=d);var f=new Uint8Array(e+2),u=(f[0]=e,f[1]=E,t.subarray(r,r+e));if(f.set(u,2),await R.writeValue(f.buffer),n-=e,r+=e,!n){var v=Date.now()-s;re("Transfer OK ("+v/1e3+" sec, "+(t.length/v*1e3).toFixed(0)+" Bytes/sec)");break}1e3<(o=Date.now())-l&&(l=o,re((100*r/t.length).toFixed(0)+"% / "+r+" Bytes"))}}catch(e){return void(X=!1===V?"ERROR: Connection lost":"ERROR: Transfer "+e)}await Q("L",5e3),X||1e3{let a=e.target.files[0];if(re('Selected File:"'+a.name+'" Size:'+a.size+" LastModified: ["+a.lastModifiedDate.toLocaleDateString()+" "+a.lastModifiedDate.toLocaleTimeString()+"]"),void 0!==r&&".sec"==r){e="firmware_typ"+P.deviceType+"_";if(!a.name.startsWith(e)&&"_firmware.sec"==!a.name)return void re(X="ERROR: No Firmware File for this Device")}let i=new FileReader;i.onload=async function(){var t=new Uint8Array(i.result);if(t.length){let e=a.name;await De(t,e=void 0!==r&&".sec"==r?"_firmware.sec":e,n),X&&re(X),void 0!==r&&".sec"==r&&(re("Reset Device"),await Q("R",2e3),await L(1e3),X=0)}else re(X="ERROR: File is empty")},i.readAsArrayBuffer(a)},re("Select File or Cancel"),e.click()}let Ne=25,ae,ie,ne=[];function re(e){for(void 0!==e?ne.push(e):ne[0]="*** BLX Terminal ***";ne.length>ae;)ne.shift();void 0!==ie&&(document.getElementById("blxTerminalOut").innerText=ne.join("\n"))}function Fe(e){13===e.keyCode||10===e.keycode?(e.preventDefault(),document.getElementById("blxTerminalSend").click()):27===e.keyCode&&(e.preventDefault(),document.getElementById("blxTerminalCmd").value="")}function _e(e){void 0!==ie&&(document.getElementById("blxTerminalSend").disabled=!e)}let Be="";async function Me(){var e=document.getElementById("blxTerminalCmd");let t=e.value.trim();e.value="",e.focus(),re("> "+t),_e(!1),oe(1e3,.05,.1),X=0,"*"==t&&Be.length?t=Be:t.length&&(Be=t),"help"==t||"-h"==t||"/h"==t||"-?"==t||"/?"==t?(re(se+" - "+le),re(a)):(t.startsWith(".")?await Ie(t.substring(1)):await Q(t),await ke(),X&&(Ge(),re(X))),_e(!0)}function Le(e,t,a=Ne){void 0!==e?(ae=a,(ie=document.getElementById(e)).innerHTML="
",document.getElementById("blxTerminalCmd").addEventListener("keyup",Fe),document.getElementById("blxTerminalSend").addEventListener("click",Me),re(),_e(!0)):(void 0!==ie&&(ie.innerHTML=""),ie=void 0),void 0!==t&&(U="function"==typeof t?t:void 0)}function l(t,e){var a="@"+e;for(let e=0;e 14 Parameters/Channel!";return e}function i(e,t,a){e=parseInt(e);return!!(isNaN(e)||e "+e),X=0,e.startsWith(".")?await Ie(e.substring(1)):null!=t?await Q(e,t):await Q(e),await ke(),X&&(re(X),U)&&U("ERR",0,X)}var e;return"https:"!==location.protocol&&"file:"!==location.protocol&&"content:"!==location.protocol&&"localhost"!==location.hostname&&"127.0.0.1"!==location.hostname?(e="https://"+location.hostname+location.pathname,alert("BLX-API: HTTPS required. Jump to '"+e+"'"),window.location.assign(e)):void 0===navigator.bluetooth&&alert("BLX-API: Browser does not support Bluetooth!"),{setTerminal:Le,userSendCmd:async(e,t)=>{if(await He(e,t),X)throw X;if(!0===H)throw new Error("*** BLX BUSY (Since "+(Date.now()-q).toFixed(0)+" msec) ***")},terminalPrint:re,getDevice:()=>P,getMemory:()=>Y,getPinOK:()=>G,frq_ping:oe,chordsound:We,getCrc32:ce,IparamAddChannel:function(t,a){let e=0;var i=parseInt(t[2]);let n;for(;;){var r=l(t,e);if(r<0)break;if(e++,n=r,e>=i)return!1}var o=Pe(t);t.push("@"+e);for(let e=0;esectionMain.scrollIntoView(!0)),sidebuttonTerminal.addEventListener("click",()=>sectionTerminal.scrollIntoView(!1)),document.getElementById("bd-online")),bdOffline=document.getElementById("bd-offline"),lastOnlineState,blxInfoLine=(sidebuttonBluetooth.addEventListener("click",blxConnect),sidebuttonSetup.addEventListener("click",doSetupDialog),sidebuttonServersync.addEventListener("click",runServerSync),sidebuttonQRscan.addEventListener("click",bdRunQRscanner),document.getElementById("blxInfoLine")),blxGraph=document.getElementById("blxGraph");const blxCmdRes=document.getElementById("blxCmdRes");let blxConnectButtonText=document.getElementById("blxConnectButtonText"),blxMemory=document.getElementById("blxMemory"),blxSync=document.getElementById("blxSync"),blxSignal=document.getElementById("blxSignal"),blxMeasureData=document.getElementById("blxMeasureData"),blxDeviceName=document.getElementById("blxDeviceName"),blxMAC=document.getElementById("blxMAC"),blxType=document.getElementById("blxType"),blxFW=document.getElementById("blxFW"),blxPIN=document.getElementById("blxPIN"),blxBadgeButton=document.getElementById("blxBadgeButton"),blxPinEnter=document.getElementById("blxPinEnter"),blxSyncButton=document.getElementById("blxSyncButton"),blxMeasureButton=document.getElementById("blxMeasureButton"),blxEcholotCheck=document.getElementById("blxEcholot"),blxUploadButton=document.getElementById("blxUploadButton"),blxInfoButton=document.getElementById("blxInfoButton"),blxClearButton=document.getElementById("blxClearButton"),blxParametersButton=document.getElementById("blxParametersButton"),blxSysParButton=document.getElementById("blxSysParButton"),blxSyncButtonSpan=document.getElementById("blxSyncButtonSpan"),blxUploadButtonSpan=document.getElementById("blxUploadButtonSpan"),blxInfoButtonSpan=document.getElementById("blxInfoButtonSpan"),blxClearButtonSpan=document.getElementById("blxClearButtonSpan"),blxParametersSpan=document.getElementById("blxParametersSpan"),blxSetPinButton=document.getElementById("blxSetPinButton"),blxScanPinButton=document.getElementById("blxScanPinButton"),navDevicelist=(blxBadgeButton.addEventListener("click",blxPrintBadge),blxSetPinButton.addEventListener("click",blxSetPin),blxPIN.addEventListener("keyup",blxPinKeyUpEvent),blxScanPinButton.addEventListener("click",blxScanPin),blxInfoButton.addEventListener("click",blxMemoryInfo),blxSyncButton.addEventListener("click",blxSyncTime),blxUploadButton.addEventListener("click",blxUpload),blxMeasureButton.addEventListener("click",blxMeasure),blxEcholotCheck.addEventListener("click",blxEcholotClick),blxClearButton.addEventListener("click",blxClearDevice),blxParametersButton.addEventListener("click",blxEditIparam),blxSysParButton.addEventListener("click",blxEditSysparam),document.getElementById("nav-devicelist")),blxDashBadgeURL,bdurl=new URL(location),cbSpinner=(isUrlGit=bdurl.host.includes("github."),!1);function ll(e){return I18.ll(e)}async function blxConnect(){let e=!1,t=(blxCmdRes&&(blxCmdRes.textContent="-"),disabler(!0),!1);try{2<=connectionLevel?(JD.spinnerShow("Bluetooth",""+ll("Disconnect"),10,!0),await _blxCmdSend(".d")):(void 0!==lastAdvertisingName&&(t=await JD.doDialogOK(""+ll("Reconnect?"),`${ll("Reconnect to Device?")}
${ll("Name")}: '${lastAdvertisingName}'
`+ll("OK to Reconnect (or close)"))),e=!0,t?await _blxCmdSend(".r"):await _blxCmdSend(".c"),await showLoggerDetails())}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BCo]")}cbSpinner=!1,JD.spinnerClose(),disabler(!1),e&&JD.sidebarMax(.3)}function disabler(e){var t=blx.getPinOK();e?sidebuttonBluetooth.classList.add("jo-disabled"):sidebuttonBluetooth.classList.remove("jo-disabled");let n="none";!0!==t&&!1===e&&3<=connectionLevel&&(n="block"),blxPinEnter&&(blxPinEnter.style.display=n),blxBadgeButton&&(blxBadgeButton.disabled=e),0!=connectionLevel&&!0===t||(e=!0),blxSyncButton&&(blxSyncButton.disabled=e),blxMeasureButton&&(blxMeasureButton.disabled=e),blxEcholotCheck&&(blxEcholotCheck.disabled=e),blxUploadButton&&(blxUploadButton.disabled=e),blxInfoButton&&(blxInfoButton.disabled=e),blxClearButton&&(blxClearButton.disabled=e),blxParametersButton&&(blxParametersButton.disabled=e),blxSysParButton&&(blxSysParButton.disabled=e),n=void 0!==blxDevice&&1e3<=blxDevice.deviceType?"block":"none",blxSyncButtonSpan&&(blxSyncButtonSpan.style.display=n),blxUploadButtonSpan&&(blxUploadButtonSpan.style.display=n),blxInfoButtonSpan&&(blxInfoButtonSpan.style.display=n),blxClearButtonSpan&&(blxClearButtonSpan.style.display=n),blxParametersSpan&&(blxParametersSpan.style.display=n)}async function showLoggerDetails(){if(3<=connectionLevel){blxDevice=blx.getDevice(),blxMAC&&(blxMAC.textContent=blxDevice.deviceMAC),blxType&&(blxType.textContent=blxDevice.deviceType),blxFW&&(blxFW.textContent=blxDevice.firmwareVersion),4==connectionLevel&&1e3<=blxDevice.deviceType&&(await calculateMemory(!0),await showLink());var t=blxDevice.deltaToApp;let e=t+" "+ll("sec");864e5${ll("Time lost!")}
`:86400",e),_blxCmdBusyFlag=!1,_blxCmdRBCnt=0}catch(e){console.log("ERROR:",e),_blxCmdBusyFlag=!1,_blxCmdRBCnt=0,_blxCmdResult=e,connectionLevel<=2&&bleCallback("CON",0)}return n}async function calculateMemory(n){let l="???";try{n&&await _blxCmdSend(".m");var a=blx.getMemory();let e,t=(e=0 ${ll("Show Graph")}
(`+t.v.akt_len+" Byte, "+t.v.ctime.toLocaleString()+")")}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BsL]")}blxGraph.innerHTML=e}async function blxMemoryInfo(){disabler(!0),JD.spinnerShow(ll("Memory Info"),null,60,!0);try{await _blxCmdSend("v"),await calculateMemory(!0)}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BMI]")}JD.spinnerClose(),disabler(!1)}async function blxClearDevice(){if(disabler(!0),await JD.doDialogOK(ll("Clear Device?"),ll("OK to clear Device Memory?"),null,!0)){JD.spinnerShow(ll("Clear Device"),null,250);try{void 0!==blxDevice.diskCheckOK&&!0===blxDevice.diskCheckOK?(blxInfoLine&&(blxInfoLine.textContent=ll("Start new Measure, Clear all Data")),await _blxCmdSend("n")):(blxInfoLine&&(blxInfoLine.textContent=ll("Start new Measure, Clear all Data (Clean FlashDisk, may need up to 240 sec)")),await _blxCmdSend("n1",24e4)),document.getElementById("blxMemory").textContent="-",await blStore.remove(blxDevice.deviceMAC+"_xtract.edt"),await showLink()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BCD]")}JD.spinnerClose()}disabler(!1)}async function blxPinKeyUpEvent(e){13!==e.keyCode&&10!==e.keycode||(e.preventDefault(),blxSetPin())}async function blxSetPin(){blxCmdRes&&(blxCmdRes.textContent="-");var e=blxPIN.value;disabler(!0),JD.spinnerShow(ll("Set PIN"),null,300);try{if(e.length<1)throw"ERROR: PIN EMPTY";await _blxCmdSend(".i "+e),blxPIN.value="",await showLoggerDetails()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BSP]")}JD.spinnerClose(),disabler(!1)}async function blxScanPin(){await bdRunQRscanner(blxDevice.deviceMAC)}async function blxSyncTime(){disabler(!0),JD.spinnerShow(ll("Sync Device Time"),null,30,!0);try{await _blxCmdSend(".t set"),blxSync.textContent=0}catch(e){JD.joPingError(),blxCmdRes=blxCmdRes&&e+" [BST]"}JD.spinnerClose(),disabler(!1)}async function blxUpload(){disabler(!0),JD.spinnerShow(ll("Upload Data"),null,600,!1);try{await _blxCmdSend(".u"),await calculateMemory(!1),await _blxCmdSend(".x"),await showLink()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BUp]")}await updateDeviceList(),JD.spinnerClose(),disabler(!1)}async function blxEcholotClick(){await _blxCmdSend(blxEcholotCheck.checked?".a 1":".a 0")}let measureData="???";async function blxMeasure(){disabler(!0),JD.spinnerShow(ll("Measure"),null,30,!0),blxMeasureData.innerHTML=ll("Wait...");try{await _blxCmdSend("e 1")}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BMe]")}JD.spinnerClose(),disabler(!1)}let p100_beschr=["*@100_System","*DEVICE_TYP","*MAX_CHANNELS","*HK_FLAGS","*NewCookie [Parameter 10-digit Timestamp.32]","Device_Name[BLE:$11/total:$41]","Period_sec[10..86400]","Period_Offset_sec[0..(Period_sec-1)]","Period_Alarm_sec[0..Period_sec]","Period_Internet_sec[0..604799]","Period_Internet_Alarm_sec[0..Period_Internet_sec]","UTC_Offset_sec[-43200..43200]","Flags (B0:Rec B1:Ring) (0: RecOff) B2:Compress","HK_flags (B0:Bat B1:Temp B2.Hum B3.Perc B4.Baro)","HK_reload[0..255]","Net_Mode (0:Off 1:OnOff 2:On_5min 3:Online)","ErrorPolicy (O:None 1:RetriesForAlarms, 2:RetriesForAll)","MinTemp_oC[-40..10]","Config0_U31 (B0:OffPer.Inet:On/Off B1,2:BLE:On/Mo/Li/MoLi B3:EnDS B4:CE:Off/On B5:Live:Off/On)","Configuration_Command[$79]","Internet_Starttime[Timestamp.32]"],pkan_beschr=["*@ChanNo","Action[0..65535] (B0:Meas B1:Cache B2:Alarms)","Physkan_no[0..65535]","Kan_caps_str[$8]","Src_index[0..255]","Unit[$8]","Mem_format[0..255]","DB_id[0..2e31]","Offset[float]","Factor[float]","Alarm_hi[float]","Alarm_lo[float]","Messbits[0..65535]","Xbytes[$32]"],p200_beschr=["*@200_Sys_Param","APN[$41]","Server/VPN[$41]","Script/Id[$41]","API Key[$41]","ConFlags[0..255] (B0:Verbose B1:RoamAllow B4:LOG_FILE (B5:LOG_UART) B7:Debug)","SIM Pin[0..65535] (opt)","APN User[$41]","APN Password[$41]","Max_creg[10..255]","Port[1..65535]","Server_timeout_0[1000..65535]","Server_timeout_run[1000..65535]","Modem Check Reload[60..3600]","Bat. Capacity (mAh)[0..100000]","Bat. Volts 0%[float]","Bat. Volts 100%[float]","Max Ringsize (Bytes)[1000..2e31]","mAmsec/Measure[0..1e9]","Mobile Protocol[0..255] B0:0/1:HTTP/HTTPS B1:PUSH B2,3:TCP/UDPSetup"],original_par;async function editParamDialogDo(e){var t="
";let n;return e?n=JD.prepareCustomDialog(ll("Edit Parameter")+" 'sys_param'",t,ll("Send...")):(n=JD.prepareCustomDialog(ll("Edit Parameter")+" 'iparam'",t,ll("Send..."),``)).querySelector("#editBtnAddChannel").addEventListener("click",()=>{try{blxEditedParamGet(0),blx.IparamAddChannel(blxDevice.iparam,!0),blxParametersCopy(!1,0);var e=document.getElementById("blxParameterEdit");e.innerHTML=blxParametersGetHtml(0),e.scrollTop=e.scrollHeight,JD.joPing()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BaC]")}}),document.getElementById("blxParameterEdit").innerHTML=blxParametersGetHtml(e),await JD.doCustomDialog(0)}function blxParCancel(e){e?blxDevice.sys_param=original_par:blxDevice.iparam=original_par,blxCmdRes&&(blxCmdRes.textContent=ll("Edit Parameters cancelled"))}function blxEditedParamGet(n){var e=(n?blxDevice.sys_param:blxDevice.iparam).length;for(let t=0;t


${e}
`,null),t=e}else try{blxEditedParamGet(0),blx.CompactIparam(blxDevice.iparam),blxParametersCopy(!1,0);var o=blx.IparamValidate(blxDevice.iparam);if(o)throw"ERROR: Iparam-Check(3):\n"+o;var r=(new TextEncoder).encode(blxDevice.iparam.join("\n")+"\n"),s=blx.getCrc32(r);await blStore.get(blxDevice.deviceMAC+"_iparam.lxp");let e=blStore.result();if(void 0!==e&&s===e.v.crc32&&r.length===e.v.akt_len&&!1===blxDevice.iparam_dirtyflag)return blxCmdRes&&(blxCmdRes.textContent=ll("(No Changes)")),JD.spinnerClose(),t;void 0===e&&(e={v:{}}),blxEditedParamGet(0),blxDevice.iparam[4]=(Date.now()/1e3).toFixed(0),blxDevice.iparam_dirtyflag=!0;var d=new TextEncoder;if(e.v.bytebuf=d.encode(blxDevice.iparam.join("\n")+"\n"),e.v.crc32=blx.getCrc32(e.v.bytebuf),e.v.total_len=e.v.bytebuf.length,e.v.akt_len=e.v.total_len,e.v.ctime=new Date(1e3*blxDevice.iparam[4]),e.v.esync_flag=!0,e.v.tssync=void 0,await blStore.set(blxDevice.deviceMAC+"_iparam.lxp",e.v),await _blxCmdSend(".fput "+blxDevice.deviceMAC+"_iparam.lxp"),_blxCmdResult)throw _blxCmdResult;if(await _blxCmdSend("X"),_blxCmdResult)throw _blxCmdResult;blxDevice.iparam_dirtyflag=!1,await blStore.set(blxDevice.deviceMAC+"_#BAK_iparam.lxp",e.v)}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+"[BPa]"),await JD.doDialogOK(ll("ERROR"),ll("Parameter Check")+` 'iparam'


${e}
`,null),t=e}return await updateDeviceList(),JD.spinnerClose(),t}function blxParametersCopy(e,t){var n=t?blxDevice.sys_param:blxDevice.iparam;if(!0===e)if(original_par=[],void 0===n)JD.doDialogOK(ll("ERROR")+": Iparam-Check(1)","No Parameters found!",null);else{for(let e=0;e"):i++;var s,d=void 0!==a[i]?a[i]:"(unknown)";let e,t=(d.indexOf("Timestamp.32")&&1e9[${n}+(+${i})] +import*as JD from"./jodash.js";import*as QRS from"./qrscanner.js";import*as I18 from"./intmain_i18n.js";import"./blx.js";import"./blStore.js";import"./FileSaver.js";let VERSION="V0.24 / 16.12.2024",COPYRIGHT="(C)JoEmbedded.de",connectionLevel=0,lastAdvertisingName,blxDevice,uplStatus={totalsize:0,mode:"",sumsize:0,filesize:0,filename:"",fproc:0,ndata:!1},deviceListDB=[],defLang=I18.i18_availLang[0],setupOptions={dtheme:!1,font:100,lang:defLang,server:"../sync/blxremote.php",accesstoken:"123456"},isUrlGit,sidebuttonMaincontent=(document.getElementById("bd-version").textContent=VERSION+(0sectionMain.scrollIntoView(!0)),sidebuttonTerminal.addEventListener("click",()=>sectionTerminal.scrollIntoView(!1)),document.getElementById("bd-online")),bdOffline=document.getElementById("bd-offline"),lastOnlineState,blxInfoLine=(sidebuttonBluetooth.addEventListener("click",blxConnect),sidebuttonSetup.addEventListener("click",doSetupDialog),sidebuttonServersync.addEventListener("click",runServerSync),sidebuttonQRscan.addEventListener("click",bdRunQRscanner),document.getElementById("blxInfoLine")),blxGraph=document.getElementById("blxGraph");const blxCmdRes=document.getElementById("blxCmdRes");let blxConnectButtonText=document.getElementById("blxConnectButtonText"),blxMemory=document.getElementById("blxMemory"),blxSync=document.getElementById("blxSync"),blxSignal=document.getElementById("blxSignal"),blxMeasureData=document.getElementById("blxMeasureData"),blxDeviceName=document.getElementById("blxDeviceName"),blxMAC=document.getElementById("blxMAC"),blxType=document.getElementById("blxType"),blxFW=document.getElementById("blxFW"),blxPIN=document.getElementById("blxPIN"),blxBadgeButton=document.getElementById("blxBadgeButton"),blxPinEnter=document.getElementById("blxPinEnter"),blxSyncButton=document.getElementById("blxSyncButton"),blxMeasureButton=document.getElementById("blxMeasureButton"),blxEcholotCheck=document.getElementById("blxEcholot"),blxUploadButton=document.getElementById("blxUploadButton"),blxInfoButton=document.getElementById("blxInfoButton"),blxClearButton=document.getElementById("blxClearButton"),blxParametersButton=document.getElementById("blxParametersButton"),blxSysParButton=document.getElementById("blxSysParButton"),blxSyncButtonSpan=document.getElementById("blxSyncButtonSpan"),blxUploadButtonSpan=document.getElementById("blxUploadButtonSpan"),blxInfoButtonSpan=document.getElementById("blxInfoButtonSpan"),blxClearButtonSpan=document.getElementById("blxClearButtonSpan"),blxParametersSpan=document.getElementById("blxParametersSpan"),blxSetPinButton=document.getElementById("blxSetPinButton"),blxScanPinButton=document.getElementById("blxScanPinButton"),navDevicelist=(blxBadgeButton.addEventListener("click",blxPrintBadge),blxSetPinButton.addEventListener("click",blxSetPin),blxPIN.addEventListener("keyup",blxPinKeyUpEvent),blxScanPinButton.addEventListener("click",blxScanPin),blxInfoButton.addEventListener("click",blxMemoryInfo),blxSyncButton.addEventListener("click",blxSyncTime),blxUploadButton.addEventListener("click",blxUpload),blxMeasureButton.addEventListener("click",blxMeasure),blxEcholotCheck.addEventListener("click",blxEcholotClick),blxClearButton.addEventListener("click",blxClearDevice),blxParametersButton.addEventListener("click",blxEditIparam),blxSysParButton.addEventListener("click",blxEditSysparam),document.getElementById("nav-devicelist")),blxDashBadgeURL,blxAutoPINURL,bdurl=new URL(location),cbSpinner=(isUrlGit=bdurl.host.includes("github."),!1);function ll(e){return I18.ll(e)}async function blxConnect(){let e=!1,t=(blxCmdRes&&(blxCmdRes.textContent="-"),disabler(!0),!1);try{2<=connectionLevel?(JD.spinnerShow("Bluetooth",""+ll("Disconnect"),10,!0),await _blxCmdSend(".d")):(void 0!==lastAdvertisingName&&(t=await JD.doDialogOK(""+ll("Reconnect?"),`${ll("Reconnect to Device?")}
${ll("Name")}: '${lastAdvertisingName}'
`+ll("OK to Reconnect (or close)"))),e=!0,t?await _blxCmdSend(".r"):await _blxCmdSend(".c"),await showLoggerDetails())}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BCo]")}cbSpinner=!1,JD.spinnerClose(),disabler(!1),e&&JD.sidebarMax(.3)}async function disabler(e){var t=blx.getPinOK();e?sidebuttonBluetooth.classList.add("jo-disabled"):sidebuttonBluetooth.classList.remove("jo-disabled");let n="none";if(!0!==t&&!1===e&&3<=connectionLevel&&(n="block"),blxPinEnter&&"block"===(blxPinEnter.style.display=n)&&void 0!==blxAutoPINURL)try{var l=blxAutoPINURL+"&mac="+blxDevice.deviceMAC;console.log("PIN-Fetch: ",l);var a=await(await fetch(l,{method:"GET",mode:"cors",headers:{"Content-Type":"application/json"}})).json();if(parseInt(a.status))throw a.status;blxPIN.value=a.pin,blx.chordsound(1e3),await blxSetPin()}catch(e){JD.joPingError(),JD.doDialogOK(ll("ERROR"),"AutoPIN: "+e)}let i=e;void 0!==blxDevice&&void 0!==blxDevice.devicePIN||(i=!0),blxBadgeButton&&(blxBadgeButton.disabled=i),0!=connectionLevel&&!0===t||(e=!0),blxSyncButton&&(blxSyncButton.disabled=e),blxMeasureButton&&(blxMeasureButton.disabled=e),blxEcholotCheck&&(blxEcholotCheck.disabled=e),blxUploadButton&&(blxUploadButton.disabled=e),blxInfoButton&&(blxInfoButton.disabled=e),blxClearButton&&(blxClearButton.disabled=e),blxParametersButton&&(blxParametersButton.disabled=e),blxSysParButton&&(blxSysParButton.disabled=e),n=void 0!==blxDevice&&1e3<=blxDevice.deviceType?"block":"none",blxSyncButtonSpan&&(blxSyncButtonSpan.style.display=n),blxUploadButtonSpan&&(blxUploadButtonSpan.style.display=n),blxInfoButtonSpan&&(blxInfoButtonSpan.style.display=n),blxClearButtonSpan&&(blxClearButtonSpan.style.display=n),blxParametersSpan&&(blxParametersSpan.style.display=n)}async function showLoggerDetails(){if(3<=connectionLevel){blxDevice=blx.getDevice(),blxMAC&&(blxMAC.textContent=blxDevice.deviceMAC),blxType&&(blxType.textContent=blxDevice.deviceType),blxFW&&(blxFW.textContent=blxDevice.firmwareVersion),4==connectionLevel&&1e3<=blxDevice.deviceType&&(await calculateMemory(!0),await showLink());var t=blxDevice.deltaToApp;let e=t+" "+ll("sec");864e5${ll("Time lost!")}`:86400",e),_blxCmdBusyFlag=!1,_blxCmdRBCnt=0}catch(e){console.log("ERROR:",e),_blxCmdBusyFlag=!1,_blxCmdRBCnt=0,_blxCmdResult=e,connectionLevel<=2&&bleCallback("CON",0)}return n}async function calculateMemory(n){let l="???";try{n&&await _blxCmdSend(".m");var a=blx.getMemory();let e,t=(e=0 ${ll("Show Graph")}
(`+t.v.akt_len+" Byte, "+t.v.ctime.toLocaleString()+")")}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BsL]")}blxGraph.innerHTML=e}async function blxMemoryInfo(){disabler(!0),JD.spinnerShow(ll("Memory Info"),null,60,!0);try{await _blxCmdSend("v"),await calculateMemory(!0)}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BMI]")}JD.spinnerClose(),disabler(!1)}async function blxClearDevice(){if(disabler(!0),await JD.doDialogOK(ll("Clear Device?"),ll("OK to clear Device Memory?"),null,!0)){JD.spinnerShow(ll("Clear Device"),null,250);try{void 0!==blxDevice.diskCheckOK&&!0===blxDevice.diskCheckOK?(blxInfoLine&&(blxInfoLine.textContent=ll("Start new Measure, Clear all Data")),await _blxCmdSend("n")):(blxInfoLine&&(blxInfoLine.textContent=ll("Start new Measure, Clear all Data (Clean FlashDisk, may need up to 240 sec)")),await _blxCmdSend("n1",24e4)),document.getElementById("blxMemory").textContent="-",await blStore.remove(blxDevice.deviceMAC+"_xtract.edt"),await showLink()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BCD]")}JD.spinnerClose()}disabler(!1)}async function blxPinKeyUpEvent(e){13!==e.keyCode&&10!==e.keycode||(e.preventDefault(),blxSetPin())}async function blxSetPin(){blxCmdRes&&(blxCmdRes.textContent="-");var e=blxPIN.value;disabler(!0),JD.spinnerShow(ll("Set PIN"),null,300);try{if(e.length<1)throw"ERROR: PIN EMPTY";await _blxCmdSend(".i "+e),blxPIN.value="",await showLoggerDetails()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BSP]")}JD.spinnerClose(),disabler(!1)}async function blxScanPin(){await bdRunQRscanner(blxDevice.deviceMAC)}async function blxSyncTime(){disabler(!0),JD.spinnerShow(ll("Sync Device Time"),null,30,!0);try{await _blxCmdSend(".t set"),blxSync.textContent=0}catch(e){JD.joPingError(),blxCmdRes=blxCmdRes&&e+" [BST]"}JD.spinnerClose(),disabler(!1)}async function blxUpload(){disabler(!0),JD.spinnerShow(ll("Upload Data"),null,600,!1);try{await _blxCmdSend(".u"),await calculateMemory(!1),await _blxCmdSend(".x"),await showLink()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BUp]")}await updateDeviceList(),JD.spinnerClose(),disabler(!1)}async function blxEcholotClick(){await _blxCmdSend(blxEcholotCheck.checked?".a 1":".a 0")}let measureData="???";async function blxMeasure(){disabler(!0),JD.spinnerShow(ll("Measure"),null,30,!0),blxMeasureData.innerHTML=ll("Wait...");try{await _blxCmdSend("e 1")}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BMe]")}JD.spinnerClose(),disabler(!1)}let p100_beschr=["*@100_System","*DEVICE_TYP","*MAX_CHANNELS","*HK_FLAGS","*NewCookie [Parameter 10-digit Timestamp.32]","Device_Name[BLE:$11/total:$41]","Period_sec[10..86400]","Period_Offset_sec[0..(Period_sec-1)]","Period_Alarm_sec[0..Period_sec]","Period_Internet_sec[0..604799]","Period_Internet_Alarm_sec[0..Period_Internet_sec]","UTC_Offset_sec[-43200..43200]","Flags (B0:Rec B1:Ring) (0: RecOff) B2:Compress","HK_flags (B0:Bat B1:Temp B2.Hum B3.Perc B4.Baro)","HK_reload[0..255]","Net_Mode (0:Off 1:OnOff 2:On_5min 3:Online)","ErrorPolicy (O:None 1:RetriesForAlarms, 2:RetriesForAll)","MinTemp_oC[-40..10]","Config0_U31 (B0:OffPer.Inet:On/Off B1,2:BLE:On/Mo/Li/MoLi B3:EnDS B4:CE:Off/On B5:Live:Off/On)","Configuration_Command[$79]","Internet_Starttime[Timestamp.32]"],pkan_beschr=["*@ChanNo","Action[0..65535] (B0:Meas B1:Cache B2:Alarms)","Physkan_no[0..65535]","Kan_caps_str[$8]","Src_index[0..255]","Unit[$8]","Mem_format[0..255]","DB_id[0..2e31]","Offset[float]","Factor[float]","Alarm_hi[float]","Alarm_lo[float]","Messbits[0..65535]","Xbytes[$32]"],p200_beschr=["*@200_Sys_Param","APN[$41]","Server/VPN[$41]","Script/Id[$41]","API Key[$41]","ConFlags[0..255] (B0:Verbose B1:RoamAllow B4:LOG_FILE (B5:LOG_UART) B7:Debug)","SIM Pin[0..65535] (opt)","APN User[$41]","APN Password[$41]","Max_creg[10..255]","Port[1..65535]","Server_timeout_0[1000..65535]","Server_timeout_run[1000..65535]","Modem Check Reload[60..3600]","Bat. Capacity (mAh)[0..100000]","Bat. Volts 0%[float]","Bat. Volts 100%[float]","Max Ringsize (Bytes)[1000..2e31]","mAmsec/Measure[0..1e9]","Mobile Protocol[0..255] B0:0/1:HTTP/HTTPS B1:PUSH B2,3:TCP/UDPSetup"],original_par;async function editParamDialogDo(e){var t="
";let n;return e?n=JD.prepareCustomDialog(ll("Edit Parameter")+" 'sys_param'",t,ll("Send...")):(n=JD.prepareCustomDialog(ll("Edit Parameter")+" 'iparam'",t,ll("Send..."),``)).querySelector("#editBtnAddChannel").addEventListener("click",()=>{try{blxEditedParamGet(0),blx.IparamAddChannel(blxDevice.iparam,!0),blxParametersCopy(!1,0);var e=document.getElementById("blxParameterEdit");e.innerHTML=blxParametersGetHtml(0),e.scrollTop=e.scrollHeight,JD.joPing()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BaC]")}}),document.getElementById("blxParameterEdit").innerHTML=blxParametersGetHtml(e),await JD.doCustomDialog(0)}function blxParCancel(e){e?blxDevice.sys_param=original_par:blxDevice.iparam=original_par,blxCmdRes&&(blxCmdRes.textContent=ll("Edit Parameters cancelled"))}function blxEditedParamGet(n){var e=(n?blxDevice.sys_param:blxDevice.iparam).length;for(let t=0;t


${e}
`,null),t=e}else try{blxEditedParamGet(0),blx.CompactIparam(blxDevice.iparam),blxParametersCopy(!1,0);var o=blx.IparamValidate(blxDevice.iparam);if(o)throw"ERROR: Iparam-Check(3):\n"+o;var r=(new TextEncoder).encode(blxDevice.iparam.join("\n")+"\n"),s=blx.getCrc32(r);await blStore.get(blxDevice.deviceMAC+"_iparam.lxp");let e=blStore.result();if(void 0!==e&&s===e.v.crc32&&r.length===e.v.akt_len&&!1===blxDevice.iparam_dirtyflag)return blxCmdRes&&(blxCmdRes.textContent=ll("(No Changes)")),JD.spinnerClose(),t;void 0===e&&(e={v:{}}),blxEditedParamGet(0),blxDevice.iparam[4]=(Date.now()/1e3).toFixed(0),blxDevice.iparam_dirtyflag=!0;var d=new TextEncoder;if(e.v.bytebuf=d.encode(blxDevice.iparam.join("\n")+"\n"),e.v.crc32=blx.getCrc32(e.v.bytebuf),e.v.total_len=e.v.bytebuf.length,e.v.akt_len=e.v.total_len,e.v.ctime=new Date(1e3*blxDevice.iparam[4]),e.v.esync_flag=!0,e.v.tssync=void 0,await blStore.set(blxDevice.deviceMAC+"_iparam.lxp",e.v),await _blxCmdSend(".fput "+blxDevice.deviceMAC+"_iparam.lxp"),_blxCmdResult)throw _blxCmdResult;if(await _blxCmdSend("X"),_blxCmdResult)throw _blxCmdResult;blxDevice.iparam_dirtyflag=!1,await blStore.set(blxDevice.deviceMAC+"_#BAK_iparam.lxp",e.v)}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+"[BPa]"),await JD.doDialogOK(ll("ERROR"),ll("Parameter Check")+` 'iparam'


${e}
`,null),t=e}return await updateDeviceList(),JD.spinnerClose(),t}function blxParametersCopy(e,t){var n=t?blxDevice.sys_param:blxDevice.iparam;if(!0===e)if(original_par=[],void 0===n)JD.doDialogOK(ll("ERROR")+": Iparam-Check(1)","No Parameters found!",null);else{for(let e=0;e"):i++;var s,d=void 0!==a[i]?a[i]:"(unknown)";let e,t=(d.indexOf("Timestamp.32")&&1e9[${n}+(+${i})] '${a[i]}'
`,o+=t}return o}async function blxEditIparam(){for(blxParametersCopy(!0,0);;){if("OK"!==await editParamDialogDo(0)){blxParCancel(0);break}if(!await blxParSend(0))break}}async function blxEditSysparam(){for(blxParametersCopy(!0,1);;){if("OK"!==await editParamDialogDo(1)){blxParCancel(1);break}if(!await blxParSend(1))break}}function bleCallback(l,a,i){switch(l){case"CON":switch(connectionLevel=a,console.log("CON-Level: "+a),a){case 0:case 1:blxConnectButtonText&&(blxConnectButtonText.textContent=ll("Connect")),blxInfoLine&&(blxInfoLine.textContent=ll("Disconnect")),blxMemory&&(blxMemory.textContent="-"),blxSync&&(blxSync.textContent="-"),blxSignal&&(blxSignal.hidden=!0),blxMeasureData&&(blxMeasureData.innerHTML="-"),sidebuttonBluetooth.querySelector("i").classList.remove("jo-icon-ani-beat"),disabler(!1);break;case 2:lastAdvertisingName=blx.getDevice().advertisingName,blxDeviceName&&(blxDeviceName.textContent=lastAdvertisingName),blxMAC&&(blxMAC.textContent="-"),blxType&&(blxType.textContent="-"),blxFW&&(blxFW.textContent="-"),sidebuttonBluetooth.querySelector("i").classList.add("jo-icon-ani-beat"),blxSignal&&(blxSignal.textContent="... dBm"),blxSignal&&(blxSignal.style.backgroundColor="gray");var o=`${ll("Connecting")} '${lastAdvertisingName}'...`;blxConnectButtonText&&(blxConnectButtonText.textContent=o),blxInfoLine&&(blxInfoLine.textContent=o),blxGraph&&(blxGraph.innerHTML=""),JD.spinnerGetBusy()||(cbSpinner=!0,JD.spinnerShow("Bluetooth",o,30,!0));break;case 3:JD.spinnerGetBusy()&&JD.spinnerSetInfo(ll("Reading IDs...")),blxInfoLine&&(blxInfoLine.textContent=ll("Reading IDs...")),blxConnectButtonText&&(blxConnectButtonText.textContent=`'${lastAdvertisingName}'`);break;case 4:blxSignal&&(blxSignal.hidden=!1),disabler(!1),cbSpinner&&(cbSpinner=!1,JD.spinnerClose())}break;case"UPLOAD":uplStatus={totalsize:a,mode:i,sumsize:0,filesize:0,filename:"",fproc:0,ndata:!0};break;case"GET":uplStatus.filesize=a,uplStatus.filename=i,uplStatus.ndata=!0,blxInfoLine&&(blxInfoLine.textContent=ll("File")+`:'${i}' ${a} Byte`);break;case"PROG":uplStatus.fproc=a,uplStatus.ndata=!0;let e,t;t=uplStatus.totalsize?(r=uplStatus.sumsize/uplStatus.totalsize*100,d=uplStatus.filesize/uplStatus.totalsize*uplStatus.fproc,`${e=(r+d).toFixed(0)}% of ${(uplStatus.totalsize/1024).toFixed(0)} kB`):(e=a)+"%",JD.spinnerGetBusy()&&(JD.spinnerSetProgress(e),JD.spinnerSetInfo(t)),blxInfoLine&&(blxInfoLine.textContent=e+"%");break;case"GET_OK":uplStatus.sumsize+=a,uplStatus.ndata=!0,blxInfoLine&&(blxInfoLine.textContent=`OK (${a} ${i} )`);break;case"RSSI":var r=.273*a+28;let n="limegreen";0<=r&&(r<4?n="gray":r<8&&(n="orange")),blxSignal&&(blxSignal.textContent=a+" dBm"),blxSignal&&(blxSignal.style.backgroundColor=n),l=void 0;break;case"VSENS":blxInfoLine&&(blxInfoLine.textContent="VSENS "+i+": "+a),l=void 0;break;case"INFO":blxInfoLine&&(blxInfoLine.textContent=i);break;case"MSG":blxInfoLine&&(blxInfoLine.textContent="MSG "+a+":"+i);break;case"WARN":blxCmdRes&&(blxCmdRes.textContent="WARNING "+a+":"+i);break;case"ERR":blxCmdRes&&(blxCmdRes.textContent="ERROR "+a+":"+i);break;case"BZY":var s=parseInt(i);if(blxInfoLine)switch(a){case 1:blxInfoLine.textContent=2...");break;case"MEAS_V":if("*"==i[0]&&(i=`(${ll("ALARM")}) `+i.substring(1)),90==a&&void 0!==blxDevice.sys_param&&void 0!==blxDevice.sys_param[16]){var r=parseFloat(blxDevice.sys_param[15]),d=parseFloat(blxDevice.sys_param[16]);if(r("+a+") "+i,blxMeasureData&&(blxMeasureData.innerHTML=measureData)}void 0!==l&&console.log("BLX: ",l,a,i)}async function getSetupOptions(){await blStore.get("#blxDash_#SETUP");var e=blStore.result(),e=(void 0!==e&&((setupOptions=e.v).dtheme&&JD.dashToggleTheme(),setupOptions.font&&JD.dashSetFont(setupOptions.font/100),setupOptions.lang)&&I18.i18localize(setupOptions.lang),await blStore.get("#blxDash_#badgeURL"),blStore.result());void 0!==e&&void 0!==e.v&&(blxDashBadgeURL=e.v,document.getElementById("blxBadge").style.display="block")}async function doSetupDialog(){var e=await blStore.quotaget(),e=`
+${ll("Measure")}...`;break;case"MEAS_T":0...");break;case"MEAS_V":if("*"==i[0]&&(i=`(${ll("ALARM")}) `+i.substring(1)),90==a&&void 0!==blxDevice.sys_param&&void 0!==blxDevice.sys_param[16]){var r=parseFloat(blxDevice.sys_param[15]),d=parseFloat(blxDevice.sys_param[16]);if(r("+a+") "+i,blxMeasureData&&(blxMeasureData.innerHTML=measureData)}void 0!==l&&console.log("BLX: ",l,a,i)}async function getSetupOptions(){await blStore.get("#blxDash_#SETUP");var e=blStore.result(),e=(void 0!==e&&((setupOptions=e.v).dtheme&&JD.dashToggleTheme(),setupOptions.font&&JD.dashSetFont(setupOptions.font/100),setupOptions.lang)&&I18.i18localize(setupOptions.lang),await blStore.get("#blxDash_#badgeURL"),blStore.result()),e=(void 0!==e&&void 0!==e.v&&(blxDashBadgeURL=e.v,document.getElementById("blxBadge").style.display="block"),await blStore.get("#blxDash_#AutoPINURL"),blStore.result());void 0!==e&&void 0!==e.v&&(blxAutoPINURL=e.v,document.getElementById("blxAutoPIN").style.display="block")}async function doSetupDialog(){var e=await blStore.quotaget(),e=`
${ll("Contact/Info")}: (C)JoEmbedded.de @@ -43,9 +43,9 @@ ${ll("Measure")}...`;break;case"MEAS_T":0
-
`;let n=JD.prepareCustomDialog("Dashboard Setup",e,null);n.querySelector("#jd-theme").checked=setupOptions.dtheme,n.querySelector("#jd-fontsize").value=setupOptions.font+"%";e=n.querySelector("#jd-lang");let t="";I18.i18_availLang.forEach(e=>{t+=``}),e.innerHTML=t,n.querySelector("#jd-lang").value=setupOptions.lang,n.querySelector("#jd-server").value=setupOptions.server,n.querySelector("#jd-accesstoken").value=setupOptions.accesstoken,e.addEventListener("change",e=>{var t=n.querySelector("#jd-lang").value;setupOptions.lang=t,I18.i18localize(t),JD.joSagmal(ll("Greeting"),t)}),n.querySelector("#jd-fontsize").addEventListener("change",e=>{var t=n.querySelector("#jd-fontsize").value;setupOptions.font=parseInt(t),JD.dashSetFont(setupOptions.font/100)}),n.querySelector("#jd-theme").addEventListener("click",e=>{JD.dashToggleTheme(),setupOptions.dtheme=!setupOptions.dtheme}),n.querySelector("#jd-servertest").addEventListener("click",e=>{isUrlGit?JD.doDialogOK(ll("ERROR"),`${ll("Can't Open Server on GITs")}
(Host: '${location.hostname}')`):window.open(n.querySelector("#jd-server").value+"?k="+n.querySelector("#jd-accesstoken").value)}),"OK"===await JD.doCustomDialog()&&(setupOptions.server=n.querySelector("#jd-server").value,setupOptions.accesstoken=n.querySelector("#jd-accesstoken").value),await blStore.set("#blxDash_#SETUP",setupOptions)}async function runServerSync(){if(blx.terminalPrint(ll("Server-Synchronize")+"..."),isUrlGit)JD.doDialogOK(ll("ERROR"),`${ll("Can't Open Server on GITs")}
(Host: '${location.hostname}')`);else{disabler(!0),JD.spinnerShow(ll("Server-Synchronize"),null,300,!1);try{var n=setupOptions.server,l=setupOptions.accesstoken;for(let t=0;t",null,`  `);e.querySelector("#removeDeviceBtn").addEventListener("click",async()=>{await JD.doDialogOK(ll("Remove Device?"),`${ll("Name")}: '${t.advname}'
MAC: ${t.mac}
`," "+ll("Remove"),!0)&&(await removeDevice(t.mac),JD.closeCustomDialog("REMOVED"))});let n=`${ll("Name")}: '${t.advname}'
MAC: ${t.mac}
`;n=n+("
PIN: "+(0
";var l=t.files.length;if(l){n+=``;for(let e=0;e':n+="","xtract.edt"==r.fname?(a=" Show Graph ",n+=``):n+=``,n=(n+=``)+`"}n+="
${ll("File")}Byte${ll("Age")}
${a}'${r.fname}'${r.aktlen} ${r.syncflag?"✔":"-"}`,void 0!==r.tssync?(a=(Date.now()-r.tssync)/1e3,a=(a=(a-=86400*(r=Math.floor(a/86400)))-3600*(i=Math.floor(a/3600)))-60*(o=Math.floor(a/60)),n+=`${r}d ${i}h ${o}min ${Math.floor(a)}sec`):n+="-",n+="
"}else n+=ll("No Files!");e.querySelector("#deviceDialog-content").innerHTML=n,await JD.doCustomDialog()}async function updateDeviceList(){deviceListDB=[];let i=0,o=0,r=0,n=(navDevicelist.innerHTML="",await blStore.iterate(function(l){var t=l.k.substr(0,16);if(16===t.length&&"_"===l.k.charAt(16)){let n;for(let e=0;e +
`;let n=JD.prepareCustomDialog("Dashboard Setup",e,null);n.querySelector("#jd-theme").checked=setupOptions.dtheme,n.querySelector("#jd-fontsize").value=setupOptions.font+"%";e=n.querySelector("#jd-lang");let t="";I18.i18_availLang.forEach(e=>{t+=``}),e.innerHTML=t,n.querySelector("#jd-lang").value=setupOptions.lang,n.querySelector("#jd-server").value=setupOptions.server,n.querySelector("#jd-accesstoken").value=setupOptions.accesstoken,e.addEventListener("change",e=>{var t=n.querySelector("#jd-lang").value;setupOptions.lang=t,I18.i18localize(t),JD.joSagmal(ll("Greeting"),t)}),n.querySelector("#jd-fontsize").addEventListener("change",e=>{var t=n.querySelector("#jd-fontsize").value;setupOptions.font=parseInt(t),JD.dashSetFont(setupOptions.font/100)}),n.querySelector("#jd-theme").addEventListener("click",e=>{JD.dashToggleTheme(),setupOptions.dtheme=!setupOptions.dtheme}),n.querySelector("#jd-servertest").addEventListener("click",e=>{isUrlGit?JD.doDialogOK(ll("ERROR"),`${ll("Can't Open Server on GITs")}
(Host: '${location.hostname}')`):window.open(n.querySelector("#jd-server").value+"?k="+n.querySelector("#jd-accesstoken").value,"_blank")}),"OK"===await JD.doCustomDialog()&&(setupOptions.server=n.querySelector("#jd-server").value,setupOptions.accesstoken=n.querySelector("#jd-accesstoken").value),await blStore.set("#blxDash_#SETUP",setupOptions)}async function runServerSync(){if(blx.terminalPrint(ll("Server-Synchronize")+"..."),isUrlGit)JD.doDialogOK(ll("ERROR"),`${ll("Can't Open Server on GITs")}
(Host: '${location.hostname}')`);else{disabler(!0),JD.spinnerShow(ll("Server-Synchronize"),null,300,!1);try{var n=setupOptions.server,l=setupOptions.accesstoken;for(let t=0;t",null,`  `);e.querySelector("#removeDeviceBtn").addEventListener("click",async()=>{await JD.doDialogOK(ll("Remove Device?"),`${ll("Name")}: '${t.advname}'
MAC: ${t.mac}
`," "+ll("Remove"),!0)&&(await removeDevice(t.mac),JD.closeCustomDialog("REMOVED"))});let n=`${ll("Name")}: '${t.advname}'
MAC: ${t.mac}
`;n=n+("
PIN: "+(0
";var l=t.files.length;if(l){n+=``;for(let e=0;e':n+="","xtract.edt"==r.fname?(a=" Show Graph ",n+=``):n+=``,n=(n+=``)+`"}n+="
${ll("File")}Byte${ll("Age")}
${a}'${r.fname}'${r.aktlen} ${r.syncflag?"✔":"-"}`,void 0!==r.tssync?(a=(Date.now()-r.tssync)/1e3,a=(a=(a-=86400*(r=Math.floor(a/86400)))-3600*(i=Math.floor(a/3600)))-60*(o=Math.floor(a/60)),n+=`${r}d ${i}h ${o}min ${Math.floor(a)}sec`):n+="-",n+="
"}else n+=ll("No Files!");e.querySelector("#deviceDialog-content").innerHTML=n,await JD.doCustomDialog()}async function updateDeviceList(){deviceListDB=[];let i=0,o=0,r=0,n=(navDevicelist.innerHTML="",await blStore.iterate(function(l){var t=l.k.substr(0,16);if(16===t.length&&"_"===l.k.charAt(16)){let n;for(let e=0;e '${l.advname}'`,l.synccnt?e+=`▴${l.synccnt}/${a.length}
`:e+=`${a.length}
`):e=`
'${l.advname}' -
`,n+=e}navDevicelist.innerHTML=n;for(let e=0;edeviceDialogDo(e));var e=sidebuttonServersync.querySelector("i").classList,t=sidebuttonServersync.querySelector(".jo-badge-span");r?(e.add("jo-icon-ani-shake"),t.classList.remove("jo-hidden"),t.innerHTML=`▴${r}/`+o):(e.remove("jo-icon-ani-shake"),t.classList.add("jo-hidden"))}async function removeDevice(t){if(16!=t.length)return!1;let n=[];if(await blStore.iterate(function(e){e.k.substr(0,16)===t&&"_"===e.k.charAt(16)&&n.push(e.k)}),!n.length)return!1;for(let e=0;ee.mac==n);if(void 0===a||0==a.pin){let e=!1,t;if(blx.chordsound(750,.2,.2),l[1].startsWith("OT:")?16==(a=l[1].substring(3)).length&&(t=ownertoken2pin(a),e=await addDevice(n,a,void 0)):l[1].startsWith("PIN:")&&6==(t=l[1].substring(4)).length&&(e=await addDevice(n,void 0,t)),!0===e&&n==searchmac)return blxPIN.value=t,await JD.dashSleepMs(500),blxSetPin(),0}else blx.frq_ping(750,.1,.3);return 1}}if(n.startsWith("TXT-")&&":"==n[6]){let e=n.substring(4,6),t=n.substring(7);return blx.terminalPrint(`Text(${e}): '${t}'`),blx.frq_ping(1500,.1,.3),setTimeout(()=>JD.sagmal(t,e.toLowerCase()),300),2}return blx.frq_ping(30,.1,.3),-1}async function bdRunQRscanner(e=""){searchmac=e,QRS.setQrLogPrint(blx.terminalPrint),QRS.setScanCallback(scanFoundAddDevice),QRS.clearScannedResults();e=await QRS.openSelectedCamera();"string"==typeof e?JD.doDialogOK(ll("ERROR"),ll("Reason")+`: '${e}'`,null):await QRS.scannerBusy()}function checkViewportEnablers(){JD.isFullInViewportHeight(sectionMain)?!1!==sectionMainEnabled&&(sectionMainEnabled=!1,sidebuttonMaincontent.classList.add("jo-disabled")):!0!==sectionMainEnabled&&(sectionMainEnabled=!0,sidebuttonMaincontent.classList.remove("jo-disabled")),JD.isFullInViewportHeight(sectionTerminal)?!1!==sectionTerminalEnabled&&(sectionTerminalEnabled=!1,sidebuttonTerminal.classList.add("jo-disabled")):!0!==sectionTerminalEnabled&&(sectionTerminalEnabled=!0,sidebuttonTerminal.classList.remove("jo-disabled"));var e=navigator.onLine;lastOnlineState!==e&&(bdOnline.hidden=!e,bdOffline.hidden=e,(lastOnlineState=e)?sidebuttonServersync.classList.remove("jo-disabled"):sidebuttonServersync.classList.add("jo-disabled"))}function blxtimer1sec(){checkViewportEnablers()}function blxPrintBadge(){var e="mac="+(blxDevice=void 0===blxDevice?blx.getDevice():blxDevice).deviceMAC+"&type="+blxDevice.deviceType+"&fw="+blxDevice.firmwareVersion+"&advname="+blxDevice.advertisingName;window.open(blxDashBadgeURL+"?"+encodeURI(e),"_blank")}if(window.jdDebug){document.addEventListener("wheel",e=>{var t=getComputedStyle(document.documentElement).getPropertyValue("--fontrel"),e=0{t++,JD.joSagmal("Lies dieses Lied Leise Elise","de")})}console.log("blxdash.js init, Version:",VERSION);export{VERSION,COPYRIGHT}; \ No newline at end of file + `,n+=e}navDevicelist.innerHTML=n;for(let e=0;edeviceDialogDo(e));var e=sidebuttonServersync.querySelector("i").classList,t=sidebuttonServersync.querySelector(".jo-badge-span");r?(e.add("jo-icon-ani-shake"),t.classList.remove("jo-hidden"),t.innerHTML=`▴${r}/`+o):(e.remove("jo-icon-ani-shake"),t.classList.add("jo-hidden"))}async function removeDevice(t){if(16!=t.length)return!1;let n=[];if(await blStore.iterate(function(e){e.k.substr(0,16)===t&&"_"===e.k.charAt(16)&&n.push(e.k)}),!n.length)return!1;for(let e=0;ee.mac==n);if(void 0===a||0==a.pin){let e=!1,t;if(blx.chordsound(750,.2,.2),l[1].startsWith("OT:")?16==(a=l[1].substring(3)).length&&(t=ownertoken2pin(a),e=await addDevice(n,a,void 0)):l[1].startsWith("PIN:")&&6==(t=l[1].substring(4)).length&&(e=await addDevice(n,void 0,t)),!0===e&&n==searchmac)return blxPIN.value=t,await JD.dashSleepMs(500),blxSetPin(),0}else blx.frq_ping(750,.1,.3);return 1}}if(n.startsWith("TXT-")&&":"==n[6]){let e=n.substring(4,6),t=n.substring(7);return blx.terminalPrint(`Text(${e}): '${t}'`),blx.frq_ping(1500,.1,.3),setTimeout(()=>JD.sagmal(t,e.toLowerCase()),300),2}return blx.frq_ping(30,.1,.3),-1}async function bdRunQRscanner(e=""){searchmac=e,QRS.setQrLogPrint(blx.terminalPrint),QRS.setScanCallback(scanFoundAddDevice),QRS.clearScannedResults();e=await QRS.openSelectedCamera();"string"==typeof e?JD.doDialogOK(ll("ERROR"),ll("Reason")+`: '${e}'`,null):await QRS.scannerBusy()}function checkViewportEnablers(){JD.isFullInViewportHeight(sectionMain)?!1!==sectionMainEnabled&&(sectionMainEnabled=!1,sidebuttonMaincontent.classList.add("jo-disabled")):!0!==sectionMainEnabled&&(sectionMainEnabled=!0,sidebuttonMaincontent.classList.remove("jo-disabled")),JD.isFullInViewportHeight(sectionTerminal)?!1!==sectionTerminalEnabled&&(sectionTerminalEnabled=!1,sidebuttonTerminal.classList.add("jo-disabled")):!0!==sectionTerminalEnabled&&(sectionTerminalEnabled=!0,sidebuttonTerminal.classList.remove("jo-disabled"));var e=navigator.onLine;lastOnlineState!==e&&(bdOnline.hidden=!e,bdOffline.hidden=e,(lastOnlineState=e)?sidebuttonServersync.classList.remove("jo-disabled"):sidebuttonServersync.classList.add("jo-disabled"))}function blxtimer1sec(){checkViewportEnablers()}function blxPrintBadge(){let e=blxDevice;var t;void 0!==(e=void 0===e?blx.getDevice():e).devicePIN?(t="mac="+e.deviceMAC+"&type="+e.deviceType+"&fw="+e.firmwareVersion+"&advname="+e.advertisingName+"&pin="+e.devicePIN,console.log(t),window.open(blxDashBadgeURL+"?"+encodeURI(t),"_blank")):(JD.joPingError(),JD.doDialogOK(ll("ERROR"),"No PIN"))}if(window.jdDebug){document.addEventListener("wheel",e=>{var t=getComputedStyle(document.documentElement).getPropertyValue("--fontrel"),e=0{t++,JD.joSagmal("Lies dieses Lied Leise Elise","de")})}console.log("blxdash.js init, Version:",VERSION);export{VERSION,COPYRIGHT}; \ No newline at end of file diff --git a/ble_api/sw.js b/ble_api/sw.js index 29a1946..a565c95 100644 --- a/ble_api/sw.js +++ b/ble_api/sw.js @@ -1,2 +1,2 @@ -if(!self.define){let e,s={};const i=(i,r)=>(i=new URL(i+".js",r).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(r,c)=>{const n=e||("document"in self?document.currentScript.src:"")||location.href;if(s[n])return;let o={};const d=e=>i(e,n),f={module:{uri:n},exports:o,require:d};s[n]=Promise.all(r.map((e=>f[e]||d(e)))).then((e=>(c(...e),o)))}}define(["./workbox-2e7151d3"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"css/jodash.css",revision:"7ba87d02cd05a16dee8e76919a2093b6"},{url:"css/qrscanner.css",revision:"d9afdd33d6a9398cd7289af26f8f7090"},{url:"index.html",revision:"6edf99bd6b69d6780a1288104d82a77e"},{url:"js/blStore.js",revision:"40ded8652b6dc76b7b88c4610263699d"},{url:"js/blx.js",revision:"fca0cdfc16eb435fd9f4dfedb10b6b65"},{url:"js/blxdash.js",revision:"31128c3440f347d90c4ea994e1323dbe"},{url:"js/FileSaver.js",revision:"25561894dca7cb2506d64df529987e62"},{url:"js/intmain_i18n.js",revision:"d26f527708fa74ea408267828c62fd28"},{url:"js/jodash.js",revision:"68b566290586017559ef72d90d879c7f"},{url:"js/qrscanner.js",revision:"a143743e6ece343d9c8b3f84cba81c2e"},{url:"manifest.webmanifest",revision:"570178ed3b2209baf62d2a4d02ad42a3"},{url:"static/favicon.ico",revision:"5b48c6125a55da335f09ed8fd555f277"},{url:"static/favicon.svg",revision:"f2cee656f163f4735a2b1a086846f621"},{url:"static/icons/bootstrap-icons.min.css",revision:"5605c44f8b24ea5de37a959955b71eb6"},{url:"static/icons/fonts/bootstrap-icons.woff",revision:"ba49e844892321d8540ea3b7c088cf97"},{url:"static/icons/fonts/bootstrap-icons.woff2",revision:"cc1e5eda776be5f0ff614285c31d4892"},{url:"static/preview1024x768.png",revision:"4606894e6fa5300618b660f2b63ee6d2"},{url:"static/preview512.png",revision:"bce3d7151098b5feddfcac9ba62d3f6a"}],{ignoreURLParametersMatching:[/^utm_/,/^fbclid$/]})})); +if(!self.define){let e,s={};const i=(i,r)=>(i=new URL(i+".js",r).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(r,c)=>{const f=e||("document"in self?document.currentScript.src:"")||location.href;if(s[f])return;let n={};const o=e=>i(e,f),a={module:{uri:f},exports:n,require:o};s[f]=Promise.all(r.map((e=>a[e]||o(e)))).then((e=>(c(...e),n)))}}define(["./workbox-2e7151d3"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"css/jodash.css",revision:"d8d7e185521733f9d24df526fd2f3241"},{url:"css/qrscanner.css",revision:"d9afdd33d6a9398cd7289af26f8f7090"},{url:"index.html",revision:"1814e28c904a0ba0cbf70f732fffe0a8"},{url:"js/blStore.js",revision:"40ded8652b6dc76b7b88c4610263699d"},{url:"js/blx.js",revision:"f44fde51c4896f743b2ad3307bd94b24"},{url:"js/blxdash.js",revision:"c01f3733a53396a9e4cf28af286e226c"},{url:"js/FileSaver.js",revision:"25561894dca7cb2506d64df529987e62"},{url:"js/intmain_i18n.js",revision:"d26f527708fa74ea408267828c62fd28"},{url:"js/jodash.js",revision:"68b566290586017559ef72d90d879c7f"},{url:"js/qrscanner.js",revision:"a143743e6ece343d9c8b3f84cba81c2e"},{url:"manifest.webmanifest",revision:"570178ed3b2209baf62d2a4d02ad42a3"},{url:"static/favicon.ico",revision:"5b48c6125a55da335f09ed8fd555f277"},{url:"static/favicon.svg",revision:"f2cee656f163f4735a2b1a086846f621"},{url:"static/icons/bootstrap-icons.min.css",revision:"5605c44f8b24ea5de37a959955b71eb6"},{url:"static/icons/fonts/bootstrap-icons.woff",revision:"ba49e844892321d8540ea3b7c088cf97"},{url:"static/icons/fonts/bootstrap-icons.woff2",revision:"cc1e5eda776be5f0ff614285c31d4892"},{url:"static/preview1024x768.png",revision:"4606894e6fa5300618b660f2b63ee6d2"},{url:"static/preview512.png",revision:"bce3d7151098b5feddfcac9ba62d3f6a"}],{ignoreURLParametersMatching:[/^utm_/,/^fbclid$/]})})); //# sourceMappingURL=sw.js.map diff --git a/ble_api/sw.js.map b/ble_api/sw.js.map index 751dd99..44bc3a6 100644 --- a/ble_api/sw.js.map +++ b/ble_api/sw.js.map @@ -1 +1 @@ -{"version":3,"file":"sw.js","sources":["../../../Users/jwick/AppData/Local/Temp/f7319b5677bd6369101665445f60c917/sw.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from 'C:/Users/jwick/AppData/Roaming/npm/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"css/jodash.css\",\n \"revision\": \"7ba87d02cd05a16dee8e76919a2093b6\"\n },\n {\n \"url\": \"css/qrscanner.css\",\n \"revision\": \"d9afdd33d6a9398cd7289af26f8f7090\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"6edf99bd6b69d6780a1288104d82a77e\"\n },\n {\n \"url\": \"js/blStore.js\",\n \"revision\": \"40ded8652b6dc76b7b88c4610263699d\"\n },\n {\n \"url\": \"js/blx.js\",\n \"revision\": \"fca0cdfc16eb435fd9f4dfedb10b6b65\"\n },\n {\n \"url\": \"js/blxdash.js\",\n \"revision\": \"31128c3440f347d90c4ea994e1323dbe\"\n },\n {\n \"url\": \"js/FileSaver.js\",\n \"revision\": \"25561894dca7cb2506d64df529987e62\"\n },\n {\n \"url\": \"js/intmain_i18n.js\",\n \"revision\": \"d26f527708fa74ea408267828c62fd28\"\n },\n {\n \"url\": \"js/jodash.js\",\n \"revision\": \"68b566290586017559ef72d90d879c7f\"\n },\n {\n \"url\": \"js/qrscanner.js\",\n \"revision\": \"a143743e6ece343d9c8b3f84cba81c2e\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"570178ed3b2209baf62d2a4d02ad42a3\"\n },\n {\n \"url\": \"static/favicon.ico\",\n \"revision\": \"5b48c6125a55da335f09ed8fd555f277\"\n },\n {\n \"url\": \"static/favicon.svg\",\n \"revision\": \"f2cee656f163f4735a2b1a086846f621\"\n },\n {\n \"url\": \"static/icons/bootstrap-icons.min.css\",\n \"revision\": \"5605c44f8b24ea5de37a959955b71eb6\"\n },\n {\n \"url\": \"static/icons/fonts/bootstrap-icons.woff\",\n \"revision\": \"ba49e844892321d8540ea3b7c088cf97\"\n },\n {\n \"url\": \"static/icons/fonts/bootstrap-icons.woff2\",\n \"revision\": \"cc1e5eda776be5f0ff614285c31d4892\"\n },\n {\n \"url\": \"static/preview1024x768.png\",\n \"revision\": \"4606894e6fa5300618b660f2b63ee6d2\"\n },\n {\n \"url\": \"static/preview512.png\",\n \"revision\": \"bce3d7151098b5feddfcac9ba62d3f6a\"\n }\n], {\n \"ignoreURLParametersMatching\": [/^utm_/, /^fbclid$/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,aACP,IAWFC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,eACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,qCAEb,CACDC,4BAA+B,CAAC,QAAS"} \ No newline at end of file +{"version":3,"file":"sw.js","sources":["../../../Users/jwick/AppData/Local/Temp/63801fef5af0d4375df99baefa149342/sw.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from 'C:/Users/jwick/AppData/Roaming/npm/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"css/jodash.css\",\n \"revision\": \"d8d7e185521733f9d24df526fd2f3241\"\n },\n {\n \"url\": \"css/qrscanner.css\",\n \"revision\": \"d9afdd33d6a9398cd7289af26f8f7090\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"1814e28c904a0ba0cbf70f732fffe0a8\"\n },\n {\n \"url\": \"js/blStore.js\",\n \"revision\": \"40ded8652b6dc76b7b88c4610263699d\"\n },\n {\n \"url\": \"js/blx.js\",\n \"revision\": \"f44fde51c4896f743b2ad3307bd94b24\"\n },\n {\n \"url\": \"js/blxdash.js\",\n \"revision\": \"c01f3733a53396a9e4cf28af286e226c\"\n },\n {\n \"url\": \"js/FileSaver.js\",\n \"revision\": \"25561894dca7cb2506d64df529987e62\"\n },\n {\n \"url\": \"js/intmain_i18n.js\",\n \"revision\": \"d26f527708fa74ea408267828c62fd28\"\n },\n {\n \"url\": \"js/jodash.js\",\n \"revision\": \"68b566290586017559ef72d90d879c7f\"\n },\n {\n \"url\": \"js/qrscanner.js\",\n \"revision\": \"a143743e6ece343d9c8b3f84cba81c2e\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"570178ed3b2209baf62d2a4d02ad42a3\"\n },\n {\n \"url\": \"static/favicon.ico\",\n \"revision\": \"5b48c6125a55da335f09ed8fd555f277\"\n },\n {\n \"url\": \"static/favicon.svg\",\n \"revision\": \"f2cee656f163f4735a2b1a086846f621\"\n },\n {\n \"url\": \"static/icons/bootstrap-icons.min.css\",\n \"revision\": \"5605c44f8b24ea5de37a959955b71eb6\"\n },\n {\n \"url\": \"static/icons/fonts/bootstrap-icons.woff\",\n \"revision\": \"ba49e844892321d8540ea3b7c088cf97\"\n },\n {\n \"url\": \"static/icons/fonts/bootstrap-icons.woff2\",\n \"revision\": \"cc1e5eda776be5f0ff614285c31d4892\"\n },\n {\n \"url\": \"static/preview1024x768.png\",\n \"revision\": \"4606894e6fa5300618b660f2b63ee6d2\"\n },\n {\n \"url\": \"static/preview512.png\",\n \"revision\": \"bce3d7151098b5feddfcac9ba62d3f6a\"\n }\n], {\n \"ignoreURLParametersMatching\": [/^utm_/, /^fbclid$/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,aACP,IAWFC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,eACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,qCAEb,CACDC,4BAA+B,CAAC,QAAS"} \ No newline at end of file