{"version":3,"sources":["components/nav.js","components/dashboard.js","components/badge-creator.js","components/app.js","index.js"],"names":["Nav","_Component","_this","_classCallCheck","this","_possibleConstructorReturn","_getPrototypeOf","call","state","version","require","_inherits","_createClass","key","value","React","createElement","className","href","Component","Dashboard","match","window","location","search","badges","error","mail","fetch","concat","method","then","response","json","data","message","setState","length","map","badge","src","_id","class","alt","name","description","BadgeCreator","icons","templates","image","success","criteria","username","fullname","icon","iconColor","fill","stroke","displayExtra","extraAlpha","displayBanner","bannerFill","bannerStroke","bannerText","timer","handleSubmitBadgeCreator","bind","_assertThisInitialized","handleSubmitBadge","handleChange","handleInputChange","handleTemplateChanged","categoryName","_step","_iterator","_createForOfIteratorHelper","s","n","done","push","text","err","e","f","toBase64","template","replace","event","_this2","clearTimeout","target","type","checked","setTimeout","_defineProperty","_this3","info","preventDefault","_this4","inputs","elements","formData","FormData","append","body","btoa","JSON","stringify","parseFloat","for","onChange","selected","onSubmit","id","required","min","max","step","recipient","rows","cols","htmlFor","App","isCreatingBadge","handleSubmit","handleClick","email","role","onClick","placeholder","ReactDOM","render","document","getElementById"],"mappings":"qiCAsBeA,EApBN,SAAAC,GACL,SAAAD,IAAc,IAAAE,EAKR,OALQC,YAAAC,KAAAJ,IACVE,EAAAG,YAAAD,KAAAE,YAAAN,GAAAO,KAAAH,QAEKI,MAAQ,CACTC,QAASC,EAAQ,IAAwBD,SAC3CP,EAWL,OAjBIS,YAAAX,EAAAC,GAOJW,YAAAZ,EAAA,EAAAa,IAAA,SAAAC,MAAA,WAGG,OACIC,IAAAC,cAAA,OAAKC,UAAU,8BACXF,IAAAC,cAAA,KAAGC,UAAU,eAAeC,KAAK,KAAI,8BACTH,IAAAC,cAAA,aAAO,IAAGZ,KAAKI,MAAMC,eAI5DT,EAjBI,CAASmB,aC8DHC,EA9DA,SAAAnB,GACX,SAAAmB,IAAc,IAAAlB,EAAAC,YAAAC,KAAAgB,GACVlB,EAAAG,YAAAD,KAAAE,YAAAc,GAAAb,KAAAH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uB,UAAQ,KAG/FnG,IAAAC,cAAA,UAAQ2E,KAAK,SAAS1E,UAAU,mBAAkB,eAMjEb,KAAKI,MAAMmH,iBACZ5G,IAAAC,cAAA,OAAKC,UAAU,UACXF,IAAAC,cAAA,UAAQC,UAAU,0BAA0B+G,QAAS5H,KAAKyH,aAAa,aAIzEzH,KAAKI,MAAMmH,iBACb5G,IAAAC,cAACI,EAAS,MAGThB,KAAKI,MAAMmH,iBACZ5G,IAAAC,cAAC8B,EAAY,YAK5B4E,EA7EI,CAASvG,aCDlB+G,IAASC,OAAOpH,IAAAC,cAAC0G,EAAG,MAAKU,SAASC,eAAe","file":"static/js/main.93b34690.chunk.js","sourcesContent":["import React, { Component } from 'react';\n\nclass Nav extends Component {\n constructor() {\n super();\n\n this.state = {\n version: require('./../../package.json').version,\n };\n }\n\n render() {\n return (\n \n );\n }\n}\n\nexport default Nav;\n","import React, { Component } from 'react';\n\nclass Dashboard extends Component {\n constructor() {\n super();\n\n const { search } = window.location;\n const match = search.match(/\\?email=(.+)/);\n\n this.state = {\n badges: [],\n error: null,\n mail: match ? match[1] : null,\n };\n\n const options = {\n method: 'get',\n };\n\n if (this.state.mail) {\n fetch(`/badges?email=${this.state.mail}`, options)\n .then(response => response.json())\n .then(data => {\n if (data.message) {\n return this.setState({ error: data.message });\n }\n\n this.setState({ badges: data.badges });\n });\n }\n }\n\n render() {\n return (\n
\n {\n this.state.mail &&

Hello 👋

\n }\n\n { this.state.error &&\n

{ this.state.error }

\n }\n\n { this.state.mail && !this.state.badges.length &&\n

Vous n'avez pas de badges 😢.

\n }\n\n
\n { this.state.badges.map((badge) =>\n
\n {\n
\n
{ badge.name }
\n

{ badge.description }

\n Télécharger\n
\n
\n )}\n
\n
\n );\n }\n}\n\nexport default Dashboard;\n","import React, { Component } from 'react';\n\nclass BadgeCreator extends Component {\n constructor() {\n super();\n\n this.state = {\n icons: [],\n templates: [],\n image: null,\n error: null,\n success: null,\n name: '',\n description: '',\n criteria: '',\n username: 'tuveuxunemedaille',\n fullname: 'Tu veux une médaille',\n mail: 'noreply@tuveuxunemedaille.fr',\n icon: null,\n iconColor: '#000000',\n fill: '#ffffff',\n stroke: '#000000',\n displayExtra: 0,\n extraAlpha: 0.2,\n displayBanner: 1,\n bannerFill: '#ffffff',\n bannerStroke: '#000000',\n bannerText: 'Hello world!'\n };\n\n this.timer = null;\n this.handleSubmitBadgeCreator = this.handleSubmitBadgeCreator.bind(this);\n this.handleSubmitBadge = this.handleSubmitBadge.bind(this);\n this.handleChange = this.handleChange.bind(this);\n this.handleInputChange = this.handleInputChange.bind(this);\n this.handleTemplateChanged = this.handleTemplateChanged.bind(this);\n\n fetch('/icons').then(response => response.json()).then(data => {\n const icons = [];\n for (var categoryName in data) {\n for (var image of data[categoryName]) {\n icons.push({ value: `/${categoryName}/${image}`, text: `${image} [${categoryName}]` });\n }\n }\n\n this.setState({ icons });\n this.setState({ image: '/badge/image/' + this.toBase64() });\n });\n\n fetch('/badges/templates').then(response => response.json()).then(data => {\n this.setState({ templates: data.map(template => template.replace('.json', '')) });\n });\n }\n\n handleChange(event) {\n clearTimeout(this.timer);\n\n const data = {};\n if (event.target.type === 'checkbox') {\n data[event.target.name] = event.target.checked;\n } else {\n data[event.target.name] = event.target.value;\n }\n\n this.setState(data);\n this.timer = setTimeout(() => this.setState({ image: '/badge/image/' + this.toBase64() }), 100);\n }\n\n handleInputChange(event) {\n this.setState({ [event.target.name]: event.target.value });\n }\n\n handleTemplateChanged(event) {\n if (event.target.value) {\n fetch(`/templates/${event.target.value}.json`)\n .then(response => response.json())\n .then(data => {\n this.setState({\n icon: data.image.icon,\n iconColor: data.image.iconColor,\n fill: data.image.fill,\n stroke: data.image.stroke,\n displayExtra: data.image.displayExtra,\n extraAlpha: data.image.extraAlpha,\n displayBanner: data.image.displayBanner,\n bannerFill: data.image.bannerFill,\n bannerStroke: data.image.bannerStroke,\n bannerText: data.image.bannerText,\n name: data.info.name,\n description: data.info.description,\n criteria: data.info.criteria\n });\n\n this.setState({ image: '/badge/image/' + this.toBase64() });\n });\n }\n }\n\n handleSubmitBadgeCreator(event) {\n event.preventDefault();\n\n this.setState({ image: '/badge/image/' + this.toBase64() });\n }\n\n handleSubmitBadge(event) {\n event.preventDefault();\n\n this.setState({ error: null, success: null });\n\n const inputs = event.target.elements;\n const formData = new FormData();\n\n formData.append('name', inputs['badge-name'].value);\n formData.append('description', inputs['badge-description'].value);\n formData.append('criteria', inputs['badge-criteria'].value);\n formData.append('recipient', inputs['badge-recipient'].value);\n\n formData.append('username', inputs['badge-issuer-username'].value);\n formData.append('fullname', inputs['badge-issuer-fullname'].value);\n formData.append('mail', inputs['badge-issuer-mail'].value);\n\n formData.append('image', this.toBase64());\n\n const options = {\n method: 'post',\n body: formData,\n };\n\n fetch('/badge', options)\n .then(response => response.json())\n .then(data => {\n if (data.message) {\n return this.setState({ error: data.message });\n }\n\n this.setState({ success: data });\n });\n }\n\n toBase64() {\n return btoa(JSON.stringify({\n icon: this.state.icon ||this.state.icons[0].value,\n iconColor: this.state.iconColor,\n fill: this.state.fill,\n stroke: this.state.stroke,\n displayExtra: this.state.displayExtra ? 1 : 0,\n extraAlpha: parseFloat(this.state.extraAlpha),\n displayBanner: this.state.displayBanner ? 1 : 0,\n bannerFill: this.state.bannerFill,\n bannerStroke: this.state.bannerStroke,\n bannerText: this.state.bannerText\n }));\n }\n\n render() {\n return (\n
\n
\n { this.state.image && }\n
\n\n
\n \n\n

🖍 Edition badge

\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n
\n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n
\n
\n\n \n
\n\n

✉️ Informations du receveur

\n\n { this.state.error &&\n

{ this.state.error }

\n }\n\n { this.state.success &&\n

\n 👌 Badge créé et disponible sur le profile de { '/badge/' + this.state.success._id }\n Revenir à l'accueil\n

\n }\n\n
\n
\n \n\n \n
\n\n
\n \n\n \n
\n\n
\n \n\n \n \n
\n\n
\n \n\n \n
\n\n

🖋 Informations de l'émetteur

\n\n
\n \n\n \n
\n\n
\n \n \n
\n\n
\n \n\n \n
\n\n \n
\n
\n
\n );\n }\n}\n\nexport default BadgeCreator;\n","import React, {Component} from 'react';\nimport Nav from './nav';\nimport Dashboard from './dashboard';\nimport BadgeCreator from './badge-creator';\n\nclass App extends Component {\n constructor() {\n super();\n\n this.state = {\n isCreatingBadge: false\n };\n\n this.handleSubmit = this.handleSubmit.bind(this);\n this.handleClick = this.handleClick.bind(this);\n }\n\n handleClick() {\n this.setState(state => ({ isCreatingBadge: !state.isCreatingBadge }));\n }\n\n handleSubmit(event) {\n event.preventDefault();\n window.location = `/?email=${event.target.elements.email.value}`;\n }\n\n render() {\n return (\n
\n
\n );\n }\n}\n\nexport default App;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport App from './components/app';\n\nReactDOM.render(, document.getElementById('root'));\n"],"sourceRoot":""}