| 1 |
- var trio_glucoseGetLast;(()=>{var e={5941:e=>{function t(e,t){t||(t=0);var r=Math.pow(10,t);return Math.round(Math.round(e*r*1e7)/1e7)/r}function r(e){return e.date||Date.parse(e.display_time)||Date.parse(e.dateString)}e.exports=function(e){for(var o=(e=e.filter((function(e){return e.glucose||e.sgv})).map((function(e){if(e.glucose=e.glucose||e.sgv,null!==e.glucose)return e})))[0],n=r(o),u=[],a=[],l=[],c=0,s=1;s<e.length;s++){if(void 0!==e[s]&&"cal"===e[s].type){c=s;break}if(void 0!==e[s]&&e[s].glucose>38&&e[s].device===o.device){var i,g=e[s],d=r(g),v=0;void 0!==d&&void 0!==n?(i=t((n-d)/6e4,0),v=(o.glucose-g.glucose)/i*5):console.error("Error: date field not found: cannot calculate avgdelta"),-2<i&&i<=2.5?(o.glucose=(o.glucose+g.glucose)/2,n=(n+d)/2):2.5<i&&i<=17.5?(a.push(v),2.5<i&&i<7.5&&u.push(v)):17.5<i&&i<42.5&&l.push(v)}}var f=0,h=0,p=0;return u.length>0&&(f=u.reduce((function(e,t){return e+t}))/u.length),a.length>0&&(h=a.reduce((function(e,t){return e+t}))/a.length),l.length>0&&(p=l.reduce((function(e,t){return e+t}))/l.length),{delta:t(f,2),glucose:t(o.glucose,2),noise:t(o.noise,2),short_avgdelta:t(h,2),long_avgdelta:t(p,2),date:n,last_cal:c,device:o.device}}}},t={},r=function r(o){var n=t[o];if(void 0!==n)return n.exports;var u=t[o]={exports:{}};return e[o](u,u.exports,r),u.exports}(5941);trio_glucoseGetLast=r})();
|