75e1a957cf988268d269d84e5752343f5eb6f0bb0a6840c3be24dc27e9f0b3d43dbfa54b05bcca3dac07d636b5b6650d36c3bc3b930a6b157d44db3d0669 24,7 ko
Newer Older
KOUTO Dosseh's avatar
KOUTO Dosseh a validé
{"map":"{\"version\":3,\"sources\":[\"/home/dosseh/tpe/src/Utils/lib/adcdacpi/adcdacpi.js\",\"/home/dosseh/tpe/src/Model_Chargement.js\",\"/home/dosseh/tpe/src/Informations_Chargement.js\",\"/home/dosseh/tpe/src/Traitements/Recuperation_chargement.js\",\"/home/dosseh/tpe/src/App.js\",\"/home/dosseh/tpe/src/serviceWorker.js\",\"/home/dosseh/tpe/src/index.js\"],\"names\":[\"Buffer\",\"rpio\",\"require\",\"ADCDAC\",\"adcRefVoltage\",\"maxDacVoltage\",\"dacGain\",\"adctx\",\"adcrx\",\"dactx\",\"dacrx\",\"spiBegin\",\"spiSetCSPolarity\",\"LOW\",\"spiSetDataMode\",\"prototype\",\"readADCRaw\",\"channel\",\"mode\",\"Error\",\"spiChipSelect\",\"spiSetClockDivider\",\"spiTransfer\",\"readADCVoltage\",\"raw\",\"this\",\"setADCRefVoltage\",\"voltage\",\"setDACVoltage\",\"rawval\",\"setDACRaw\",\"value\",\"setDACGain\",\"gain\",\"closeSPI\",\"adc\",\"close\",\"dac\",\"Model_Chargement\",\"percentage\",\"Object\",\"classCallCheck\",\"_percentage\",\"createClass\",\"key\",\"Date\",\"toLocaleString\",\"get\",\"set\",\"Information_Chargement\",\"voltReader\",\"etat\",\"date\",\"getDate\",\"console\",\"log\",\"sendData\",\"react_default\",\"a\",\"createElement\",\"Component\",\"App\",\"className\",\"styles\",\"color\",\"size\",\"contenteditable\",\"Informations_Chargement\",\"Boolean\",\"window\",\"location\",\"hostname\",\"match\",\"ReactDOM\",\"render\",\"src_App_0\",\"document\",\"getElementById\",\"navigator\",\"serviceWorker\",\"ready\",\"then\",\"registration\",\"unregister\"],\"mappings\":\"0FACA,SAAAA,GAgBA,IAAIC,EAAOC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,MACIF,EAAAC,EAAAC,cAAA,SAAA,CAASO,iBAAe,IAExBT,EAAAC,EAAAC,cAAA,KAAA,MACAF,EAAAC,EAAAC,cAAA,KAAA,MAEAF,EAAAC,EAAAC,cAACQ,EAAD,OAMRV,EAAAC,EAAAC,cAAA,SAAA,KAAA,uBAEEF,EAAAC,EAAAC,cAAA,KAAA,MACAF,EAAAC,EAAAC,cAAA,QAAA,KAAA,iCA7BIC,EAAAA,WCQEQ,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCZNC,EAAAA,EAASC,OAAOjB,EAAAC,EAAAC,cAACgB,EAAD,MAASC,SAASC,eAAe,SDuH3C,kBAAmBC,WACrBA,UAAUC,cAAcC,MAAMC,KAAK,SAAAC,GACjCA,EAAaC\",\"sourcesContent\":[\"\\n/** \\n* ABElectronics ADC-DAC Pi Zero Analogue to Digital / Digital to Analogue Converter\\n* https://www.abelectronics.co.uk/p/74/ADC-DAC-Pi-Zero-Raspberry-Pi-ADC-and-DAC-expansion-board\\n* \\n* \\n* Version 1.0 Created 06/07/2016\\n* Version 1.1 Updated 19/06/2017 - changed library to use rpio and optimised code for speed.\\n* ================================================\\n* \\n* Based on the Microchip MCP3202 and MCP4822\\n* \\n* Requires rpio to be installed, install with: npm install rpio\\n* \\n* ================================================\\n*/\\n\\nvar rpio = require('rpio');\\n\\n\\n var ADCDAC = (function () {\\n\\n    // variables\\n    var adc;\\n    var dac;\\n    var adcRefVoltage = 3.3; //reference voltage for the ADC chip.\\n    var maxDacVoltage = 2.048; // maximum voltage for the DAC output\\n    var dacGain = 1;\\n    var adctx = new Buffer([0x01, 0xC0, 0x00]);\\n    var adcrx = new Buffer([0, 0, 0]);\\n    var dactx = new Buffer([0x00, 0x00]);\\n    var dacrx = new Buffer(2);\\n    var out;\\n    \\n    /**\\n     * Create ADCDAC object and connect to the SPI bus\\n     */\\n    function ADCDAC() {\\n        rpio.spiBegin();\\n        rpio.spiSetCSPolarity(0, rpio.LOW);\\n        rpio.spiSetDataMode(0);\\n    }\\n\\n    \\n    /**\\n     * Returns the raw value from the selected ADC channel\\n     * When in differential mode setting channel to 1 will make IN1 = IN+ and IN2 = IN-\\n     * When in differential mode setting channel to 2 will make IN1 = IN- and IN2 = IN+\\n     * @param  {number} channel - 1 or 2\\n     * @param  {number} mode - Mode: 0 = Single Ended or 1 = Differential\\n     * @returns  {number} - Value between 0 and 4096\\n     */\\n    ADCDAC.prototype.readADCRaw = function (channel, mode) {\\n        if (channel === 1) {\\n            if (mode === 0) {\\n                adctx[1] = 0x80;\\n            } else if (mode === 1) {\\n                adctx[1] = 0x00;\\n            } else {\\n                throw new Error(\\\"Channel 1 Mode Argument Out Of Range\\\");\\n            }\\n        } else if (channel === 2) {\\n            if (mode === 0) {\\n                adctx[1] = 0xC0;\\n            } else if (mode === 1) {\\n                adctx[1] = 0x40;\\n            } else {\\n                throw new Error(\\\"Channel 2 Mode Argument Out Of Range\\\");\\n            }\\n        } else {\\n            throw new Error(\\\"Channel Argument Out Of Range\\\");\\n        }\\n\\n        rpio.spiChipSelect(0); /* Use CE0 */\\n        rpio.spiSetClockDivider(140);\\n        rpio.spiTransfer(adctx, adcrx, 3);\\n        out = ((adcrx[1] & 0x0F) << 8) + adcrx[2];\\n\\n        return out;\\n    };\\n\\n    /**\\n     * Returns the voltage from the selected ADC channel\\n     * When in differential mode setting channel to 1 will make IN1 = IN+ and IN2 = IN-\\n     * When in differential mode setting channel to 2 will make IN1 = IN- and IN2 = IN+\\n     * @param  {number} channel - 1 or 2\\n     * @param  {number} mode - Mode: 0 = Single Ended or 1 = Differential\\n     * @returns  {number} - Voltage between 0 and vref\\n     */\\n    ADCDAC.prototype.readADCVoltage = function (channel, mode) {\\n        var raw = this.readADCRaw(channel, mode);\\n\\n        var voltage = adcRefVoltage / 4096 * raw;\\n        return voltage;\\n    };\\n\\n    /**\\n     * Sets the reference voltage for the ADC\\n     * @param  {number} voltage - This should be the voltage as measured on the Raspberry Pi 3.3V power rail.\\n     */\\n    ADCDAC.prototype.setADCRefVoltage = function (voltage) {\\n        adcRefVoltage = voltage;\\n    };\\n\\n    /**\\n     * Set the DAC voltage.\\n     * @param  {number} channel - 1 or 2\\n     * @param  {number} voltage - voltage can be between 0 and 2.047 volts when gain is 1 or 0 and 3.3V when gain is 2\\n     */\\n    ADCDAC.prototype.setDACVoltage = function (channel, voltage) {\\n        if (channel < 1 || channel > 2) {\\n            throw new Error(\\\"Channel Out Of Range\\\");\\n        }\\n\\n        if (voltage < 0 || voltage > maxDacVoltage) {\\n            throw new Error(\\\"Voltage Out Of Range\\\");\\n        }\\n\\n        var rawval = voltage / 2.048 * 4096 / dacGain; // convert the voltage into a raw value\\n        this.setDACRaw(channel, rawval); // set the raw value\\n\\n    };\\n\\n    /**\\n     * Set the raw value for the selected dac channel\\n     * @param  {number} channel - 1 to 2\\n     * @param  {number} value - 0 to 4095\\n     */\\n    ADCDAC.prototype.setDACRaw = function (channel, value) {\\n        if (channel < 1 || channel > 2) {\\n            throw new Error(\\\"Channel Out Of Range\\\");\\n        }\\n\\n        if (value < 0 || value > 4095) {\\n            throw new Error(\\\"Value Out Of Range\\\");\\n        }\\n\\n        dactx[1] = value & 0xff;\\n        dactx[0] = value >> 8 & 0xff | channel - 1 << 7 | 0x1 << 5 | 1 << 4;\\n\\n        if (dacGain === 2) {\\n            dactx[0] = dactx[0] &= ~(1 << 5);\\n        }\\n\\n        rpio.spiChipSelect(1); /* Use CE1 */\\n        rpio.spiSetClockDivider(14);\\n        rpio.spiTransfer(dactx, dacrx, 2);\\n    };\\n\\n    /**\\n     * Set the gain for the DAC.  This is used to set the output based on the reference voltage of 2.048V.\\n     * When the gain is set to 2 the maximum voltage will be approximately 3.3V.\\n     * @param  {number} gain - 1 or 2\\n     */\\n    ADCDAC.prototype.setDACGain = function (gain) {\\n        if (gain < 1 || gain > 2) {\\n            throw new Error(\\\"Gain Out Of Range\\\");\\n        }\\n\\n        if (gain === 1) {\\n            dacGain = 1;\\n            maxDacVoltage = 2.048;\\n        }\\n        if (gain === 2) {\\n            dacGain = 2;\\n            maxDacVoltage = 3.3;\\n        }\\n    };\\n\\n    /**\\n     * Close the SPI bus\\n     */\\n    ADCDAC.prototype.closeSPI = function () {\\n        adc.close();\\n        dac.close();\\n    };\\n\\n\\n    return ADCDAC;\\n\\n})();\\n\\nexport default ADCDAC;\",\"export const version = () => \\\"1.0.0\\\";\\n\\nexport class Model_Chargement {\\n  constructor(percentage) {\\n    this._percentage = percentage;\\n  }\\n\\n  get value() {\\n    return this._percentage || [];\\n  }\\n\\n  set value(percentage) {\\n    this._percentage = percentage;\\n  }\\n\\n  getDate() {\\n    return new Date().toLocaleString();\\n  }\\n}\\n\\n \",\"import React, { Component } from \\\"react\\\";\\nimport {Model_Chargement} from \\\"./Model_Chargement\\\";\\nimport \\\"./App.css\\\";\\nimport {sendData} from \\\"./Traitements/Recuperation_chargement\\\";\\n\\nclass Information_Chargement extends Component {\\n  render() {\\n    let percentage, voltReader, etat, date;\\n     \\n    let model_Chargement = new Model_Chargement();\\n\\n    date = model_Chargement.getDate();\\n    voltReader = sendData();\\n    percentage = (voltReader/1023)*100;\\n    \\n    if (percentage == 100)\\n   {\\n    etat = \\\"Batterie pleine\\\"\\n   }\\n   else if (percentage < 10)\\n   {\\n    etat = \\\"Batterie faible !\\\"\\n   }\\n   else{\\n     etat = \\\" \\\";\\n   }\\n\\n\\n    return (\\n      <div>\\n  \\n        <br />\\n        <br />\\n        <b>\\n          VOLTAGE : {voltReader} {\\\" V\\\"}\\n        </b>\\n        <br />\\n        <br />\\n        <br />\\n\\n        <b>\\n          POURCENTAGE : {percentage} {\\\" %\\\"}\\n        </b>\\n        <br />\\n        <br />\\n        <br />\\n        \\n        <b> DATE : {date}</b>\\n        <br />\\n        <br />\\n        <br />\\n        <b> {etat}</b>\\n        <br />\\n        <br />\\n        <br />\\n        <br />\\n        <br />\\n        <br />\\n       \\n      </div>\\n    );\\n  }\\n}\\n\\nexport default Information_Chargement;\\n\\n/* ------------------- VERSION ARDUINO AVEC ECRAN LCD -----------------------\\nvoid loop() \\n{ \\n   int voltReading = analogRead(battPin);\\n   int volts = (voltReading/1023)*100;\\n   if (volts == 100)\\n   {\\n   lcd.setCursor(12,0);\\n   lcd.print(volts);\\n   lcd.print(\\\"%\\\");\\n   delay(1000);\\n   lcd.clear();\\n   }\\n   else if (volts < 10)\\n   {\\n   lcd.setCursor(14,0);\\n   lcd.print(volts);\\n   lcd.print(\\\"%\\\");\\n   delay(1000);\\n   lcd.clear();\\n   }\\n   else\\n   {\\n   lcd.setCursor(13,0);\\n   lcd.print(volts);\\n   lcd.print(\\\"%\\\");\\n   delay(1000);\\n   lcd.clear();\\n   }\\n}\\n */\\n\",\"\\n  // var ADCDAC = require('../Utils/lib/adcdacpi/adcdacpi');\\nimport ADCDAC from '../Utils/lib/adcdacpi/adcdacpi'\\n  export const sendData = () => {\\n\\n    // create an instance of the adRaw anglaiscdac class\\n    \\n    let adc = new ADCDAC();\\n    \\n    // set the reference voltage\\n    \\n    adc.setADCRefVoltage(3.3);\\n    \\n    // read the raw value and voltage from channels 1 and 2 and print them on the console.\\n\\n\\n        console.log('Reading 1 Voltage: ' + adc.readADCVoltage(1, 0));\\n        console.log('Reading 1 Raw: ' + adc.readADCRaw(1, 0));\\n        \\n\\n    return adc.readADCVoltage(1, 0);\\n\\n  }\\n\\n  export const voltage = ()=> {\\n    return 1\\n }\\n\",\"import React, { Component } from 'react';\\nimport styles from \\\"./App.css\\\"\\nimport Informations_Chargement from \\\"./Informations_Chargement.js\\\"\\n\\nclass App extends Component {\\n  render() {\\n\\n    return (\\n        <div className={styles.App}>\\n          <article>\\n            <header>\\n            < font color=\\\"#C8D9E4\\\" size =\\\"4\\\">INFORMATIONS DU CHARGEMENT DE LA BATTERIE </font>\\n\\n            </header>\\n                        \\n                <br />\\n              <main>\\n\\n                <br />\\n                    <strong  contenteditable>\\n                    </strong>\\n                    <br />\\n                    <br />\\n\\n                    <Informations_Chargement/>\\n\\n               \\n              </main>\\n\\n\\n            <footer>\\n              All rights reserved.\\n              <br />\\n              <small>@ Dosseh KOUTO 2019</small>\\n            </footer>\\n\\n          </article>\\n        </div>\\n    );\\n  }\\n}\\n\\nexport default App;\\n\",\"// This optional code is used to register a service worker.\\n// register() is not called by default.\\n\\n// This lets the app load faster on subsequent visits in production, and gives\\n// it offline capabilities. However, it also means that developers (and users)\\n// will only see deployed updates on subsequent visits to a page, after all the\\n// existing tabs open on the page have been closed, since previously cached\\n// resources are updated in the background.\\n\\n// To learn more about the benefits of this model and instructions on how to\\n// opt-in, read http://bit.ly/CRA-PWA.\\n\\nconst isLocalhost = Boolean(\\n  window.location.hostname === 'localhost' ||\\n    // [::1] is the IPv6 localhost address.\\n    window.location.hostname === '[::1]' ||\\n    // 127.0.0.1/8 is considered localhost for IPv4.\\n    window.location.hostname.match(\\n      /^127(?:\\\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\\n    )\\n);\\n\\nexport function register(config) {\\n  if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\\n    // The URL constructor is available in all browsers that support SW.\\n    const publicUrl = new URL(process.env.PUBLIC_URL, window.location);\\n    if (publicUrl.origin !== window.location.origin) {\\n      // Our service worker won't work if PUBLIC_URL is on a different origin\\n      // from what our page is served on. This might happen if a CDN is used to\\n      // serve assets; see https://github.com/facebook/create-react-app/issues/2374\\n      return;\\n    }\\n\\n    window.addEventListener('load', () => {\\n      const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\\n\\n      if (isLocalhost) {\\n        // This is running on localhost. Let's check if a service worker still exists or not.\\n        checkValidServiceWorker(swUrl, config);\\n\\n        // Add some additional logging to localhost, pointing developers to the\\n        // service worker/PWA documentation.\\n        navigator.serviceWorker.ready.then(() => {\\n          console.log(\\n            'This web app is being served cache-first by a service ' +\\n              'worker. To learn more, visit http://bit.ly/CRA-PWA'\\n          );\\n        });\\n      } else {\\n        // Is not localhost. Just register service worker\\n        registerValidSW(swUrl, config);\\n      }\\n    });\\n  }\\n}\\n\\nfunction registerValidSW(swUrl, config) {\\n  navigator.serviceWorker\\n    .register(swUrl)\\n    .then(registration => {\\n      registration.onupdatefound = () => {\\n        const installingWorker = registration.installing;\\n        installingWorker.onstatechange = () => {\\n          if (installingWorker.state === 'installed') {\\n            if (navigator.serviceWorker.controller) {\\n              // At this point, the updated precached content has been fetched,\\n              // but the previous service worker will still serve the older\\n              // content until all client tabs are closed.\\n              console.log(\\n                'New content is available and will be used when all ' +\\n                  'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\\n              );\\n\\n              // Execute callback\\n              if (config && config.onUpdate) {\\n                config.onUpdate(registration);\\n              }\\n            } else {\\n              // At this point, everything has been precached.\\n              // It's the perfect time to display a\\n              // \\\"Content is cached for offline use.\\\" message.\\n              console.log('Content is cached for offline use.');\\n\\n              // Execute callback\\n              if (config && config.onSuccess) {\\n                config.onSuccess(registration);\\n              }\\n            }\\n          }\\n        };\\n      };\\n    })\\n    .catch(error => {\\n      console.error('Error during service worker registration:', error);\\n    });\\n}\\n\\nfunction checkValidServiceWorker(swUrl, config) {\\n  // Check if the service worker can be found. If it can't reload the page.\\n  fetch(swUrl)\\n    .then(response => {\\n      // Ensure service worker exists, and that we really are getting a JS file.\\n      if (\\n        response.status === 404 ||\\n        response.headers.get('content-type').indexOf('javascript') === -1\\n      ) {\\n        // No service worker found. Probably a different app. Reload the page.\\n        navigator.serviceWorker.ready.then(registration => {\\n          registration.unregister().then(() => {\\n            window.location.reload();\\n          });\\n        });\\n      } else {\\n        // Service worker found. Proceed as normal.\\n        registerValidSW(swUrl, config);\\n      }\\n    })\\n    .catch(() => {\\n      console.log(\\n        'No internet connection found. App is running in offline mode.'\\n      );\\n    });\\n}\\n\\nexport function unregister() {\\n  if ('serviceWorker' in navigator) {\\n    navigator.serviceWorker.ready.then(registration => {\\n      registration.unregister();\\n    });\\n  }\\n}\\n\",\"import React from 'react';\\nimport ReactDOM from 'react-dom';\\nimport './index.css';\\nimport App from './App';\\nimport * as serviceWorker from './serviceWorker';\\n\\nReactDOM.render(<App />, document.getElementById('root'));\\n\\n// If you want your app to work offline and load faster, you can change\\n// unregister() to register() below. Note this comes with some pitfalls.\\n// Learn more about service workers: http://bit.ly/CRA-PWA\\nserviceWorker.unregister();\\n \"]}","code":"(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{12:function(e,t,n){\"use strict\";(function(e){var r=n(9),a=function(){var t=3.3,n=2.048,a=1,l=new e([1,192,0]),o=new e([0,0,0]),c=new e([0,0]),i=new e(2);function u(){r.spiBegin(),r.spiSetCSPolarity(0,r.LOW),r.spiSetDataMode(0)}return u.prototype.readADCRaw=function(e,t){if(1===e)if(0===t)l[1]=128;else{if(1!==t)throw new Error(\"Channel 1 Mode Argument Out Of Range\");l[1]=0}else{if(2!==e)throw new Error(\"Channel Argument Out Of Range\");if(0===t)l[1]=192;else{if(1!==t)throw new Error(\"Channel 2 Mode Argument Out Of Range\");l[1]=64}}return r.spiChipSelect(0),r.spiSetClockDivider(140),r.spiTransfer(l,o,3),((15&o[1])<<8)+o[2]},u.prototype.readADCVoltage=function(e,n){var r=this.readADCRaw(e,n);return t/4096*r},u.prototype.setADCRefVoltage=function(e){t=e},u.prototype.setDACVoltage=function(e,t){if(e<1||e>2)throw new Error(\"Channel Out Of Range\");if(t<0||t>n)throw new Error(\"Voltage Out Of Range\");var r=t/2.048*4096/a;this.setDACRaw(e,r)},u.prototype.setDACRaw=function(e,t){if(e<1||e>2)throw new Error(\"Channel Out Of Range\");if(t<0||t>4095)throw new Error(\"Value Out Of Range\");c[1]=255&t,c[0]=48|(t>>8&255|e-1<<7),2===a&&(c[0]=c[0]&=-33),r.spiChipSelect(1),r.spiSetClockDivider(14),r.spiTransfer(c,i,2)},u.prototype.setDACGain=function(e){if(e<1||e>2)throw new Error(\"Gain Out Of Range\");1===e&&(a=1,n=2.048),2===e&&(a=2,n=3.3)},u.prototype.closeSPI=function(){(void 0).close(),(void 0).close()},u}();t.a=a}).call(this,n(19).Buffer)},13:function(e,t,n){e.exports=n(28)},18:function(e,t,n){},28:function(e,t,n){\"use strict\";n.r(t);var r=n(0),a=n.n(r),l=n(11),o=n.n(l),c=(n(18),n(1)),i=n(2),u=n(4),s=n(3),f=n(5),E=n(6),m=n.n(E),p=function(){function e(t){Object(c.a)(this,e),this._percentage=t}return Object(i.a)(e,[{key:\"getDate\",value:function(){return(new Date).toLocaleString()}},{key:\"value\",get:function(){return this._percentage||[]},set:function(e){this._percentage=e}}]),e}(),b=n(12),w=function(e){function t(){return Object(c.a)(this,t),Object(u.a)(this,Object(s.a)(t).apply(this,arguments))}return Object(f.a)(t,e),Object(i.a)(t,[{key:\"render\",value:function(){var e,t,n,r;return r=(new p).getDate(),n=100==(e=(t=function(){var e=new b.a;return e.setADCRefVoltage(3.3),console.log(\"Reading 1 Voltage: \"+e.readADCVoltage(1,0)),console.log(\"Reading 1 Raw: \"+e.readADCRaw(1,0)),e.readADCVoltage(1,0)}())/1023*100)?\"Batterie pleine\":e<10?\"Batterie faible !\":\" \",a.a.createElement(\"div\",null,a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"b\",null,\"VOLTAGE : \",t,\" \",\" V\"),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"b\",null,\"POURCENTAGE : \",e,\" \",\" %\"),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"b\",null,\" DATE : \",r),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"b\",null,\" \",n),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null))}}]),t}(r.Component),h=function(e){function t(){return Object(c.a)(this,t),Object(u.a)(this,Object(s.a)(t).apply(this,arguments))}return Object(f.a)(t,e),Object(i.a)(t,[{key:\"render\",value:function(){return a.a.createElement(\"div\",{className:m.a.App},a.a.createElement(\"article\",null,a.a.createElement(\"header\",null,a.a.createElement(\"font\",{color:\"#C8D9E4\",size:\"4\"},\"INFORMATIONS DU CHARGEMENT DE LA BATTERIE \")),a.a.createElement(\"br\",null),a.a.createElement(\"main\",null,a.a.createElement(\"br\",null),a.a.createElement(\"strong\",{contenteditable:!0}),a.a.createElement(\"br\",null),a.a.createElement(\"br\",null),a.a.createElement(w,null)),a.a.createElement(\"footer\",null,\"All rights reserved.\",a.a.createElement(\"br\",null),a.a.createElement(\"small\",null,\"@ Dosseh KOUTO 2019\"))))}}]),t}(r.Component);Boolean(\"localhost\"===window.location.hostname||\"[::1]\"===window.location.hostname||window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/));o.a.render(a.a.createElement(h,null),document.getElementById(\"root\")),\"serviceWorker\"in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()})},6:function(e,t,n){}},[[13,1,2]]]);","extractedComments":[]}