1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[945],{5559:function(e,t,n){var r=n(4051),o=n.n(r),a=n(9669),u=n.n(a),i=n(4809);function c(e,t,n,r,o,a,u){try{var i=e[a](u),c=i.value}catch(s){return void n(s)}i.done?t(c):Promise.resolve(c).then(r,o)}var s=["/service-user-api/api/rest/v1/user/authenticate","/service-user-api/api/rest/v1/user/register","/service-user-api/api/rest/v1/user/refresh/token","/service-user-api/api/rest/v1/capcha/"],l=u().create({baseURL:"https://pub.rmcbfm-ads.com/web-api",headers:{"Content-Type":"application/json"}});l.interceptors.request.use((function(e){var t=i.Z.getLocalAccessToken();return t&&!s.includes(e.url)&&(e.headers.Authorization="Bearer "+t),e}),(function(e){return Promise.reject(e)})),l.interceptors.response.use((function(e){return e}),function(){var e,t=(e=o().mark((function e(t){var n,r,a;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("/service-user-api/api/rest/v1/user/authenticate"===(null===(n=t.config)||void 0===n?void 0:n.url)||!t.response){e.next=17;break}if(401!==t.response.status||n._retry||"/service-user-api/api/rest/v1/user/refresh/token"==n.url){e.next=17;break}return n._retry=!0,e.prev=4,e.next=8,l.post("/service-user-api/api/rest/v1/user/refresh/token",{refresh_token:i.Z.getLocalRefreshToken()});case 8:return a=e.sent,i.Z.updateLocalAccessToken(null===(r=a.data)||void 0===r?void 0:r.data),e.abrupt("return",l(n));case 13:return e.prev=13,e.t0=e.catch(4),localStorage.removeItem("token"),e.abrupt("return",Promise.reject(e.t0));case 17:return localStorage.removeItem("token"),e.abrupt("return",Promise.reject(t));case 19:case"end":return e.stop()}}
1),e,null,[[4,13]])})),function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function u(e){c(a,r,o,u,i,"next",e)}function i(e){c(a,r,o,u,i,"throw",e)}u(void 0)}))});return function(e){return t.apply(this,arguments)}}()),t.Z=l},9904:function(e,t,n){var r=n(5559),o=n(4809);function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,u;return t=e,(n=[{key:"login",value:function(e,t){return r.Z.post("/service-user-api/api/rest/v1/user/authenticate",JSON.stringify({username:e,password:t})).then((function(e){return e.data&&o.Z.setToken(e.data.data),e.data}))}},{key:"logout",value:function(){o.Z.removeToken()}},{key:"register",value:function(e){var t=e.firstName,n=e.lastName,o=e.email,a=e.tel,u=e.nameCompany,i=e.password,c=e.otpVerificationCode,s=e.allowProspecting,l=a;"0"===a[0]&&(l="+33"+a.substring(1));var f={firstName:t,lastName:n,email:o,tel:a=l,nameCompany:u,password:i,otpVerificationCode:c,allowProspecting:s};return r.Z.post("/service-user-api/api/rest/v1/user/register",JSON.stringify(f)).then((function(e){return e.data}))}},{key:"registerBoth",value:function(e){var t=e.firstName,n=e.lastName,o=e.email,a=e.tel,u=e.nameCompany,i=e.password,c=e.otpVerificationCode,s=e.allowProspecting,l=e.company,f=a;"0"===a[0]&&(f="+33"+a.substring(1));var v={firstName:t,lastName:n,email:o,tel:a=f,nameCompany:u,password:i,otpVerificationCode:c,allowProspecting:s,company:l};return r.Z.post("/service-user-api/api/rest/v1/user/registerBoth",JSON.stringify(v)).then((function(e){return e.data}))}},{key:"getCurrentUser",value:function(){return o.Z.getUserInfoFromToken()}},{key:"isAuthenticated",value:function(){return!o.Z.isExpiredRefreshToken()}},{key:"getCapcha",value:function(e){return r.Z.get("/service-user-api/api/rest/v1/capcha/"+e,{responseType:"blob"}).catch((function(e){console.log(e)})).then((function(e){return null===e||void 0===e?void 0:e.data}))}},{key:"verifyUser",value:function(e){return r.Z.post("/service-user-api/api/rest/v1/user/verify",e).then((function(e){return e.data}))}}])&&a(t.prototype,n),u&&a(t,u),e}();t.Z=new u},4809:function(e,t){function n(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var r=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,o;return t=e,(r=[{key:"getLocalRefreshToken",value:function(){var e=JSON.parse(localStorage.getItem("token"));return null===e||void 0===e?void 0:e.refresh_token}},{key:"getLocalAccessToken",value:function(){if(null!==localStorage.getItem("token"))return JSON.parse(localStorage.getItem("token")).access_token}},{key:"updateLocalAccessToken",value:function(e){var t=JSON.parse(localStorage.getItem("token"));t.access_token=e.access_token,t.refresh_token=e.refresh_token,localStorage.setItem("token",JSON.stringify(t))}},{key:"getTokenDetails",value:function(){if("undefined"!==localStorage.getItem("token"))return JSON.parse(localStorage.getItem("token"))}},{key:"setToken",value:function(e){localStorage.setItem("token",JSON.stringify(e))}},{key:"removeToken",value:function(){localStorage.removeItem("token")}},{key:"jwtDecode",value:function(e){if(e){var t={};return t.raw=e,t.header=JSON.parse(window.atob(e.split(".")[0])),t.payload=JSON.parse(window.atob(e.split(".")[1])),t}return null}},{key:"getTokenInfo",value:function(){var e;return this.getTokenDetails()?this.jwtDecode(null===(e=this.getTokenDetails())||void 0===e?void 0:e.access_token):null}},{key:"getRefreshTokenInfo",value:function(){var e;return this.getTokenDetails()?this.jwtDecode(null===(e=this.getTokenDetails())||void 0===e?void 0:e.refresh_token):null}},{key:"isExpiredToken",value:function(){var e,t,n;return!(null===(e=this.getTokenInfo())||void 0===e||null===(t=e.payload)||void 0===t?void 0:t.exp)||1e3*(null===(n=this.getTokenInfo().payload)||void 0===n?void 0:n.exp)<(new Date).getTime()}},{key:"isExpiredRefreshToken",value:function(){var e,t,n;return!(null===(e=this.getRefreshTokenInfo())||void 0===e||null===(t=e.payload)||void 0===t?void 0:t.exp)||1e3*(null===(n=this.getRefreshTokenInfo().payload)||void 0===n?void 0:n.exp)<(new Date).getTime()}},{key:"getUserInfoFromToken",value:function(){var e;return null===(e=this.getRefreshTokenInfo())||void 0===e?void 0:e.payload}},{key:"getRecentToken",value:function(){return this.isExpiredToken()?this.getLocalRefreshToken():this.getLocalAccessToken()}}])&&n(t.prototype,r),o&&n(t,o),e}();t.Z=new r},1005:function(e,t,n){var r=n(4051),o=n.n(r),a=n(5559);function u(e,t,n,r,o,a,u){try{var i=e[a](u),c=i.value}catch(s){return void n(s)}i.done?t(c):Promise.resolve(c).then(r,o)}function i(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){u(a,r,o,i,c,"next",e)}function c(e){u(a,r,o,i,c,"throw",e)}i(void 0)}))}}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}var s="".concat("https://pub.rmcbfm-ads.com/web-api").concat("/service-user-api/api/rest/v1"),l=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,n,r;return t=e,(n=[{key:"getFamilleSectorList",value:function(){return a.Z.get(s+"/secteur/familleLib").then((function(e){return e.data}))}},{key:"getSubFamilleSectorList",value:function(e){return a.Z.get(s+"/secteur/sousFamilleLib/".concat(e)).then((function(e){return e.data}))}},{key:"getSectorList",value:function(e){return a.Z.get(s+"/secteur/codeSecteur/".concat(e)).then((function(e){return e.data}))}},{key:"companySearch",value:function(e){return fetch("".concat(s,"/user/client/?siret=").concat(e)).then((function(e){return e.json()}))}},{key:"createCompany",value:function(e){return a.Z.post(s+"/user/clientagent/add",JSON.stringify(e)).then((function(e){return e.data}))}}
1,{key:"getCountryList",value:function(){return a.Z.get(s+"/user/salesforce/country").then((function(e){return e.data}))}},{key:"getIndustryList",value:function(){return a.Z.get(s+"/user/salesforce/industry").then((function(e){return e.data}))}},{key:"getCitiesByZipCode",value:function(e){return fetch("".concat(s,"/geoloc/cities/search?zipcode=").concat(e)).then((function(e){return e.json()})).then((function(e){return e}))}},{key:"activateUserAccount",value:function(e){return a.Z.get("".concat(s,"/user/activate/").concat(e))}},{key:"getUserInfo",value:function(){return a.Z.get("".concat(s,"/user/userinfo")).then((function(e){return e.data}))}},{key:"updateUserInfo",value:function(e){return a.Z.patch("".concat(s,"/user/userinfo"),JSON.stringify(e)).then((function(e){return e.data}))}},{key:"getZipCode",value:function(e,t){return i(o().mark((function n(){var r,a;return o().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=null,n.prev=1,n.next=4,fetch("".concat(s,"/geoloc/cities/nearbyxy/").concat(t,"/").concat(e));case 4:return a=n.sent,n.next=7,a.json();case 7:r=n.sent,n.next=13;break;case 10:return n.prev=10,n.t0=n.catch(1),n.abrupt("return","Aucun code postal");case 13:return n.abrupt("return",r);case 14:case"end":return n.stop()}}),n,null,[[1,10]])})))()}},{key:"getAllCitiesWithZipCodeResponse",value:function(e){return i(o().mark((function t(){var n;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("".concat(s,"/geoloc/cities/search?zipcode=").concat(e));case 2:return n=t.sent,t.next=5,n.json();case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t)})))()}},{key:"getPDF",value:function(e){return a.Z.get("".concat(s,"/order/")+e+"/plan/pdf").then((function(e){return e})).catch((function(e){return null}))}},{key:"checkPDF",value:function(e){return a.Z.get("".concat(s,"/order/")+e).then((function(e){return e.data})).catch((function(e){return null}))}},{key:"simulationPlanDiff",value:function(e){return a.Z.post(s+"/user/plan/simulation",{quotationId:e}).then((function(e){return e.data}))}},{key:"getProjectById",value:function(e){return a.Z.get(s+"/user/project/"+e).then((function(e){return e.data}))}}])&&c(t.prototype,n),r&&c(t,r),e}();t.Z=new l}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.