(self.webpackChunk_segment_analytics_next=self.webpackChunk_segment_analytics_next||[]).push([[714],{2734:function(n,e,t){"use strict";t.r(e),t.d(e,{applyDestinationMiddleware:function(){return o},sourceMiddlewarePlugin:function(){return s}});var r=t(655),i=t(7372),a=t(5764),u=t(2722);function o(n,e,t){return(0,r.mG)(this,void 0,Promise,(function(){function i(e,t){return(0,r.mG)(this,void 0,Promise,(function(){var i,o,s;return(0,r.Jh)(this,(function(l){switch(l.label){case 0:return i=!1,o=null,[4,(0,a.O)(t({payload:(0,u.D)(e,{clone:!0,traverse:!1}),integration:n,next:function(n){i=!0,null===n&&(o=null),n&&(o=n.obj)}}))];case 1:return l.sent(),i||null===o||((o=o).integrations=(0,r.pi)((0,r.pi)({},e.integrations),((s={})[n]=!1,s))),[2,o]}}))}))}var o,s,l,c;return(0,r.Jh)(this,(function(n){switch(n.label){case 0:o=0,s=t,n.label=1;case 1:return o<s.length?(l=s[o],[4,i(e,l)]):[3,4];case 2:if(null===(c=n.sent()))return[2,null];e=c,n.label=3;case 3:return o++,[3,1];case 4:return[2,e]}}))}))}function s(n){function e(e){var t;return(0,r.mG)(this,void 0,Promise,(function(){var o;return(0,r.Jh)(this,(function(r){switch(r.label){case 0:return o=!1,[4,(0,a.O)(n({payload:(0,u.D)(e.event,{clone:!0,traverse:!1}),integrations:null!==(t=e.event.integrations)&&void 0!==t?t:{},next:function(n){o=!0,n&&(e.event=n.obj)}}))];case 1:if(r.sent(),!o)throw new i.Y({retry:!1,type:"middleware_cancellation",reason:"Middleware `next` function skipped"});return[2,e]}}))}))}return{name:"Source Middleware "+n.name,type:"before",version:"0.1.0",isLoaded:function(){return!0},load:function(n){return Promise.resolve(n)},track:e,page:e,identify:e,alias:e,group:e}}}}]);
//# sourceMappingURL=middleware.bundle.773453cc0971a146c626.js.map