Compare commits

..

1 Commits

Author SHA1 Message Date
8ee2f50bf4 Correction des chemins des fichiers SVG et renommage 2020-10-30 18:55:10 +01:00
3 changed files with 2 additions and 9 deletions

Binary file not shown.

View File

@ -27,13 +27,6 @@ for( param in params ){
d = new Date() d = new Date()
document.querySelector("[name=heuresortie]").value = ('0'+d.getHours()).slice(-2)+":"+('0'+d.getMinutes()).slice(-2) document.querySelector("[name=heuresortie]").value = ('0'+d.getHours()).slice(-2)+":"+('0'+d.getMinutes()).slice(-2)
function formToURL(l,x){
out=document.location.origin + document.location.pathname+"#"
for( i in l ) { out+=`${i}=${l[i]}&` }
window.history.pushState('Votre version', 'Votre version', out);
}
</script> </script>
</body> </body>
<!-- Mirrored from media.interieur.gouv.fr/deplacement-covid-19/ by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 29 Oct 2020 20:30:22 GMT --> <!-- Mirrored from media.interieur.gouv.fr/deplacement-covid-19/ by HTTrack Website Copier/3.x [XR&CO'2014], Thu, 29 Oct 2020 20:30:22 GMT -->

View File

@ -443,7 +443,7 @@ module.exports="eJztWsuy48iN/Ret74KZfHtX47meqfGjPHaXx4/wgpJ4JbooUU1JVXXb0f9u4JwE
},{"./api/index":"xU9E","./core/index":"jZtJ","./types/index":"LYu1","./utils/index":"eZqv"}],"zusO":[function(require,module,exports) { },{"./api/index":"xU9E","./core/index":"jZtJ","./types/index":"LYu1","./utils/index":"eZqv"}],"zusO":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generatePdf=i;var e=r(require("@babel/runtime/regenerator")),t=r(require("@babel/runtime/helpers/asyncToGenerator")),a=require("./util"),n=require("pdf-lib");function r(e){return e&&e.__esModule?e:{default:e}}var c={travail:578,achats:533,sante:477,famille:435,handicap:396,sport_animaux:358,convocation:295,missions:255,enfants:211};function i(e,t,a){return o.apply(this,arguments)}function o(){return(o=(0,t.default)(e.default.mark(function t(r,i,o){var u,d,l,f,p,h,g,m,x,v,b,y,w,S,P,D,T,q,z,A,F,M,_;return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=new Date,d=u.toLocaleDateString("fr-FR"),l=u.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}).replace(":","h"),f=r.lastname,p=r.firstname,h=r.birthday,g=r.placeofbirth,m=r.address,x=r.zipcode,v=r.city,b=r.datesortie,y=r.heuresortie,w=["Cree le: ".concat(d," a ").concat(l),"Nom: ".concat(f),"Prenom: ".concat(p),"Naissance: ".concat(h," a ").concat(g),"Adresse: ".concat(m," ").concat(x," ").concat(v),"Sortie: ".concat(b," a ").concat(y),"Motifs: ".concat(i)].join(";\n "),e.next=7,fetch(o).then(function(e){return e.arrayBuffer()});case 7:return S=e.sent,e.next=10,n.PDFDocument.load(S);case 10:return(P=e.sent).setTitle("COVID-19 - Déclaration de déplacement"),P.setSubject("Attestation de déplacement dérogatoire"),P.setKeywords(["covid19","covid-19","attestation","déclaration","déplacement","officielle","gouvernement"]),P.setProducer("DNUM/SDIT"),P.setCreator(""),P.setAuthor("Ministère de l'intérieur"),D=P.getPages()[0],e.next=20,P.embedFont(n.StandardFonts.Helvetica);case 20:return T=e.sent,(q=function(e,t,a){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:11;D.drawText(e,{x:t,y:a,size:n,font:T})})("".concat(p," ").concat(f),119,696),q(h,119,674),q(g,297,674),q("".concat(m," ").concat(x," ").concat(v),133,652),i.split(", ").forEach(function(e){q("x",84,c[e],18)}),(z=s(T,r.city,83,7,11))||(alert('Le nom de la ville risque de ne pas être affiché correctement en raison de sa longueur. Essayez d\'utiliser des abréviations ("Saint" en "St." par exemple) quand cela est possible.'),z=7),q(r.city,105,177,z),q("".concat(r.datesortie),91,153,11),q("".concat(r.heuresortie),264,153,11),e.next=34,(0,a.generateQR)(w);case 34:return A=e.sent,e.next=37,P.embedPng(A);case 37:return F=e.sent,D.drawImage(F,{x:D.getWidth()-156,y:100,width:92,height:92}),P.addPage(),(M=P.getPages()[1]).drawImage(F,{x:50,y:M.getHeight()-350,width:300,height:300}),e.next=44,P.save();case 44:return _=e.sent,e.abrupt("return",new Blob([_],{type:"application/pdf"}));case 46:case"end":return e.stop()}},t)}))).apply(this,arguments)}function s(e,t,a,n,r){for(var c=r,i=e.widthOfTextAtSize(t,r);i>a&&c>n;)i=e.widthOfTextAtSize(t,--c);return i>a?null:c} "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.generatePdf=i;var e=r(require("@babel/runtime/regenerator")),t=r(require("@babel/runtime/helpers/asyncToGenerator")),a=require("./util"),n=require("pdf-lib");function r(e){return e&&e.__esModule?e:{default:e}}var c={travail:578,achats:533,sante:477,famille:435,handicap:396,sport_animaux:358,convocation:295,missions:255,enfants:211};function i(e,t,a){return o.apply(this,arguments)}function o(){return(o=(0,t.default)(e.default.mark(function t(r,i,o){var u,d,l,f,p,h,g,m,x,v,b,y,w,S,P,D,T,q,z,A,F,M,_;return e.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=new Date,d=u.toLocaleDateString("fr-FR"),l=u.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}).replace(":","h"),f=r.lastname,p=r.firstname,h=r.birthday,g=r.placeofbirth,m=r.address,x=r.zipcode,v=r.city,b=r.datesortie,y=r.heuresortie,w=["Cree le: ".concat(d," a ").concat(l),"Nom: ".concat(f),"Prenom: ".concat(p),"Naissance: ".concat(h," a ").concat(g),"Adresse: ".concat(m," ").concat(x," ").concat(v),"Sortie: ".concat(b," a ").concat(y),"Motifs: ".concat(i)].join(";\n "),e.next=7,fetch(o).then(function(e){return e.arrayBuffer()});case 7:return S=e.sent,e.next=10,n.PDFDocument.load(S);case 10:return(P=e.sent).setTitle("COVID-19 - Déclaration de déplacement"),P.setSubject("Attestation de déplacement dérogatoire"),P.setKeywords(["covid19","covid-19","attestation","déclaration","déplacement","officielle","gouvernement"]),P.setProducer("DNUM/SDIT"),P.setCreator(""),P.setAuthor("Ministère de l'intérieur"),D=P.getPages()[0],e.next=20,P.embedFont(n.StandardFonts.Helvetica);case 20:return T=e.sent,(q=function(e,t,a){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:11;D.drawText(e,{x:t,y:a,size:n,font:T})})("".concat(p," ").concat(f),119,696),q(h,119,674),q(g,297,674),q("".concat(m," ").concat(x," ").concat(v),133,652),i.split(", ").forEach(function(e){q("x",84,c[e],18)}),(z=s(T,r.city,83,7,11))||(alert('Le nom de la ville risque de ne pas être affiché correctement en raison de sa longueur. Essayez d\'utiliser des abréviations ("Saint" en "St." par exemple) quand cela est possible.'),z=7),q(r.city,105,177,z),q("".concat(r.datesortie),91,153,11),q("".concat(r.heuresortie),264,153,11),e.next=34,(0,a.generateQR)(w);case 34:return A=e.sent,e.next=37,P.embedPng(A);case 37:return F=e.sent,D.drawImage(F,{x:D.getWidth()-156,y:100,width:92,height:92}),P.addPage(),(M=P.getPages()[1]).drawImage(F,{x:50,y:M.getHeight()-350,width:300,height:300}),e.next=44,P.save();case 44:return _=e.sent,e.abrupt("return",new Blob([_],{type:"application/pdf"}));case 46:case"end":return e.stop()}},t)}))).apply(this,arguments)}function s(e,t,a,n,r){for(var c=r,i=e.widthOfTextAtSize(t,r);i>a&&c>n;)i=e.widthOfTextAtSize(t,--c);return i>a?null:c}
},{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","./util":"wT1R","pdf-lib":"Yu9A"}],"qRST":[function(require,module,exports) { },{"@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","./util":"wT1R","pdf-lib":"Yu9A"}],"qRST":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setReleaseDateTime=p,exports.getProfile=v,exports.getReasons=h,exports.prepareInputs=m,exports.prepareForm=g;var e=u(require("@babel/runtime/helpers/toConsumableArray")),t=u(require("@babel/runtime/regenerator")),r=u(require("@babel/runtime/helpers/asyncToGenerator")),n=require("./dom-utils"),a=require("./util"),i=u(require("../certificate.pdf")),o=require("./pdf-util");function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw i}}}}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d={"#field-firstname":{length:1},"#field-lastname":{length:1},"#field-birthday":{pattern:/^([0][1-9]|[1-2][0-9]|30|31)\/([0][1-9]|10|11|12)\/(19[0-9][0-9]|20[0-1][0-9]|2020)/g},"#field-placeofbirth":{length:1},"#field-address":{length:1},"#field-city":{length:1},"#field-zipcode":{pattern:/\d{5}/g},"#field-datesortie":{pattern:/\d{4}-\d{2}-\d{2}/g},"#field-heuresortie":{pattern:/\d{2}:\d{2}/g}};function f(){return Object.keys(d).map(function(e){var t=d[e],r=t.pattern,a=t.length,i=r&&!(0,n.$)(e).value.match(r),o=a&&!(0,n.$)(e).value.length,u=!(!i&&!o);return(0,n.$)(e).setAttribute("aria-invalid",u),u&&(0,n.$)(e).focus(),u}).includes(!0)}function p(e){var t=new Date;e.value=(0,a.getFormattedDate)(t)}function v(e){var t,r={},n=l(e);try{for(n.s();!(t=n.n()).done;){var a=t.value,i=a.value;if("field-datesortie"===a.id){var o=a.value.split("-");i="".concat(o[2],"/").concat(o[1],"/").concat(o[0])}r[a.id.substring("field-".length)]=i}}catch(u){n.e(u)}finally{n.f()}return r}function h(e){return e.filter(function(e){return e.checked}).map(function(e){return e.value}).join(", ")}function m(e,u,l,c,s){e.forEach(function(e){var t=e.parentNode.parentNode.querySelector(".exemple"),r=e.parentNode.parentNode.querySelector(".validity");e.placeholder&&t&&e.addEventListener("input",function(n){e.value?(t.innerHTML="ex.&nbsp;: "+e.placeholder,r.removeAttribute("hidden")):t.innerHTML=""})}),(0,n.$)("#field-birthday").addEventListener("keyup",function(e){e.preventDefault();var t=e.target,r=e.keyCode||e.charCode;8!==r&&46!==r&&(t.value=(0,a.addSlash)(t.value))}),u.forEach(function(e){e.addEventListener("change",function(e){var t=u.every(function(e){return!e.checked});l.classList.toggle("fieldset-error",t),c.classList.toggle("hidden",!t)})}),(0,n.$)("#generate-btn").addEventListener("click",function(){var a=(0,r.default)(t.default.mark(function r(a){var d,p,m,g,b;return t.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a.preventDefault(),d=h(u)){t.next=7;break}return l.classList.add("fieldset-error"),c.classList.remove("hidden"),l.scrollIntoView&&l.scrollIntoView(),t.abrupt("return");case 7:if(!f()){t.next=10;break}return t.abrupt("return");case 10:return formToURL(v(e),d),console.log(v(e),d),t.next=13,(0,o.generatePdf)(v(e),d,i.default);case 13:p=t.sent,m=new Date,g=m.toLocaleDateString("fr-CA"),b=m.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}).replace(":","-"),(0,n.downloadBlob)(p,"attestation-".concat(g,"_").concat(b,".pdf")),s.classList.remove("d-none"),setTimeout(function(){return s.classList.add("show")},100),setTimeout(function(){s.classList.remove("show"),setTimeout(function(){return s.classList.add("d-none")},500)},6e3);case 21:case"end":return t.stop()}},r)}));return function(e){return a.apply(this,arguments)}}())}function g(){var t=(0,n.$$)("#form-profile input"),r=(0,n.$)("#snackbar"),a=(0,e.default)((0,n.$$)('input[name="field-reason"]')),i=(0,n.$)("#reason-fieldset"),o=i.querySelector(".msg-alert");p((0,n.$)("#field-datesortie")),m(t,a,i,o,r)} "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.setReleaseDateTime=p,exports.getProfile=v,exports.getReasons=h,exports.prepareInputs=m,exports.prepareForm=g;var e=u(require("@babel/runtime/helpers/toConsumableArray")),t=u(require("@babel/runtime/regenerator")),r=u(require("@babel/runtime/helpers/asyncToGenerator")),n=require("./dom-utils"),a=require("./util"),i=u(require("../certificate.pdf")),o=require("./pdf-util");function u(e){return e&&e.__esModule?e:{default:e}}function l(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){u=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(u)throw i}}}}function c(e,t){if(e){if("string"==typeof e)return s(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var d={"#field-firstname":{length:1},"#field-lastname":{length:1},"#field-birthday":{pattern:/^([0][1-9]|[1-2][0-9]|30|31)\/([0][1-9]|10|11|12)\/(19[0-9][0-9]|20[0-1][0-9]|2020)/g},"#field-placeofbirth":{length:1},"#field-address":{length:1},"#field-city":{length:1},"#field-zipcode":{pattern:/\d{5}/g},"#field-datesortie":{pattern:/\d{4}-\d{2}-\d{2}/g},"#field-heuresortie":{pattern:/\d{2}:\d{2}/g}};function f(){return Object.keys(d).map(function(e){var t=d[e],r=t.pattern,a=t.length,i=r&&!(0,n.$)(e).value.match(r),o=a&&!(0,n.$)(e).value.length,u=!(!i&&!o);return(0,n.$)(e).setAttribute("aria-invalid",u),u&&(0,n.$)(e).focus(),u}).includes(!0)}function p(e){var t=new Date;e.value=(0,a.getFormattedDate)(t)}function v(e){var t,r={},n=l(e);try{for(n.s();!(t=n.n()).done;){var a=t.value,i=a.value;if("field-datesortie"===a.id){var o=a.value.split("-");i="".concat(o[2],"/").concat(o[1],"/").concat(o[0])}r[a.id.substring("field-".length)]=i}}catch(u){n.e(u)}finally{n.f()}return r}function h(e){return e.filter(function(e){return e.checked}).map(function(e){return e.value}).join(", ")}function m(e,u,l,c,s){e.forEach(function(e){var t=e.parentNode.parentNode.querySelector(".exemple"),r=e.parentNode.parentNode.querySelector(".validity");e.placeholder&&t&&e.addEventListener("input",function(n){e.value?(t.innerHTML="ex.&nbsp;: "+e.placeholder,r.removeAttribute("hidden")):t.innerHTML=""})}),(0,n.$)("#field-birthday").addEventListener("keyup",function(e){e.preventDefault();var t=e.target,r=e.keyCode||e.charCode;8!==r&&46!==r&&(t.value=(0,a.addSlash)(t.value))}),u.forEach(function(e){e.addEventListener("change",function(e){var t=u.every(function(e){return!e.checked});l.classList.toggle("fieldset-error",t),c.classList.toggle("hidden",!t)})}),(0,n.$)("#generate-btn").addEventListener("click",function(){var a=(0,r.default)(t.default.mark(function r(a){var d,p,m,g,b;return t.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a.preventDefault(),d=h(u)){t.next=7;break}return l.classList.add("fieldset-error"),c.classList.remove("hidden"),l.scrollIntoView&&l.scrollIntoView(),t.abrupt("return");case 7:if(!f()){t.next=10;break}return t.abrupt("return");case 10:return console.log(v(e),d),t.next=13,(0,o.generatePdf)(v(e),d,i.default);case 13:p=t.sent,m=new Date,g=m.toLocaleDateString("fr-CA"),b=m.toLocaleTimeString("fr-FR",{hour:"2-digit",minute:"2-digit"}).replace(":","-"),(0,n.downloadBlob)(p,"attestation-".concat(g,"_").concat(b,".pdf")),s.classList.remove("d-none"),setTimeout(function(){return s.classList.add("show")},100),setTimeout(function(){s.classList.remove("show"),setTimeout(function(){return s.classList.add("d-none")},500)},6e3);case 21:case"end":return t.stop()}},r)}));return function(e){return a.apply(this,arguments)}}())}function g(){var t=(0,n.$$)("#form-profile input"),r=(0,n.$)("#snackbar"),a=(0,e.default)((0,n.$$)('input[name="field-reason"]')),i=(0,n.$)("#reason-fieldset"),o=i.querySelector(".msg-alert");p((0,n.$)("#field-datesortie")),m(t,a,i,o,r)}
},{"@babel/runtime/helpers/toConsumableArray":"Fhqp","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","./dom-utils":"XNdd","./util":"wT1R","../certificate.pdf":"W9IH","./pdf-util":"zusO"}],"OPnp":[function(require,module,exports) { },{"@babel/runtime/helpers/toConsumableArray":"Fhqp","@babel/runtime/regenerator":"PMvg","@babel/runtime/helpers/asyncToGenerator":"agGE","./dom-utils":"XNdd","./util":"wT1R","../certificate.pdf":"W9IH","./pdf-util":"zusO"}],"OPnp":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnFacebookBrowserUserIfNecessary=r;var e=require("./dom-utils");function r(){if(o()){var r=(0,e.$)("#alert-facebook");r.value="ATTENTION !! Vous utilisez actuellement le navigateur Facebook, ce générateur ne fonctionne pas correctement au sein de ce navigateur ! Merci d'ouvrir Chrome sur Android ou bien Safari sur iOS.",r.classList.remove("d-none")}}function o(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.includes("FBAN")||e.includes("FBAV")} "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnFacebookBrowserUserIfNecessary=r;var e=require("./dom-utils");function r(){if(o()){var r=(0,e.$)("#alert-facebook");r.value="ATTENTION !! Vous utilisez actuellement le navigateur Facebook, ce générateur ne fonctionne pas correctement au sein de ce navigateur ! Merci d'ouvrir Chrome sur Android ou bien Safari sur iOS.",r.classList.remove("d-none")}}function o(){var e=navigator.userAgent||navigator.vendor||window.opera;return e.includes("FBAN")||e.includes("FBAV")}
},{"./dom-utils":"XNdd"}],"IxO8":[function(require,module,exports) { },{"./dom-utils":"XNdd"}],"IxO8":[function(require,module,exports) {