ordering-ui-external 1.9.1 → 1.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/0.ordering-ui.ea0875b41af5b7f1d809.js +1 -0
- package/_bundles/{1.ordering-ui.a97bdaf67c563ada4c74.js → 1.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{2.ordering-ui.a97bdaf67c563ada4c74.js → 2.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{4.ordering-ui.a97bdaf67c563ada4c74.js → 4.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{5.ordering-ui.a97bdaf67c563ada4c74.js → 5.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{6.ordering-ui.a97bdaf67c563ada4c74.js → 6.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{7.ordering-ui.a97bdaf67c563ada4c74.js → 7.ordering-ui.ea0875b41af5b7f1d809.js} +2 -2
- package/_bundles/{7.ordering-ui.a97bdaf67c563ada4c74.js.LICENSE.txt → 7.ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt} +0 -0
- package/_bundles/{8.ordering-ui.a97bdaf67c563ada4c74.js → 8.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/{9.ordering-ui.a97bdaf67c563ada4c74.js → 9.ordering-ui.ea0875b41af5b7f1d809.js} +1 -1
- package/_bundles/ordering-ui.ea0875b41af5b7f1d809.js +2 -0
- package/_bundles/{ordering-ui.a97bdaf67c563ada4c74.js.LICENSE.txt → ordering-ui.ea0875b41af5b7f1d809.js.LICENSE.txt} +0 -0
- package/_modules/components/VerticalOrdersLayout/SingleOrderCard/index.js +9 -10
- package/_modules/themes/five/index.js +7 -0
- package/_modules/themes/five/src/components/AddressList/index.js +3 -2
- package/_modules/themes/five/src/components/BusinessItemAccordion/index.js +3 -2
- package/_modules/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
- package/_modules/themes/five/src/components/BusinessProductsList/index.js +50 -14
- package/_modules/themes/five/src/components/BusinessProductsListing/index.js +9 -2
- package/_modules/themes/five/src/components/BusinessProductsListing/styles.js +10 -6
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +34 -129
- package/_modules/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +29 -40
- package/_modules/themes/five/src/components/Cart/index.js +6 -3
- package/_modules/themes/five/src/components/CartContent/index.js +97 -2
- package/_modules/themes/five/src/components/CartContent/styles.js +6 -4
- package/_modules/themes/five/src/components/Checkout/index.js +8 -2
- package/_modules/themes/five/src/components/Checkout/styles.js +10 -4
- package/_modules/themes/five/src/components/Header/index.js +26 -34
- package/_modules/themes/five/src/components/Header/styles.js +46 -35
- package/_modules/themes/five/src/components/HeaderOption/index.js +3 -2
- package/_modules/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +3 -2
- package/_modules/themes/five/src/components/MultiCheckout/index.js +20 -10
- package/_modules/themes/five/src/components/MultiCheckout/styles.js +11 -8
- package/_modules/themes/five/src/components/MultiOrdersDetails/index.js +2 -0
- package/_modules/themes/five/src/components/OrderContextUI/index.js +192 -0
- package/_modules/themes/five/src/components/OrderContextUI/styles.js +41 -0
- package/_modules/themes/five/src/components/OrderDetails/index.js +5 -2
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +8 -2
- package/_modules/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +8 -2
- package/_modules/themes/five/src/components/ProductItemAccordion/index.js +17 -8
- package/_modules/themes/five/src/components/ProductItemAccordion/styles.js +27 -27
- package/_modules/themes/five/src/components/ProductOptionSubOption/index.js +7 -2
- package/_modules/themes/five/src/components/ProductOptionSubOption/styles.js +17 -14
- package/_modules/themes/five/src/components/SingleOrderCard/index.js +16 -16
- package/_modules/themes/five/src/components/SingleOrderCard/styles.js +49 -41
- package/package.json +2 -1
- package/src/components/VerticalOrdersLayout/SingleOrderCard/index.js +12 -12
- package/src/themes/five/index.js +2 -0
- package/src/themes/five/src/components/AddressList/index.js +3 -2
- package/src/themes/five/src/components/BusinessItemAccordion/index.js +2 -1
- package/src/themes/five/src/components/BusinessProductsCategories/index.js +8 -3
- package/src/themes/five/src/components/BusinessProductsList/index.js +54 -18
- package/src/themes/five/src/components/BusinessProductsListing/index.js +14 -2
- package/src/themes/five/src/components/BusinessProductsListing/styles.js +18 -6
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/index.js +2 -85
- package/src/themes/five/src/components/BusinessesListing/layouts/OriginalBusinessesListing/styles.js +2 -77
- package/src/themes/five/src/components/Cart/index.js +6 -3
- package/src/themes/five/src/components/CartContent/index.js +61 -3
- package/src/themes/five/src/components/CartContent/styles.js +6 -0
- package/src/themes/five/src/components/Checkout/index.js +16 -2
- package/src/themes/five/src/components/Checkout/styles.js +19 -6
- package/src/themes/five/src/components/Header/index.js +281 -277
- package/src/themes/five/src/components/Header/styles.js +20 -51
- package/src/themes/five/src/components/HeaderOption/index.js +3 -2
- package/src/themes/five/src/components/HomeHero/layouts/OriginalHomeHero/index.js +2 -1
- package/src/themes/five/src/components/MultiCheckout/index.js +26 -6
- package/src/themes/five/src/components/MultiCheckout/styles.js +8 -13
- package/src/themes/five/src/components/MultiOrdersDetails/index.js +2 -0
- package/src/themes/five/src/components/OrderContextUI/index.js +133 -0
- package/src/themes/five/src/components/OrderContextUI/styles.js +86 -0
- package/src/themes/five/src/components/OrderDetails/index.js +6 -2
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/index.js +5 -2
- package/src/themes/five/src/components/OrdersOption/PreviousBusinessOrdered/styles.js +4 -0
- package/src/themes/five/src/components/ProductItemAccordion/index.js +58 -40
- package/src/themes/five/src/components/ProductItemAccordion/styles.js +4 -3
- package/src/themes/five/src/components/ProductOptionSubOption/index.js +8 -1
- package/src/themes/five/src/components/ProductOptionSubOption/styles.js +6 -0
- package/src/themes/five/src/components/SingleOrderCard/index.js +12 -13
- package/src/themes/five/src/components/SingleOrderCard/styles.js +26 -7
- package/template/app.js +1 -1
- package/template/components/ListenPageChanges/index.js +3 -2
- package/template/components/OrderingThemeUpdated/index.js +41 -0
- package/template/helmetdata.json +7 -0
- package/template/pages/MessagesList/index.js +2 -0
- package/template/pages/MultiCart/index.js +24 -0
- package/template/pages/MultiCheckout/index.js +86 -10
- package/template/pages/MultiOrdersDetails/index.js +9 -4
- package/_bundles/0.ordering-ui.a97bdaf67c563ada4c74.js +0 -1
- package/_bundles/ordering-ui.a97bdaf67c563ada4c74.js +0 -2
|
@@ -1,22 +1,98 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import {
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
import { useParams } from 'react-router-dom'
|
|
3
3
|
import { MultiCheckout as MultiCheckoutController } from '../../../src/themes/five/src/components/MultiCheckout'
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
|
-
import { useEvent } from 'ordering-components-external'
|
|
5
|
+
import { useEvent, useLanguage, useOrder } from 'ordering-components-external'
|
|
6
|
+
import { loadStripe } from '@stripe/stripe-js'
|
|
6
7
|
|
|
7
8
|
export const MultiCheckout = (props) => {
|
|
8
9
|
const [events] = useEvent()
|
|
9
|
-
const
|
|
10
|
+
const { cartUuid } = useParams()
|
|
11
|
+
const [, { confirmMultiCarts }] = useOrder()
|
|
12
|
+
const [, t] = useLanguage()
|
|
13
|
+
const stripePayments = ['stripe', 'stripe_connect', 'stripe_direct', 'google_pay', 'apple_pay']
|
|
14
|
+
const [errors, setErrors] = useState([])
|
|
15
|
+
|
|
16
|
+
const actionsBeforePlace = async (paymethod, cart) => {
|
|
17
|
+
if (stripePayments.includes(paymethod.gateway)) {
|
|
18
|
+
try {
|
|
19
|
+
const stripe = await loadStripe(paymethod.paymethod?.credentials?.publishable || paymethod?.paymethod?.credentials?.publishable_key)
|
|
20
|
+
const result = await stripe.confirmCardPayment(cart.paymethod_data.result.client_secret)
|
|
21
|
+
if (result?.paymentIntent?.status === 'succeeded') {
|
|
22
|
+
try {
|
|
23
|
+
const confirmCartRes = await confirmMultiCarts(cartUuid)
|
|
24
|
+
if (confirmCartRes.error) {
|
|
25
|
+
setErrors([confirmCartRes.error.message])
|
|
26
|
+
}
|
|
27
|
+
if (confirmCartRes.result.order?.uuid) {
|
|
28
|
+
events.emit('go_to_page', { page: 'multi_orders', params: { orderId: confirmCartRes.result.order.uuid }, replace: true })
|
|
29
|
+
}
|
|
30
|
+
} catch (error) {
|
|
31
|
+
setErrors([error.message])
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (result?.error?.code === 'payment_intent_authentication_failure') {
|
|
35
|
+
setErrors([t('CART_STATUS_CANCEL_MESSAGE', 'The payment has not been successful, please try again')])
|
|
36
|
+
}
|
|
37
|
+
return true
|
|
38
|
+
} catch (error) {
|
|
39
|
+
setErrors([error.message])
|
|
40
|
+
}
|
|
41
|
+
} else if (paymethod.gateway === 'stripe_redirect') {
|
|
42
|
+
const stripe = await loadStripe(paymethod.paymethod?.credentials?.publishable)
|
|
43
|
+
const confirmOption = {
|
|
44
|
+
bancontact: {
|
|
45
|
+
name: 'confirmBancontactPayment',
|
|
46
|
+
type: 1
|
|
47
|
+
},
|
|
48
|
+
alipay: {
|
|
49
|
+
name: 'confirmAlipayPayment',
|
|
50
|
+
type: 2
|
|
51
|
+
},
|
|
52
|
+
giropay: {
|
|
53
|
+
name: 'confirmGiropayPayment',
|
|
54
|
+
type: 1
|
|
55
|
+
},
|
|
56
|
+
ideal: {
|
|
57
|
+
name: 'confirmIdealPayment',
|
|
58
|
+
type: 2
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
const params = {
|
|
62
|
+
1: {
|
|
63
|
+
payment_method: {
|
|
64
|
+
billing_details: cart.paymethod_data.data.owner
|
|
65
|
+
},
|
|
66
|
+
return_url: `${window.location.origin}/checkout/${cartUuid}`
|
|
67
|
+
},
|
|
68
|
+
2: {
|
|
69
|
+
return_url: `${window.location.origin}/checkout/${cartUuid}`
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
stripe[confirmOption[paymethod.data.type]?.name](
|
|
73
|
+
cart.paymethod_data.result.client_secret,
|
|
74
|
+
params[confirmOption[paymethod.data.type]?.type]
|
|
75
|
+
).then((result) => {
|
|
76
|
+
if (result?.error) {
|
|
77
|
+
setErrors([...errors, result?.error?.message])
|
|
78
|
+
}
|
|
79
|
+
}).catch((e) => {
|
|
80
|
+
setErrors([...errors, e?.message || e?.toString()])
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
}
|
|
10
84
|
const multiCheckoutProps = {
|
|
11
85
|
...props,
|
|
86
|
+
cartUuid,
|
|
87
|
+
errors,
|
|
88
|
+
clearErrors: () => setErrors([]),
|
|
12
89
|
onRedirectPage: (data) => events.emit('go_to_page', data),
|
|
13
|
-
onPlaceOrderClick: (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
})
|
|
18
|
-
}
|
|
90
|
+
onPlaceOrderClick: (order) => {
|
|
91
|
+
events.emit('go_to_page', { page: 'multi_orders', params: { orderId: order?.id } })
|
|
92
|
+
},
|
|
93
|
+
actionsBeforePlace
|
|
19
94
|
}
|
|
95
|
+
|
|
20
96
|
return (
|
|
21
97
|
<>
|
|
22
98
|
<HelmetTags page='multi_checkout' />
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { useHistory, useParams } from 'react-router-dom'
|
|
3
3
|
import { MultiOrdersDetails as MultiOrdersDetailsController } from '../../../src/themes/five/src/components/MultiOrdersDetails'
|
|
4
4
|
import { HelmetTags } from '../../components/HelmetTags'
|
|
5
5
|
import { useEvent } from 'ordering-components-external'
|
|
6
6
|
|
|
7
7
|
export const MultiOrdersDetails = (props) => {
|
|
8
8
|
const [events] = useEvent()
|
|
9
|
-
const {
|
|
9
|
+
const { orderId } = useParams()
|
|
10
|
+
const history = useHistory()
|
|
11
|
+
|
|
10
12
|
const multiOrdersDetailsProps = {
|
|
11
13
|
...props,
|
|
12
|
-
|
|
13
|
-
onRedirectPage: () => events.emit('go_to_page', { page: 'search' })
|
|
14
|
+
orderId: orderId,
|
|
15
|
+
onRedirectPage: () => events.emit('go_to_page', { page: 'search' }),
|
|
16
|
+
handleOrderRedirect: () => {
|
|
17
|
+
history.push('/profile/orders')
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
return (
|
|
16
21
|
<>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(window.webpackJsonpOrderingUI=window.webpackJsonpOrderingUI||[]).push([[0],{625:function(t,n,e){"use strict";function i(t,n){var e,i;return"boolean"==typeof(null==n?void 0:n.enabled)?n.enabled:null===(i=null===(e=null==t?void 0:t.__default)||void 0===e?void 0:e.enabled)||void 0===i||i}e.d(n,"a",(function(){return i}))},728:function(t,n,e){"use strict";e.r(n),e.d(n,"LegacyDestination",(function(){return w})),e.d(n,"ajsDestinations",(function(){return _}));var i=e(4),r=e(58),o=e(47),a=e(21),s=e(103),c=e(66),u=e(625),d=e(193),l=e(198),h=e(48),v=e(72),f=e(194),b=e(87),p=e(108);function g(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function y(t,n){return void 0===n&&(n=!1),n?btoa(t).replace(/=/g,""):void 0}function j(t,n,e,r){return Object(i.b)(this,void 0,void 0,(function(){var o,a,s,c,u,d;return Object(i.d)(this,(function(l){switch(l.label){case 0:o=g(n),a=y(o,r),s=Object(b.b)(),c="".concat(s,"/integrations/").concat(null!=a?a:o,"/").concat(e,"/").concat(null!=a?a:o,".dynamic.js.gz"),l.label=1;case 1:return l.trys.push([1,3,,4]),[4,Object(p.a)(c)];case 2:return l.sent(),function(t,n,e){var r,o;try{var a=(null!==(o=null===(r=null===window||void 0===window?void 0:window.performance)||void 0===r?void 0:r.getEntriesByName(t,"resource"))&&void 0!==o?o:[])[0];a&&n.stats.gauge("legacy_destination_time",Math.round(a.duration),Object(i.f)([e],a.duration<100?["cached"]:[],!0))}catch(t){}}(c,t,n),[3,4];case 3:throw u=l.sent(),t.stats.gauge("legacy_destination_time",-1,["plugin:".concat(n),"failed"]),u;case 4:return d=window["".concat(o,"Deps")],[4,Promise.all(d.map((function(t){return Object(p.a)(s+t+".gz")})))];case 5:return l.sent(),window["".concat(o,"Loader")](),[2,window["".concat(o,"Integration")]]}}))}))}function O(t){return"object"===Object.prototype.toString.call(t).slice(8,-1).toLowerCase()}function m(t,n){return Object(i.b)(this,void 0,void 0,(function(){var e,r=this;return Object(i.d)(this,(function(s){switch(s.label){case 0:return e=[],Object(o.a)()?[2,n]:[4,Object(l.a)((function(){return n.length>0&&Object(o.b)()}),(function(){return Object(i.b)(r,void 0,void 0,(function(){var r,o;return Object(i.d)(this,(function(i){switch(i.label){case 0:return(r=n.pop())?[4,Object(c.a)(r,t)]:[2];case 1:return o=i.sent(),o instanceof a.a||e.push(r),[2]}}))}))}))];case 1:return s.sent(),e.map((function(t){return n.pushWithBackoff(t)})),[2,n]}}))}))}var w=function(){function t(t,n,e,r,o){void 0===e&&(e={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=t,this.version=n,this.settings=Object(i.a)({},e),this.disableAutoISOConversion=r.disableAutoISOConversion||!1,this.integrationSource=o,this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=r,this.buffer=r.disableClientPersistence?new h.b(4,[]):new v.a(4,"dest-".concat(t)),this.scheduleFlush()}return t.prototype.isLoaded=function(){return this._ready},t.prototype.ready=function(){var t;return null!==(t=this.onReady)&&void 0!==t?t:Promise.resolve()},t.prototype.load=function(t,n){var e;return Object(i.b)(this,void 0,void 0,(function(){var r,o,a=this;return Object(i.d)(this,(function(i){switch(i.label){case 0:return this._ready||void 0!==this.onReady?[2]:null===(e=this.integrationSource)||void 0===e?[3,1]:(o=e,[3,3]);case 1:return[4,j(t,this.name,this.version,this.options.obfuscate)];case 2:o=i.sent(),i.label=3;case 3:r=o,this.integration=function(t,n,e){var i;"Integration"in t?(t({user:function(){return e.user()},addIntegration:function(){}}),i=t.Integration):i=t;var r=new i(n);return r.analytics=e,r}(r,this.settings,n),this.onReady=new Promise((function(t){a.integration.once("ready",(function(){a._ready=!0,t(!0)}))})),this.onInitialize=new Promise((function(t){a.integration.on("initialize",(function(){a._initialized=!0,t(!0)}))}));try{t.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(n){throw t.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),n}return[2]}}))}))},t.prototype.unload=function(t,n){return function(t,n,e){return Object(i.b)(this,void 0,void 0,(function(){var r,o,a,s;return Object(i.d)(this,(function(i){return r=Object(b.b)(),o=g(t),a=y(t,e),s="".concat(r,"/integrations/").concat(null!=a?a:o,"/").concat(n,"/").concat(null!=a?a:o,".dynamic.js.gz"),[2,Object(p.b)(s)]}))}))}(this.name,this.version,this.options.obfuscate)},t.prototype.addMiddleware=function(){for(var t,n=[],e=0;e<arguments.length;e++)n[e]=arguments[e];this.middleware=(t=this.middleware).concat.apply(t,n)},t.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&(Object(o.a)()||!1===this._ready||!1===this._initialized)},t.prototype.send=function(t,n,e){var r,o;return Object(i.b)(this,void 0,void 0,(function(){var s,c,d,l,h,v;return Object(i.d)(this,(function(b){switch(b.label){case 0:if(this.shouldBuffer(t))return this.buffer.push(t),this.scheduleFlush(),[2,t];if(s=null===(o=null===(r=this.options)||void 0===r?void 0:r.plan)||void 0===o?void 0:o.track,c=t.event.event,s&&c&&"Segment.io"!==this.name){if(d=s[c],!Object(u.a)(s,d))return t.updateEvent("integrations",Object(i.a)(Object(i.a)({},t.event.integrations),{All:!1,"Segment.io":!0})),t.cancel(new a.b({retry:!1,reason:"Event ".concat(c," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t];if(t.updateEvent("integrations",Object(i.a)(Object(i.a)({},t.event.integrations),null==d?void 0:d.integrations)),(null==d?void 0:d.enabled)&&!1===(null==d?void 0:d.integrations[this.name]))return t.cancel(new a.b({retry:!1,reason:"Event ".concat(c," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,t]}return[4,Object(f.applyDestinationMiddleware)(this.name,t.event,this.middleware)];case 1:if(null===(l=b.sent()))return[2,t];h=new n(l,{traverse:!this.disableAutoISOConversion}),t.stats.increment("analytics_js.integration.invoke",1,["method:".concat(e),"integration_name:".concat(this.name)]),b.label=2;case 2:return b.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,e,h)]:[3,4];case 3:b.sent(),b.label=4;case 4:return[3,6];case 5:throw v=b.sent(),t.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(e),"integration_name:".concat(this.name)]),v;case 6:return[2,t]}}))}))},t.prototype.track=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(n){return[2,this.send(t,r.Track,"track")]}))}))},t.prototype.page=function(t){var n;return Object(i.b)(this,void 0,void 0,(function(){var e=this;return Object(i.d)(this,(function(i){return(null===(n=this.integration)||void 0===n?void 0:n._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return e.send(t,r.Page,"page")}))]}))}))},t.prototype.identify=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(n){return[2,this.send(t,r.Identify,"identify")]}))}))},t.prototype.alias=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(n){return[2,this.send(t,r.Alias,"alias")]}))}))},t.prototype.group=function(t){return Object(i.b)(this,void 0,void 0,(function(){return Object(i.d)(this,(function(n){return[2,this.send(t,r.Group,"group")]}))}))},t.prototype.scheduleFlush=function(){var t=this;this.flushing||setTimeout((function(){return Object(i.b)(t,void 0,void 0,(function(){var t;return Object(i.d)(this,(function(n){switch(n.label){case 0:return this.flushing=!0,t=this,[4,m(this,this.buffer)];case 1:return t.buffer=n.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},t}();function _(t,n,e,r,o){var a,c;if(void 0===n&&(n={}),void 0===e&&(e={}),Object(s.b)())return[];t.plan&&((e=null!=e?e:{}).plan=t.plan);var u=null!==(c=null===(a=t.middlewareSettings)||void 0===a?void 0:a.routingRules)&&void 0!==c?c:[],l=t.integrations,h=e.integrations,v=Object(d.a)(t,null!=e?e:{}),f=null==o?void 0:o.reduce((function(t,n){var e;return Object(i.a)(Object(i.a)({},t),((e={})[function(t){return("Integration"in t?t.Integration:t).prototype.name}(n)]=n,e))}),{}),b=new Set(Object(i.f)(Object(i.f)([],Object.keys(l).filter((function(t){return function(t,n){var e,i=n.type,r=n.bundlingStatus,o=n.versionSettings,a="unbundled"!==r&&("browser"===i||(null===(e=null==o?void 0:o.componentTypes)||void 0===e?void 0:e.includes("browser")));return!t.startsWith("Segment")&&"Iterable"!==t&&a}(t,l[t])})),!0),Object.keys(f||{}).filter((function(t){return O(l[t])||O(null==h?void 0:h[t])})),!0));return Array.from(b).filter((function(t){return!function(t,n){var e=!1===n.All&&void 0===n[t];return!1===n[t]||e}(t,n)})).map((function(t){var n=function(t){var n,e,i,r;return null!==(r=null!==(e=null===(n=null==t?void 0:t.versionSettings)||void 0===n?void 0:n.override)&&void 0!==e?e:null===(i=null==t?void 0:t.versionSettings)||void 0===i?void 0:i.version)&&void 0!==r?r:"latest"}(l[t]),i=new w(t,n,v[t],e,null==f?void 0:f[t]);return u.filter((function(n){return n.destinationName===t})).length>0&&r&&i.addMiddleware(r),i}))}}}]);
|