Current File : //var/www/prestashop/modules/psxmarketingwithgoogle/views/js/remoteMiddleware.js
"use strict";(self.webpackChunkmarketing_with_google_verification_tag=self.webpackChunkmarketing_with_google_verification_tag||[]).push([[214],{6209:(e,t,r)=>{r.r(t),r.d(t,{remoteMiddlewares:()=>o});var n=r(7768),a=r(5374),i=r(6505),c=r(3427);function o(e,t,r){var o;return(0,n.mG)(this,void 0,void 0,(function(){var s,l,u,d,f=this;return(0,n.Jh)(this,(function(h){switch(h.label){case 0:return(0,a.s)()?[2,[]]:(s=(0,c.Kg)(),l=null!==(o=t.enabledMiddleware)&&void 0!==o?o:{},u=Object.entries(l).filter((function(e){return e[0],e[1]})).map((function(e){return e[0]})),d=u.map((function(t){return(0,n.mG)(f,void 0,void 0,(function(){var a,c,o,l;return(0,n.Jh)(this,(function(n){switch(n.label){case 0:a=t.replace("@segment/",""),c=a,r&&(c=btoa(a).replace(/=/g,"")),o="".concat(s,"/middleware/").concat(c,"/latest/").concat(c,".js.gz"),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,(0,i.v)(o)];case 2:return n.sent(),[2,window["".concat(a,"Middleware")]];case 3:return l=n.sent(),e.log("error",l),e.stats.increment("failed_remote_middleware"),[3,4];case 4:return[2]}}))}))})),[4,Promise.all(d)]);case 1:return[2,h.sent().filter(Boolean)]}}))}))}}}]);