1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8830,92282,45818,6716,15778,50619,4600],{162534:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/deliveries/cart",function(){return r(103002)}])},839625:function(e,t,r){"use strict";r.d(t,{S:function(){return f}});var n,o,i=r(456552),a=r(447178),l=r(671718),c=r(140224),u=r(699219),s=r(900253);function d(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var f=function(e,t){var r=(0,a.Z)().fetch,n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,(0,c.O)()),o=[u.Z["assets.animation"],n];return(0,i.useQuery)(o,function(){return p(n,o,r)},t)},p=(n=function(e,t){var r,n,o=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(i){switch(i.label){case 0:return r=e.brand,n=e.fileName,[4,(o.length>2&&void 0!==o[2]?o[2]:l.Z)((0,s.V)("/assets/".concat(r,"/animations/").concat(n)),t,{fetchSpanAttributes:{"request.backend_service":"s3","request.backend_action":"get-animation-asset"}},{skipGetAuth:!0},{baseURL:""})];case 1:return[2,i.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){d(i,r,o,a,l,"next",e)}function l(e){d(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)})},12309:function(e,t,r){"use strict";r.d(t,{O:function(){return n}});var n={SETTINGS:function(e){return"/payments/customers/".concat(e,"/credit-application/settings")},DELIVERY_WEEK:function(e,t){return"/payments/customers/".concat(e,"/credit-application/delivery-week/").concat(t)}}},606984:function(e,t,r){"use strict";r.d(t,{r:function(){return y}});var n,o,i=r(456552),a=r(671718),l=r(447178),c=r(699219),u=r(140224),s=r(12309);function d(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function p(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var b=(n=function(e,t){var r,n,o,i,l,c,u=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(d){switch(d.label){case 0:return r=e.systemCountry,n=e.locale,o=e.customerUUID,i=e.deliveryWeek,l=e.enabled,[4,(u.length>2&&void 0!==u[2]?u[2]:a.Z)(s.O.DELIVERY_WEEK(o,i),t,{method:"PUT",headers:{"Content-Type":"application/json"},query:{country:r,locale:n},data:{enabled:l},fetchSpanAttributes:{"request.backend_service":"balance-service","request.backend_action":"set-credit-application-delivery-week"}})];case 1:if(!(c=d.sent()).ok)throw Error("HTTP error! status: ".concat(c.status));return[2]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){d(i,r,o,a,l,"next",e)}function l(e){d(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),y=function(e){var t=(0,l.Z)().fetch,r=(0,i.useQueryClient)(),n=(0,u.O)();return(0,i.useMutation)(p(f({mutationFn:function(e){var r=f({},e,n),o=[c.Z["cash-credit.creditApplicationDeliveryWeek"],r];return b(r,o,t)}},e),{onSuccess:function(t,n,o){var i;r.setQueriesData({queryKey:[c.Z["cash-credit.creditApplicationSettings"]]},function(e){return e?p(f({},e),{optedInWeek:n.enabled?n.deliveryWeek:null}):e}),null==e||null===(i=e.onSuccess)||void 0===i||i.call(e,t,n,o)}}))}},91745:function(e,t,r){"use strict";r.d(t,{Z:function(){return m}});var n,o,i=r(456552),a=r(671718),l=r(447178),c=r(699219),u=r(140224),s=r(12309),d=r(892940),f=d.z.object({group:d.z.enum
1(["control","variation"]),optedInWeek:d.z.string().nullable()});function p(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var y=(n=function(e,t){var r,n,o,i=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(l){switch(l.label){case 0:return r=e.systemCountry,n=e.locale,o=e.customerUUID,[4,(i.length>2&&void 0!==i[2]?i[2]:a.Z)(s.O.SETTINGS(o),t,{method:"PUT",headers:{"Content-Type":"application/json"},query:{country:r,locale:n},fetchSpanAttributes:{"request.backend_service":"balance-service","request.backend_action":"get-credit-application-settings"}})];case 1:return[4,l.sent().json()];case 2:var c;return[2,(c=l.sent(),f.parse(c))]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){p(i,r,o,a,l,"next",e)}function l(e){p(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),m=function(e,t){var r=(0,l.Z)().fetch,n=b({},e,(0,u.O)()),o=[c.Z["cash-credit.creditApplicationSettings"],n];return(0,i.useQuery)(b({queryKey:o,queryFn:function(){return y(n,o,r)}},t))}},54879:function(e,t,r){"use strict";r.d(t,{N:function(){return f}});var n,o,i=r(456552),a=r(671718),l=r(447178),c=r(699219),u=r(140224);function s(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var d=(n=function(e,t){var r,n,o,i=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(l){switch(l.label){case 0:return r=i.length>2&&void 0!==i[2]?i[2]:a.Z,n=e.customerUUID,o=e.systemCountry,[4,r("/payments/customers/".concat(n,"/balance?country=").concat(o),t,{query:{country:o,business_unit:o},fetchSpanAttributes:{"request.backend_service":"balance-service","request.backend_action":"get-cash-credit-balance"}})];case 1:return[2,l.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){s(i,r,o,a,l,"next",e)}function l(e){s(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),f=function(e,t){var r=e.customerUUID,n=(0,l.Z)().fetch,o=(0,u.O)(),a=o.locale,s=o.systemCountry,f=[c.Z["cash-credit.balance"],{systemCountry:s,locale:a}];return(0,i.useQuery)(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({queryKey:f,queryFn:function(){return d({customerUUID:r,systemCountry:s},f,n)},suspense:!1,retry:function(e,t){var r,n=null===(r=t.response)||void 0===r?void 0:r.status;return!!(e<3&&n&&n<400)}},t))}},190174:function(e,t,r){"use strict";r.d(t,{x:function(){return p}});var n,o,i=r(456552),a=r(671718),l=r(447178),c=r(699219),u=r(140224);function s(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function d(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var f=(n=function(e,t){var r,n=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(o){switch(o.label){case 0:return[4,(n.length>2&&void 0!==n[2]?n[2]:a.Z)("/api/plans",t,{method:"GET",query:{includeCanceled:null!==(r=null==e?void 0:e.includeCanceled)&&void 0!==r&&r},parentSpan:null==e?void 0:e.parentSpan,headers:{"Content-Type":"application/json"}})];case 1:return[2,o.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){s(i,r,o,a,l,"next",e)}function l(e){s(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.Z)().fetch,n=(0,u.O)(),o=[c.Z["customer-plans.get"],e];return(0,i.useQuery)(o,function(){return f(d({},e,n),o,r)},d({suspense:!1},t))}},485062:function(e,t,r){"use strict";r.d(t,{M6:function(){return y},iq:function(){return v}});var n,o,i=r(456552),a=r(671718),l=r(447178),c=r(699219),u=r(140224);function s(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function d(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){s(i,n,o,a,l,"next",e)}function l(e){s(i,n,o,a,l,"throw",e)}a(void 0)})}}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function p(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}
1var b=(n=d(function(e,t){var r,n,o,i,l,c,u,s,d,b,y,m,v,g=arguments;return p(this,function(p){switch(p.label){case 0:return r=e.systemCountry,n=e.locale,o=e.customerPlanId,i=e.subscriptionId,l=e.parentSpan,u=void 0===(c=e.legacyVoucherCode)?null:c,d=void 0===(s=e.defaultProductSKU)?null:s,y=void 0===(b=e.legacyVoucherShippedDiscountedBoxes)?null:b,v=void 0===(m=e.additionalIncludeParams)?"":m,[4,(g.length>2&&void 0!==g[2]?g[2]:a.Z)("/customer-wallet/v1/standalone",t,{method:"GET",headers:{"Content-Type":"application/json"},query:f({country:r,locale:n,subscription:i,customerPlanID:o,amazonPrimeEnabled:!0,externalPartnerBenefits:!0,include:"addon,subscription".concat(v)},u?{legacyVoucherCode:u}:{},d?{defaultProductSKU:d}:{},y?{legacyVoucherShippedDiscountedBoxes:y}:{}),parentSpan:l})];case 1:return[2,p.sent().json()]}})}),function(e,t){return n.apply(this,arguments)}),y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.Z)().fetch,n=f({},e,(0,u.O)()),o=[c.Z["customer-wallet.standaloneWallet"],n];return(0,i.useQuery)(o,function(){return b(f({},e,n),o,r)},t)},m=(o=d(function(e,t){var r,n,o,i,l,c,u,s,d,b,y,m,v,g=arguments;return p(this,function(p){switch(p.label){case 0:return r=e.systemCountry,n=e.locale,o=e.customerPlanId,i=e.subscriptionId,l=e.parentSpan,u=void 0===(c=e.legacyVoucherCode)?null:c,d=void 0===(s=e.defaultProductSKU)?null:s,y=void 0===(b=e.legacyVoucherShippedDiscountedBoxes)?null:b,v=void 0===(m=e.additionalIncludeParams)?"":m,[4,(g.length>2&&void 0!==g[2]?g[2]:a.Z)("/customer-wallet/v2/standalone",t,{method:"GET",headers:{"Content-Type":"application/json"},query:f({country:r,locale:n,subscription:i,customerPlanID:o,amazonPrimeEnabled:!0,externalPartnerBenefits:!0,include:"addon,subscription".concat(v)},u?{legacyVoucherCode:u}:{},d?{defaultProductSKU:d}:{},y?{legacyVoucherShippedDiscountedBoxes:y}:{}),parentSpan:l})];case 1:return[2,p.sent().json()]}})}),function(e,t){return o.apply(this,arguments)}),v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.Z)().fetch,n=f({},e,(0,u.O)()),o=[c.Z["customer-wallet.standaloneWallet.v2"],n];return(0,i.useQuery)(o,function(){return m(f({},e,n),o,r)},t)}},563181:function(e,t,r){"use strict";r.d(t,{P:function(){return y}});var n,o,i=r(456552),a=r(671718),l=r(447178),c=r(140224),u=r(699219),s=r(881821);function d(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function p(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var b=(n=function(e,t){var r,n,o,i,l,c,u,d=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(b){switch(b.label){case 0:return n=void 0===(r=e.limit)?1e5:r,o=e.systemCountry,i=e.locale,[4,(d.length>2&&void 0!==d[2]?d[2]:a.Z)("/api/customers/me/orders",t,{query:{country:o,locale:i,limit:n},fetchSpanAttributes:{"request.backend_service":"api-v2","request.backend_action":"get-customer-orders"}})];case 1:return[4,b.sent().json()];case 2:if(l=b.sent(),"FJ"===o&&(u=null==l?void 0:null===(c=l.items)||void 0===c?void 0:c.filter(function(e){return!(0,s.Ui)(e)})))return[2,p(f({},l),{items:u,count:l.count-(l.count-u.length)})];return[2,l]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){d(i,r,o,a,l,"next",e)}function l(e){d(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),y=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.Z)().fetch,n=f({},e,(0,c.O)()),o=(0,c.C)(null==t?void 0:t.enabled),a=[u.Z["customer.orders"],n];return(0,i.useQuery)(a,function(){return b(n,a,r)},p(f({},t),{enabled:o}))}},691093:function(e,t,r){"use strict";r.d(t,{T:function(){return f}});var n,o,i=r(456552),a=r(671718),l=r(447178),c=r(140224),u=r(699219);function s(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var d=(n=function(e,t){var r,n,o,i,l=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(c){switch(c.label){case 0:return r=l.length>2&&void 0!==l[2]?l[2]:a.Z,n=e.systemCountry,o=e.customerUuid,i=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["systemCountry","customerUuid"]),[4,r("/v1/payments/customers/".concat(o,"/transactions"),t,{method:"GET",query:{businessUnit:n.toUpperCase(),hfWeek:i.hfWeek,isEnriched:i.isEnriched},parentSpan:i.parentSpan})];case 1:return[2,c.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){s(i,r,o,a,l,"next",e)}function l(e){s(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.Z)().fetch,n=(0,c.O)(),o=[u.Z["payments.transactions"],e];return(0,i.useQuery)(o,function(){return d(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,n),o,r)},t)}},785785:function(e,t,r){"use strict";r.d(t,{Qm:function(){return m},DR:function(){return y}});var n,o,i=r(456552),a=r(671718),l=r(447178),c=r(140224),u=r(699219),s=r(189452),d=r(127061);function f(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var b=(n=function(e,t){var r,n,o,i,l,c,u=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(s){switch(s.label){case 0:return n=void 0===(r=e.count)?6:r,o=e.page,i=e.locale,l=e.systemCountry,c=e.parentSpan,[4,(u.length>2&&void 0!==u[2]?u[2]:a.Z)("/recipes/recipes",t,{query:{take:n,skip:(o-1)*n,country:l,locale:i},parentSpan:c,fetchSpanAttributes:{"request.backend_service":"shopping-platform-service","request.backend_action":"get-all-recipes"}})];case 1:return[2,s.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){f(i,r,o,a,l,"next",e)}function l(e){f(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),y=function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(0,l.Z)().fetch,a=p({},e,(0,c.O)()),s=[u.Z["recipe.all"],a];return(0,i.useQuery)(s,function(){return b(a,s,o)},(t=p({},n),r=r={keepPreviousData:!0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))},m=function(e){var t,r,n,o,i=e.isMultiRegion,a=e.region,l=(0,s.Z)(),c=(t="FOOD_CONTENT_HUB_URL",r=((0,s.Z)().VERCEL_REGION||"").toUpperCase(),n="".concat(t,"_").concat(r),o=d.env[t]||"",d.env[n]||o),u="production"===l.NODE_ENV?"prod":"stage";if(a)switch(a){case"syd1":return"https://food-content-hub-api.oc.growth.".concat(u,".int.hellofresh.io");case"iad1":return"https://food-content-hub-api.na.growth.".concat(u,".int.hellofresh.io");default:return l.FOOD_CONTENT_HUB_URL}return i&&c?c:l.FOOD_CONTENT_HUB_URL}},574502:function(e,t,r){"use strict";r.d(t,{G:function(){return p},r:function(){return b}});var n,o,i=r(456552),a=r(671718),l=r(447178),c=r(140224),u=r(699219),s=r(752323);function d(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var p=(n=function(e,t){var r,n,o,i,l=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(c){switch(c.label){case 0:return r=e.id,n=e.systemCountry,o=e.locale,i=e.parentSpan,[4,(l.length>2&&void 0!==l[2]?l[2]:a.Z)("/recipes/recipes/".concat(r),t,{query:{country:n,locale:o},parentSpan:i,fetchSpanAttributes:{"request.backend_service":"shopping-platform-service","request.backend_action":"get-recipe-by-id","recipe.id":r}})];case 1:return[2,c.sent().json()]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){d(i,r,o,a,l,"next",e)}function l(e){d(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,l.Z)().fetch,n=null==e?void 0:e.isFoodContentHub,o=null==e?void 0:e.isMultiRegion,a=(null==e?void 0:e.region)||"",d=f({id:e.id},(0,c.O)()),b=n?[u.Z["foodContentHubRecipe.byId"],d]:[u.Z["recipe.byId"],d];return(0,i.useQuery)(b,function(){var e,t;return n?(0,s.i)((e=f({},d),t=t={isMultiRegion:o,region:a},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e),b,r):p(d,b,r)},t)}},752323:function(e,t,r){"use strict";r.d(t,{i:function(){return s}}),r(456552);var n,o,i=r(608139),a=r(671718),l=r(574502),c=r(785785);function u(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var s=(n=function(e,t){var r,n,o,u,s,d,f,p,b,y,m,v,g,h,O=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(w){switch(w.label){case 0:r=e.id,n=e.systemCountry,o=e.locale,u=e.parentSpan,s=e.isMultiRegion,d=e.region,f=e.shouldUseUpdatedCanonical,p=e.futureUrlStrategyReleaseDate,b=O.length>2&&void 0!==O[2]?O[2]:a.Z,y={},f&&(y.withUpdatedCanonical="true"),p&&(y.futureUrlStrategyReleaseDate=p),m=(0,i.stringify)(y,{addQueryPrefix:!0,encode:!1}),v="/recipes/".concat(r,"-").concat(o).concat(m),w.label=1;case 1:return w.trys.push([1,3,,4]),[4,b(v,t,{query:{country:n,locale:o},parentSpan:u,fetchSpanAttributes:{"request.backend_service":"food-content-hub","request.backend_action":"get-recipe-by-id","re
1cipe.id":r}},void 0,{baseURL:"".concat((0,c.Qm)({isMultiRegion:s,region:d}),"/api")})];case 2:if(!(g=w.sent()).ok)throw Error("Failed to fetch recipe with id ".concat(r," from Food Content Hub"));return[2,g.json()];case 3:return h=w.sent(),null==u||u.setAttribute("get-foodContentHub-recipe-by-id-error",h),[2,(0,l.G)({id:r,systemCountry:n,locale:o,parentSpan:u},t,b=a.Z)];case 4:return[2]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){u(i,r,o,a,l,"next",e)}function l(e){u(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)})},736026:function(e,t,r){"use strict";r.d(t,{D:function(){return d}});var n,o,i=r(671718),a=r(26124),l=r(140224),c=r(699219);function u(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var s=(n=function(e,t){var r,n,o,a=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(l){switch(l.label){case 0:if(r=a.length>2&&void 0!==a[2]?a[2]:i.Z,n=e.parentSpan,"string"!=typeof(o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["parentSpan"])).code||!o.code)return[2,{}];l.label=1;case 1:return l.trys.push([1,3,,4]),[4,r("/vouchers/".concat(o.code),t,{method:"GET",query:{country:o.systemCountry,locale:o.locale},parentSpan:n,fetchSpanAttributes:{"request.backend_service":"voucher-validation-service","request.backend_action":"voucher-details",voucherCode:o.code}})];case 2:return[2,l.sent().json()];case 3:throw l.sent();case 4:return[2]}})},o=function(){var e=this,t=arguments;return new Promise(function(r,o){var i=n.apply(e,t);function a(e){u(i,r,o,a,l,"next",e)}function l(e){u(i,r,o,a,l,"throw",e)}a(void 0)})},function(e,t){return o.apply(this,arguments)}),d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e,(0,l.O)()),n=[c.Z["voucher.info"],r];return(0,a.Z)(n,function(e){return s(r,n,e)},t)}},826746:function(e,t,r){"use strict";function n(e){var t=e.grandTotal,r=e.cashCreditAmount,n=e.shouldNotApplyCredits,o=e.isNextModifiableWeek,i=e.multiplier,a=Math.round(100*t),l=a;return o&&r>0&&a>0&&!n&&(a>r?l-=r:l=0),Math.floor(l*i/100)}r.d(t,{K:function(){return n}})},165591:function(e,t,r){"use strict";
1var n=r(390977),o=r(301813);t.Z=function(e){var t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,n.Z)();if(!e||!i)return!1;var a=null!==(t=(0,o.Z)(i))&&void 0!==t?t:{},l=a.year,c=a.week,u=null!==(r=(0,o.Z)(e))&&void 0!==r?r:{},s=u.year,d=u.week;return l<s||l===s&&c<d}},989830:function(e,t,r){"use strict";var n=r(976555),o=r(546430);t.Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,n.Z)();return e===t||(0,o.Z)(e,t)}},307935:function(e,t,r){"use strict";r.d(t,{cl:function(){return p},aw:function(){return m},rB:function(){return f},hC:function(){return v},xg:function(){return y},lN:function(){return u},D6:function(){return b},y9:function(){return d},ww:function(){return s}});var n=r(340332),o=r(391957),i=function(e){var t=e.discountAmount,r=e.discountType,o=e.country,i=e.locale,a=e.decimals;if("percent"===r)return"".concat(Math.round((t||0)/100),"%");var l=t/100%1!=0;return(0,n.xG)(t,{country:o,locale:i,decimals:l?void 0===a?2:a:0})},a=function(e){return!!e.some(function(e){return"mealbox"===e.applicableTo})},l=function(e){return!!e.every(function(e){return"freeAddons"===e.applicableTo})},c=function(e){var t=e.units,r=void 0===t?null:t,n=e.source,i=e.unlimited,c=e.campaign,u=e.type;return r?"amazonPrime"===(void 0===n?"unspecified":n)?o.hJ.AMAZON_PRIME_SHIPPING:r.find(function(e){var t;return a(t=e.benefits)&&!!t.some(function(e){return"shipping"===e.applicableTo})})?o.hJ.MEALBOX_VOUCHER:r.find(function(e){return!!e.benefits.every(function(e){return"addons"===e.applicableTo})})?o.hJ.ADDON_VOUCHER:r.find(function(e){return!!e.benefits.every(function(e){return"premiumSurcharge"===e.applicableTo})})?o.hJ.PREMIUM_VOUCHER:r.find(function(e){return a(e.benefits)})?o.hJ.MEALBOX_VOUCHER:r.find(function(e){return!!e.benefits.every(function(e){return"shipping"===e.applicableTo})})?o.hJ.MEALBOX_FREE_SHIPPING:(null==c?void 0:c.type)==="freeSmoothie"&&r.find(function(e){return l(e.benefits)})?o.hJ.SMOOTHIE_BOX:(null==c?void 0:c.type)==="caraway"?o.hJ.CARAWAY:(null==c?void 0:c.type)==="tefal"||(null==c?void 0:c.type)==="tefalpan"?o.hJ.TEFAL:(null==c?void 0:c.type)==="avios"?o.hJ.AVIOS:(null==c?void 0:c.type)==="tlcGifts"?o.hJ.TLC_GIFTS:(null==c?void 0:c.type)==="panGifts"?o.hJ.PAN_GIFTS:(null==c?void 0:c.type)==="cuttingBoardGifts"?o.hJ.CUTTING_BOARD_GIFTS:(null==c?void 0:c.type)==="misenKnife"?o.hJ.MISEN_KNIFE:(null==c?void 0:c.type)==="paramount"?o.hJ.PARAMOUNT:(null==c?void 0:c.type)==="zwilling_knives"?o.hJ.ZWILLING_KNIVES:(null==c?void 0:c.type)==="withings_scale"?o.hJ.WITHINGS_SCALE:(null==c?void 0:c.type)==="graza_olive_oil"?o.hJ.GRAZA_OLIVE_OIL:(null==c?void 0:c.type)==="endy_pillow_blanket"?o.hJ.ENDY_PILLOW_BLANKET:i&&r.find(function(e){return l(e.benefits)})?o.hJ.ADDON_FOR_LIFE:!i&&r.find(function(e){return l(e.benefits)})?o.hJ.ADDON_FOR_MULTI_WEEK:(null==c?void 0:c.type)&&"externalPartner"===u?o.hJ.EXTERNAL_PARTNER_BENEFIT:void 0:void 0},u=function(e){return e.promiseData&&c(null==e?void 0:e.promiseData)||null},s=function(e){var t,r,n,o;return{hasFreeStandardShipping:(null==e?void 0:null===(r=e.currentPromiseUnit)||void 0===r?void 0:null===(t=r.benefits)||void 0===t?void 0:t.some(function(e){return"shipping"===e.applicableTo}))||null,hasOnlyFreeStandardShipping:(null==e?void 0:null===(o=e.currentPromiseUnit)||void 0===o?void 0:null===(n=o.benefits)||void 0===n?void 0:n.every(function(e){return"shipping"===e.applicableTo}))||null}},d=function(e){var t,r,n=e.budget,o=e.country,a=e.locale,l=null!==(t=null==n?void 0:n.type)&&void 0!==t?t:null,c=null!==(r=null==n?void 0:n.value)&&void 0!==r?r:null;if(!c||!l)return{discountType:null,discountValue:null,rawDiscountValue:null};var u=i({country:o,locale:a,discountAmount:c,discountType:l});return{discountType:l,discountValue:u,rawDiscountValue:c}}
1,f=function(e){var t=e.benefitDelivery,r=e.weekDelivery;return(null==t?void 0:t.hfWeek)?{id:null==t?void 0:t.hfWeek,deliveryDate:null==r?void 0:r.deliveryDate,isPaused:(null==r?void 0:r.status)==="PAUSED"}:null},p=function(e){var t=e.delivery,r=e.promises,n=e.units;return null==n?void 0:n.map(function(e){var n,o,i,a=(null==r?void 0:r.find(function(t){return t.id===e.promiseId}))||null,l=(null==a?void 0:null===(i=a.units)||void 0===i?void 0:i.find(function(t){return(null==t?void 0:t.box)===(null==e?void 0:e.box)}))||null;return n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),o=o={promiseData:a,delivery:t,currentPromiseUnit:l},Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(o)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(o)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(o,e))}),n})},b=function(e){var t,r=e.promise,n=e.currentBox,o=e.country,i=e.locale;return(null==r?void 0:null===(t=r.units)||void 0===t?void 0:t.length)?r.units.map(function(e){var t,r,a,l=(null==e?void 0:null===(t=e.benefits)||void 0===t?void 0:t.some(function(e){return"shipping"===e.applicableTo}))||null,c=(null==e?void 0:null===(r=e.benefits)||void 0===r?void 0:r.every(function(e){return"shipping"===e.applicableTo}))||null;return{discountBoxNumber:e.box,isCurrent:e.box===n||void 0,isDelivered:e.used||void 0,discountValue:d({budget:(null===(a=e.benefits)||void 0===a?void 0:a[0].budget)||null,country:o,locale:i}).discountValue,hasFreeStandardShipping:l,hasOnlyFreeStandardShipping:c}}):null},y=function(e,t){return null!=e&&!!e.length&&!t&&!e.some(function(e){return"inactive"===e.status})},m=function(e){return(null==e?void 0:e.isSwappable)&&!e.isSelected&&e.isSwappable?"small":"medium"},v=function(e,t){return t?"paused":"inactive"===e?"conflicted":"earned"}},103002:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return uH},default:function(){return uG}});var n,o,i,a,l,c,u,s,d,f,p,b,y,m,v,g,h,O,w,x=r(687800),P=r(827378),S=r(31748),k=r(203666),j=r(631540),C=r(184883),Z=r(126589),A=r(548295),_=r(768587),D=r(164528),I=r(95719);(n=b||(b={}))[n.Default=0]="Default",n[n.Success=1]="Success",n[n.Error=2]="Error";var E={success:5e3},T="cart",B={TRACE:"open-product-details",START:"open-product-details-start",END:"open-product-details-end"},M={cart:"cart",store:"store"};(o=y||(y={}))[o.Meals=0]="Meals",o[o.AddOns=1]="AddOns",(i=m||(m={}))[i.MenuAddOns=0]="MenuAddOns",i[i.Account=1]="Account",M.cart;var R="".concat("https://www.hellofresh.com/assets","/hellofresh/my-deliveries-fragment/cart"),L="cart_errors_sold-out_message",q={title:"".concat(M.cart,".pfand.price.title"),accessibilityLabel:"".concat(M.cart,".pfand.price.accessibility.label")};(a=v||(v={}))[a.Saving=0]="Saving",a[a.SoldOut=1]="SoldOut",a[a.Modular=2]="Modular",a[a.AtItemLimit=3]="AtItemLimit",a[a.AtTypeLimit=4]="AtTypeLimit",a[a.AtOverallLimit=5]="AtOverallLimit",a[a.NoQuantityOption=6]="NoQuantityOption",a[a.MealSwapDisabled=7]="MealSwapDisabled",a[a.OneOffChangeDisabled=8]="O
1neOffChangeDisabled",(l=g||(g={}))[l.Disabled=0]="Disabled",l[l.Available=1]="Available",l[l.Unavailable=2]="Unavailable",l[l.Paid=3]="Paid",l[l.Failed=4]="Failed";var U="SNAP",X=function(){var e=(0,D.ZP)("store"),t=e.translate,r=e.translateRaw;return(0,P.useEffect)(function(){(0,I.B1)("".concat(T,".").concat("error-view"))},[]),(0,x.tZ)(A.Z,{componentName:"cart-error-layout",children:(0,x.BX)(_.xu,{my:["lg-3","xxl"],display:"flex",flexDirection:"column",alignItems:"center",children:[(0,x.tZ)(_.xu,{mb:"md-2",children:(0,x.tZ)("img",{src:"https://media.hellofresh.com/store/box-alert.svg",width:"100px",height:"100px",alt:r("store.error-handler.server-response-error.title")})}),(0,x.BX)(_.xu,{mb:"md-2",textAlign:"center",children:[(0,x.tZ)(_.xv,{as:"p",type:"body-lg-regular",children:t("store.error-handler.server-response-error.title")}),(0,x.tZ)(_.xv,{as:"p",type:"body-md-regular",children:t("store.error-handler.server-response-error.description")})]}),(0,x.tZ)(_.zx.Secondary,{size:"sm",appearance:"negative",width:"unset",onClick:function(){return window.location.reload()},children:t("store.error-handler.server-response-error.action")})]})})},N=r(268481),F=function(e){var t,r,n=e.children,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children"]);return(0,x.tZ)(_.xu,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({position:"relative",width:["94%","640px","1144px"],display:"flex",flexDirection:"column",gap:"md-1",py:["xs","md-1"]},o),r=r={children:n},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))};function W(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var z=function(e){var t,r,n=e.backgroundColor,o=e.borderRadius,i=e.animate,a=e.m,l=e.mb,c=e.ml,u=e.as,s=e["aria-label"],d=e.children,f=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["backgroundColor","borderRadius","animate","m","mb","ml","as","aria-label","children"]);return(0,x.tZ)(_.xu,(t=W({"data-test-id":"skeleton",position:"relative",backgroundColor:void 0===n?"neutral.400":n,borderRadius:void 0===o?"border-radius-sm":o,overflow:"hidden",m:void 0===a?"zero":a,mb:void 0===l?"zero":l,ml:void 0===c?"zero":c,as:u,"aria-label":s},f),r=r={pseudo:{"::after":W({position:"absolute",content:'""',top:0,right:0,bottom:0,left:0,transform:" translateX(-100%)",backgroundImage:"linear-gradient(90deg, rgba(255,255,255,0) 0, rgba(255,255,255,0.2) 20%, rgba(255,255,255,0.5) 60%, rgba(255,255,255,0))"},void 0!==i&&i?{animation:"shimmer 2s infinite"}:{})},__dangerouslySetCustomCSS:{"@keyframes shimmer":{"100%":{transform:"translateX(100%)"}}},children:d},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}
1)(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))},V=function(){var e=(0,D.ZP)("cart").translateRaw;return(0,x.tZ)(_.xu,{position:"sticky",top:"0",zIndex:"99",backgroundColor:"alias.page-background.default",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",children:(0,x.BX)(F,{py:"sm-1",children:[(0,x.tZ)(_.xu,{position:"absolute",height:"calc(100% - 24px)",display:"flex",alignItems:"center",children:(0,x.tZ)(_.PZ,{"data-test-id":"cart-revamped-close-button",disabled:!0,"aria-label":e("".concat(M.cart,".revamp.header.close-button"))})}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"xxs",alignItems:"center",children:[(0,x.tZ)(z,{height:"29px",width:"144px",as:"h1",children:(0,x.tZ)(_.xu,{as:"span",position:"absolute",width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",children:e("cart.loading-layout.title")})}),(0,x.tZ)(z,{height:"19px",width:"172px"})]})]})})},H=function(){return(0,x.BX)(_.xu,{gap:"md-2",display:"flex",flexDirection:"column",children:[(0,x.tZ)(z,{height:"29px",width:"90px"}),(0,x.tZ)(z,{height:"19px",width:"188px"})]})},G=function(){return(0,x.BX)(_.xu,{display:"flex",gap:"sm-2",py:"xs",children:[(0,x.tZ)(z,{minWidth:["72px","90px"],width:["72px","90px"],height:["72px","90px"]}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"xs",width:"fill-available",children:[(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",children:[(0,x.tZ)(z,{width:["163px","400px"],height:"24px"}),(0,x.tZ)(z,{width:"44px",height:"24px"})]}),(0,x.BX)(_.xu,{display:"flex",alignItems:"center",gap:"xs",children:[(0,x.tZ)(z,{width:"97px",height:"40px"}),(0,x.tZ)(z,{width:"23px",height:"24px"}),(0,x.tZ)(z,{width:"42px",height:"24px"})]})]})]})},Q=function(){var e=(0,D.ZP)("cart").translateRaw;return(0,x.BX)(_.xu,{role:"region","aria-label":e("".concat(M.cart,".loading-fallback.container.aria-label")),height:"100%",width:["100%","100%","723px"],mb:["md-2","md-2","lg-2"],display:"flex",flexDirection:"column",gap:"md-1",children:[(0,x.BX)(_.xu,{display:"flex",gap:"xs",alignItems:"center",children:[(0,x.tZ)(z,{width:"90px",height:"30px"}),(0,x.tZ)(z,{width:"20px",height:"30px"})]}),(0,x.tZ)(_.xu,{role:"region","aria-label":e("".concat(M.cart,".loading-fallback-aria-label")),overflowY:"auto",maxHeight:"100%",children:[1,2,3].map(function(e,t){return(0,x.tZ)(G,{},"cart-loading-row-".concat(t))})}),(0,x.tZ)(z,{width:"100%",height:"64px"})]})},J=function(){var e=(0,N.Sj)();return(0,x.BX)(_.xu,{gap:"sm-2",display:"flex",flexDirection:"column",children:[(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",children:[(0,x.tZ)(z,{width:["100px","235px"],height:"30px"}),(0,x.BX)(_.xu,{display:"flex",gap:"sm-2",children:[(0,x.tZ)(z,{width:"90px",height:"30px"}),"mobile"!==e&&(0,x.BX)(_.xu,{display:"flex",gap:"xs",children:[(0,x.tZ)(z,{width:"30px",height:"30px"}),(0,x.tZ)(z,{width:"30px",height:"30px"})]})]})]}),(0,x.tZ)(_.xu,{display:"flex",gap:"md-2",overflowX:"hidden",flex:1,children:[1,2,3,4,5].map(function(e,t){return(0,x.tZ)(z,{width:"222px",minWidth:"222px",height:"232px"},"cart-upsell-loading-".concat(t))})})]})},K=function(){return(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",children:[(0,x.tZ)(z,{width:"214px",height:"24px"}),(0,x.tZ)(z,{width:"30px",height:"24px"})]})},Y=function(){return(0,x.BX)(_.xu,{gap:"md-2",display:"flex",flexDirection:"column",children:[(0,x.tZ)(z,{width:"130px",height:"30px"}),(0,x.BX)(_.xu,{gap:"md-1",display:"flex",flexDirection:"column",children:[(0,x.tZ)(z,{width:"100%",height:"64px"}),(0,x.tZ)(_.xu,{display:"flex",flexDirection:"column",gap:"xs",children:[1,2,3].map(function(e,t){return(0,x.tZ)(K,{},"cart-price-row-loading-".concat(t))})})]}),(0,x.tZ)(z,{width:"100%",height:"40px"})]})},$=(0,P.memo)(function(){var e=(0,N.Sj)(),t=(0,D.ZP)("cart").translateRaw;return(0,P.useEffect)(function(){(0,I.B1)("".concat(T,".").concat("loading-view"))},[]),(0,x.BX)(_.xu,{height:"100dvh",backgroundColor:"alias.page-background.default","data-test-id":"cart-loading-layout",role:"main","aria-label":t("".concat(M.cart,".loading-layout.aria-label")),children:[(0,x.tZ)(V,{}),(0,x.tZ)(_.xu,{role:"region","aria-label":t("".concat(M.cart,".loading-layout.content.aria-label")),lineHeight:"line-height-md-1",display:"flex",flexDirection:["column","column","row"],width:"100%",justifyContent:"center",alignItems:"center",children:(0,x.BX)(F,{gap:["zero","zero","md-2"],pb:["zero","zero","md-1"],children:[(0,x.BX)(_.xu,{display:"flex",gap:["md-2","md-2","lg-1"],flexDirection:["column","column","row"],children:[(0,x.tZ)(Q,{}),(0,x.BX)(_.xu,{role:"complementary","aria-label":t("".concat(M.cart,".loading-layout.sidebar.aria-label")),width:["100%","100%","373px"],display:"flex",flexDirection:["column-reverse","column-reverse","column"],gap:["md-2","md-2","md-3"],position:["relative","relative","sticky"],top:[0,0,"98px"],children:[(0,x.tZ)(Y,{}),(0,x.tZ)(H,{}),"desktop"!==e&&(0,x.tZ)(J,{})]})]}),"desktop"===e&&(0,x.tZ)(J,{})]})})]})}),ee=r(385021),et=r(469386),er=r(547723),en=r(127239),eo=r(581340),ei=r(456552),ea=r(699219),el=P.createContext({}),ec=el.Provider,eu=function(){return(0,P.useContext)(el)},es=P.createContext({}),ed=es.Provider,ef=function(){return(0,P.useContext)(es)},ep=P.createContext({}),eb=ep.Provider,ey=function(){return(0,P.useContext)(ep)};function em(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var ev=function(){var e,t=(0,eo.t)(),r=(0,ei.useQueryClient)(),n=eu().products,o=ey().oneOffSku,i=ef().wasSelectionChanged,a=(0,en.n6)().delivery,l=(0,P.useCallback)(function(e){var t=ea.Z["customer.deliveries"],n=ea.Z["customer.delivery"];e&&r.removeQueries(n),r.removeQueries(t)},[r]),c=(0,P.useCallback)(function(){r.invalidateQueries([ea.Z["menu.byWeek"]],{predicate:function(e){return e.queryKey[1].week===t.query.week}})},[r,t.query.week]);return(0,P.useCallback)((e=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){return i&&(c(),n.current&&l(o!==a.product.handle)),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){em(i,n,o,a,l,"next",e)}function l(e){em(i,n,o,a,l,"throw",e)}a(void 0)})}),[a.product.handle,c,o,n,l,i])},eg=function(e){try{return btoa(JSON.stringify(e))}catch(e){return}},eh=function(e){try{return JSON.parse(atob(e))}catch(e){return}},eO=function(){var e=ef().state,t=e.addOns.items;return eg({meals:e.courses.items.map(function(e){return{id:e.id,index:e.index,quantity:e.quantity}}),addOns:t.map(function(e){return{id:e.id,index:e.index,quantity:e.quantity}})})},ew=function(){var e=eO(),t=ey().oneOffSku;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e?{selections:e}:{},t?{sku:t}:{},ef().wasSelectionChanged?{wasSelectionChanged:"true"}:{})},ex=function(){var e=(0,eo.t)(),t=ev(),r=ew();(0,P.useEffect)(function(){e.beforePopState(function(n){var o,i,a,l=n.as,c=null==l?void 0:null===(o=l.split("?"))||void 0===o?void 0:o[0];if(c!==(null===(a=e.asPath)||void 0===a?void 0:null===(i=a.split("?"))||void 0===i?void 0:i[0])){t();var u=new URLSearchParams(r).toString();if(u&&"/store"===c)return e.replace("".concat(l,"&").concat(u)),!1}return!0})},[r,t,e])},eP=r(214172),eS=r(725627),ek=r(723897),ej=P.createContext({}),eC=ej.Provider,eZ=function(){return(0,P.useContext)(ej)},eA=P.createContext({}),e_=eA.Provider,eD=function(){return(0,P.useContext)(eA)},eI=r(949322),eE=r(463171),eT=r(148159),eB=r.n(eT),eM=r(138354),eR=r.n(eM),eL=r(277425),eq=r(822897),eU=r(199216);function eX(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function eN(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function eF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){eN(e,t,r[t])})}return e}function eW(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function ez(e){return function(e){if(Array.isArray(e))return eX(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return eX(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return eX(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var eV=function(e){return e.addOns.map(function(t){return{addOn:t,groupType:e.groupType,sku:e.sku}})},eH=function(e,t,r){var n,o,i,a,l=r.find(function(t){return t.defaultCourseIndex===e.index||(t.variations||[]).some(function(t){return t.index===e.index})}),c={addOns:t.filter(function(e){var t,r=e.index;return null==l?void 0:null===(t=l.addOns)||void 0===t?void 0:t.some(function(e){return e.index===r})}).map(function(e){return{quantityOptions:e.quantityOptions}}),isMainCourse:(null==l?void 0:l.defaultCourseIndex)===e.index,variations:(null==l?void 0:l.variations)||[]};return{type:y.Meals,id:e.recipe.id,index:e.index,name:e.recipe.name,quantity:null!==(a=null===(n=e.selection)||void 0===n?void 0:n.quantity)&&void 0!==a?a:0,isSoldOut:!!e.isSoldOut,imageSrc:(0,eL.Z)(e.recipe.image,eq.b.website),limit:null===(o=e.selection)||void 0===o?void 0:o.limit,modularity:c,priceInfo:e.charge?eW(eF({},e.charge),{text:null===(i=e.recipe.label)||void 0===i?void 0:i.text}):{},itemPrice:(0,eU.z)(e.itemPrice),nutrition:e.recipe.nutrition}},eG=function(e,t,r){var n,o,i,a,l,c,u,s,d=e.addOn,f=e.groupType,p=e.sku,b=[];d.quantityOptions&&!d.priceCatalog&&(b=d.quantityOptions.map(function(e){return{price:e.totalAmount,people:e.people,quantity:e.quantity}}));var m=d.priceCatalog,v=e0(d),g=v.promoLabel,h=v.recipeLabel,O=null!==(u=null===(o=d.selection)||void 0===o?void 0:null===(n=o.courses)||void 0===n?void 0:n.map(function(e){var n,o,i,a=r.find(function(t){return t.defaultCourseIndex===e.index||(t.variations||[]).some(function(t){return t.index===e.index})});return null!==(i=null===(o=t.find(function(e){var t;return ez(null!==(t=null==a?void 0:a.variations.map(function(e){return e.index}))&&void 0!==t?t:[]).concat([null==a?void 0:a.defaultCourseIndex]).includes(e.index)}))||void 0===o?void 0:null===(n=o.recipe)||void 0===n?void 0:n.id)&&void 0!==i?i:""}).filter(function(e){return e}))&&void 0!==u?u:[];return{type:y.AddOns,id:d.recipe.id,index:d.index,name:d.recipe.name,quantity:(null===(i=d.selection)||void 0===i?void 0:i.oneOffQuantity)||!(null===(a=d.selection)||void 0===a?void 0:a.skipped)&&(null===(l=d.selection)||void 0===l?void 0:l.preselectedQuantity)||0,isSoldOut:!!d.isSoldOut,imageSrc:(0,eL.Z)(d.recipe.image,eq.b.website),pairedWith:O,sku:p,preselectedQuantity:null!==(s=null===(c=d.selection)||void 0===c?void 0:c.preselectedQuantity)&&void 0!==s?s:0,categoryName:f,categoryType:f,label:g||h,priceCatalog:(m||b)&&{basePrice:(null==m?void 0:m.basePrice)||(null==b?void 0:b.length)&&b[0].price,pricePerContent:null==m?void 0:m.pricePerContent,pricePerQuantity:(null==m?void 0:m.pricePerQuantity)||b,displayPricePerContent:null==m?void 0:m.displayPricePerContent,displayStrikethrough:null==m?void 0:m.displayStrikethrough},quantityOptions:(d.quantityOptions||[]).map(function(e){return{people:e.people,totalAmount:e.totalAmount,quantity:e.quantity}}),tags:d.recipe.tags,limit:d.maxQuantity}},eQ=function(e,t){var r;return eW(eF({},e),eN({},t.groupType,null!==(r=t.selectionLimit)&&void 0!==r?r:0))},eJ=function(e){var t=e.handle,r=e.specs,n=e.price,o=e.oneOffPrice,i=e.shippingPrice,a=e.isAvailableForExtraMeals;
1return{sku:t,specs:eB()(r,["recurrency"]),price:n,oneOffPrice:o,shippingPrice:i,isAvailableForExtraMeals:a}},eK=function(e,t){var r,n,o,i,a,l,c,u=e.priceCatalog,s=e.quantityOptions,d=[];s&&!e.priceCatalog&&(d=s.map(function(e){var r,n;return{price:e.totalAmount,people:e.people,quantity:e.quantity,discountPercentage:null==t?void 0:null===(n=t.priceCatalog)||void 0===n?void 0:null===(r=n.pricePerQuantity.find(function(t){return t.quantity===e.quantity}))||void 0===r?void 0:r.discountPercentage}}));var f=e0(t),p=f.promoLabel,b=f.recipeLabel;return{product:eW(eF({},e),{type:"MARKET_ITEM",index:e.index,isSoldOut:!1,recipe:eW(eF({},e),{label:p||b,tags:[],image:e.imageSrc,headline:e.name}),selection:{quantity:0,isSkipped:(null==t?void 0:null===(r=t.selection)||void 0===r?void 0:r.skipped)||!1},pricing:eW(eF({},e.priceCatalog),{basePrice:(null==u?void 0:u.basePrice)||(null==d?void 0:d.length)&&d[0].price,displayStrikethrough:null!==(i=null==u?void 0:u.displayStrikethrough)&&void 0!==i&&i,displayPricePerContent:null!==(a=null==u?void 0:u.displayPricePerContent)&&void 0!==a&&a,pricePerContent:(null==u?void 0:u.pricePerContent)?eW(eF({},null==u?void 0:u.pricePerContent),{quantity:1}):void 0,isPriceFixedPerQuantity:null!==(l=null==t?void 0:null===(n=t.priceCatalog)||void 0===n?void 0:n.isPriceFixedPerQuantity)&&void 0!==l&&l,displayPricePerVolume:null!==(c=null==t?void 0:null===(o=t.priceCatalog)||void 0===o?void 0:o.displayPricePerVolume)&&void 0!==c&&c,pricePerQuantity:(null==u?void 0:u.pricePerQuantity)||d})})}},eY=function(e,t,r){var n,o,i,a,l,c=e.priceCatalog,u=e.quantityOptions,s=[];u&&!c&&(s=u.map(function(e){return{price:e.totalAmount,people:e.people,quantity:e.quantity}}));var d=(null==c?void 0:null===(n=c.additionalInformation)||void 0===n?void 0:n.promotionalLabel)&&{text:null==c?void 0:null===(o=c.additionalInformation)||void 0===o?void 0:o.promotionalLabel.text,foregroundColor:null==c?void 0:null===(i=c.additionalInformation)||void 0===i?void 0:i.promotionalLabel.foregroundColor,backgroundColor:null==c?void 0:null===(a=c.additionalInformation)||void 0===a?void 0:a.promotionalLabel.backgroundColor,handle:"price-catalog-promo-label",displayLabel:!0};return{type:"MARKET_ITEM",index:e.index,isSoldOut:!!e.isSoldOut,groupType:e.categoryType,quantity:null!==(l=null==r?void 0:r.quantity)&&void 0!==l?l:0,productFamilyLimit:t(e.categoryType),pricing:(c||s)&&{basePrice:(null==c?void 0:c.basePrice)||(null==s?void 0:s.length)&&s[0].price,pricePerContent:null==c?void 0:c.pricePerContent,pricePerVolume:null==c?void 0:c.pricePerVolume,pricePerQuantity:(null==c?void 0:c.pricePerQuantity)||s,isPriceFixedPerQuantity:null==c?void 0:c.isPriceFixedPerQuantity,displayPricePerContent:null==c?void 0:c.displayPricePerContent,displayPricePerVolume:null==c?void 0:c.displayPricePerVolume,displayStrikethrough:null==c?void 0:c.displayStrikethrough,pairingQuantityOptions:"modularity"===e.categoryType?e.quantityOptions:void 0},label:d||e.recipe.label,limit:e.maxQuantity}},e$=function(e,t){var r,n;return{type:"CORE_ITEM",subType:"MEALKIT",index:e.index,isSoldOut:!!e.isSoldOut,quantity:null!==(n=null==t?void 0:t.quantity)&&void 0!==n?n:0,limit:null===(r=e.selection)||void 0===r?void 0:r.limit,productFamilyLimit:!1,pricing:e.charge&&{amount:e.charge.totalAmount,reason:e.charge.reason,strategy:e.charge.strategy,unitAmou
1nt:e.charge.unitAmount,totalAmount:e.charge.totalAmount,baseTotalAmount:e.charge.baseTotalAmount,baseUnitAmount:e.charge.baseUnitAmount},tags:e.recipe.tags,label:e.recipe.label}},e0=function(e){if(!e)return{promoLabel:void 0,recipeLabel:void 0};var t,r,n,o,i=e.priceCatalog;return{promoLabel:(null==i?void 0:null===(t=i.additionalInformation)||void 0===t?void 0:t.promotionalLabel)&&{text:null==i?void 0:null===(r=i.additionalInformation)||void 0===r?void 0:r.promotionalLabel.text,foregroundColor:null==i?void 0:null===(n=i.additionalInformation)||void 0===n?void 0:n.promotionalLabel.foregroundColor,backgroundColor:null==i?void 0:null===(o=i.additionalInformation)||void 0===o?void 0:o.promotionalLabel.backgroundColor,handle:"price-catalog-promo-label",displayLabel:!0},recipeLabel:e.recipe.label?{foregroundColor:e.recipe.label.foregroundColor,backgroundColor:e.recipe.label.backgroundColor,text:e.recipe.label.text,handle:e.recipe.label.handle,displayLabel:e.recipe.label.displayLabel}:void 0}},e1=function(e){var t,r,n,o,i,a,l=(0,eE.Z)("rnsm_flexible_addon_pairing").isEnabled,c=eD().menu,u=ef().state.addOns.items,s=null==c?void 0:null===(r=c.meals)||void 0===r?void 0:null===(t=r.find(function(t){return t.recipe.id===e}))||void 0===t?void 0:t.relatedCategory,d=(0,eI.h)({relatedCategorySlug:null!=s?s:null,categories:null!==(i=null==c?void 0:null===(n=c.categories)||void 0===n?void 0:n.categories)&&void 0!==i?i:[],addOnGroups:null!==(a=null==c?void 0:null===(o=c.addOns)||void 0===o?void 0:o.groups)&&void 0!==a?a:[]}).flexibleAddOns;return{isEnabled:l,addOns:(0,P.useMemo)(function(){return d.map(function(e){var t,r,n,o=e.addOn,i=eG({addOn:o,groupType:e.groupType,sku:e.sku},[],[]),a=u.find(function(e){return e.id===o.recipe.id});return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},i),r=r={quantity:null!==(n=null==a?void 0:a.quantity)&&void 0!==n?n:0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t})},[d,u])}},e2=r(324423),e6=r(96516),e3=r(77641),e4=function(e){var t,r=ef().state,n=r.addOns.items,o=r.courses.items,i=eD().menu;return(0,P.useMemo)(function(){var t;return{course:{menu:null==i?void 0:i.meals.find(function(t){return t.recipe.id===e}),cart:o.find(function(t){return t.id===e})},addOn:{menu:null==i?void 0:null===(t=i.addOns)||void 0===t?void 0:t.groups.flatMap(function(e){var t=e.addOns,r=e.groupType;return t.map(function(e){var t,n;return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),n=n={categoryType:r},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t})}).find(function(t){return t.recipe.id===e}),cart:n.find(function(t){return t.id===e})}}},[n,o,null==i?void 0:null===(t=i.addOns)||void 0===t?void 0:t.groups,null==i?void 0:i.meals,e])},e5=function(e){var t,r,n=e4(e.id).addOn.menu,o=eK(e,n).product;return o.selection=(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},o.selection),r=r={quantity:e.quantity},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t),{product:o,hideActionButtons:!1,servings:0}};function e7(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var e8=function(e){var t,r,n=e.addOn,o=e.onAddClick,i=e.onIncreaseClick,a=e.onDecreaseClick,l=e.callback,c=e.index,u=e.mutationDisableReason,s=e.source,d=e5(n),f=d.product,p=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(d,["product"]),b=v.AtOverallLimit===u||v.AtItemLimit===u,y=v.AtTypeLimit===u,m=(0,P.useCallback)(function(e){var t=e.event;switch(t.type){case"CARD_CLICKED":l(t,{type:"product_click",payload:e7({id:n.id,recipePosition:c+1},s&&{source:s})});break;case"ADD":if(b||y)return;o();break;case"INCREASE_QUANTITY":if(b||y)return;null==i||i();break;case"DECREASE_QUANTITY":null==a||a();break;default:return null}},[c,l,n.id,s,o,i,a,b,y]);return(0,x.tZ)(e3.Z,(t=e7({product:f,variant:"SMALL_EDIT"},p),r=r={featureFlags:{isAutoSaveEnabled:{enabled:!0,variables:{isAutoSaving:u===v.Saving}}},hasReachedMaximum:b,hasReachedRecipeFamilyLimit:y,handleAction:function(e){return m({event:e})}},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))},e9=r(90104),te=r.n(e9);function tt(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var tr=(0,r(575085).Z)("active-journey-cart-config",(c=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){return[2,r.e(53978).then(r.bind(r,953978))]})},function(){var e=this,t=arguments;return new Promise(function(r,n){var o=c.apply(e,t);function i(e){tt(o,r,n,i,a,"next",e)}function a(e){tt(o,r,n,i,a,"throw",e)}i(void 0)})})),tn=tr.ProjectConfigProvider,to=(tr.configMiddleware,tr.useConfig);tr.getConfigFromSSRPayload;var ti=function(){var e,t,r=(0,en.n6)().subscription;return to().factorCrossSellingProductFamily===(null==r?void 0:null===(t=r.productType)||void 0===t?void 0:null===(e=t.family)||void 0===e?void 0:e.handle)},ta=function(){var e=(0,eo.t)(),t=e.push,r=e.query,n=r.week,o=r.subscriptionId,i=to(),a=i.redirectUriByReferrer,l=i.defaultRedirectUri,c=ey().preserved,u=ti(),s=ev(),d=ew();return function(e){var r,i=e.referrer,f=e.query;s();var p=["store","xsell-store"].includes(i)?d:{};t({pathname:null!==(r=a[i])&&void 0!==r?r:l,query:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({week:n},u?{}:{subscriptionId:o},te()(f)?c.query:{},p,f)},void 0,{shallow:!0})}},tl=r(37017);function tc(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var tu=(0,tl.cn)(!1),ts=function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,tl.KO)(tu))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return tc(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tc(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],n=t[1];return{isOpen:r,open:function(){return n(!0)},close:function(){return n(!1)}}},td=r(871961),tf=r(158256),tp=r(887824),tb="StorefrontHeader",ty=function(){var e=(0,tp.Z)().push,t=ef().quantities,r=(0,en.n6)(),n=r.subscription,o=r.delivery,i=null==o?void 0:o.id,a=null==n?void 0:n.id,l=null==t?void 0:t.courses;return{trackDisplay:function(){e({event_name:"ShoppingActionsHeader_Cancel",gaEventCategory:tb,gaEventAction:"exitMealChoice|popUp|display",gaEventLabel:i,meals_selected:l})},trackDiscardKeepEditing:function(){e({event_name:"ShoppingActionsHeader_Cancel",gaEventCategory:tb,gaEventAction:"exitMealChoice|popUp|keepEditing",gaEventLabel:"".concat(i,"|").concat(a),meals_selected:l})},trackDiscardSelection:function(){e({event_name:"ShoppingActionsHeader_Discard",gaEventCategory:"cancelMealChoice",gaEventAction:"cancel",gaEventLabel:"".concat(i,"|").concat(a),meals_selected:l})}}},tm=function(){var e,t=(0,D.ZP)("store").translateRaw,r=(0,td.d)(tf.nK.genericModal),n=r.setModalState,o=r.openModal,i=r.closeModal,a=eu(),l=a.isBelowMinimum,c=a.belowMinimumDelta,u=a.products,s=ty(),d=s.trackDisplay,f=s.trackDiscardKeepEditing,p=s.trackDiscardSelection;return(0,P.useCallback)(function(e){return new Promise(function(r,a){if(!l||"store"===e)return r();var s,b=c>1?"plural":"singular";n({testId:"discard-changes-prompt",title:t("store.autosave.below-minimum-modal-header"),subtitle:t("store.autosave.below-minimum-modal-body-plural",{amountOfMeals:null===(s=u.min)||void 0===s?void 0:s.specs.meals}),confirmButtonText:t("store.autosave.below-minimum-modal-confirm-".concat(b),{amountOfMeals:c}),cancelButtonText:t("store.autosave.below-minimum-modal-dismiss"),onClose:function(){f(),a(),i()},onDismiss:function(){p(),r(),i()},onConfirm:function(){f(),a(),i()}}),o(),d()})},[l,c,n,t,null===(e=u.min)||void 0===e?void 0:e.specs.meals,o,i,d,f,p])},tv=r(482204),tg=r.n(tv),th=r(60074),tO=r(206329),tw=r(447054),tx=r(410690),tP=r.n(tx),tS=r(331227),tk=r(52130),tj=r(882493),tC=function(e,t){return"PAUSED"===e?tO.NZ.Paused:"DELIVERED"===e?tO.NZ.Delivered:t?tO.NZ.PostCutoff:tO.NZ.BeforeCutoff},tZ=function(e,t){return e===tj.m.ReadyToEat||t?tO.k9.RTE:tO.k9.MealKit},tA=function(){var e=(0,tk.L3)().trackJanusEvent,t=(0,tS.Z)(),r=ti(),n=(0,en.n6)(),o=n.subscription,i=n.delivery;return{trackCloseCartIconClick:(0,P.useCallback)(function(){try{var n=tg()(i.cutoffDate);e(tO.yg.janusEvent({hellofreshDeliveryWeek:tO.yg.hellofreshDeliveryWeek({deliveryWeek:i.id,deliveryWeekStatus:tC(i.state,n),nextDeliveryWeek:(0,tw.Z)(tP()(i.id,o.deliveryInterval))}),plan:tO.yg.plan({planId:o.customerPlanId,planType:tZ(t,r),planStatus:o.isActive?tO.b5.Active:tO.b5.Cancelled,subscriptionSku:o.product.sku,deliveryFrequency:String(o.deliveryInterval)}),uiComponent:tO.yg.uiComponent({uiComponentName:"cart-revamped-close-button",uiComponentLabel:null})}))}catch(e){(0,th.Tb)(e,{tags:{event:"Cart_Close_Cart_Icon_Click",component:"useCartCloseCartIconClickSnowplowEvent"}})}},[t,i.cutoffDate,i.id,i.state,r,o.customerPlanId,o.deliveryInterval,o.isActive,o.product.sku,e])}},t_=r(227413),tD=function(e){return e?e.screenReader?e.screenReader:e.visual&&e.visual.replace(/<[^>]*>/g,"").replace(/\s+/g," ").trim()||null:null},tI=function(){var e=(0,tk.L3)().trackJanusEvent,t=(0,tS.Z)(),r=ti(),n=(0,en.n6)(),o=n.subscription,i=n.delivery;return{trackAddMoreButtonClick:(0,P.useCallback)(function(n){try{var a=tg()(i.cutoffDate);e(t_.vR.janusEvent({hellofreshDeliveryWeek:t_.vR.hellofreshDeliveryWeek({deliveryWeek:i.id,deliveryWeekStatus:tC(i.state,a),nextDeliveryWeek:(0,tw.Z)(tP()(i.id,o.deliveryInterval))}),plan:t_.vR.plan({planId:o.customerPlanId,planType:tZ(t,r),planStatus:o.isActive?t_.b5.Active:t_.b5.Cancelled,subscriptionSku:o.product.sku,deliveryFrequency:String(o.deliveryInterval)}),uiComponent:t_.vR.uiComponent({uiComponentName:"add-more-nudge",uiComponentLabel:n})}
1))}catch(e){(0,th.Tb)(e,{tags:{event:"Cart_Add_More_Button_Click",component:"useCartAddMoreButtonClickSnowplowEvent"}})}},[t,i.cutoffDate,i.id,i.state,r,o.customerPlanId,o.deliveryInterval,o.isActive,o.product.sku,e])}},tE=r(63590),tT=function(){var e=(0,tk.L3)().trackJanusEvent,t=(0,tS.Z)(),r=ti(),n=(0,en.n6)(),o=n.subscription,i=n.delivery;return{trackContinueShoppingButtonClick:(0,P.useCallback)(function(n){try{var a=tg()(i.cutoffDate);e(tE.XA.janusEvent({hellofreshDeliveryWeek:tE.XA.hellofreshDeliveryWeek({deliveryWeek:i.id,deliveryWeekStatus:tC(i.state,a),nextDeliveryWeek:(0,tw.Z)(tP()(i.id,o.deliveryInterval))}),plan:tE.XA.plan({planId:o.customerPlanId,planType:tZ(t,r),planStatus:o.isActive?tE.b5.Active:tE.b5.Cancelled,subscriptionSku:o.product.sku,deliveryFrequency:String(o.deliveryInterval)}),uiComponent:tE.XA.uiComponent({uiComponentName:"cart-continue-button",uiComponentLabel:n})}))}catch(e){(0,th.Tb)(e,{tags:{event:"Cart_Continue_Shopping_Button_Click",component:"useCartContinueShoppingButtonClickSnowplowEvent"}})}},[t,i.cutoffDate,i.id,i.state,r,o.customerPlanId,o.deliveryInterval,o.isActive,o.product.sku,e])}},tB=r(210841),tM=function(){var e=(0,tk.L3)().trackJanusEvent,t=(0,tS.Z)(),r=ti(),n=(0,en.n6)(),o=n.subscription,i=n.delivery;return{trackSelectCartIconClick:(0,P.useCallback)(function(){try{var n=tg()(i.cutoffDate);e(tB.yO.janusEvent({hellofreshDeliveryWeek:tB.yO.hellofreshDeliveryWeek({deliveryWeek:i.id,deliveryWeekStatus:tC(i.state,n),nextDeliveryWeek:(0,tw.Z)(tP()(i.id,o.deliveryInterval))}),planEntities:[tB.yO.plan({planId:o.customerPlanId,planType:tZ(t,r),planStatus:o.isActive?tB.b5.Active:tB.b5.Cancelled,subscriptionSku:o.product.sku,deliveryFrequency:String(o.deliveryInterval)})],uiComponent:tB.yO.uiComponent({uiComponentName:"cart-button",uiComponentLabel:null})}))}catch(e){(0,th.Tb)(e,{tags:{event:"Cart_Select_Cart_Icon_Click",component:"useCartSelectCartIconClickSnowplowEvent"}})}},[t,i.cutoffDate,i.id,i.state,r,o.customerPlanId,o.deliveryInterval,o.isActive,o.product.sku,e])}};function tR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tL(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tq(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){tL(e,t,r[t])})}return e}function tU(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var tX=function(){var e,t=(0,tp.Z)().push,r=tA().trackCloseCartIconClick,n=tM().trackSelectCartIconClick,o=tI().trackAddMoreButtonClick,i=tT().trackContinueShoppingButtonClick,a=(0,eo.t)().query,l=a.week,c=a.referrer,u=a.subscriptionId,s=(0,j.C)(),d=eu().products,f=ey().preserved,p=(0,en.n6)(),b=p.subscription,y=p.delivery,m=ef(),v=m.wasSelectionChanged,g=m.state,h=g.courses.items,O=g.addOns.items,w=null==b?void 0:b.product.sku,x=null===(e=d.current)||void 0===e?void 0:e.sku,P=function(e){var r=e.recipeName,n=e.recipeId;t({event:"gaEventTrigger",event_name:"OrderSummary_EditableSummaryRemoveMeal",base_sku:w,hf_week:l,original_sku:x,recipe_name:r,recipe_id:n,gaEventCategory:"editableOrderSummary|Seamless One-Off",gaEventAction:"Add Extra Meal De-Select",gaEventLabel:"".concat(w,"|").concat(x,"|").concat(r,"|").concat(n)})},S=function(){t({event:"gaEventTrigger",event_name:"OrderSummary_EditableSummaryUnselectMeal",gaEventCategory:"editableOrderSummary|unselectMealChoice",gaEventAction:"regular",base_sku:w,subscription_id:u,gaEventLabel:"".concat(w,"|").concat(u,"|Menu")})};return{trackMainCTAClick:function(e,r){if(i(r),t({event:"gaEventTrigger",event_name:"ShoppingActions_MainCTAClick",event_category:"ShoppingActions",event_action:"CTAClick",event_label:"".concat(l,"|cart"),is_selection_changed:v,display_module:"cart"}),e){var n=[];h.forEach(function(e){if(e.quantity&&e.quantity>0){var t=Array(e.quantity).fill(e.index);n.push.apply(n,function(e){if(Array.isArray(e))return tR(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return tR(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tR(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}}),t({event:"gaEventTrigger",event_name:"XSell_MealSelectionFinal",gaEventCategory:"XSell_MealSelectionFinal",gaEventAction:"Click",meal_selection:n.join(","),meal_selection_count:n.length})}},trackOrderSummaryDrawerClose:function(){r();var e=tg()(y.cutoffDate)?"Post-cutoff":"Pre-cutoff";t({event:"gaEventTrigger",event_name:"OrderSummary_EditableSummaryDrawerClose",hf_week:y.id,gaEventCategory:"editableOrderSummary",gaEventAction:"orderSummaryDrawerClose",gaEventLabel:"".concat(b.id,"|").concat(y.id,"|").concat(e),cutoff_info:e})},trackSelectionSaved:function(e){var r=(null==f?void 0:f.nextStep)==="single-week"&&"store"===c?"Step_2":"Step_1",n=0,o=function(e,t){return e.reduce(function(e,r){var o;return n+=1,tU(tq({},e),(tL(o={},"recipe_index_".concat(n),r.index),tL(o,"food_item_type_".concat(n),t),tL(o,"Quantity_".concat(n),r.quantity),o))},{})},i=h.reduce(function(e,t){var r;return(null===(r=t.priceInfo)||void 0===r?void 0:r.totalAmount)?e+t.quantity:e},0);t(tq(tU(tq({},o(h,"recipe"),o(O,"add-on")),{event:"gaEventTrigger",event_name:"OrderFinalised_FoodItemSaved",surchargeCount:i,MealChoice_Step:r,gaEventCategory:"foodItem",gaEventAction:"Save|".concat(r),gaEventLabel:"".concat(l,"|").concat(u),display_module:"CART"}),e&&{plan_type:"rte"}))},trackOneOffSelectionSaved:function(e){var r=e.baseSku,n=e.isFactorCrossSellingFamily,o=e.newSku;t(tq({event:"gaEventTrigger",event_name:"SelectMeals_SeamlessOneOffSave",gaEventCategory:"Seamless One-Off",gaEventAction:"Meal Choice Save",gaEventLabel:"".concat(u,"|").concat(l,"|").concat(r,"|").concat(o),new_sku:o,base_sku:r},n&&{plan_type:"rte"}))},trackOnAddMissingMealClick:function(){t({event:"gaEventTrigger",event_name:"OrderSummary_MealPlaceholderClicked",gaEventCategory:"editableOrderSummary",gaEventAction:"mealPlaceholderClicked",gaEventLabel:"".concat(u,"|").concat(l,"|Pre-cutoff")})},trackAddExtraAddOnNudgeClick:function(){t({event:"gaEventTrigger",event_name:"OrderSummary_MarketNudgeClicked",gaEventCategory:"editableOrderSummary",gaEventAction:"marketNudgeClicked",gaEventLabel:"".concat(u,"|").concat(l,"|Pre-cutoff"),hf_week:l})},trackOnAddMoreNudgeMealClick:function(){t({event:"gaEventTrigger",event_name:"OrderSummary_ExtraMealsNudgeClicked",gaEventCategory:"editableOrderSummary",gaEventAction:"extraMealsNudgeClicked",gaEventLabel:"".concat(u,"|").concat(l,"|Pre-cutoff"),hf_week:l})},trackOnExtraMealAdd:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.trackAddMoreSnowplow;(void 0===n||n)&&o(e),t({event:"gaEventTrigger",event_name:"OrderSummary_EditableSummarySelectMeal",gaEventCategory:"editableOrderSummary|selectMealChoice",gaEventAction:"regular",base_sku:w,gaEventLabel:"".concat(w,"|").concat(u,"|Menu")})},trackIncreaseMealQuantity:function(e){var r=e.recipeName,n=e.recipeId;t({event:"gaEventTrigger",event_name:"OrderSummary_EditableSummaryAddMeal",base_sku:w,hf_week:l,original_sku:x,recipe_name:r,recipe_id:n,gaEventCategory:"editableOrderSummary|Seamless One-Off",gaEventAction:"Add Extra Meal Click",gaEventLabel:"".concat(w,"|").concat(x,"|").concat(r,"|").concat(n)})},trackDecreaseMealQuantityOrUnselect:function(e){var t=e.quantity,r=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["quantity"]);if(t>1)return P(r);S()},trackOrderSummaryDrawerOpen:function(e){var r=e.cutoffDate;n();var o=(null==s?void 0:s.entry_point)||"n/a",i=tg()(r)?"Post-cutoff":"Pre-cutoff";t({event:"gaEventTrigger",event_name:"OrderSummary_EditableSummaryDrawerOpen",hf_week:l,gaEventCategory:"editableOrderSummary",gaEventAction:"orderSummaryDrawerOpen",gaEventLabel:"".concat(u,"|").concat(l,"|").concat(i,"|").concat(o),entry_point:o,cutoff_info:i,referrer:c})},trackAddOnSelect:function(e,r){var n=e.id,o=e.sku,i=e.categoryType;t(tU(tq({event:"gaEventTrigger",event_name:"EditableSummary_AddonsSelect",hf_week:l,SKU:o,recipeID:n,addonType:i,gaEventCategory:"editAddOns",gaEventAction:"select".concat(i,"|AddonsEntryPoint|EOS"),gaEventLabel:"".concat(u,"|").concat(l,"|").concat(o,"|").concat(n)},r&&{source:r}),{touchpoint:e2.z.CART}))},trackAddOnUnselect:function(e){var r=e.id,n=e.sku,o=e.categoryType;t({event:"gaEventTrigger",event_name:"OrderSummary_EOSAddonsUnselect",hf_week:l,SKU:n,recipeID:r,addonType:o,gaEventCategory:"editAddOns",gaEventAction:"unselect".concat(o,"|EOS"),gaEventLabel:"".concat(u,"|").concat(l,"|").concat(o,"|").concat(n,"|").concat(r)})},trackAddOnIncreaseQuantity:function(e){var r=e.id,n=e.sku,o=e.categoryType;t({event:"gaEventTrigger",event_name:"OrderSummary_EOSAddonsAddPortion",hf_week:l,SKU:n,recipeID:r,addonType:o,gaEventCategory:"editAddOns",gaEventAction:"addPortionfromEOS|".concat(o),gaEventLabel:"".concat(u,"|").concat(l,"|").concat(n,"|").concat(r)})},trackAddOnDecreaseQuantity:function(e){var r=e.id,n=e.sku,o=e.categoryType;t({event:"gaEventTrigger",event_name:"OrderSummary_EOSAddonsRemovePortion",hf_week:l,SKU:n,recipeID:r,addonType:o,gaEventCategory:"editAddOns",gaEventAction:"removePortion|EOS|".concat(o),gaEventLabel:"".concat(u,"|").concat(l,"|").concat(n,"|").concat(r)})},trackAddOnsCarouselScrolledToEnd:function(){t({event:"gaEventTrigger",event_name:"EditableSummary_AddonsScrollComplete",hf_week:l,gaEventCategory:"editAddOns",gaEventAction:"scroll|AddonsEntryPoint|EOS|complete",gaEventLabel:"".concat(u,"|").concat(l)})},trackEditDeliveryPillClick:function(){var e,r;t({event:"gaEventTrigger",event_name:"OrderSummary_EditDeliveryBannerClick",gaEventCategory:"editableOrderSummary",gaEventAction:"orderSummary|DeliveryBannerClick",gaEventLabel:"".concat(l,"|").concat(u),customer_id:null!==(r=null==b?void 0:null===(e=b.customer)||void 0===e?void 0:e.id)&&void 0!==r?r:"",subscription_id:u,menu_week:l})}}};function tN(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function tF(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var tW=function(){var e,t,r,n=(0,eo.t)().query,o=ta(),i=eu().isBelowMinimum,a=tm(),l=tX().trackOrderSummaryDrawerClose,c=ts().open,u=(function(e){if(Array.isArray(e))return e}(e=(0,eP.n)())||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return tN(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tN(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[1],s=ef().wasSelectionChanged,d=function(){switch(l(),n.referrer){case"store":return o({referrer:"store",query:{}});case"xsell-store":return o({referrer:"xsell-store",query:{referrer:"cart"}});default:return o({referrer:"single-week",query:s&&!i?{browseSuccess:!0,referrer:"cart"}:{}})}};return t=function(e,t){var r,o,i,l;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){switch(e.label){case 0:switch(t.type){case"close_cart":return[3,1];case"product_click":return[3,4];case"delivery_pill_click":return[3,5]}return[3,6];case 1:if(!("xsell-store"!==n.referrer))return[3,3];return[4,a(null===(r=n.referrer)||void 0===r?void 0:r.toString())];case 2:e.sent(),e.label=3;case 3:return[2,d()];case 4:return i=(o=t.payload).id,l=o.source,(0,I.B1)(B.START,{detail:{productId:i}}),[2,u({type:"SET_PRODUCT_DETAILS_STATE",payload:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({productId:i},l&&{source:l})})];case 5:return[2,c()];case 6:return[2]}})},r=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(e){tF(i,n,o,a,l,"next",e)}function l(e){tF(i,n,o,a,l,"throw",e)}a(void 0)})},function(e,t){return r.apply(this,arguments)}},tz=P.createContext({}),tV=tz.Provider,tH=function(){return(0,P.useContext)(tz)},tG=function(){var e=ef(),t=e.quantities,r=e.state.addOns,n=r.limit,o=r.categoryLimit,i=r.items;return{canIncrease:function(e){if(e.pairedWith.length>0)return v.Modular;if(o&&(null==o?void 0:o[e.categoryType])){var r;if(o[e.categoryType]<=i.reduce(function(t,r){return r.categoryType===e.categoryType?t+r.quantity:t},0))return v.AtTypeLimit}if(t.addOns>=(n||0))return v.AtOverallLimit;var a=e.quantityOptions,l=e.priceCatalog,c=e.quantity,u=null!==(r=null==l?void 0:l.pricePerQuantity)&&void 0!==r?r:a;return(null==u?void 0:u.some(function(e){return e.quantity===c+1}))?null:v.NoQuantityOption},canDecrease:function(e){return e.pairedWith.length>0?v.Modular:null}}},tQ=function(){var e=eu().products,t=ef().quantities;return{canIncrease:function(){return!e.next||e.max&&e.max.specs.meals===t.courses?v.AtOverallLimit:null}}},tJ=function(){var e=eZ().isSaving,t=tQ().canIncrease,r=tG(),n=r.canIncrease,o=r.canDecrease,i=function(){return e?v.Saving:null};return{canIncrease:function(e){var r=null;switch(e.type){case y.Meals:r=t();break;case y.AddOns:r=n(e)}return e.isSoldOut?v.SoldOut:e.limit&&e.limit<=e.quantity?v.AtItemLimit:null!=r?r:i()},canDecrease:function(e){var t=null;return e.type===y.AddOns&&(t=o(e)),null!=t?t:i()}}},tK=function(e){var t=e1(e.mainItemId).addOns,r=tW(),n=tH(),o=n.onAddAddOn,i=n.onIncreaseAddOn,a=n.onDecreaseAddOn,l=tJ().canIncrease;return(0,x.tZ)(e6.p,{cards:t.map(function(e,t){return(0,x.tZ)(e8,{index:t,addOn:e,callback:r,mutationDisableReason:l(e),source:e2.H.FLEXIBLE_ADDONS,onAddClick:function(){return o(e.id,e2.H.FLEXIBLE_ADDONS)},onIncreaseClick:function(){return i(e.id)},onDecreaseClick:function(){return a(e.id)}},e.id)})})};function tY(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}
1var t$=function(e){var t,r=eD().menu,n=e4(e).course.menu,o=ef().state.addOns.items;return(0,P.useMemo)(function(){if(n){var e,t,i,a,l,c,u=null==r?void 0:null===(t=r.modularity)||void 0===t?void 0:t.find(function(e){var t=e.defaultCourseIndex,r=e.variations;return t===n.index||r.some(function(e){return e.index===n.index})});if(u){var s=null==r?void 0:r.meals.find(function(e){return e.index===u.defaultCourseIndex});if(s)return{mainItem:{id:s.recipe.id},activeItem:{id:n.recipe.id},variations:[{mainRecipeId:s.recipe.id,title:u.noVariationsDefaultTitle,category:u.defaultCategory,ingredient:u.defaultIngredient,pricing:e$(s).pricing,id:s.recipe.id,isSoldOut:!!s.isSoldOut}].concat(function(e){if(Array.isArray(e))return tY(e)}(e=null!==(l=null===(i=u.variations)||void 0===i?void 0:i.map(function(e){var t=e.title,n=e.category,o=e.ingredient,i=e.index,a=e.quantity,l=null==r?void 0:r.meals.find(function(e){return i===e.index});if(l)return{mainRecipeId:s.recipe.id,title:t,category:n,ingredient:o,pricing:e$(l).pricing,id:l.recipe.id,isSoldOut:!!l.isSoldOut,isDoublePortion:(null!=a?a:1)>=2}}).filter(function(e){return!!e}))&&void 0!==l?l:[])||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return tY(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tY(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),pairings:null!==(c=null===(a=u.addOns)||void 0===a?void 0:a.map(function(e){var t,i,a,l=null==r?void 0:null===(t=r.addOns)||void 0===t?void 0:t.groups.find(function(e){return"modularity"===e.groupType});if(l){var c=l.addOns.find(function(t){return t.index===e.index});if(c&&!c.isSoldOut){var d=o.filter(function(e){return e.pairedWith.includes(n.recipe.id)}).find(function(t){return t.index===e.index});return{mainRecipeId:s.recipe.id,title:e.title,name:c.recipe.name,image:c.recipe.image,id:c.recipe.id,pricing:{pairingQuantityOptions:null!==(i=c.quantityOptions)&&void 0!==i?i:[]},selection:{quantity:null!==(a=null==d?void 0:d.quantity)&&void 0!==a?a:0},isPaired:!!(null==d?void 0:d.quantity),sku:l.sku,groupType:l.groupType,pairingsHeadline:u.addOnsHeadline}}}}).filter(function(e){return!!e}))&&void 0!==c?c:[],variationsHeadline:u.variationsHeadline,isCustomizationCarouselDisabled:!1}}}},[o,null==r?void 0:null===(t=r.addOns)||void 0===t?void 0:t.groups,null==r?void 0:r.meals,null==r?void 0:r.modularity,n])};function t0(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var t1=function(e){var t,r=function(e){if(Array.isArray(e))return e}(t=(0,eP.n)())||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return t0(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t0(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[0].state.source,o=r[1],i=tH(),a=i.onAddAddOn,l=i.onAddCourse,c=i.onSwapCourse,u=i.onAddPairing,s=i.onRemovePairing,d=i.onIncreaseAddOn,f=i.onDecreaseAddOn,p=i.onIncreaseCourse,b=i.onDecreaseCourse,y=e4(e),m=y.addOn.menu,v=y.course.menu,g={};return v&&(g={onAdd:function(){return l(e)},onIncrease:function(){return p(v.index)},onDecrease:function(){return b(v.index)},onSwap:function(t){return c(e,t)},onAddPairing:function(t){return u(e,t)},onRemovePairing:function(t){return s(e,t)}}),m&&(g={onAdd:function(){return a(e,n)},onIncrease:function(){return d(e)},onDecrease:function(){return f(e)}}),function(e){var t=e.type,r=e.payload,n=g.onAdd,i=g.onIncrease,a=g.onDecrease,l=g.onSwap,c=g.onAddPairing,u=g.onRemovePairing;switch(t){case"INCREASE_QUANTITY":return null==i?void 0:i();case"DECREASE_QUANTITY":return null==a?void 0:a();case"ADD":return null==n?void 0:n();case"SWAP":null==l||l(r.id),o({type:"SET_PRODUCT_DETAILS_STATE",payload:{productId:r.id}});return;case"ADD_PAIRING":return null==c?void 0:c(r.pairing.id);case"REMOVE_PAIRING":return null==u?void 0:u(r.pairing.id)}}};function t2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function t6(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var t3=function(e){var t=ef(),r=t.state.addOns,n=r.limit,o=r.categoryLimit,i=r.items,a=t.quantities,l=eu().products,c=e4(e),u=c.addOn,s=u.menu,d=u.cart,f=c.course,p=f.menu,b=f.cart,y=(0,P.useCallback)(function(e){var t=i.filter(function(t){return t.categoryType===e}).reduce(function(e,t){return e+t.quantity},0);return(null==o?void 0:o[e])===t},[i,o]);return(0,P.useMemo)(function(){if(p){var e,t,r,o,i=(null===(e=p.recipe.tags)||void 0===e?void 0:e.map(function(e){return t6(t2({},e),{id:e.name,slug:e.colorHandle||e.name})}))||[],c=p.recipe.label&&(null===(t=p.recipe.label)||void 0===t?void 0:t.displayLabel)?t6(t2({},p.recipe.label),{text:p.recipe.label.text}):void 0;return{product:e$(p,b),hasReachedMaximum:(null===(r=l.current)||void 0===r?void 0:r.specs.meals)===(null===(o=l.max)||void 0===o?void 0:o.specs.meals),menuContextTags:i,menuContextLabel:c,itemPrice:(0,eU.z)(p.itemPrice)}}if(s){var u,f=s.recipe.tags||[],m=s.recipe.label&&(null===(u=s.recipe.label)||void 0===u?void 0:u.displayLabel)?t6(t2({},s.recipe.label),{text:s.recipe.label.text}):void 0;return{product:eY(s,y,d),hasReachedMaximum:n===a.addOns,actionsDisabled:"modularity"===s.categoryType,menuContextTags:f,menuContextLabel:m}}},[p,s,b,l,y,d,n,a.addOns])};function t4(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var t5=function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,eP.n)())||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return t4(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t4(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],n=r.state,o=r.previousState,i=t[1];return{handler:function(e){switch(e.type){case"LOADED":var t=B.START,r=B.END,a=B.TRACE;(0,I.B1)(r),(0,I.L8)(a,t,r),window.performance.clearMarks(t);return;case"BACK":i({type:"SET_PRODUCT_DETAILS_STATE",payload:o}),i({type:"RESET_PREVIOUS_PRODUCT_DETAILS_STATE"});break;case"REDIRECT":var l=e.payload.id;i({type:"SET_PREVIOUS_PRODUCT_DETAILS_STATE",payload:n}),i({type:"SET_PRODUCT_DETAILS_STATE",payload:{productId:l,referrer:"product-details"}})}},referrer:n.referrer}};function t7(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var t8=function(e){var t,r,n,o,i,a=e.productId,l=eZ().isSaving,c=(0,en.n6)().delivery,u=e1().isEnabled,s=eD().menu,d=e4(a),f=d.course,p=d.addOn,b=(null===(n=f.menu)||void 0===n?void 0:n.recipeFamily)==="menu-addons-modularity"||(null===(o=p.menu)||void 0===o?void 0:o.recipeFamily)==="menu-addons-modularity";(0,eS.Z)(b?"":a,b?"":null!==(i=null==s?void 0:s.week)&&void 0!==i?i:"");var y=t$(a),m=t3(a),v=t1(a),g={sustainabilityNudges:{enabled:(0,eE.Z)("prod-2002-shopex-bnl-sustainability-nudges").isEnabled}},h=t5(),O=h.handler,w=h.referrer;return m?(0,x.tZ)(ek.f,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({isModal:!0},m),r=r={config:{},variant:"EDIT",referrer:w,productId:a,modularity:y,actionsDisabled:l||m.actionsDisabled,handleAction:v,servings:c.product.specs.size,handleLifecycleEvent:O,featureFlags:g,flexibleAddonCarousel:u?(0,x.tZ)(tK,{mainItemId:a}):null},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t)):null},t9=function(){var e,t,r=(null!==(t=(function(e){if(Array.isArray(e))return e}(e=(0,eP.n)())||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return t7(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t7(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0].state.productId)&&void 0!==t?t:"").toString();return r?(0,x.tZ)(t8,{productId:r}):null},re=r(472175),rt=r(46687),rr=r(190174),rn=function(){var e=(0,rr.x)({},{suspense:!1}).data;return(0,P.useMemo)(function(){if(!e)return!1;var t=e.some(function(e){return"rte"===e.planType}),r=e.some(function(e){return"mealkit"===e.planType});return t&&r},[e])},ro=function(){var e=(0,P.useRef)(null),t=(0,N.Sj)(),r=(0,D.ZP)("cart").translateRaw,n=ts(),o=n.isOpen,i=n.close,a=(0,en.n6)(),l=a.delivery,c=a.subscription,u=rn(),s=l.id===c.nextModifiableDeliveryWeek;return(0,x.tZ)(_.dy.Container,{isModal:!0,isTouchMoveEnabled:!0,width:["100%","600px"],placement:"mobile"===t?"bottom":"right",returnFocusRef:e,isOpen:o,onClose:i,onDismiss:i,headerText:r("cart.revamp.delivery-drawer.header"),children:(0,x.tZ)(re.Z,{subscriptionId:c.id,week:l.id,onCancel:i,headless:!0,mode:s?rt.K.BOTH:rt.K.SAVE_ONE_OFF,isMultiBrandSubscription:u,isCustomPriorityEnabled:!0})})},ri=r(165218),ra=r.n(ri)()(function(){return r.e(74593).then(r.bind(r,574593))},{loadableGenerated:{webpack:()=>[574593]},ssr:!1}),rl=r(314664),rc=r(395720);function ru(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function rs(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ru(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ru(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var rd=(0,tl.cn)(null),rf=(0,tl.cn)(void 0),rp=(0,tl.cn)(null),rb=function(){var e=rs((0,tl.KO)(rf),2),t=e[0],r=e[1],n=rs((0,tl.KO)(rd),2),o=n[0],i=n[1],a=rs((0,tl.KO)(rp),2),l=a[0],c=a[1],u=(0,P.useCallback)(function(){i(null),r()},[r,i]),s=function(e){o&&clearTimeout(o),i(setTimeout(u,e))};return{showToast:function(e){var t=e.content,n=e.timeout||E.success;r({content:t,toastType:e.toastType||b.Default,timeout:n}),s(n)},actionToast:t,resetToast:u,anchorRef:l,setAnchorRef:c}};function ry(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function rm(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function rv(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function rg(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ry(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ry(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var rh=(0,_.q)(_.xu),rO=function(e,t){var r=rg((0,P.useState)(null),2),n=r[0],o=r[1];return(0,P.useEffect)(function(){var r=null==e?void 0:e.current;if(!t||!r){o(null);return}var n=function(){var e=r.offsetHeight;e>0&&o(e+8)};n();var i=new ResizeObserver(n);return i.observe(r),function(){return i.disconnect()}},[e,t]),n},rw=function(){var e,t=(0,D.ZP)("store").translateRaw,r=rg((0,P.useState)(),2),n=r[0],o=r[1],i=rb(),a=i.actionToast,l=rO(i.anchorRef,void 0!==a),c=(0,_.Yz)(void 0!==a,{from:{opacity:0}
1,enter:{opacity:1},leave:{opacity:0},config:{duration:200,easing:_.Gk.easeInOutCubic}});(0,P.useEffect)(function(){a&&o(a)},[a]);var u=null!==(e=null==a?void 0:a.toastType)&&void 0!==e?e:null==n?void 0:n.toastType,s=(0,P.useMemo)(function(){var e={iconColor:"shared-alias.positive.foreground.default",backgroundColor:"shared-alias.positive.background.light"};return u===b.Error?rv(rm({},e),{iconColor:"shared-alias.negative.foreground.default",backgroundColor:"shared-alias.negative.background.lightest",icon:(0,x.tZ)(rc.default,{}),role:"alert",ariaLive:"assertive",dataTestId:"cart-toast-error"}):rv(rm({},e),{icon:(0,x.tZ)(rl.default,{}),role:"status",ariaLive:"polite",dataTestId:"cart-toast-success"})},[u]),d=s.icon,f=s.iconColor,p=s.backgroundColor,y=s.role,m=s.ariaLive,v=s.dataTestId,g=u===b.Error?"".concat(t("store.autosave.toast-error-primary")," ").concat(t("store.autosave.toast-error-secondary")):"".concat(t("store.autosave.toast-default-primary"));return c(function(e,t){var r;return t&&(0,x.tZ)(rh,{role:y,"aria-live":m,"aria-label":g,"data-test-id":v,position:"fixed",width:["90%","auto"],backgroundColor:p,py:"xs",px:"sm-2",boxShadow:"shadow-xl",borderWidth:"1px",borderRadius:"border-radius-md",borderStyle:"solid",borderColor:"shared-alias.neutral.border.lighter",left:"50%",bottom:l?"".concat(l,"px"):["96px","5%"],transform:"translate(-50%, 0)",zIndex:"10000",display:"flex",justifyContent:"space-between",alignItems:"center",style:e,children:(0,x.BX)(_.xu,{display:"flex",gap:"xs",alignItems:"center","aria-hidden":"true",children:[(0,x.tZ)(_.xu,{color:f,display:"flex",alignItems:"center",children:d}),(0,x.tZ)(_.xu,{display:"flex",justifyContent:"center",alignItems:"center",gap:"xxs",children:null!==(r=null==a?void 0:a.content)&&void 0!==r?r:null==n?void 0:n.content})]})})})},rx=r(295332),rP=r(29765),rS=r(384949),rk=r(835814),rj=r(204912),rC=function(e){var t=e.quantity,r=(0,D.ZP)(M.cart).translateRaw;return 0===t?null:(0,x.tZ)(_.xu,{borderRadius:"border-radius-circle",backgroundColor:"alias.interactive-alt.surface.level-1",px:"xs",height:"24px",display:"flex",alignItems:"center",justifyContent:"center",children:(0,x.tZ)(_.xv,{type:"body-sm-regular",role:"status","aria-label":r("".concat(M.cart,".revamp.selection.quantity-badge.aria-label")),children:t})})},rZ=function(){return!(0,eE.Z)("rn_seamless_box_downgrade").isEnabled},rA=r(966622),r_=r(943701);(u=h||(h={})).CONTROL="Control",u.VARIATION_1="Variation_1",u.VARIATION_2="Variation_2";var rD=function(){var e=(0,rA.py)({runUsingStatsig:!0}),t=e.decide,r=e.isReady,n=(0,r_.R)({runUsingStatsig:!0}),o=n.id,i=n.attributes,a=n.isReady,l=r&&a,c=(l?t({experimentKey:"free_shipping_on_minimum_spend",experimentationUserId:o,experimentationUserAttributes:i}):{variationKey:null}).variationKey;return{isAllocated:"Variation_1"===c||"Variation_2"===c,isReady:l}},rI=r(553911),rE=function(){var e,t=(0,D.ZP)("store").translateRaw,r=eu(),n=r.belowMinimumDelta,o=r.belowExpectedDelta,i=r.isBelowExpected,a=r.isBelowMinimum,l=rZ();return i&&(e=t("store.mealGuidance.seamless.".concat(1===o?"singular":"plural"),{number:o})),a&&!l&&(e=t("store.mealGuidance.belowMinimum.".concat(1===n?"singular":"plural"),{number:n})),(0,x.tZ)(rI.Z,{copy:e||""})},rT=function(){var e=(0,eE.Z)("rn_seamless_box_downgrade_v2").isEnabled,t=rZ(),r=eu(),n=r.isBelowExpected,o=r.isBelowMinimum,i=ef().state.isLoading,a=rE(),l=rD(),c=l.isAllocated,u=l.isReady;return!i&&(e||t)&&(n||o)?o?(0,x.tZ)(_.Yo,{variant:"information",children:a}):!u||c?null:(0,x.tZ)(_.Yo,{variant:"information",children:a}):null},rB=r(91745),rM="manual-credit-apply-drawer",rR="manual-credit-nudge-banner",rL="cart",rq=function(){var e=(0,eE.Z)("manual-cash-credit-feature-gate"),t=e.isEnabled,r=e.isReady;return{isManualCreditFeatureGateEnabled:!!(t&&r)}},rU=function(){var e,t=rq().isManualCreditFeatureGateEnabled,r=(0,en.n6)().subscription.customer.uuid,n=(0,rB.Z)({customerUUID:r},{enabled:!!r&&t}),o=n.data,i=n.isLoading,a=n.isError;return t?{isManualApplyEnabled:t&&(null==o?void 0:o.group)==="variation",optedInWeek:null!==(e=null==o?void 0:o.optedInWeek)&&void 0!==e?e:null,isLoading:i,isError:a}:{isManualApplyEnabled:!1,optedInWeek:null,isLoading:!1}},rX=(0,tl.cn)(!1),rN=r(867610),rF=function(e){var t=e.isVisible,r=e.onDismiss,n=(0,D.ZP)(rL),o=n.translate,i=n.translateRaw;return t?(0,x.tZ)(_.Yo,{variant:"error",icon:(0,x.tZ)(rN.default,{}),alignLeadingIconPosition:"center",onDismiss:r,"aria-label":i("cart.manual_credit.error_bar.a11y.label"),children:o("cart.manual_credit.applied_bar.error.label")}):null},rW=function(e){return(0,x.tZ)(C.Z,{scope:"manual-credit-error-bar",children:(0,x.tZ)(rF,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e))})};function rz(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var rV=function(){var e,t=rU().isManualApplyEnabled,r=function(e){if(Array.isArray(e))return e}(e=(0,tl.KO)(rX))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return rz(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return rz(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[0],o=r[1],i=t&&n;(0,P.useEffect)(function(){if(i){var e=setTimeout(function(){return o(!1)},5e3);return function(){return clearTimeout(e)}}},[i,o]);var a=(0,P.useCallback)(function(){o(!1)},[o]);return(0,x.tZ)(rW,{isVisible:i,onDismiss:a})},rH=function(){return(0,x.tZ)(C.Z,{scope:"credit-error-feedback",children:(0,x.tZ)(rV,{})})},rG=function(){var e=eD().error,t=(0,D.ZP)(M.cart).translate,r=e?{onRetry:function(){return window.location.reload()},errorCopy:t("".concat(M.cart,".pricing-info.error"))}:null;if(!r)return null;var n=r.onRetry,o=r.errorCopy;return(0,x.tZ)(_.Yo,{variant:"error",content:(0,x.tZ)(_.xu,{width:"100vw",display:"flex",justifyContent:"center","data-test-id":"cart-error-communication",children:(0,x.BX)(_.xu,{display:"flex",alignItems:["flex-start","flex-start","center"],justifyContent:"space-between",width:["100%","640px"],flexDirection:["column","column","row"],gap:["xs","xs","zero"],children:[(0,x.tZ)(_.xv,{children:o}),(0,x.tZ)(_.zx.Secondary,{size:"sm",appearance:"negative",width:"fit-content",onClick:n,"data-test-id":"cart-error-communication-cta",children:t("".concat(M.cart,".pricing-info.retry"))})]})})})},rQ=function(){var e=(0,D.ZP)(M.cart),t=e.translate,r=e.translateRaw,n=(0,rk.Z)(),o=ti(),i=eZ().isSaving,a=(0,en.n6)().delivery,l=ef(),c=l.quantities,u=l.state.isLoading,s=tW();return(0,x.BX)(_.xu,{position:n?"static":"sticky",top:"0",zIndex:"99",backgroundColor:"alias.page-background.default",width:"100%",display:"flex",flexDirection:"column",alignItems:"center",children:[(0,x.BX)(F,{maxWidth:n?"none":["94%","640px","1144px"],pl:n?"global.lg-1":"zero",py:"global.sm-1",children:[(0,x.tZ)(_.xu,{position:"absolute",left:"0",display:"flex",alignItems:"center",children:(0,x.tZ)(_.PZ,{disabled:u||i,"data-test-id":"cart-revamped-close-button","aria-label":r("".concat(M.cart,".revamp.header.close-button")),onClick:function(e){return s(e,{type:"close_cart"})}})}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",children:[(0,x.BX)(_.xu,{display:"flex",alignItems:"center",gap:"global.xs",children:[(0,x.tZ)(_.xv,{as:"h3",children:t(o?"".concat(M.cart,".revamp.eos.main-header.your-xsell-factor-order"):"".concat(M.cart,".revamp.eos.main-header.your-order"))}),(0,x.tZ)(rC,{quantity:c.addOns+c.courses})]}),(0,x.tZ)(_.xv,{children:t("".concat(M.cart,".revamp.header.cutoff-date"),{cutoffDate:(0,rx.Z)((0,rP.Z)(a.cutoffDate),rS.n1)})})]})]}),(0,x.tZ)(rG,{}),(0,x.tZ)(rj.Z,{viewports:["desktop"],children:(0,x.tZ)(rT,{})}),(0,x.tZ)(rH,{})]})},rJ=r(527157),rK=r(543790),rY=r(783244),r$=r(984056),r0=r(660751),r1=r(576499),r2=r(765866),r6=function(){var e=(0,r2.v)({retry:1}).mutateAsync,t=(0,en.n6)(),r=t.delivery,n=t.subscription;return function(){return e({subscriptionId:n.id,week:r.id,cutoffDate:r.cutoffDate,deliveryDate:r.deliveryDate,status:"RUNNING"})}},r3=r(602307),r4=r(318066),r5=function(e){var t=e.onClose,r=e.onConfirm,n=e.onProceed,o=e.planMeals,i=e.nrMealsSelected,a=(0,D.ZP)("store").translateRaw,l=o-i>1?"many":"one",c=i>1?"many":"one";return(0,x.tZ)(r3.Z,{claim:{name:"cart-and-wallet",githubTeam:"hellofresh/squad-cart-and-wallet",tribe:"shopping-journey",alliance:"consumer",jiraPrefix:"MPC",slackChannel:"#squad-cart-and-wallet",slackAlertsChannel:"#squad-cart-and-wallet",skipLabelsOnPR:!1,teamIdentifier:"cart-and-wallet"},children:(0,x.tZ)(C.Z,{scope:"seamless-downgrade-modal",children:(0,x.BX)(_.xu,{p:"global.md-1","data-test-id":"seamless-downgrade-modal",children:[(0,x.tZ)(_.xu,{position:"absolute",top:["0.5rem","1rem"],right:["0.5rem","1rem"],children:(0,x.tZ)(_.PZ,{onClick:t})}),(0,x.tZ)(_.xu,{display:"flex",flex:"1",justifyContent:"center",children:(0,x.tZ)(r4.ZP,{src:(0,eL.Z)("/hellofresh_website/seamless-downgrade-modal/Box.svg",eq.b.website),alt:"box-content",width:"104",height:"104",fetchFormat:"svg"})}),(0,x.BX)(_.xu,{py:"global.md-1",children:[(0,x.tZ)(_.xv,{as:"h3",textAlign:"center",children:a("store.seamless-downgrade-modal.title")}),(0,x.tZ)(_.xu,{pt:"global.sm-2",children:(0,x.tZ)(_.xv,{type:"body-md-regular",children:a("store.seamless-downgrade-modal.subtitle[".concat(l,"]"))})})]}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",rowGap:"global.sm-2",children:[(0,x.tZ)(_.zx.Primary,{onClick:n,"data-test-id":"seamless-downgrade-modal-accept",children:a("store.seamless-downgrade-modal.button-accept[".concat(c,"]"),{nrMealsSelected:i})}),(0,x.tZ)(_.zx.Secondary,{onClick:r,"data-test-id":"seamless-downgrade-modal-decline",children:a("store.seamless-downgrade-modal.button-decline")})]})]})})})}
1,r7=r(54818),r8="shared-alias.neutral.foreground.default",r9=function(e){var t=e.topContent,r=e.bottomContent;return(0,x.BX)(_.xu,{py:"xs",display:"flex",minWidth:"334px",flexDirection:"column",justifyContent:"space-between",children:[t&&(0,x.tZ)(_.xv,{type:"body-sm-bold",color:r8,children:t}),r&&(0,x.tZ)(_.xv,{type:"body-sm-regular",color:r8,children:r})]})},ne=r(495500);function nt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function nr(e){return function(e){if(Array.isArray(e))return nt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return nt(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nt(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nn(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}var no=new Set(["item_sold_out","ITEM_SOLD_OUT","item_not_available","ITEM_NOT_AVAILABLE"]),ni=new Set(["cart_not_editable","CART_NOT_EDITABLE"]),na=new Set(["cart_limit_exceeded","CART_LIMIT_EXCEEDED"]),nl=function(e){if(e){var t=e.toUpperCase();if("MEALKIT_BOX"===t||"ADDON_BOX"===t||"ADDON_CATEGORY"===t)return t}},nc=function(e){var t=(null!=(r=ne.Z)&&"undefined"!=typeof Symbol&&r[Symbol.hasInstance]?!!r[Symbol.hasInstance](e):e instanceof r)?e.responseResult:e&&(void 0===e?"undefined":nn(e))==="object"&&"responseResult"in e&&"string"==typeof e.responseResult?e.responseResult:void 0;if(!t)return[];try{var r,n,o=JSON.parse(t);return null!==(n=o.errors)&&void 0!==n?n:[]}catch(e){return[]}},nu=function(e){var t,r;if("object"===nn(e.productId)&&(null===(t=e.productId)||void 0===t?void 0:t.index)!=null){var n=Number(e.productId.index);return Number.isNaN(n)?void 0:n}if((null===(r=e.item)||void 0===r?void 0:r.index)!=null){var o=Number(e.item.index);return Number.isNaN(o)?void 0:o}},ns=function(e){var t,r,n;return"string"==typeof e.productId?e.productId:"object"===nn(e.productId)&&(null===(t=e.productId)||void 0===t?void 0:t.productItemId)?e.productId.productItemId:null!==(n=null===(r=e.item)||void 0===r?void 0:r.product_item_id)&&void 0!==n?n:void 0},nd=function(e,t){var r=ns(e);if(r){var n=t.find(function(e){return e.id===r});if(n)return n}var o=nu(e);if(null!=o)return t.find(function(e){return Number(e.index)===o})},nf=function(e){var t,r=nc(e).find(function(e){return!!e.code&&na.has(e.code)});if(!r)return null;var n=nl(null!==(t=r.limitType)&&void 0!==t?t:r.limit_type);return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},n&&{limitType:n},r.category&&{category:r.category})},np=function(e,t,r){var n=nr(t).concat(nr(r));return Array.from(new Set(nc(e).filter(function(e){return e.code&&no.has(e.code)}).map(function(e){var t;return null===(t=nd(e,n))||void 0===t?void 0:t.id}).filter(function(e){return!!e})))},nb=r(313954),ny=function(e){var t=e.onDismiss,r=(0,D.ZP)("store").translateRaw;return(0,x.tZ)(nb.Z,{componentName:"CartPostCutOffErrorModal",children:(0,x.tZ)(r3.Z,{claim:{name:"cart-and-wallet",githubTeam:"hellofresh/squad-cart-and-wallet",tribe:"shopping-journey",alliance:"consumer",jiraPrefix:"MPC",slackChannel:"#squad-cart-and-wallet",slackAlertsChannel:"#squad-cart-and-wallet",skipLabelsOnPR:!1,teamIdentifier:"cart-and-wallet"},children:(0,x.tZ)(C.Z,{scope:"cart-post-cutoff-error-modal",fallback:(0,x.tZ)(x.HY,{}),children:(0,x.BX)(_.xu,{p:"global.md-1",pt:"global.lg-1","data-test-id":"store-post-cutoff-error-modal",children:[(0,x.tZ)(_.xu,{display:"flex",justifyContent:"center",pb:"global.md-1","data-test-id":"store-post-cutoff-error-icon",children:(0,x.tZ)(r4.ZP,{alt:"","aria-hidden":"true",fetchFormat:"svg",width:48,height:48,src:(0,eL.Z)("https://media.hellofresh.com/hellofresh_website/factor/cancel-unified-flow/calendar_denied.svg")})}),(0,x.tZ)(_.xu,{pb:"global.sm-2",textAlign:"center",children:(0,x.tZ)(_.xv,{as:"h3",type:"body-md-bold",textAlign:"center","data-test-id":"store-post-cutoff-error-title",children:r("store.autosave.postcutoff.error.title")})}),(0,x.tZ)(_.xu,{pb:"global.md-1",textAlign:"center",children:(0,x.tZ)(_.xv,{type:"body-sm-regular",textAlign:"center","data-test-id":"store-post-cutoff-error-description",children:r("store.autosave.postcutoff.error.description")})}),(0,x.tZ)(_.zx.Primary,{onClick:t,width:"100%","data-test-id":"store-post-cutoff-error-primary-button",children:r("store.autosave.postcutoff.error.button.title")})]})})})})};function nm(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function nv(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var ng=function(){var e,t,r,n=(0,D.ZP)("store").translateRaw,o=eu(),i=o.isAllowedToSave,a=o.products,l=ef(),c=l.restorePrevious,u=l.revertAndMarkSoldOut,s=l.confirmSuccessfulSelection,d=l.state,f=l.unfilteredAddons,p=l.didLastChangeIncreaseQuantity,y=ev(),m=ey().setOneOffSku,v=(0,en.n6)(),g=v.subscription,h=v.delivery,O=ti(),w=(0,td.d)(tf.nK.genericModal),S=w.setModalState,k=w.openModal,j=w.closeModal,C=(0,r7.c)({retry:2}),Z=C.mutateAsync,A=C.isLoading,_=rb(),I=_.showToast,E=_.resetToast,T=tX(),B=T.trackSelectionSaved,M=T.trackOneOffSelectionSaved,R=(0,eE.Z)("rn_seamless_box_downgrade_v2").isEnabled,q=(0,eE.Z)(L),U=q.isEnabled,X=q.isReady&&U,N=(0,eE.Z)("cart_errors_cart-limit-exceeded_message"),F=N.isEnabled,W=N.isReady&&F,z=rZ(),V=function(e){if(Array.isArray(e))return e}(e=(0,P.useState)(null))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return nm(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nm(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),H=V[0],G=V[1],Q=(0,P.useCallback)(function(){G(null)},[]),J=O&&"PAUSED"===h.status,K=function(e){B(O),g.product.sku!==e&&M({baseSku:g.product.sku,isFactorCrossSellingFamily:O,newSku:e}),J||I({toastType:b.Success,content:(0,x.tZ)(r9,{bottomContent:n("store.autosave.toast-default-primary")})})},Y=function(){c(),J||I({toastType:b.Error,content:(0,x.tZ)(r9,{topContent:n("store.autosave.toast-error-primary"),bottomContent:n("store.autosave.toast-error-secondary")})})};return{isSaving:A,save:(t=function(){var e,t,r,n,o,l,b,v,O,w;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(P){switch(P.label){case 0:if(e=f.filter(function(e){return e.quantity>0||e.preselectedQuantity>0}),t=d.courses.items,E(),r=g.customer,n=eR()(e,"sku"),!i||!a.current){if(z||!R)return setTimeout(K,300),[2,!0];return[2,!1]}o=t.map(function(e){return{index:e.index,quantity:e.quantity}}),l=Object.keys(n).map(function(e){var r=n[e];if(r[0])return{groupType:r[0].categoryType,sku:e,selection:r.map(function(e){return{index:e.index,oneOffQuantity:e.quantity,preselectedQuantity:e.preselectedQuantity,courses:e.pairedWith.map(function(e){var r,n;return{index:null!==(n=null===(r=t.find(function(t){return t.id===e}))||void 0===r?void 0:r.index)&&void 0!==n?n:-1}}).filter(function(e){return -1!==e.index})}})}}).filter(function(e){return!!e}),P.label=1;case 1:return P.trys.push([1,3,,4]),[4,Z({preference:g.preset,weekId:h.id,subscriptionId:g.id,customerId:r.id,productSku:a.current.sku,updateQuantity:!0,cutoffDate:h.cutoffDate,extras:l,meals:o})];case 2:return P.sent(),m(a.current.sku),s(),K(a.current.sku),[2,!0];case 3:if(nc(b=P.sent()).some(function(e){return!!e.code&&ni.has(e.code)}))return c(),v=function(){j()},S({children:(0,x.tZ)(ny,{onDismiss:v}),headless:!0,padding:"zero",testId:"store-post-cutoff-error-modal-wrapper",onDismiss:v}),k(),[2,!1];if(O=nf(b),W&&O)return G(O),c(),[2,!1];if((w=X&&p()?np(b,t,e):[]).length>0)return y().catch(function(){}),u(w),[2,!1];return Y(),[2,!1];case 4:return[2]}})},r=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(e){nv(i,n,o,a,l,"next",e)}function l(e){nv(i,n,o,a,l,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)}),cartLimitExceeded:H,clearCartLimitExceeded:Q}};function nh(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var nO=function(){var e=(0,td.d)(tf.nK.genericModal),t=e.setModalState,r=e.openModal,n=e.closeModal,o=(0,en.n6)().subscription,i=ef(),a=i.wasSelectionChanged,l=i.wasCurrentSelectionChanged,c=i.quantities,u=eD().mainCategory,s=ta(),d=ng().save,f=(0,eE.Z)("rn_seamless_box_downgrade_v2").isEnabled,p=rZ(),b=eu().isBelowExpected,y=!!ey().preserved.query.marketCategory&&a&&!l;return(0,P.useCallback)(function(){return new Promise(function(e,i){if(!a||o.productType.specs.meals<=c.courses&&!f||f&&!b)return e();if(p&&b)return i();if(p&&!b)return e();if(f&&y)return d().then(function(t){return t?e():i()});var l,m,v=function(){s({referrer:"store",query:{category:u}})},g=function(){i(),n()},h=(l=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(t){switch(t.label){case 0:if(!f)return[3,2];return[4,d()];case 1:if(!t.sent())return n(),[2,i()];t.label=2;case 2:return e(),n(),[2]}})},m=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=l.apply(e,t);function i(e){nh(o,r,n,i,a,"next",e)}function a(e){nh(o,r,n,i,a,"throw",e)}i(void 0)})},function(){return m.apply(this,arguments)});t({children:(0,x.tZ)(r5,{onClose:g,onConfirm:v,onProceed:h,nrMealsSelected:c.courses,planMeals:o.productType.specs.meals}),padding:"zero",headless:!0,onClose:g,onConfirm:v,onDismiss:g}),r()})},[a,o.productType.specs.meals,c.courses,p,f,b,y,t,r,s,u,n,d])};function nw(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function nx(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var nP=function(){var e,t,r,n,o=(0,eo.t)(),i=o.push,a=o.query.referrer,l=(0,D.ZP)("store").translateRaw,c=(0,D.ZP)("cart").translateRaw,u=(0,D.ZP)("factor-plus").translateRaw,s=(0,rJ.Z)(),d=ef(),f=d.state.isLoading,p=d.wasSelectionChanged,b=eZ().isSaving,y=ey().preserved,m=eu(),v=m.isBelowMinimum,g=m.isBelowExpected,h=m.belowMinimumDelta,O=m.belowExpectedDelta,w=ti(),S=(0,en.n6)().delivery,k=r6(),j=ta(),C=tX().trackMainCTAClick,Z=nO(),A=(function(e){if(Array.isArray(e))return e}(e=(0,rY.Z)("hf_factor_plus_enabled"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),1!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,1)||function(e,t){if(e){if("string"==typeof e)return nw(e,1);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nw(e,1)}}(e,1)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],I=(null===(n=(0,r$.oO)(A))||void 0===n?void 0:n.enabled)===!0,E=(0,r0.e)().isChecked,T=(0,r1.B)().open,B=(0,eE.Z)("rn_seamless_box_downgrade_v2").isEnabled,M=rZ(),R=(0,P.useMemo)(function(){if(I&&E)return u("factorplus.cart.cta.see-benefits");if(g&&B)return l("store.mealGuidance.save-selection-button");if(g&&M||v&&!B){var e=M?O:h;return l(e>1?"store.editableOrderSummary.floatingButton.select-x-more-meals":"store.editableOrderSummary.floatingButton.select-x-more-meal",{number:e})}return w?"PAUSED"===S.status?c("cart.cta.xsell-place-order"):c("cart.cta.xsell-update-order"):"cross-selling"===y.nextStep?l("store.autosave.top-bar-second-step-button"):l("store.autosave.top-bar-goto-menu-button")},[v,w,y.nextStep,l,h,O,S.status,c,u,g,B,M,I,E]),L=(t=function(){var e;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(t){switch(t.label){case 0:if(I&&E)return T(),[2];C(w,R||null),e=function(){var e={};w?e={factorOrderSuccess:!0,deliveryDate:nS(S.deliveryDate),updateDate:nS(S.cutoffDate),referrer:"cart"}:p&&!v&&(e={browseSuccess:!0,referrer:"cart"}),j({referrer:"single-week",query:e})},t.label=1;case 1:switch(t.trys.push([1,13,,14]),y.nextStep){case"cross-selling":return[3,2];case"welcome-space":return[3,4];case"single-week":return[3,5]}return[3,12];case 2:return[4,Z()];case 3:return t.sent(),[2,j({referrer:"store",query:{marketCategory:"your-extras"}})];case 4:return[2,i({pathname:s===rK.Z.hellofresh?"/my-account/deliveries/welcome":"/welcome"})];case 5:if(!(w&&"PAUSED"===S.status))return[3,7];return[4,k()];case 6:t.sent(),t.label=7;case 7:if(!("single-week"===a&&!w))return[3,9];return[4,Z()];case 8:t.sent(),t.label=9;case 9:if(!(B||M))return[3,11];return[4,Z()];case 10:t.sent(),t.label=11;case 11:return[2,e()];case 12:return[3,14];case 13:return t.sent(),[2];case 14:return[2]}})},r=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(e){nx(i,n,o,a,l,"next",e)}function l(e){nx(i,n,o,a,l,"throw",e)}a(void 0)})},function(){return r.apply(this,arguments)});if(f)return null;var q=M&&g;return(0,x.tZ)(_.zx.Primary,{"data-test-id":"cart-save-button","aria-label":R,disabled:b||v||q,onClick:L,children:R})},nS=function(e){return(0,rx.Z)((0,rP.Z)(e),rS.n1)},nk=function(){var e=(0,eE.Z)("rn_seamless_box_downgrade_v2").isEnabled,t=rZ(),r=eu(),n=r.isBelowExpected,o=r.isBelowMinimum,i=rE();return(e||t)&&(n||o)?(0,x.tZ)(_.xv,{type:"body-sm-regular",textAlign:"center",children:i}):null},nj=r(671583),nC=function(){var e=(0,en.n6)(),t=e.subscription,r=e.delivery,n=ef().state,o=n.courses.items,i=n.addOns.items,a=n.isLoading;return(0,nj.Z)({weekId:null==r?void 0:r.id,subscriptionId:null==t?void 0:t.id,courses:o,addOns:i}
1,{suspense:!1,enabled:!!((null==r?void 0:r.id)&&(null==t?void 0:t.id)&&!a)})},nZ=function(){var e,t=(0,P.useRef)(null),r=(0,P.useRef)(void 0),n=rD().isAllocated,o=nC(),i=o.data,a=o.error,l=ef().quantities,c=(0,eE.Z)("rn_seamless_box_downgrade_v2").isEnabled,u=rZ(),s=eu(),d=s.isBelowExpected,f=s.isBelowMinimum,p=(c||u)&&(d||f),b=null==i?void 0:i.freeShippingThreshold,y=null==i?void 0:i.standardShippingAmount;if(!n||null==b||null==y||p)return a?(t.current=null,null):t.current&&n&&!p?t.current:null;var m=b.remainingAmount,v=r.current;r.current=m;var g={freeShippingThreshold:b,shippingFee:y,cartSize:l.courses+l.addOns,cartValue:null!==(e=null==i?void 0:i.subTotal)&&void 0!==e?e:0,justCrossedThreshold:void 0!==v&&v>0&&0===m};return t.current=g,g},nA=r(856083),n_=r(340332),nD=r(795016),nI=function(e){var t=e.freeShippingProgressBarProps,r=(0,tp.Z)().push,n=(0,rA.py)({runUsingStatsig:!0}).track,o=(0,r_.R)(),i=o.id,a=o.attributes,l=t.freeShippingThreshold,c=t.cartSize,u=t.cartValue,s=l.thresholdAmount,d=l.remainingAmount;return{trackUpdate:function(){r({event:"gaEventTrigger",event_name:"Upsell_FreeShippingOfferUpdate",free_shipping_offer_remaining:d,free_shipping_offer_threshold:s,cart_size:c}),i&&n({experimentationUserId:i,experimentationUserAttributes:a,eventName:"Upsell_FreeShippingOfferUpdate",eventTags:{free_shipping_offer_remaining:String(d),free_shipping_offer_threshold:String(s),cart_size:String(c)}})},trackApplied:function(){r({event:"gaEventTrigger",event_name:"Upsell_FreeShippingOfferApplied",cart_size:c,cart_value:u}),i&&n({experimentationUserId:i,experimentationUserAttributes:a,eventName:"Upsell_FreeShippingOfferApplied",eventTags:{cart_size:String(c),cart_value:String(u)}})}}},nE=function(e){var t=e.freeShippingProgressBarProps,r=(0,tp.Z)().push,n=(0,rA.py)({runUsingStatsig:!0}).track,o=(0,r_.R)(),i=o.id,a=o.attributes,l=(0,P.useRef)(!1);(0,P.useEffect)(function(){if(!l.current&&t){l.current=!0;var e=t.freeShippingThreshold,o=t.cartSize,c=e.thresholdAmount,u=e.remainingAmount;r({event:"gaEventTrigger",event_name:"Upsell_FreeShippingOfferImpression",free_shipping_offer_remaining:u,free_shipping_offer_threshold:c,cart_size:o}),i&&n({experimentationUserId:i,experimentationUserAttributes:a,eventName:"Upsell_FreeShippingOfferImpression",eventTags:{free_shipping_offer_remaining:String(u),free_shipping_offer_threshold:String(c),cart_size:String(o)}})}},[null!==t])},nT=r(839625);function nB(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var nM=function(e){var t,r=e.shouldTrigger,n=e.onComplete,o=(0,rJ.Z)(),i=(0,P.useRef)(null),a=function(e){if(Array.isArray(e))return e}(t=(0,P.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return nB(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nB(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=a[0],c=a[1],u=(0,nT.S)({brand:o,fileName:"free-shipping-unlocked.json"},{enabled:!0,suspense:!1}).data;return((0,P.useEffect)(function(){r&&!l&&u&&c(!0)},[r,l,u]),l&&u)?(0,x.tZ)(_.xu,{"data-test-id":"free-shipping-unlocked-animation",position:"absolute",bottom:"200%",left:"25%",width:"50%",height:"50%",pointerEvents:"none",children:(0,x.tZ)(_.Fm,{ref:i,animationData:u,loop:!1,onComplete:function(){null==n||n()}})}):null};function nR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function nL(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return nR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nR(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var nq=function(e){var t,r=e.freeShippingThreshold,n=e.shippingFee,o=e.cartSize,i=e.cartValue,a=e.justCrossedThreshold,l=void 0!==a&&a,c=(0,D.ZP)(M.store).translateRaw,u=(0,D.ZP)("free-shipping").translate,s=(0,_.Fg)(),d=(0,n_.nB)(),f=function(e){return d(100*e,e%1==0?{decimals:0}:void 0)},p=(0,N.Sj)(),b=to(),y=b.redirectUriByReferrer,m=b.defaultRedirectUri,v=null!==(t=y.store)&&void 0!==t?t:m,g={freeShippingThreshold:r,shippingFee:n,cartSize:o,cartValue:i},h=nI({freeShippingProgressBarProps:g}),O=h.trackUpdate,w=h.trackApplied;nE({freeShippingProgressBarProps:g});var S=r.thresholdAmount,k=r.remainingAmount,j=0===k,C=nL((0,P.useState)(!1),2),Z=C[0],A=C[1],I=nL((0,P.useState)(!1),2),E=I[0],T=I[1],B=nL((0,P.useState)(!1),2),R=B[0],L=B[1],q=(0,P.useRef)(void 0),U=(0,P.useRef)();if((0,P.useEffect)(function(){var e=q.current;k>0&&(E&&T(!1),R&&L(!1),U.current&&(clearTimeout(U.current),U.current=void 0)),void 0!==e&&e!==k&&O();var t=0===k&&void 0!==e&&e>0,r=0===k&&void 0===e&&l;(t||r)&&(A(!0),L(!0),w(),U.current&&clearTimeout(U.current),U.current=setTimeout(function(){T(!0),L(!1)},5e3)),q.current=k},[k,S,O,w,E,R,l]),(0,P.useEffect)(function(){return function(){U.current&&clearTimeout(U.current)}},[]),E)return null;var X=void 0===q.current&&j&&!l,F=0===q.current&&j;if((X||F)&&!R)return null;var W=j?100:Math.max(0,Math.min(100,(S-k)/S*100)),z=s.colors.alias.brand.foreground.default,V=s.colors.alias.accent.default;return(0,x.BX)(_.xu,{"data-test-id":"free-shipping-progress-bar-container",display:"flex",flexDirection:"column",gap:"global.xs",width:"100%",position:"relative",children:[Z&&(0,x.tZ)(nM,{shouldTrigger:Z,onComplete:function(){A(!1)}}),(0,x.BX)(_.xu,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"global.xs",children:[j?(0,x.BX)(_.xu,{display:"flex",alignItems:"center",gap:"global.xs",color:"inherit",children:[(0,x.tZ)(nA.default,{}),(0,x.tZ)(_.xv,{type:"body-md-regular",children:(0,x.tZ)(rI.Z,{hasMarkdown:!0,copy:c("free-shipping.progress-bar.unlocked",{shipping_fee:f(n)})})})]}):(0,x.tZ)(_.xv,{type:"body-md-regular",children:(0,x.tZ)(rI.Z,{hasMarkdown:!0,copy:c("free-shipping.progress-bar.add",{amount:f(k)})})}),"mobile"===p&&(0,x.BX)(_.xu,{display:"flex",alignItems:"center",gap:"global.xs",children:[(0,x.tZ)(_.rU,{href:v,children:u("free-shipping.progress-bar.menu-link.label")}),(0,x.tZ)(nD.Z,{})]})]}),(0,x.tZ)(_.xu,{"data-test-id":"free-shipping-progress-bar",position:"relative",width:"100%",height:"10px",borderWidth:"1px",borderStyle:"solid",borderColor:"alias.brand.foreground.default",borderRadius:"border-radius-xl",overflow:"hidden",role:"progressbar","aria-valuenow":W,"aria-valuemin":0,"aria-valuemax":100,children:(0,x.tZ)(_.xu,{position:"absolute",top:0,left:0,height:"100%",width:"".concat(W,"%"),borderRadius:"border-radius-xl",borderWidth:"1px",borderStyle:"solid",borderColor:"alias.brand.foreground.default",transition:"width 0.3s ease-in-out",background:"linear-gradient(90deg, ".concat(z," 0%, ").concat(z," 80%, ").concat(V," 100%)")})})]})},nU=function(e){var t=e.topSlot,r=(0,N.Sj)(),n=ef().state.isLoading,o=nZ(),i=(0,P.useRef)(null),a=rb().setAnchorRef;return((0,P.useEffect)(function(){return a(i),function(){return a(null)}},[a]),"desktop"===r||n)?null:(0,x.BX)(_.xu,{ref:i,position:"sticky",bottom:"0",width:"100%",zIndex:"1",children:[t,(0,x.tZ)(_.xu,{id:"benefit-plus-banner-slot",px:"global.sm-1",mb:"global.sm-1"}),(0,x.BX)(_.xu,{backgroundColor:"alias.elevation.level-2",boxShadow:"shadow-xl",py:["global.sm-1","global.md-1"],px:"global.md-1",flexDirection:"column",display:"flex",gap:"global.sm-1",children:[o?(0,x.tZ)(nq,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},o)):(0,x.tZ)(nk,{}),(0,x.tZ)(_.xu,{id:"factor-plus-simplified-banner-mobile-slot"}),(0,x.tZ)(nP,{})]})]})},nX=r(838776),nN=r(493522),nF=function(e){var t,r,n=e.children,o=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["children"]);return(0,x.tZ)(_.xu,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({as:"button",padding:"zero",borderWidth:0,cursor:"pointer",textAlign:"unset",backgroundColor:"transparent"},o),r=r={children:n},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))},nW=r(70953),nz=function(){var e=(0,D.ZP)(M.cart).translateRaw;return(0,x.tZ)(_.gb,{variant:"warning",width:"100%","data-test-id":"sold-out-keep-in-cart-message",icon:(0,x.tZ)(nW.default,{width:24,height:24,"aria-hidden":"true"}),children:(0,x.tZ)(_.xv,{type:"body-sm-regular",children:e("".concat(M.cart,".soldout_product_item.error_title"))})})},nV=function(e){var t=e.image,r=e.name,n=(0,N.Sj)(),o="".concat("mobile"===n?72:90,"px");return(0,x.tZ)(_.xu,{minWidth:o,height:o,display:"flex",alignItems:"center",position:"relative",children:(0,x.tZ)(r4.ZP,{fill:!0,fallbacksrc:"/hellofresh_website/empty-dish-thumbnail.png",src:t,style:{objectFit:"cover",objectPosition:"center",borderRadius:"4px"},alt:r})})};function nH(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function nG(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||nQ(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function nQ(e,t){if(e){if("string"==typeof e)return nH(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return nH(e,t)}}(s=O||(O={}))[s.Decrease=0]="Decrease",s[s.Increase=1]="Increase",(d=w||(w={}))[d.Decrease=0]="Decrease",d[d.Increase=1]="Increase";var nJ=function(e){var t=e.onIncrease,r=e.onDecrease,n=e.quantity,o=e.canIncrease,i=void 0===o||o,a=e.canDecrease,l=void 0===a||a,c=e.tooltipMessage,u=e.shouldShowTooltip,s=e.itemName,d=(0,P.useRef)(null),f=(0,P.useRef)(null),p=nG((0,P.useState)([]),2),b=p[0],y=p[1],m=nG((0,P.useState)(null),2),v=m[0],g=m[1];(0,P.useEffect)(function(){return function(){b.map(clearTimeout)}},[b]);var h=function(e,t){return function(){e();var r=(0===t?d:f).current;null==r||r.blur()}},O=function(e,t){t||(g(e),y(function(e){return((function(e){if(Array.isArray(e))return nH(e)})(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||nQ(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat([setTimeout(function(){return g(null)}
1,3e3)])}))},w=function(){g(null)};return(0,x.BX)(_.Pg,{size:"sm","aria-label":"".concat(s," quantity stepper"),children:[l?(0,x.tZ)(_.Pg.DecrementButton,{onClick:h(r,0),"data-test-id":"cart-quantity-btn-decrease",ref:d,"aria-label":"Decrease ".concat(s," quantity")}):(0,x.tZ)(_.xu,{onMouseEnter:function(){return O(0,l)},onMouseLeave:w,"aria-label":"Decrease ".concat(s," quantity (disabled)"),children:(0,x.tZ)(_.u,{variant:"dark",position:"top",placement:"start",isVisible:0===v&&u,content:c,contentStyle:{zIndex:100},"data-test-id":"cart-quantity-btn-decrease-tooltip",asChild:!0,trigger:(0,x.tZ)(_.Pg.DecrementButton,{onClick:h(r,0),"data-test-id":"cart-quantity-btn-decrease",disabled:!l,ref:d,"aria-label":"Decrease ".concat(s," quantity (disabled)")})})}),(0,x.tZ)(_.Pg.Value,{"data-test-id":"cart-quantity-btn-value","aria-label":"".concat(s," quantity"),children:n}),i?(0,x.tZ)(_.Pg.IncrementButton,{onClick:h(t,1),"data-test-id":"cart-quantity-btn-increase",ref:f,"aria-label":"Increase ".concat(s," quantity")}):(0,x.tZ)(_.xu,{onMouseEnter:function(){return O(1,i)},onMouseLeave:w,"aria-label":"Increase ".concat(s," quantity (disabled)"),children:(0,x.tZ)(_.u,{variant:"dark",position:"top",placement:"end",isVisible:1===v&&u,content:c,contentStyle:{zIndex:100},"data-test-id":"cart-quantity-btn-increase-tooltip",asChild:!0,trigger:(0,x.tZ)(_.Pg.IncrementButton,{onClick:h(t,1),"data-test-id":"cart-quantity-btn-increase",disabled:!i,ref:f,"aria-label":"Increase ".concat(s," quantity (disabled)")})})})]})},nK=r(958042),nY=r(449551),n$=function(){var e=(0,nY.Z)(),t=(0,nK.Z)();return function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=n.trailingZeros;return(0,n_.xG)(r,{locale:t,decimals:void 0===o||o||r%100!=0?2:0,country:e})}},n0=function(e){var t=e.price,r=e.basePrice,n=e.showPrefix,o=(0,D.ZP)("cart").translate,i=n$(),a=!!r&&t<r,l=0===t?o("cart.label.free"):"".concat(void 0!==n&&n?"+":"").concat(i(t));return(0,x.BX)(_.xu,{display:"flex",gap:"xxs",alignItems:"center","data-test-id":"item-extra-charge",children:[a&&(0,x.tZ)(_.xv,{color:"shared-alias.neutral.foreground.dark",strikethrough:!0,children:i(r)}),(0,x.tZ)(_.xv,{color:a?"shared-alias.negative.foreground.default":"shared-alias.neutral.foreground.default",children:l})]})},n1=r(156060),n2=function(e){var t=e.icon,r=e.text;return(0,x.BX)(_.xu,{display:"flex",gap:"xs",color:"neutral.600",alignItems:"center",children:[t,(0,x.tZ)(_.xv,{type:"body-md-regular",color:"neutral.600",children:r})]})},n6=function(e){var t;if(!(null===(t=e.modularity)||void 0===t?void 0:t.isMainCourse)){var r,n,o,i,a=null===(n=e.modularity)||void 0===n?void 0:null===(r=n.variations)||void 0===r?void 0:r.find(function(e){var t;return null===(t=e.course)||void 0===t?void 0:t.isChosen});return null!==(i=null==a?void 0:null===(o=a.ingredient)||void 0===o?void 0:o.name)&&void 0!==i?i:e.priceInfo.text}return e.priceInfo.text},n3=function(e){var t=e.course,r=e.shouldShowAbsolutePrice,n=t.modularity,o=t.priceInfo,i=t.quantity,a=t.index,l=(0,P.useMemo)(function(){var e,r,l=(null!==(e=null==n?void 0:n.variations)&&void 0!==e?e:[]).find(function(e){return e.index===a});if(l&&!(null==n?void 0:n.isMainCourse))return{type:"customization",payload:{customizationName:l.title||(null===(r=l.ingredient)||void 0===r?void 0:r.name)||""}};var c=(o.totalAmount||0)*i,u=(o.baseTotalAmount||0)*i||void 0,s=n6(t);return c||u?{type:"surcharge",payload:{label:null!=s?s:""}}:null},[t,a,null==n?void 0:n.isMainCourse,null==n?void 0:n.variations,o.baseTotalAmount,o.totalAmount,i]),c=function(){switch(null==l?void 0:l.type){case"surcharge":return l.payload.label;case"customization":var e=l.payload.customizationName;return(0,x.tZ)(n2,{icon:(0,x.tZ)(n1.Z,{}),text:e});default:return null}}(),u=(0,P.useMemo)(function(){var e=(o.totalAmount||0)*i,t=(o.baseTotalAmount||0)*i||null;return e||t?{price:e,basePrice:t}:null},[o.baseTotalAmount,o.totalAmount,i]);return u||(null==l?void 0:l.type)==="customization"?(0,x.BX)(_.xu,{width:"fill-available",display:"flex",alignItems:"center",justifyContent:"space-between",children:[c&&(0,x.tZ)(_.xv,{type:"body-md-regular",color:"neutral.600","data-test-id":"
1course-extra-charge-description",children:c}),u&&!(void 0!==r&&r)&&(0,x.tZ)(n0,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({showPrefix:!0},u))]}):null},n4=function(e,t){var r=null==t?void 0:t.find(function(t){return t.quantity===e});return{baseAmount:(null==r?void 0:r.baseAmount)||0,totalAmount:(null==r?void 0:r.totalAmount)||0}},n5=function(e){var t,r,n=e.addOn,o=e.product;if(!o)return{shouldHidePrice:!0,priceForChosenQuantity:0,basePriceForChosenQuantity:0};var i=(null==o?void 0:o.specs.size)||0,a=(null===(t=n.quantityOptions)||void 0===t?void 0:t.find(function(e){return e.people===i}))||(null===(r=n.quantityOptions)||void 0===r?void 0:r[0]),l=n.quantity/((null==a?void 0:a.quantity)||1);return{priceForChosenQuantity:((null==a?void 0:a.totalAmount)||0)*l,basePriceForChosenQuantity:((null==a?void 0:a.baseAmount)||0)*l}},n7=function(e){var t,r=e.addOn,n=e.product,o=r.priceCatalog,i=r.quantityOptions,a=r.quantity;if(r.pairedWith.length>0)return n5({addOn:r,product:n});if(!(null==o?void 0:null===(t=o.pricePerQuantity)||void 0===t?void 0:t.length)){var l=n4(a,i),c=l.baseAmount;return{priceForChosenQuantity:l.totalAmount,basePriceForChosenQuantity:c}}var u=o.pricePerQuantity,s=o.displayStrikethrough,d=null==u?void 0:u.find(function(e){return e.quantity===a}),f=(null==d?void 0:d.price)||0,p=(null==d?void 0:d.basePrice)||0;return{priceForChosenQuantity:f,basePriceForChosenQuantity:s?p:null}},n8=function(e){var t=n7({addOn:e.addOn,product:e.product});return(0,x.tZ)(n0,{basePrice:t.basePriceForChosenQuantity,price:t.priceForChosenQuantity})},n9=function(e){var t=e.isPfandEnabled,r=(0,D.ZP)(M.cart).translateRaw,n=n$();if(!t)return null;var o=n(3.99);return(0,x.tZ)(_.xu,{display:"flex",justifyContent:"flex-end","data-test-id":"item-pfand",children:(0,x.tZ)(_.xv,{type:"body-sm-regular",color:"neutral.600",whiteSpace:"nowrap","aria-label":r(q.accessibilityLabel,{price:o}),children:"+ ".concat(o," ").concat(r(q.title))})})},oe=r(827921),ot=r.n(oe),or=r(333021),on=function(e){var t,r=e.recipeNames,n=(0,D.ZP)(M.cart),o=n.translate,i=n.translateRaw;return 1===r.length?(0,x.tZ)(_.xv,{color:"inherit",children:"".concat(i("".concat(M.cart,".revamp.extra.pairing"))," ").concat(null==r?void 0:null===(t=r.at)||void 0===t?void 0:t.call(r,0))}):(0,x.BX)(_.xv,{color:"inherit",children:[o("".concat(M.cart,".revamp.extra.pairing")),r.map(function(e){return(0,x.tZ)(_.xu,{pl:"sm-2",children:(0,x.tZ)(_.xu,{display:"list-item","list-style-position":"inside",mx:"xs",children:e})},e)})]})};function oo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var oi=function(e){var t,r=e.addOn,n=e.product,o=(0,D.ZP)(M.cart).translate,i=ef().state.courses.items,a=[];return(0===n7({addOn:r,product:n}).priceForChosenQuantity&&a.push(o("".concat(M.cart,".loyalty.benefits.fxfl"))),r.preselectedQuantity&&a.push((0,x.tZ)(n2,{icon:(0,x.tZ)(or.Z,{}),text:o("".concat(M.cart,".revamp.extra.subscription"),{quantity:r.preselectedQuantity})})),r.pairedWith.length>0&&a.push((0,x.tZ)(on,{recipeNames:i.filter(function(e){var t,n,o=e.id,i=e.modularity;return ot()(r.pairedWith,[o].concat(function(e){if(Array.isArray(e))return oo(e)}(t=(null!==(n=null==i?void 0:i.variations)&&void 0!==n?n:[]).map(function(e){var t,r=e.course;return null==r?void 0:null===(t=r.recipe)||void 0===t?void 0:t.id}).filter(function(e){return e}))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||function(e,t){if(e){if("string"==typeof e)return oo(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oo(e,void 0)}}(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())).length>0}).map(function(e){return e.name})})),(null===(t=r.label)||void 0===t?void 0:t.handle)==="ships-separately"&&a.push(o("".concat(M.cart,".revamp.dropshipping"))),0===a.length)?null:(0,x.tZ)(_.xu,{display:"flex",flexDirection:"column",gap:"xs",justifyContent:"center",width:"fill-available","data-test-id":"
1cart-revamp-add-on-description",children:a.map(function(e,t){return(0,x.tZ)(_.xv,{type:"body-md-regular",color:"neutral.600",children:e},"cart-revamp-add-on-description-".concat(t))})})},oa=function(e){var t=e.item,r=e.mutationDisableReason,n=(0,D.ZP)(M.cart),o=n.translateRaw,i=n.translate;return(0,P.useMemo)(function(){var e=t.isSoldOut;if(t.type===y.AddOns){var n=t.pairedWith,a=t.preselectedQuantity,l=t.quantity,c=t.priceCatalog,u=t.categoryName;if(n.length>0)return i("".concat(M.cart,".menuaddons.editable-order-summary.disabled-increase-decrease-tooltip-message"));if(e)return i("".concat(M.cart,".sold-out-disabled-cta-tooltip"));if(r===v.AtTypeLimit)return i("".concat(M.cart,".menuaddons.tooltip-warning.reached-max-units-type"),{category:u});if(r===v.AtItemLimit){var s,d=c&&(null===(s=c.pricePerQuantity[c.pricePerQuantity.length-1])||void 0===s?void 0:s.quantity);return i("".concat(M.cart,".menuaddons.tooltip-warning.reached-max-product"),{quantity:d})}return a&&1===l?i("".concat(M.cart,".subscription-add-on.min-quantity-disabled-tooltip")):i("".concat(M.cart,".menuaddons.tooltip-warning.reached-max-units"))}return o(e?"".concat(M.cart,".sold-out-disabled-cta-tooltip"):"".concat(M.cart,".single-menu-screen.remove-meal"))},[r,t,i,o])},ol=function(e){var t=e.productName,r=e.onChangeItem,n=e.onRemove,o=(0,D.ZP)(M.cart).translateRaw,i=o("".concat(M.cart,".soldout_product_item.change_item_title")),a=o("".concat(M.cart,".soldout_product_item.remove_item_title")),l=o("".concat(M.cart,".soldout_product_item.error_title"));return(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"xs",width:"100%",children:[(0,x.tZ)(_.gb,{variant:"error",width:"100%","data-test-id":"sold-out-inline-message",icon:(0,x.tZ)(rc.default,{width:24,height:24,"aria-hidden":"true"}),children:(0,x.tZ)(_.xv,{type:"body-sm-regular",children:l})}),(0,x.BX)(_.xu,{display:"flex",gap:"xs",width:["100%","346px","346px"],children:[(0,x.tZ)(_.zx.Primary,{size:"sm","data-test-id":"sold-out-change-item",onClick:r,"aria-label":"".concat(i," ").concat(t),children:i}),(0,x.tZ)(_.zx.Secondary,{size:"sm","data-test-id":"sold-out-remove-item",onClick:n,"aria-label":"".concat(a," ").concat(t),children:a})]})]})},oc=function(e){var t=e.name,r=e.imageSrc,n=e.onChangeItem,o=e.onRemoveAll;return(0,x.BX)(_.xu,{width:"100%",display:"flex",gap:"md-1",py:"xs","data-test-id":"cart-product-item",children:[(0,x.tZ)(_.xu,{display:"flex",flexDirection:"column",opacity:.5,children:(0,x.tZ)(nV,{image:r,name:t})}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:["xxs","xs"],width:"100%",children:[(0,x.tZ)(_.xv,{type:"body-md-bold",children:t}),(0,x.tZ)(ol,{productName:t,onChangeItem:n,onRemove:o})]})]})},ou=function(e){var t,r=e.item,n=e.onIncrease,o=e.onDecrease,i=e.increaseMutationDisableReason,a=e.decreaseMutationDisableReason,l=e.hasItemSaveError,c=e.onChangeItem,u=e.onRemoveAll,s=(0,N.Sj)(),d=tW(),f=(0,D.ZP)(M.cart).translateRaw,p=eZ().isSaving,b=eu().products,m=(0,eE.Z)("pfand_initiative"),v=m.isEnabled,g=m.isReady&&v,h=(0,eE.Z)(L),O=h.isEnabled,w=h.isReady,P=oa({item:r,mutationDisableReason:i}),S=r.type===y.Meals?r:null,k=(0,nX.s)(null==S?void 0:S.itemPrice);if(void 0!==l&&l&&null!=c&&null!=u)return(0,x.tZ)(oc,{name:r.name,imageSrc:r.imageSrc,onChangeItem:c,onRemoveAll:u});var j=function(e){d(e,{type:"product_click",payload:{id:r.id,recipePosition:0}})},C=r.quantity,Z=r.imageSrc,A=r.name,I=r.type,E=r.isSoldOut,T=C*((null===(t=b.delivery)||void 0===t?void 0:t.specs.size)||0),B=function(){switch(I){case y.Meals:var e,t,n=null!==(t=null===(e=b.delivery)||void 0===e?void 0:e.specs.size)&&void 0!==t?t:1;return{headerSlot:k&&(null==S?void 0:S.itemPrice)?(0,x.tZ)(n0,{price:S.itemPrice.amount*C*n,basePrice:null}):null,servingsSlot:(0,x.BX)(_.xu,{color:"neutral.600",display:"flex",gap:"xxs",alignItems:"center",children:[(0,x.tZ)(nN.default,{width:16,height:16,"aria-hidden":"true"}),(0,x.tZ)(_.xv,{type:"body-md-regular",color:"neutral.600",children:"".concat(T," ").concat(f("".concat(M.cart,".product-item.servings.short")))})]}),stepperSlot:(0,x.tZ)(n3,{course:r,shouldShowAbsolutePrice:k})};case y.AddOns:return{headerSlot:(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"flex-end",children:[(0,x.tZ)(n8,{addOn:r,product:b.delivery}),(0,x.tZ)(n9,{isPfandEnabled:g})]}),servingsSlot:null,stepperSlot:(0,x.tZ)(oi,{addOn:r,product:b.delivery})}}}(),R=B.headerSlot,q=B.servingsSlot,U=B.stepperSlot;return(0,x.BX)(_.xu,{width:"100%",display:"flex",gap:"md-1",py:"xs","data-test-id":"
1cart-product-item",children:[(0,x.BX)(nF,{display:"flex",flexDirection:"column",cursor:"pointer",onClick:function(e){return j(e)},children:[(0,x.tZ)(nV,{image:Z,name:A}),"mobile"===s&&q]}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:["xxs","xs"],width:"100%",children:[(0,x.BX)(_.xu,{children:[(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",children:[(0,x.tZ)(nF,{onClick:function(e){return j(e)},width:"75%",children:(0,x.tZ)(_.xv,{type:"body-md-bold",children:A})}),R]}),"mobile"!==s&&q]}),w&&O&&E&&(0,x.tZ)(nz,{}),(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",flexDirection:["column-reverse","row"],gap:["xs","lg-1"],width:"fill-available",children:[(0,x.tZ)(_.xu,{display:"flex",alignItems:"center",minWidth:"100px",children:(0,x.tZ)(nJ,{quantity:C,onIncrease:n,onDecrease:o,canIncrease:null===i,canDecrease:null===a,tooltipMessage:P,shouldShowTooltip:!p,itemName:A})}),U]})]})]})},os=function(){var e=(0,D.ZP)(M.cart).translate;return(0,x.BX)(_.xu,{my:"md-1",display:"flex",alignItems:"center",flexDirection:"column",gap:"md-1","data-test-id":"cart-empty-layout",children:[(0,x.tZ)("img",{src:"".concat(R,"/auto-save/empty-box.svg"),alt:""}),(0,x.tZ)(_.xu,{alignItems:"center",display:"flex",flexDirection:"column",gap:"xs",children:(0,x.tZ)(_.xv,{as:"h4",children:e("".concat(M.cart,".autosave.cart-empty-header"))})})]})},od=r(156141),of=r.n(od),op=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return{perServing:0,perProduct:0,perServingWithoutShipping:0};var r=e.price,n=e.oneOffPrice,o=e.shippingPrice,i=e.specs,a=i.size,l=i.meals,c=t&&n?n:r,u=c+(o||0),s=a*l;return{perServing:u/s,perProduct:u/a,perServingWithoutShipping:c/s}},ob=function(e){switch(e){case 2:return"".concat(M.cart,".seamless.seamlessMessageBannerSecond");case 3:return"".concat(M.cart,".seamless.seamlessMessageBannerThird");default:return"".concat(M.cart,".seamless.seamlessMessageBannerXth")}},oy=function(e){var t=e.subscriptionProduct,r=e.nextAvailableProduct,n=e.currentProduct,o=(null==n?void 0:n.sku)!==(null==t?void 0:t.sku),i=(null==r?void 0:r.sku)!==(null==t?void 0:t.sku),a=op(n,o),l=op(t,!1),c=op(r,i),u=(null==r?void 0:r.specs)||{meals:0,size:0},s=u.meals,d=u.size,f=a.perServing,p=l.perServingWithoutShipping,b=c.perProduct-a.perProduct;return{basePrice:f,basePriceWithoutShipping:p,upgradePrice:b,meals:s,size:d,perServingSave:f-b,totalSave:s*d*(f-b),percentSave:(p-b)/p*100}},om=function(e){var t=e.type,r=e.overallQuantity,n=e.showSimplifiedCopy,o=void 0!==n&&n,i=n$(),a=eu(),l=a.belowMinimumDelta,c=a.products,u=(0,en.n6)().subscription,s=to().upgradeNudge,d=(0,D.ZP)(M.cart).translateRaw,f=(0,D.ZP)(M.store).translateRaw;return(0,P.useMemo)(function(){switch(t){case y.AddOns:return{visual:d("".concat(M.cart,".eos.addons.shop-the-hf-market"))};case y.Meals:if(of()(c.max,c.current))return{visual:d("".concat(M.cart,".autosave.cart-max-meals-reached"))};if(l>0)return{visual:d("".concat(M.cart,".autosave.cart-add-missing-courses-").concat(l>1?"plural":"singular"),{numberOfMeals:l})};var e=oy({nextAvailableProduct:c.next,currentProduct:c.current,subscriptionProduct:c.subscription}),n=e.meals,a=e.upgradePrice,p=e.basePrice,b=e.perServingSave,m=e.totalSave,v=e.basePriceWithoutShipping,g=e.percentSave,h=d(ob(n),{meals:n});if(s){var O,w=(O=d(ob(n),{meals:n}),o?d("".concat(M.cart,".revamp.seamless.seamlessMessageBanner"),{number:O}):f(p<=a?"".concat(M.store,".extraMeal.messageNoDiscount"):"".concat(M.store,".extraMeal.messageWithDiscount"),{number:O,basePrice:i(p),price:i(a)}));if(p>a)return{visual:w,screenReader:d("".concat(M.cart,".seamless.discountMessage.screenReader"),{number:h,price:i(a),basePrice:i(p)})};return{visual:w}}var x=(S=(P={basePrice:p,upgradePrice:a}).basePrice,k=P.upgradePrice,((null==u?void 0:u.productType.specs.meals)||0)<r?"".concat(M.cart,".single-menu-screen.select-up-x-meal"):S<=k?"".concat(M.cart,".seamless.seamlessMessageBannerNoDiscount"):"".concat(M.cart,".revamp.seamless.seamlessMessageBanner"));if(x){var P,S,k,j,C=d(x,{number:h,price:i(a),basePrice:i(p),percentSave:g,perServingSave:i(b),totalSave:i(m),subPrice_noShipping:i(v),value:(null===(j=c.max)||void 0===j?void 0:j.specs.meals)||0});if(x==="".concat(M.cart,".revamp.seamless.seamlessMessageBanner")&&p>a)return{visual:C,screenReader:d("".concat(M.cart,".seamless.discountMessage.screenReader"),{number:h,price:i(a),basePrice:i(p)})};return{visual:C}}}}
1,[t,d,f,c,l,null==u?void 0:u.productType.specs.meals,r,i,s,o])},ov=r(749427),og=P.createContext({}),oh=og.Provider,oO=function(){return(0,P.useContext)(og)},ow=function(){var e=(0,D.ZP)(M.cart).translate;return oO().snapState===g.Disabled?null:(0,x.BX)(_.xu,{display:"flex",alignItems:"center",gap:"global.xxs",color:"global.gray.600",role:"status","aria-label":"SNAP eligibility information",paddingTop:"global.xxs",children:[(0,x.tZ)(ov.Z,{"aria-hidden":"true"}),(0,x.tZ)(_.xv,{type:"body-xs-regular",color:"global.gray.600",margin:"zero",children:e("".concat(M.cart,".snap.eligibility.text"))})]})},ox=function(e){var t=e.cartLimitExceeded,r=(0,D.ZP)(M.cart),n=r.translate,o=r.translateRaw,i=function(){switch(t.limitType){case"ADDON_BOX":return o("".concat(M.cart,".cart-limit-exceeded.remove-to-add-extras"));case"ADDON_CATEGORY":var e;return n("".concat(M.cart,".cart-limit-exceeded.category-limit"),{category:null!==(e=t.category)&&void 0!==e?e:""});default:return o("".concat(M.cart,".cart-limit-exceeded.remove-to-add"))}}();return(0,x.tZ)(_.xu,{"data-test-id":"cart-limit-remove-to-add-message",children:(0,x.tZ)(_.gb,{variant:"warning",width:"100%",icon:(0,x.tZ)(rc.default,{width:24,height:24,"aria-hidden":"true"}),children:(0,x.tZ)(_.xv,{type:"body-sm-regular",children:i})})})},oP=r(114902),oS=function(e){var t=(0,oP.S)(),r=t.isExperimentEnabled;return!t.isLoading&&r&&"meals"===e},ok=r(215345),oj=r(987167),oC=r(988402),oZ=function(e){var t,r,n=e.icon,o=n.component,i=n.color,a=void 0===i?"neutral.800":i,l=e.text,c=l.top,u=l.bottom,s=e.ariaLabelledBy,d=e.ariaLabel,f=e.onClick,p=e.clickIndicator,b=void 0===p?(0,x.tZ)(oC.default,{}):p,y=e.style,m=(void 0===y?{}:y).backgroundColor,v=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e.style,["backgroundColor"]),g=(0,P.useId)(),h=s?"".concat(s,"-").concat(g):g,O="".concat(h,"-click");return(0,x.BX)(nF,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({px:"sm-1",py:"xs",width:"100%",display:"flex",alignItems:"center",onClick:function(e){return null==f?void 0:f(e)},backgroundColor:void 0===m?"alias.interactive-alt.surface.level-1":m,justifyContent:"space-between",borderRadius:"border-radius-md",cursor:f?"pointer":"default",minHeight:"4rem","aria-label":d},v),r=r={children:[(0,x.BX)(_.xu,{display:"flex",gap:"xs",children:[o&&(0,x.tZ)(_.xu,{color:a,display:"flex",alignItems:"center","aria-hidden":"true",children:o}),(0,x.BX)(_.xu,{id:h,display:"flex",flexDirection:"column",justifyContent:"center","aria-hidden":d?"true":void 0,children:[(0,x.tZ)(_.xv,{type:"body-md-regular",children:c}),u&&(0,x.tZ)(_.xv,{type:"body-md-bold",children:u})]})]}),f&&(0,x.tZ)(_.xu,{id:O,color:a,display:"flex",alignItems:"center","aria-hidden":d?"true":void 0,children:b})]},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))},oA=function(e){var t=e.type,r=e.onClick,n=e.overallQuantity,o=oS(t===y.Meals?"meals":"add-ons"),i=(0,ok.x)(),a=i.isAllocated,l=i.isReady,c=eD().isModularityOnlyMarket,u=eu(),s=u.isBelowMinimum,d=u.isBelowExpected,f=u.products,p=rZ(),b=rD(),m=b.isAllocated,v=b.isReady,g=om({type:t,overallQuantity:n,showSimplifiedCopy:o||l&&a||v&&m}),h=of()(f.max,f.current),O=t===y.Meals&&h?(0,x.tZ)(rN.default,{}):(0,x.tZ)(oj.default,{});if(t===y.Meals&&((p?d:s)||!v)||t===y.AddOns&&c)return null;var w=t===y.Meals&&of()(f.max,f.current),P=tD(g)||"Add more items";return(0,x.tZ)(_.xu,{mt:"sm-1","data-test-id":"add-more-nudge",children:(0,x.tZ)(oZ,{icon:{component:O,color:"neutral.800"}
1,text:{top:(0,x.tZ)(_.xv,{type:"body-md-bold","aria-hidden":!0,children:(0,x.tZ)(rI.Z,{copy:(null==g?void 0:g.visual)||"",hasMarkdown:!0})})},ariaLabel:P,onClick:w?void 0:r})})},o_=function(e){var t,r,n,o=e.type,i=e.onAddMoreButtonClick,a=e.isCartEmpty,l=(0,D.ZP)(M.cart).translateRaw,c=eu(),u=c.isBelowMinimum,s=c.isBelowExpected,d=c.belowMinimumDelta,f=c.belowExpectedDelta,p=(0,en.n6)().delivery.deliveryDate,b=ti(),m=rZ(),v=m?f:d,g=(0,P.useMemo)(function(){return a?{translation:l(b?"".concat(M.cart,".autosave.cart-fill-with-meals-rte"):"".concat(M.cart,".autosave.cart-fill-with-meals"),{numberOfMeals:v,date:(0,rx.Z)((0,rP.Z)(p),rS.n1)}),hasNonBoldText:!0}:{translation:l("".concat(M.cart,".autosave.cart-add-missing-courses-").concat(v>1?"plural":"singular"),{numberOfMeals:v}),hasNonBoldText:!1}},[v,p,a,l,b]),h=g.translation,O=g.hasNonBoldText;return(m?s:u)&&o!==y.AddOns?(0,x.BX)(_.xu,{role:"button",tabIndex:0,"aria-labelledby":"below-minimum-nudge-label","data-test-id":"below-minimum-nudge",display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",my:"xs",cursor:"pointer",onClick:i,onKeyDown:function(e){("Enter"===e.key||" "===e.key)&&(e.preventDefault(),i())},pseudo:(n={backgroundColor:"global.cherry.400"},(r=":hover .cart-add-more-nudge")in(t={})?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t),children:[(0,x.BX)(_.xu,{display:"flex",gap:"md-1",alignItems:"center",children:[(0,x.tZ)(_.xu,{color:"global.gray.800",className:"cart-add-more-nudge",minWidth:["72px","90px"],height:["72px","90px"],display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"border-radius-sm",backgroundColor:"shared-alias.negative.background.disabled",children:(0,x.tZ)(oj.default,{"aria-hidden":"true"})}),(0,x.tZ)(_.xv,{id:"below-minimum-nudge-label",type:O?"body-md-regular":"body-md-bold",color:"global.gray.800",children:(0,x.tZ)(rI.Z,{copy:h,hasMarkdown:!0,"aria-hidden":"true"})})]}),(0,x.tZ)(oC.default,{"aria-hidden":"true"})]}):null},oD=r(143475),oI=r(466993),oE=r(458196),oT=function(e){var t=e.items,r=to().showAverageMacros,n=(0,D.ZP)(M.cart).translate,o=(0,P.useMemo)(function(){if(0===t.length)return null;var e=0,r=0,n=0,o=0;return(t.forEach(function(t){var i,a,l,c,u=t.nutrition,s=null!==(i=t.quantity)&&void 0!==i?i:0;u&&s>0&&(e+=(null!==(a=u.calories)&&void 0!==a?a:0)*s,r+=(null!==(l=u.carbohydrate)&&void 0!==l?l:0)*s,n+=(null!==(c=u.protein)&&void 0!==c?c:0)*s,o+=s)}),0===o)?null:{avgKcal:Math.round(e/o),avgCarbs:Math.round(r/o),avgProtein:Math.round(n/o)}},[t]);if(!r||!o)return null;var i=o.avgKcal,a=o.avgCarbs,l=o.avgProtein;return(0,x.BX)(_.xu,{display:"flex",gap:"global.sm-1",py:"global.xs","data-test-id":"average-macros",flexDirection:["column","row"],children:[(0,x.tZ)(_.xv,{type:"body-md-regular",children:n("".concat(M.cart,".revamp.meal-average-info.text"))}),(0,x.BX)(_.xu,{display:"flex",gap:"global.sm-1",children:[(0,x.BX)(_.xu,{display:"flex",alignItems:"center","aria-label":"".concat(i," kilocalories"),children:[(0,x.tZ)(_.xu,{color:"global.cherry.500",display:"flex",children:(0,x.tZ)(oD.Z,{"aria-hidden":"true"})}),(0,x.tZ)(_.xu,{pl:"global.xxs",children:(0,x.BX)(_.xv,{type:"body-md-regular",strong:!0,children:[i," kcal"]})})]}),(0,x.BX)(_.xu,{display:"flex",alignItems:"center","aria-label":"".concat(a," grams of carbohydrates"),children:[(0,x.tZ)(_.xu,{color:"global.cherry.800",display:"flex",children:(0,x.tZ)(oI.Z,{"aria-hidden":"true"})}),(0,x.tZ)(_.xu,{pl:"global.xxs",children:(0,x.BX)(_.xv,{type:"body-md-regular",strong:!0,children:[a,"g carbs"]})})]}),(0,x.BX)(_.xu,{display:"flex",alignItems:"center","aria-label":"".concat(l," grams of protein"),children:[(0,x.tZ)(_.xu,{color:"global.cherry.600",display:"flex",children:(0,x.tZ)(oE.Z,{"aria-hidden":"true"})}),(0,x.tZ)(_.xu,{pl:"global.xxs",children:(0,x.BX)(_.xv,{type:"body-md-regular",strong:!0,children:[l,"g protein"]})})]})]})]})},oB=function(e){var t=e.type,r=e.overallQuantity,n=e.productsInfo,o=n.items,i=n.onIncrease,a=n.onDecrease,l=n.onAddMoreButtonClick,c=(0,D.ZP)(M.cart).translate,u=ef().quantities,s=eu().isBelowMinimum,d=eZ().cartLimitExceeded,f=om({type:t,overallQuantity:r}),p=u.courses+u.addOns===0,b=!!(p&&t===y.Meals),m=function(){if(!d)return!1;var e=d.limitType;return t===y.Meals?!e||"MEALKIT_BOX"===e:"ADDON_BOX"===e||"ADDON_CATEGORY"===e}(),v=tX(),g=v.trackIncreaseMealQuantity,h=v.trackDecreaseMealQuantityOrUnselect,O=v.trackAddExtraAddOnNudgeClick,w=v.trackOnAddMissingMealClick,P=v.trackOnAddMoreNudgeMealClick,S=v.trackOnExtraMealAdd,k=v.trackAddOnUnselect,j=v.trackAddOnIncreaseQuantity,C=v.trackAddOnDecreaseQuantity,Z=tJ(),A=Z.canIncrease,I=Z.canDecrease,E=function(){switch(t){case y.Meals:return{onIncrease:function(e){return g({recipeId:e.id,recipeName:e.name}),i(e.index)},onDecrease:function(e){return h({recipeId:e.id,recipeName:e.name,quantity:e.quantity}),a(e.index)}};case y.AddOns:return{onIncrease:function(e){j(e),i(e.id)},onDecrease:function(e){e.quantity>1?C(e):k(e),a(e.id)}}}}(),T=E.onIncrease,B=E.onDecrease,R=function(){t===y.AddOns&&O(),t===y.Meals&&((s?w:P)(),S(s?null:tD(f),{trackAddMoreSnowplow:!s})),l()},L=function(){switch(t){case y.Meals:return c("".concat(M.cart,".revamp.products-list.meals"));case y.AddOns:return c("".concat(M.cart,".revamp.products-list.add-ons"))}}();return(0,x.BX)(_.xu,{mb:t===y.AddOns?"zero":["md-2","md-2","lg-2"],"data-test-id":"
1cart-products-container",display:"flex",flexDirection:"column",gap:"md-1",children:[(0,x.BX)(_.xu,{children:[(0,x.BX)(_.xu,{display:"flex",gap:"xs",alignItems:"center",children:[(0,x.tZ)(_.xv,{as:"h3","data-test-id":"cart-products-container-header",children:L}),!b&&(0,x.tZ)(rC,{quantity:r})]}),t===y.AddOns&&(0,x.tZ)(ow,{})]}),t===y.Meals&&(0,x.tZ)(oT,{items:o}),m&&d&&(0,x.tZ)(ox,{cartLimitExceeded:d}),(0,x.BX)(_.xu,{children:[b?(0,x.tZ)(os,{}):o.map(function(e){var r,n,o=(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),n=n={type:t},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r);return(0,x.tZ)(ou,{item:o,onIncrease:function(){return T(e)},onDecrease:function(){return B(e)},increaseMutationDisableReason:A(o),decreaseMutationDisableReason:I(o)},"cart-product-".concat(e.id))}),(0,x.tZ)(oA,{type:t,overallQuantity:r,onClick:R}),(0,x.tZ)(o_,{type:t,onAddMoreButtonClick:R,isCartEmpty:p})]})]})},oM=function(e){var t=e.fallback,r=e.showFallback,n=e.children;return r?(0,x.tZ)(x.HY,{children:void 0===t?null:t}):(0,x.tZ)(x.HY,{children:n})};function oR(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function oL(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return oR(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oR(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var oq=function(){var e=(0,D.ZP)(M.cart).translate,t=oO(),r=t.snapState,n=t.isLoading,o=(0,N.Sj)(),i=oL((0,rY.Z)("hf_snap_banner_shown_count"),2),a=i[0],l=i[1],c=Number(a)||0,u=oL((0,P.useState)(!1),2),s=u[0],d=u[1],f=function(){var e=document.getElementById("snapEntry");e&&e.scrollIntoView({behavior:"smooth",block:"center"})};return((0,P.useEffect)(function(){!n&&r===g.Available&&c<3&&(d(!0),l((c+1).toString()))},[r,n]),s)?(0,x.tZ)(_.xu,{pb:["global.sm-2","global.md-3"],children:(0,x.tZ)(_.gb,{variant:"information",icon:(0,x.tZ)("img",{src:"".concat(R,"/snap/snap-icon.svg"),alt:"Snap icon",width:24,height:24,"aria-hidden":!0}),onClose:function(){return d(!1)},children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",children:[(0,x.tZ)(_.xv,{type:"body-md-bold",children:e("cart.snap.onboarding.pill")}),"mobile"===o&&(0,x.tZ)(_.rU,{type:"body-md-bold",href:"#",onClick:function(e){e.preventDefault(),f()},children:e("cart.snap.onboarding.pill.link")})]})})}):null},oU=r(379158),oX=r(199471),oN=r(300563),oF=r(996715),oW=r(33270),oz=r(807947),oV=r(66077),oH=(0,oV.Z)("benefitDrawer.config",{errorAssetPath:"/hellofresh_website/wallet/hellofresh/general-apology.png"}).useConfig,oG=function(e){var t=e.children;return(0,x.tZ)(_.xu,{minWidth:[300,null],width:[null,"380px"],my:"md-1",mx:["md-1","md-2"],id:"wallet-side-drawer",children:t})},oQ=function(){var e=oH().errorAssetPath;return(0,x.tZ)(oG,{children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:["sm-1","md-1"],justifyContent:"center",alignItems:"center",my:"lg-1",children:[(0,x.tZ)(r4.ZP,{width:"100",height:"100",src:e,alt:"apology illustration"}),(0,x.BX)(_.xu,{textAlign:"center",children:[(0,x.tZ)(_.xv,{as:"h3",children:(0,x.tZ)(oz.Z,{group:"benefits",applangaKey:"benef
1its.drawer.load.errorTitle"})}),(0,x.tZ)(_.xv,{as:"h4",children:(0,x.tZ)(oz.Z,{group:"benefits",applangaKey:"benefits.drawer.load.errorSubtitle"})})]}),(0,x.tZ)(_.xu,{children:(0,x.tZ)(_.zx.Primary,{onClick:function(){window.location.reload()},children:(0,x.tZ)(oz.Z,{group:"wallet",applangaKey:"wallet.error-discount.refresh"})})})]})})},oJ=function(){return(0,x.tZ)(oG,{children:(0,x.tZ)(_.xu,{height:300,display:"flex",justifyContent:"center",alignItems:"center","data-test-id":"benefit-drawer-loading",children:(0,x.tZ)(_.$j,{size:"lg",variant:"primary"})})})},oK=P.createContext(void 0),oY=oK.Provider,o$=function(){var e=P.useContext(oK);if(!e)throw Error("useBenefitDrawerData must be used within a BenefitDrawerDataProvider");return e},o0=function(e){var t=e.subscriptionId,r=e.weekId,n=e.children,o=(0,oF.Z)({subscriptionId:t,weekId:r,includeDeliveryBenefits:!0}),i=o.isError,a=o.isLoading,l=o.subscription,c=o.benefits,u=o.delivery,s=o.cardsBenefits,d=o.cardsBenefitsOptions,f=(0,oW.f9)().isLoading;return i?(0,x.tZ)(oQ,{}):a||f?(0,x.tZ)(oJ,{}):(0,x.tZ)(oY,{value:{subscription:l,delivery:u,benefits:c,cardsBenefits:s,cardsBenefitsOptions:d},children:n})};function o1(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o2=P.createContext({isError:!1,dismissError:function(){}}),o6=function(e){var t,r=e.children,n=function(e){if(Array.isArray(e))return e}(t=(0,P.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return o1(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return o1(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=n[0],i=n[1],a=(0,P.useRef)(!1),l=(0,oW.f9)().isError;return(0,P.useEffect)(function(){a.current?i(!!l):a.current=!0},[l]),(0,x.tZ)(o2.Provider,{value:{isError:o,dismissError:function(){i(!1)}},children:r})},o3=r(252455),o4=function(){var e=ta(),t=ef().state,r=t.addOns.items,n=t.courses.items;return(0,P.useCallback)(function(t){(0,oN.aT)("menu-benefit-drawer");var o=eg({meals:n.map(function(e){return{id:e.id,index:e.index,quantity:e.quantity}}),addOns:r.map(function(e){return{id:e.id,index:e.index,quantity:e.quantity}})});e({referrer:"store",query:function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},t,o?{selections:o}:{})})},[r,n,e])},o5=r(976555),o7=r(391957),o8=function(e){switch(e.benefitType){case o7.hJ.BOX_VOUCHER:case o7.hJ.MEALBOX_VOUCHER:return e.hasOnlyFreeStandardShipping?"shipping":"box";case o7.hJ.ADDON_VOUCHER:return e.permanent?"addon-basket":"addon";case o7.hJ.PREMIUM_VOUCHER:return e.permanent?"premium-surcharge-basket":"premium-surcharge";case o7.hJ.MEALBOX_FREE_SHIPPING:case o7.hJ.FREE_SHIPPING:return"shipping";case o7.hJ.ADDON_FOR_LIFE:return"addon-for-life";case o7.hJ.AMAZON_PRIME_SHIPPING:return"amazon-free-shipping";case o7.hJ.ADDON_FOR_MULTI_WEEK:return"addon-mwd";case o7.hJ.CARAWAY:return"caraway-pan";case o7.hJ.TEFAL:return"tefal-pan";case o7.hJ.AVIOS:return"avios";case o7.hJ.EXTERNAL_PARTNER_BENEFIT:return e.campaignType||"external-partner";default:return"none"}},o9=function(e){if(!e.units||1===e.units.length)return{multiWeekDiscountConfiguration:"none",multiWeekDiscountFulfilled:"none"};var t=e.units.map(function(e){return e.hasOnlyFreeStandardShipping?"none":(e.rawDiscountValue||0)/100}
1),r=e.units.filter(function(e){return e.isDelivered}).length;return{multiWeekDiscountConfiguration:t.join(","),multiWeekDiscountFulfilled:r}},ie=function(e){var t,r,n,o,i,a=o8(e),l=o9(e),c=l.multiWeekDiscountConfiguration,u=l.multiWeekDiscountFulfilled;return{value_offer:(null!==(t=e.rawDiscountValue)&&void 0!==t?t:0)/100,value_type_offer:null!==(r=e.discountType)&&void 0!==r?r:"none",free_shipping_offer:!!(e.hasOnlyFreeStandardShipping||e.hasFreeStandardShipping),name_offer:null!==(n=e.promiseId)&&void 0!==n?n:e.id,item_offer:a,expiry_offer:null!==(o=e.expiryDate)&&void 0!==o?o:"none",mwd_configuration:c,mwd_fulfilled:u,benefit_source:null!==(i=e.source)&&void 0!==i?i:"none",is_swappable:!!e.isSwappable,is_applied:!!e.isApplied}},it=function(e){var t,r,n=e.benefit,o=e.position,i=e.subscriptionId,a=e.customerId,l=e.weekId,c="walletDrawerOffer",u="display";return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({tribe:"customer-benefits",squad:"price-and-benefits-communication",event_name:"Wallet_DrawerOfferDisplay",user_action:u,element:c,screen:"CART",subscription_id:i,customer_id:a,hf_week:(0,o5.Z)(),hf_menu_week:l,offer_position:o},ie(n)),r=r={event:"gaEventTrigger",gaEventCategory:"wallet",gaEventAction:"".concat(c,"|").concat(u)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t},ir=function(e){var t,r,n=e.benefit,o=e.position,i=e.subscriptionId,a=e.customerId,l=e.weekId,c="walletDrawerOffer",u="clickSelectItems";return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({tribe:"customer-benefits",squad:"price-and-benefits-communication",event_name:"Wallet_OfferClick",user_action:u,element:c,screen:"CART",subscription_id:i,customer_id:a,hf_week:(0,o5.Z)(),hf_menu_week:l,offer_position:o},ie(n)),r=r={event:"gaEventTrigger",gaEventCategory:"wallet",gaEventAction:"".concat(c,"|").concat(u)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t},io=function(e){var t,r,n=e.benefit,o=e.position,i=e.subscriptionId,a=e.customerId,l=e.weekId,c="walletDrawerOffer",u="clickMoreDetails";return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({tribe:"customer-benefits",squad:"price-and-benefits-communication",event_name:"Wallet_OfferClick",user_action:u,element:c,screen:"CART",subscription_id:i,customer_id:a,hf_week:(0,o5.Z)(),hf_menu_week:l,offer_position:o},ie(n)),r=r={event:"gaEventTrigger",gaEventCategory:"wallet",gaEventAction:"".concat(c,"|").concat(u)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}
1)(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t},ii=function(e){var t,r,n=e.benefit,o=e.position,i=e.subscriptionId,a=e.customerId,l=e.weekId,c="walletDrawerOffer",u="clickSwap";return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({tribe:"customer-benefits",squad:"price-and-benefits-communication",event_name:"Wallet_DrawerOfferClickSwap",user_action:u,element:c,screen:"CART",subscription_id:i,customer_id:a,hf_week:(0,o5.Z)(),hf_menu_week:l,offer_position:o},ie(n)),r=r={event:"gaEventTrigger",gaEventCategory:"wallet",gaEventAction:"".concat(c,"|").concat(u)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t},ia=function(e){var t,r,n=e.benefit,o=e.position,i=e.subscriptionId,a=e.customerId,l=e.weekId,c="walletDrawerOffer",u="clickSelect";return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({tribe:"customer-benefits",squad:"price-and-benefits-communication",event_name:"Wallet_OfferDetailsClick",user_action:u,element:c,screen:"CART",subscription_id:i,customer_id:a,hf_week:(0,o5.Z)(),hf_menu_week:l,offer_position:o},ie(n)),r=r={event:"gaEventTrigger",gaEventCategory:"wallet",gaEventAction:"".concat(c,"|").concat(u)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t},il=function(e){var t,r,n=e.benefit,o=e.position,i=e.subscriptionId,a=e.customerId,l=e.weekId,c="walletDrawerOffer",u="clickBack";return t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({tribe:"customer-benefits",squad:"price-and-benefits-communication",event_name:"Wallet_OfferDetailsClick",user_action:u,element:c,screen:"CART",subscription_id:i,customer_id:a,hf_week:(0,o5.Z)(),hf_menu_week:l,offer_position:o},ie(n)),r=r={event:"gaEventTrigger",gaEventCategory:"wallet",gaEventAction:"".concat(c,"|").concat(u)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t},ic=function(){var e=o$(),t=e.delivery,r=e.subscription,n=(0,tp.Z)().push;return{onOfferDisplay:(0,P.useCallback)(function(e){n(it({benefit:e.benefit,position:e.position,subscriptionId:r.id,customerId:r.customer.id,weekId:t.id}))},[n,r.id,r.customer.id,t.id]),onOfferSelectItemsClick:(0,P.useCallback)(function(e){n(ir({benefit:e.benefit,position:e.position,subscriptionId:r.id,customerId:r.customer.id,weekId:t.id}))},[n,r.id,r.customer.id,t.id]),onOfferMoreDetailsClick:(0,P.useCallback)(function(e){n(io({benefit:e.benefit,position:e.position,subscriptionId:r.id,customerId:r.customer.id,weekId:t.id}))},[n,r.id,r.customer.id,t.id]),onOfferSwapClick:(0,P.useCallback)(function(e){n(ii({benefit:e.benefit,position:e.position,subscriptionId:r.id,customerId:r.customer.id,weekId:t.id}))},[n,r.id,r.customer.id,t.id]),onOfferDetailsSelectClick:(0,P.useCallback)(function(e){n(ia({benefit:e.benefit,position:e.position,subscriptionId:r.id,customerId:r.customer.id,weekId:t.id}))}
1,[n,r.id,r.customer.id,t.id]),onOfferDetailsBackClick:(0,P.useCallback)(function(e){n(il({benefit:e.benefit,position:e.position,subscriptionId:r.id,customerId:r.customer.id,weekId:t.id}))},[n,r.id,r.customer.id,t.id])}},iu=[o7.hJ.MEALBOX_VOUCHER,o7.hJ.MEALBOX_FREE_SHIPPING,o7.hJ.BOX_VOUCHER,o7.hJ.FREE_SHIPPING,o7.hJ.AMAZON_PRIME_SHIPPING],is=function(e){var t=e.isPaused,r=o$().cardsBenefits.every(function(e){return iu.includes(e.benefitType)});return(0,x.BX)(_.xu,{px:["md-1","md-2"],mt:"md-2",children:[(0,x.tZ)(_.xu,{children:(0,x.tZ)(_.xv,{as:"h3",mb:"sm-2",children:(0,x.tZ)(oz.Z,{group:"benefits",applangaKey:t?"benefits.drawer.unskip.title":"benefits.drawer.title"})})}),r&&(0,x.tZ)(_.xu,{children:(0,x.tZ)(_.xv,{as:"p",type:"body-md-bold",color:"neutral.600",mb:"sm-2",children:(0,x.tZ)(oz.Z,{group:"benefits",applangaKey:t?"benefits.drawer.unskip.subtitle":"benefits.drawer.subtitle"})})})]})},id=function(e){return e.isPaused?(0,x.tZ)(_.xu,{position:"sticky",bottom:0,backgroundColor:"neutral.100",mt:"sm-2",px:["md-1","md-2"],py:"sm
1-2",boxShadow:"shadow-xl",children:(0,x.tZ)(_.zx.Primary,{appearance:"negative",width:"100%",children:(0,x.tZ)(oz.Z,{group:"benefits",applangaKey:"benefits.drawer.unskip.button"})})}):null},ip=function(){var e=P.useContext(o2),t=e.isError,r=e.dismissError,n=(0,D.ZP)("benefits").translateRaw;return t?(0,x.tZ)(_.xu,{position:"sticky",top:0,zIndex:1e3,"data-test-id":"error-benefit-selection",children:(0,x.tZ)(_.Yo,{icon:(0,x.tZ)(rN.default,{}),onDismiss:r,variant:"error",content:n("benefits.drawer.swap.error")})}):null},ib=function(){var e=o$(),t=e.cardsBenefits,r=e.cardsBenefitsOptions,n=e.delivery,o=ic(),i=o.onOfferDisplay,a=o.onOfferSelectItemsClick,l=o.onOfferMoreDetailsClick,c=o.onOfferSwapClick,u=o.onOfferDetailsSelectClick,s=o.onOfferDetailsBackClick,d=o4(),f="PAUSED"===n.state,p=t.map(function(e,t){var r,n;return r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e),n=n={onCardDisplay:function(){i({benefit:e,position:t+1})},onSelectItemClick:function(){a({benefit:e,position:t+1}),(0,oN.aT)("menu-benefit-drawer")},onDetailsClick:function(){l({benefit:e,position:t+1})},onRadioSwapClick:function(){c({benefit:e,position:t+1})},onDetailsSelectItemClick:function(){u({benefit:e,position:t+1}),(0,oN.aT)("menu-benefit-drawer")},onDetailsDialogBackClick:function(){s({benefit:e,position:t+1})}},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r});return(0,x.BX)(x.HY,{children:[(0,x.tZ)(ip,{}),(0,x.tZ)(is,{isPaused:f}),(0,x.tZ)(oG,{children:(0,x.tZ)(o3.Z,{renderingBehaviour:"sliding-panel",benefits:p,benefitOptionsOverride:r,onNavigateToStore:d})}),(0,x.tZ)(id,{isPaused:f})]})},iy=function(){var e="benefit-drawer-cart",t=(0,en.n6)(),r=t.delivery,n=t.subscription;return(0,x.tZ)(r3.Z,{claim:{name:"rewards",githubTeam:"hellofresh/squad-rewards-web",tribe:"loyalty",alliance:"consumer",jiraPrefix:"REW",slackChannel:"#squad-rewards",slackAlertsChannel:"#squad-rewards-alerts",skipLabelsOnPR:!1,teamIdentifier:"rewards"},children:(0,x.tZ)(C.Z,{scope:e,fallback:(0,x.tZ)(oQ,{}),children:(0,x.tZ)(nb.Z,{componentName:e,children:(0,x.tZ)(o6,{children:(0,x.tZ)(o0,{subscriptionId:n.id,weekId:r.id,children:(0,x.tZ)(ib,{})})})})})})},im=r(745539),iv=r(346268),ig=function(){var e=new URLSearchParams(window.location.search).get("gwp_cart_banner");return"last-box"===e||"ready-to-claim"===e?e:null},ih=function(){var e,t=(0,im.J)(),r=t.data,n=t.isLoading,o=t.campaigns,i=t.isGwpEnabled,a=t.isReadyToClaim,l=ig();return l?{state:l,campaignType:null!==(e=null==r?void 0:r.campaignType)&&void 0!==e?e:"carawaypan"}:i&&!n&&r&&(0,iv.Wr)(r.campaignType,o)&&!r.isClaimWindowClosed?r.isEligibleForRedemption?{state:"ready-to-claim",campaignType:r.campaignType}:1===r.boxesRemaining?{state:a?"ready-to-claim":"last-box",campaignType:r.campaignType}:null:null},iO=function(){var e=ih(),t=(0,D.ZP)("cart").translateRaw;if(!e)return null;var r=e.state,n=e.campaignType,o=t("cart.gwp-progress-banner.".concat(n,".").concat(r));return(0,x.tZ)(_.xu,{as:"button",onClick:function(){var e=oX.Z.create((0,x.tZ)(iy,{}),{id:"gwp-benefit-drawer"});(0,oN.Tk)(e)},backgroundColor:"alias.benefits.default",pl:"sm-1",pr:"xs",py:"xs",mb:"md-1",cursor:"pointer","data-test-id":"gwp-progress-banner",borderWidth:0,borderRadius:"16px 0 16px 0",borderColor:"transparent",width:"100%",children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",gap:"xs",children:[(0,x.BX)(_.xu,{display:"flex",alignItems:"center",gap:"global.xs",children:[(0,x.tZ)(_.xu,{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:"32px",height:"32px",borderRadius:"border-radius-circle",backgroundColor:"neutral.800",transform:"scaleX(-1)",children:(0,x.tZ)(_.JO,{icon:(0,x.tZ)(oU.Z,{}),color:"global.white","aria-hidden":"true"})}),(0,x.tZ)(_.xv,{type:"body-md-regular","data-test-id":"gwp-progress-banner-text",children:(0,x.tZ)(rI.Z,{copy:o})})]}),(0,x.tZ)(_.xu,{display:"flex",alignItems:"center",flexShrink:0,children:(0,x.tZ)(oC.default,{"aria-hidden":"true"})})]})})},iw=function(){var e=(0,D.ZP)("cart").translate,t=eu(),r=t.isBelowMinimum,n=t.products,o=ti();if(!r||!o||!n.min)return null;var i=n.min.specs.meals;return(0,x.tZ)(_.xu,{marginBottom:"global.md-3",children:(0,x.tZ)(_.Yo,{variant:"error",children:(0,x.tZ)(_.xv,{type:"body-md-bold",children:e("cart.below-minimum-warning",{minMeals:i})})})})};function ix(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function iP(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var iS=function(){var e,t=eD(),r=t.error,n=t.mainCategory,o=t.isMarketAvailable,i=t.isModularityOnlyMarket,a=ef(),l=a.state,c=l.isLoading,u=l.courses,s=l.addOns,d=a.quantities,f=tH(),p=f.onIncreaseAddOn,b=f.onDecreaseAddOn,m=f.onIncreaseCourse,v=f.onDecreaseCourse,g=ta(),h=(0,N.Sj)(),O=ti(),w=to().marketStepParams,P=O?"xsell-store":"store",S=iP(ix({},u),{onIncrease:m,onDecrease:v,onAddMoreButtonClick:function(){return g({referrer:P,query:{category:n}})}}),k=iP(ix({},s),{onIncrease:p,onDecrease:b,onAddMoreButtonClick:function(){return g({referrer:P,query:ix({},w)})}}),j=function(e,t,r){return(0,x.tZ)(oB,{type:e,productsInfo:t,overallQuantity:r})},C=i&&(null==k?void 0:null===(e=k.items)||void 0===e?void 0:e.length)>0,Z=(o&&!i||C)&&!O?j(y.AddOns,k,d.addOns):null,A=j(y.Meals,S,d.courses);return(0,x.tZ)(_.xu,{width:["100%","100%","723px"],children:(0,x.tZ)(oM,{showFallback:c,fallback:(0,x.tZ)(Q,{}),children:!r&&(0,x.BX)(x.HY,{children:["desktop"===h&&(0,x.tZ)(oq,{}),(0,x.tZ)(iw,{}),(0,x.tZ)(iO,{}),A,Z]})})})},ik=r(723740),ij=r(235487),iC=P.createContext({upsellAddOns:[],upsellAddOnsUnfiltered:[]}),iZ=iC.Provider,iA=function(){return(0,P.useContext)(iC)},i_={name:"product-details",githubTeam:"hellofresh/squad-product-details-web",tribe:"shopping-experience",alliance:"food",jiraPrefix:"PROD",slackChannel:"#squad-product-details",slackAlertsChannel:"#squad-product-details",teamIdentifier:"product-details"},iD=r(809805),iI=function(){var e,t=(0,iD.Ae)("price-anchoring-cart-threshold");return(null==t?void 0:t.isReady)&&(null===(e=t.value)||void 0===e?void 0:e.threshold)?t.value.threshold:null},iE=function(){var e=iA().upsellAddOnsUnfiltered,t=iI(),r=(0,eE.Z)("price_anchoring_in_cart"),n=r.isEnabled,o=r.isReady,i=function(e){var t,r,n=null===(r=e.priceCatalog)||void 0===r?void 0:null===(t=r.pricePerQuantity[0])||void 0===t?void 0:t.price;return null!=n?n:null},a=(0,P.useMemo)(function(){return null==t?[]:e.filter(function(e){var r=i(e);return null!=r&&r<=t})},[e,t]),l=!!(n&&o)&&a.length>=5;return{addOns:a,shouldShowPriceAnchoring:l,threshold:t}},iT=function(e){var t=e.navigate,r=e.carouselId,n=e.disabled;return(0,x.tZ)(_.hU.Tertiary,{id:"arrow-right-".concat(r),size:"sm",shape:"square",icon:(0,x.tZ)(oC.default,{}),onClick:t,disabled:n,"aria-label":"move carousel to next page"})},iB=function(e){var t=e.navigate,r=e.carouselId,n=e.disabled;return(0,x.tZ)(_.hU.Tertiary,{id:"arrow-left-".concat(r),size:"sm",shape:"square",icon:(0,x.tZ)(ik.default,{}),onClick:t,disabled:n,"aria-label":"move carousel to previous page"})},iM=function(){var e=(0,ij.D)().isDesktop,t=ti(),r=(0,P.useRef)(null),n=(0,P.useRef)(null),o=(0,D.ZP)(M.cart),i=o.translate,a=o.translateRaw,l=ta(),c=tW(),u=tX().trackAddOnsCarouselScrolledToEnd,s=iA().upsellAddOns,d=tH().onAddAddOn,f=eD(),p=f.isLoading,b=f.isMarketAvailable,y=tJ().canIncrease,m=iE(),v=m.addOns,g=m.shouldShowPriceAnchoring,h=m.threshold,O=n$(),w=g?v:s,S=b&&!t;if((0,P.useEffect)(function(){if(S){var e,t=function(e){var t=e.target;t&&t.scrollWidth===t.scrollLeft+t.clientWidth&&u()};return null===(e=n.current)||void 0===e||e.addEventListener("scrollend",t),function(){var e;return null===(e=n.current)||void 0===e?void 0:e.removeEventListener("scrollend",t)}}},[u,S]),!S)return null;var k=e?{partialSlideView:!1,showBulletPagination:!0,showArrowNavigation:!0,showNodeBlock:!0}:{partialSlideView:!0,showBulletPagination:!1,showArrowNavigation:!1,showNodeBlock:!1},j=k.partialSlideView,Z=k.showBulletPagination,A=k.showArrowNavigation,I=k.showNodeBlock;return(0,x.tZ)(oM,{showFallback:p,fallback:(0,x.tZ)(J,{}),children:(null==w?void 0:w.length)?(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"md-1",children:[(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,x.tZ)(_.xv,{as:"h3",children:g?i("".concat(M.cart,".revamp.price_anchoring_carousel.title"),{price:O(h,{trailingZeros:!1})}):i("".concat(M.cart,".revamp.market_cross_selling_eos.title"))}),(0,x.BX)(_.xu,{display:"flex",alignItems:"center",gap:"sm-1",children:[(0,x.tZ)(_.zx.Tertiary,{"aria-label":a("".concat(M.cart,".revamp.market_cross_selling_eos.browse")),"data-test-id":"browse-all-cta",onClick:function(){return l({referrer:"store",query:{category:"market"}})},size:"sm",__dangerouslySetCustomCSS:{paddingX:["8px","24px","8px"]},children:i("".concat(M.cart,".revamp.market_cross_selling_eos.browse"))}),I&&(0,x.tZ)(_.xu,{display:"flex",ref:r})]})]}),(0,x.tZ)(_.lr,{id:"add-on",carouselRole:"group",arrowLeft:iB,arrowRight:iT,arrowRefs:{LEFT:r,RIGHT:r},partialSlideView:j,showBulletPagination:Z,showArrowNavigation:A,hideNavigationWhenSinglePage:!0,sliderRef:n,paddingX:"zero",children:w.map(function(e,t){return(0,x.tZ)(C.Z,{scope:"product-cards-page-level",claimOverride:i_,fallback:(0,x.tZ)(P.Fragment,{}),children:(0,x.tZ)(_.xu,{pr:t===w.length-1?"zero":["sm-2","sm-2","md-2"],mb:"xxs",children:(0,x.tZ)(_.xu,{backgroundColor:"alias.elevation.base","data-test-id":"
1cart-add-on-card",id:"".concat(t,"-nav-card"),width:"200px",height:"100%",children:(0,x.tZ)(e8,{index:t,addOn:e,callback:c,mutationDisableReason:y(e),onAddClick:function(){return d(e.id)}})})})},"add-on-card-".concat(e.id))})})]}):null})},iR=r(8451);function iL(e){var t=e.label,r=e.borderColor;return(0,x.tZ)(_.xu,{backgroundColor:"global.factor-carbon.700",display:"inline-flex",borderRadius:"global.pill",children:(0,x.tZ)(_.xu,{paddingY:"global.xxs",paddingX:"global.sm-1",borderRadius:"global.pill",borderWidth:"1px",borderStyle:"solid",borderColor:void 0===r?"global.factor.accent-safron.800":r,backgroundColor:"transparent",display:"flex",justifyContent:"center",alignItems:"center",children:(0,x.tZ)(_.xv,{type:"body-sm-bold",color:"global.white",as:"span",children:(0,x.tZ)("span",{style:{textTransform:"uppercase"},children:t})})})})}var iq={border:"1px solid rgba(255, 255, 255, 0.25)",borderRadius:"var(--zest-global-radius-md, 8px)"};function iU(e){var t=e.translateRaw,r=t("subBrand.factorPlus.card.alternate.shippingOriginalPrice"),n=t("subBrand.factorPlus.card.alternate.benefitFreeLabel"),o=t("subBrand.factorPlus.card.alternate.benefitPremiumOff"),i=t("subBrand.factorPlus.card.alternate.perWeek");return(0,x.tZ)("div",{style:iq,children:(0,x.tZ)(_.xu,{paddingX:"global.sm-1",display:"flex",flexDirection:"column",children:(0,x.BX)("ul",{style:{listStyle:"none",padding:0,margin:0},"aria-label":"Factor Plus benefits",children:[(0,x.tZ)("li",{children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",paddingY:"global.sm-1",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"global.factor-carbon.600",children:[(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.white",children:t("subBrand.factorPlus.card.alternate.benefitFreeShipping")}),(0,x.BX)(_.xu,{display:"flex",alignItems:"center",columnGap:"global.xxs",children:[(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.400",as:"span","aria-label":"Was ".concat(r,", now free"),children:(0,x.tZ)("del",{children:r})}),(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.mint.300",children:n})]})]})}),(0,x.tZ)("li",{children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",paddingY:"global.sm-1",borderBottomWidth:1,borderBottomStyle:"solid",borderBottomColor:"global.factor-carbon.600",children:[(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.white",children:t("subBrand.factorPlus.card.alternate.benefitPremiumUpgrades")}),(0,x.tZ)(_.xu,{paddingX:"global.xs",paddingY:"global.xxs",borderRadius:"global.sm",backgroundColor:"global.mint.500",children:(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.white",children:o})})]})}),(0,x.tZ)("li",{children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",width:"100%",paddingY:"global.sm-1",children:[(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.white",children:t("subBrand.factorPlus.card.alternate.youCouldBeSaving")}),(0,x.BX)(_.xv,{type:"body-md-bold",color:"global.mint.300",children:["$42.99"," ",i]})]})})]})})})}var iX={border:"1px solid rgba(156, 163, 175, 0.9)",borderRadius:"var(--zest-global-radius-lg, 12px)"},iN={position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",width:150,height:150,borderRadius:"50%",backgroundColor:"rgba(255, 200, 0, 0.4)",filter:"blur(60px)",pointerEvents:"none",zIndex:0},iF={position:"relative",width:"100%",overflow:"visible"};function iW(e){var t=e.onJoinClick,r=e.translateRaw,n=r("subBrand.factorPlus.card.passTag");return(0,x.tZ)("div",{style:iX,children:(0,x.BX)(_.xu,{"data-testid":"factor-plus-card",padding:"global.sm-2",borderRadius:"global.lg",backgroundColor:"global.factor-carbon.800",display:"flex",flexDirection:"column",children:[(0,x.BX)("div",{style:iF,children:[(0,x.tZ)("div",{style:iN,"aria-hidden":"true"}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",position:"relative",zIndex:1,children:[(0,x.tZ)(_.xu,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",marginBottom:"global.sm-2",children:(0,x.tZ)(iL,{label:r("subBrand.factorPlus.card.mobile.passTag"),borderColor:"global.factor.accent-safron.800"})}),(0,x.tZ)(_.xv,{as:"h2",id:"factor-plus-heading",type:"display-md",styleAs:"h2",color:"global.white",textAlign:"center",marginBottom:"global.sm-2",children:r("subBrand.factorPlus.card.alternate.title")}),(0,x.BX)(_.xv,{type:"body-md-regular",color:"global.white",textAlign:"center",marginBottom:"global.sm-2",children:[r("subBrand.factorPlus.card.alternate.upgradePrefix")," ",(0,x.tZ)(_.xv,{as:"span",type:"body-md-bold",color:"global.white",children:n})," ",r("subBrand.factorPlus.card.alternate.upgradeSuffix")]})]})]}),(0,x.tZ)(iU,{translateRaw:r}),(0,x.tZ)(_.xu,{as:"button",type:"button","data-testid":"factor-plus-card-cta","aria-label":"Join Factor Plus waitlist",onClick:t,width:"100%",paddingY:"global.sm-1",paddingX:"global.sm-2",borderRadius:"global.sm",backgroundColor:"global.factor.accent-safron.500",color:"global.black",cursor:"pointer",borderWidth:"0",display:"flex",alignItems:"center",justifyContent:"center",marginTop:"global.sm-2",marginBottom:"global.xs",children:(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.black",children:r("subBrand.factorPlus.card.mobile.cta")})}),(0,x.tZ)(_.xv,{type:"body-xs-regular",color:"global.gray.400",textAlign:"center",children:r("subBrand.factorPlus.card.mobile.disclaimer")})]})})}function iz(e){var t,r,n,o=e.onJoinClick,i=e.isAlternateDesign,a=(0,D.ZP)("website").translateRaw;return void 0!==i&&i?(0,x.tZ)(iW,{onJoinClick:o,translateRaw:a}):(0,x.BX)(_.xu,{"data-testid":"factor-plus-card",padding:"global.sm-2",borderRadius:"global.lg",backgroundColor:"global.factor-carbon.800",display:"flex",flexDirection:"column",children:[(0,x.tZ)(_.xu,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:"global.xs",marginBottom:"global.sm-2",children:(0,x.tZ)(iL,{label:a("subBrand.factorPlus.card.mobile.passTag"),borderColor:"global.factor.accent-safron.400"})}),(0,x.tZ)(_.xv,{as:"h3",type:"body-xl-bold",color:"global.white",marginBottom:"global.xxs",children:a("subBrand.factorPlus.card.mobile.headline")}),(0,x.tZ)(_.xu,{marginBottom:"global.sm-1","aria-label":a("subBrand.factorPlus.card.mobile.pricing",{brand:a("subBrand.factorPlus.dialog.taglineBrand")}),children:(t=a("subBrand.factorPlus.dialog.taglineBrand"),(n=(r=a("subBrand.factorPlus.card.mobile.pricing",{brand:t})).split(t)).length>=2?(0,x.BX)(_.xv,{type:"body-md-regular",color:"global.white",children:[n[0],(0,x.tZ)(_.xv,{as:"span",type:"body-md-bold",color:"global.white",children:t}),n[1]]}):(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.white",children:r}))}),(0,x.tZ)(_.xu,{as:"button",type:"button","data-testid":"factor-plus-card-cta","aria-label":"Join Factor Plus waitlist",onClick:o,width:"100%",paddingY:"global.xs",paddingX:"global.sm-1",borderRadius:"global.sm",backgroundColor:"global.factor.accent-safron.500",color:"global.black",cursor:"pointer",borderWidth:"0",display:"flex",alignItems:"center",justifyContent:"center",marginBottom:"global.xxs",children:(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.black",children:a("subBrand.factorPlus.card.mobile.cta")})}),(0,x.tZ)(_.xv,{type:"body-xs-regular",color:"global.gray.300",textAlign:"center",children:a("subBrand.factorPlus.card.mobile.disclaimer")})]})}var iV=r(23287),iH=r(342058);function iG(e){var t=e.icon,r=e.iconColorMint,n=e.title,o=e.subtitle;return(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",alignItems:"flex-start",paddingY:"global.sm-1",columnGap:"global.sm-1",children:[(0,x.tZ)(_.xu,{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",color:r?"global.mint.300":"global.white",role:"img","aria-label":r?"Included":"Not included: ".concat(n),children:t}),(0,x.BX)(_.xu,{display:"flex",flex:1,minWidth:0,flexDirection:"column",children:[(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.gray.300",children:n}),(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.400",children:o})]})]})}function iQ(e){var t=e.translateRaw;return(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",width:"100%",columnGap:"global.sm-1",children:[(0,x.tZ)("div",{style:{borderRadius:16,overflow:"hidden",flex:1,border:"1px solid var(--zest-global-factor-carbon-600, rgba(255, 255, 255, 0.12))"},children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",padding:"global.sm-1",backgroundColor:"global.factor-carbon.700",height:"100%",children:[(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.300",marginBottom:"global.sm-1",textAlign:"center",children:t("subBrand.factorPlus.dialog.compare.withoutTitle")}),(0,x.tZ)(iG,{icon:(0,x.tZ)(iH.default,{}),iconColorMint:!1,title:t("subBrand.factorPlus.dialog.compare.withoutDeliveryTitle"),subtitle:t("subBrand.factorPlus.dialog.compare.withoutDeliverySubtitle")}),(0,x.tZ)(iG,{icon:(0,x.tZ)(iH.default,{}),iconColorMint:!1,title:t("subBrand.factorPlus.dialog.compare.withoutPremiumTitle"),subtitle:t("subBrand.factorPlus.dialog.compare.withoutPremiumSubtitle")})]})}),(0,x.BX)("div",{style:{flex:1,minHeight:0,position:"relative"},children:[(0,x.tZ)("div",{id:"best-value-badge",style:{position:"absolute",top:0,left:"50%",transform:"translate(-50%, -50%)",zIndex:1,display:"flex",justifyContent:"center"},children:(0,x.tZ)(_.xu,{paddingX:"global.xs",borderRadius:"global.pill",backgroundColor:"global.mint.500",children:(0,x.tZ)(_.xv,{type:"body-xs-bold",color:"global.black",children:t("subBrand.factorPlus.dialog.compare.bestValue")})})}),(0,x.tZ)("div",{style:{borderRadius:16,overflow:"hidden",height:"100%",border:"1px solid var(--zest-global-factor-accent-safron-600, #e6b800)"},children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",padding:"global.sm-1",paddingTop:"global.sm-2",backgroundColor:"global.factor-carbon.700",height:"100%","aria-describedby":"best-value-badge",children:[(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.300",marginBottom:"global.sm-1",textAlign:"center",children:t("subBrand.factorPlus.dialog.compare.withTitle")}),(0,x.tZ)(iG,{icon:(0,x.tZ)(iV.default,{}),iconColorMint:!0,title:t("subBrand.factorPlus.dialog.compare.withDeliveryTitle"),subtitle:t("subBrand.factorPlus.dialog.compare.withDeliverySubtitle")}),(0,x.tZ)(iG,{icon:(0,x.tZ)(iV.default,{}),iconColorMint:!0,title:t("subBrand.factorPlus.dialog.compare.withPremiumTitle"),subtitle:t("subBrand.factorPlus.dialog.compare.withPremiumSubtitle")})]})})]})]})}var iJ="monthly";function iK(e){var t,r,n,o,i=e.onPayNow,a=e.parameters,l=e.isDrawer,c=void 0!==l&&l,u=(e.modalVariant,e.onTrackDetail),s=e.onDecline,d=e.onCadenceChange,f=(0,D.ZP)("website").translateRaw,p=null!==(o=null==a?void 0:a.monthlyPrice)&&void 0!==o?o:"24.99";return(0,P.useEffect)(function(){null==d||d(iJ)},[d]),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",width:"100%",minHeight:c?"40vh":void 0,backgroundColor:"global.factor-carbon.800",padding:"global.md-1",paddingBottom:"global.sm-2",borderRadius:c?void 0:"global.sm",children:[(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",rowGap:"global.sm-1",marginBottom:"global.sm-2",children:[(0,x.tZ)(iL,{label:f("subBrand.factorPlus.dialog.mobile.passTag")}),(0,x.BX)(_.xu,{display:"flex",alignItems:"baseline",columnGap:"global.xxs",justifyContent:"center",children:[(0,x.BX)(_.xv,{type:"display-xl",color:"global.factor.accent-safron.600",children:["$",p]}),(0,x.tZ)(_.xv,{as:"span",type:"display-md",color:"global.factor.accent-safron.600",children:"/month"})]}),(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.300",textAlign:"center",children:(t=f("subBrand.factorPlus.dialog.taglineBrand"),(n=(r=f("subBrand.factorPlus.dialog.alternate.tagline",{brand:t})).split(t)).length>=2?(0,x.BX)(_.xv,{type:"body-md-regular",color:"global.gray.300",as:"span",children:[n[0],(0,x.tZ)(_.xv,{as:"span",type:"body-md-bold",color:"global.gray.300",children:t}),n[1]]}):(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.300",as:"span",children:r}))})]}),(0,x.tZ)(_.xu,{marginBottom:"global.md-1",children:(0,x.tZ)(iQ,{translateRaw:f})}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"global.sm-1",children:[(0,x.tZ)(_.xu,{as:"button",type:"button","data-testid":"factor-plus-alternate-modal-join",onClick:function(){null==u||u("accept",iJ),i()},width:"100%",paddingY:"global.sm-1",paddingX:"global.sm-2",borderRadius:"global.sm",backgroundColor:"global.factor.accent-safron.500",color:"global.black",cursor:"pointer",borderWidth:"0",display:"flex",alignItems:"center",justifyContent:"center",children:(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.black",children:f("subBrand.factorPlus.dialog.mobile.joinWaitlist")})}),(0,x.tZ)(_.xu,{as:"button",type:"button","data-testid":"factor-plus-alternate-modal-maybe-later","aria-label":"Decline Factor Plus subscription, continue without joining",onClick:function(){null==s||s(iJ)},cursor:"pointer",borderWidth:"0",backgroundColor:"transparent",paddingY:"global.xs",paddingX:"global.sm-1",children:(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.white",textAlign:"center",children:f("subBrand.factorPlus.dialog.mobile.maybeLater")})})]})]})}function iY(e){var t=e.isOpen,r=e.onClose,n=e.onPayNow,o=e.modalVariant,i=e.parameters,a=e.returnFocusRef,l=e.onTrackDetail,c=e.onDecline,u=e.onCadenceChange,s="mobile"===(0,N.Sj)(),d=(0,x.tZ)(iK,{onPayNow:n,modalVariant:o,parameters:i,isDrawer:s,onTrackDetail:l,onDecline:c,onCadenceChange:u});return s?(0,x.tZ)(_.dy.Container,{"data-testid":"factor-plus-subscription-alternate-modal","aria-label":"Factor Plus subscription details",isOpen:t,onDismiss:r,onClose:r,returnFocusRef:a,placement:"bottom",height:"auto",width:"100%",isModal:!0,isTouchMoveEnabled:!0,hideCloseButton:!0,paddingY:"global.none",paddingX:"global.none",children:d}):(0,x.tZ)(_.Vq,{"data-testid":"factor-plus-subscription-alternate-modal",headless:!0,hasCloseButton:!1,"aria-label":"Factor Plus subscription details",isOpen:t,onDismiss:r,onClose:r,returnFocusRef:a,width:["auto","min(100%, 556px)"],padding:"global.none",alignHeader:"center",alignBody:"center",children:d})}function i$(e){var t=e.translateRaw,r=t("subBrand.factorPlus.dialog.taglineBrand"),n=t("subBrand.factorPlus.dialog.mobile.tagline",{brand:r}),o=n.split(r);return o.length>=2?(0,x.BX)(_.xv,{type:"body-md-regular",color:"global.gray.300",as:"span",children:[o[0],(0,x.tZ)(_.xv,{as:"span",type:"body-md-bold",color:"global.gray.300",children:r}),o[1]]}):(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.300",as:"span",children:n})}
1function i0(e){var t=e.icon,r=e.title,n=e.subtitle,o=e.isLast;return(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",alignItems:"center",paddingY:"global.sm-1",columnGap:"global.sm-1",borderBottomWidth:o?0:1,borderBottomStyle:"solid",borderBottomColor:"global.factor-carbon.600",children:[(0,x.tZ)(_.xu,{flexShrink:0,width:48,height:48,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"global.factor-carbon.800",borderRadius:"global.md",children:t}),(0,x.BX)(_.xu,{display:"flex",flex:1,minWidth:0,flexDirection:"column",children:[(0,x.tZ)(_.xv,{type:"body-lg-bold",color:"global.gray.300",children:r}),(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.400",children:n})]}),(0,x.tZ)(_.xu,{flexShrink:0,color:"global.mint.300",display:"flex",alignItems:"center",children:(0,x.tZ)(iV.default,{})})]})}function i1(e){var t=e.translateRaw,r=e.showYearlyDiscount,n=e.annualSavings,o=e.selectedPlan,i=void 0!==r&&r,a="annual"===(void 0===o?"annual":o),l=i?t(a?"subBrand.factorPlus.dialog.benefitYearlyDiscountTitle":"subBrand.factorPlus.dialog.benefitFlexiblePricingTitle"):"",c=i?a?t("subBrand.factorPlus.dialog.benefitYearlyDiscountSubtitle",{amount:void 0===n?"":n}):t("subBrand.factorPlus.dialog.benefitFlexiblePricingSubtitle"):"";return(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",width:"100%",children:[(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.400",children:t("subBrand.factorPlus.dialog.mobile.whatsIncluded")}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",children:[i&&(0,x.tZ)(i0,{icon:(0,x.tZ)(_.xu,{as:"img",src:t("subBrand.factorPlus.dialog.benefitYearlyDiscountIcon"),alt:"",width:32,height:32,"aria-hidden":"true"}),title:l,subtitle:c}),(0,x.tZ)(i0,{icon:(0,x.tZ)(_.xu,{as:"img",src:t("subBrand.factorPlus.card.image.box"),alt:"",width:32,height:32,"aria-hidden":"true"}),title:t("subBrand.factorPlus.dialog.mobile.benefitDeliveryTitle"),subtitle:t("subBrand.factorPlus.dialog.mobile.benefitDeliverySubtitle")}),(0,x.tZ)(i0,{icon:(0,x.tZ)(_.xu,{as:"img",src:t("subBrand.factorPlus.card.image.cash"),alt:"",width:32,height:32,"aria-hidden":"true"}),title:t("subBrand.factorPlus.dialog.mobile.benefitPremiumTitle"),subtitle:t("subBrand.factorPlus.dialog.mobile.benefitPremiumSubtitle")}),(0,x.tZ)(i0,{icon:(0,x.tZ)(_.xu,{as:"img",src:t("subBrand.factorPlus.card.image.stopwatch"),alt:"",width:32,height:32,"aria-hidden":"true"}),title:t("subBrand.factorPlus.dialog.mobile.benefitCancelTitle"),subtitle:t("subBrand.factorPlus.dialog.mobile.benefitCancelSubtitle"),isLast:!0})]})]})}function i2(e){var t=e.translateRaw,r=e.selectedPlan,n=e.setSelectedPlan,o=e.annualSavings,i=e.onTrackDetail,a="monthly"===r,l=function(){null==i||i("monthly",r),n("monthly")},c=function(){null==i||i("annual",r),n("annual")},u=function(e,t){"ArrowLeft"===e.key||"ArrowUp"===e.key?(e.preventDefault(),n("monthly"),null==i||i("monthly",r)):"ArrowRight"===e.key||"ArrowDown"===e.key?(e.preventDefault(),n("annual"),null==i||i("annual",r)):("Enter"===e.key||" "===e.key)&&(e.preventDefault(),"monthly"===t?l():c())};return(0,x.tZ)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",columnGap:"global.xs",borderRadius:"global.pill",padding:"global.xxs",backgroundColor:"global.factor-carbon.700",borderWidth:"1px",borderStyle:"solid",borderColor:"global.factor-carbon.600",marginBottom:"global.sm-1",height:"global.md-1",role:"radiogroup","aria-label":"Select subscription plan",children:[(0,x.tZ)(_.xu,{flexShrink:0,paddingY:"global.xxs",paddingX:"global.sm-1",borderRadius:"global.pill",backgroundColor:a?"global.factor.accent-safron.500":"transparent",role:"radio","aria-checked":a,tabIndex:a?0:-1,onClick:l,onKeyDown:function(e){return u(e,"monthly")},cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",children:(0,x.tZ)(_.xv,{type:a?"body-md-bold":"body-md-regular",color:a?"global.black":"global.gray.300",children:t("subBrand.factorPlus.dialog.monthly")})}),(0,x.tZ)(_.xu,{flexShrink:0,paddingY:"global.xxs",paddingX:"global.sm-1",borderRadius:"global.pill",backgroundColor:a?"transparent":"global.factor.accent-safron.500",role:"radio","aria-checked":!a,tabIndex:a?-1:0,onClick:c,onKeyDown:function(e){return u(e,"annual")},cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",children:a?(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",alignItems:"center",columnGap:"global.xxs",children:[(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.300",as:"span",children:t("subBrand.factorPlus.dialog.yearlyLabel")}),(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.mint.300",as:"span",children:t("subBrand.factorPlus.dialog.saveAmountParens",{amount:o})})]}):(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.black",children:t("subBrand.factorPlus.dialog.yearlySaveAmount",{amount:o})})})]})})}function i6(e){var t=e.translateRaw,r=e.isAnnualOption,n=e.selectedPlan,o=e.setSelectedPlan,i=e.monthlyPrice,a=e.annualPrice,l=e.annualSavings,c=e.onTrackDetail;return(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",rowGap:"global.sm-1",children:[(0,x.tZ)(iL,{label:t("subBrand.factorPlus.dialog.passTag")}),r?(0,x.BX)(x.HY,{children:[(0,x.BX)(_.xu,{display:"flex",alignItems:"baseline",columnGap:"global.xxs",justifyContent:"center",width:"100%",children:[(0,x.BX)(_.xv,{type:"display-xl",color:"global.factor.accent-safron.600",children:["$","annual"===n?a:i]}),(0,x.BX)(_.xv,{as:"span",type:"display-md",color:"global.factor.accent-safron.600",children:["/","annual"===n?"year":"month"]})]}),(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.300",textAlign:"center",children:(0,x.tZ)(i$,{translateRaw:t})}),(0,x.tZ)(i2,{translateRaw:t,selectedPlan:n,setSelectedPlan:o,annualSavings:l,onTrackDetail:c})]}):(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",rowGap:"global.xxs",alignItems:"center",textAlign:"center",children:[(0,x.BX)(_.xu,{display:"flex",alignItems:"baseline",columnGap:"global.xxs",justifyContent:"center",width:"100%",children:[(0,x.BX)(_.xv,{type:"display-xl",color:"global.factor.accent-safron.600",children:["$",i]}),(0,x.tZ)(_.xv,{as:"span",type:"display-md",color:"global.factor.accent-safron.600",children:"/month"})]}),(0,x.tZ)(_.xv,{type:"body-lg-regular",color:"global.gray.300",children:t("subBrand.factorPlus.dialog.tagline")})]})]})}function i3(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function i4(e){var t,r,n,o,i,a,l,c,u,s,d,f,p,b,y,m,v,g=e.onPayNow,h=e.modalVariant,O=e.parameters,w=e.isDrawer,S=void 0!==w&&w,k=e.onTrackDetail,j=e.onDecline,C=e.onCadenceChange,Z=(0,D.ZP)("website").translateRaw,A=(i=(t={modalVariant:h,parameters:O,onPayNow:g,onTrackDetail:k,onDecline:j,onCadenceChange:C}).modalVariant,a=t.parameters,l=t.onPayNow,c=t.onTrackDetail,u=t.onDecline,s=t.onCadenceChange,p=(f=function(e){if(Array.isArray(e))return e}(d=(0,P.useState)("annual"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(d,2)||function(e,t){if(e){if("string"==typeof e)return i3(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i3(e,2)}}(d,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],b=f[1],y=null!==(r=null==a?void 0:a.monthlyPrice)&&void 0!==r?r:"12.99",m=null!==(n=null==a?void 0:a.annualPrice)&&void 0!==n?n:"99.99",v=null!==(o=null==a?void 0:a.annualSavings)&&void 0!==o?o:"0",(0,P.useEffect)(function(){null==s||s(p)},[p,s]),{selectedPlan:p,setSelectedPlan:b,monthlyPrice:y,annualPrice:m,annualSavings:v,isAnnualOption:"annualOption"===i,handlePayNowClick:function(){null==c||c("accept",p),l()},handleMaybeLaterClick:function(){null==u||u(p)}}),I=A.selectedPlan,E=A.setSelectedPlan,T=A.monthlyPrice,B=A.annualPrice,M=A.annualSavings,R=A.isAnnualOption,L=A.handlePayNowClick,q=A.handleMaybeLaterClick;return(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",width:"100%",minHeight:S?"40vh":void 0,backgroundColor:"global.factor-carbon.800",padding:"global.md-1",paddingBottom:"global.sm-2",borderRadius:S?void 0:"global.sm",children:[(0,x.tZ)(_.xu,{marginBottom:"global.sm-2",children:R?(0,x.tZ)(i6,{translateRaw:Z,isAnnualOption:!0,selectedPlan:I,setSelectedPlan:E,monthlyPrice:T,annualPrice:B,annualSavings:M,onTrackDetail:k}):(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",rowGap:"global.sm-1",children:[(0,x.tZ)(iL,{label:Z("subBrand.factorPlus.dialog.mobile.passTag")}),(0,x.BX)(_.xu,{display:"flex",alignItems:"baseline",columnGap:"global.xxs",justifyContent:"center",children:[(0,x.BX)(_.xv,{as:"h2",id:"factor-plus-subscription-heading",type:"display-xl",color:"global.factor.accent-safron.600",children:["$",T]}),(0,x.tZ)(_.xv,{as:"span",type:"display-md",color:"global.factor.accent-safron.600",children:"/month"})]}),(0,x.tZ)(_.xv,{type:"body-md-regular",color:"global.gray.300",textAlign:"center",children:(0,x.tZ)(i$,{translateRaw:Z})})]})}),(0,x.tZ)(_.xu,{display:"flex",flexDirection:"column",width:"100%",paddingX:"global.sm-2",paddingTop:"global.sm-2",borderRadius:"global.md",backgroundColor:"global.factor-carbon.700",marginBottom:"global.md-1",borderWidth:"1px",borderStyle:"solid",borderColor:"global.factor-carbon.600",children:(0,x.tZ)(i1,{translateRaw:Z,showYearlyDiscount:R,annualSavings:M,selectedPlan:I})}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",rowGap:"global.sm-1",children:[(0,x.tZ)(_.xu,{as:"button",type:"button","data-testid":"factor-plus-modal-pay-now",onClick:L,width:"100%",paddingY:"global.sm-1",paddingX:"global.sm-2",borderRadius:"global.sm",backgroundColor:"global.factor.accent-safron.500",color:"global.black",cursor:"pointer",borderWidth:"0",display:"flex",alignItems:"center",justifyContent:"center",children:(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.black",children:Z("subBrand.factorPlus.dialog.mobile.joinWaitlist")})}),(0,x.tZ)(_.xu,{as:"button",type:"button","data-testid":"factor-plus-modal-not-now",onClick:q,cursor:"pointer",borderWidth:"0",backgroundColor:"transparent",paddingY:"global.xs",paddingX:"global.sm-1",children:(0,x.tZ)(_.xv,{type:"body-md-bold",color:"global.white",textAlign:"center",children:Z("subBrand.factorPlus.dialog.mobile.maybeLater")})})]})]})}function i5(e){var t=e.isOpen,r=e.onClose,n=e.onPayNow,o=e.modalVariant,i=e.parameters,a=e.returnFocusRef,l=e.onTrackDetail,c=e.onDecline,u=e.onCadenceChange,s="mobile"===(0,N.Sj)(),d=(0,x.tZ)(i4,{onClose:r,onPayNow:n,modalVariant:o,parameters:i,isDrawer:s,onTrackDetail:l,onDecline:c,onCadenceChange:u});return s?(0,x.tZ)(_.dy.Container,{"data-testid":"factor-plus-subscription-modal","aria-label":"Factor Plus subscription details",isOpen:t,onDismiss:r,onClose:r,returnFocusRef:a,placement:"bottom",height:"auto",width:"100%",isModal:!0,isTouchMoveEnabled:!0,hideCloseButton:!0,paddingY:"global.none",paddingX:"global.none",children:d}):(0,x.tZ)(_.Vq,{"data-testid":"factor-plus-subscription-modal",headless:!0,hasCloseButton:!1,"aria-label":"Factor Plus subscription details",isOpen:t,onDismiss:r,onClose:r,returnFocusRef:a,width:["auto","min(100%, 556px)"],padding:"global.none",alignHeader:"center",alignBody:"center",children:d})}function i7(e){var t=e.onClose,r=(0,D.ZP)("website").translateRaw;return(0,x.tZ)(_.xu,{padding:"global.sm-2",paddingBottom:"global.md-2",children:(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",rowGap:"global.sm-1",children:[(0,x.tZ)(_.xu,{as:"img",src:r("subBrand.factorPlus.success.image"),alt:"",role:"presentation",width:104,height:104}),(0,x.tZ)(_.xv,{as:"h2",type:"body-lg-bold",children:r("subBrand.factorPlus.success.title")}),(0,x.tZ)(_.xv,{type:"body-sm-regular",color:"shared-alias.neutral.foreground.dark",children:r("subBrand.factorPlus.success.description")}),(0,x.tZ)(_.xu,{marginTop:"global.sm-1",width:"100%",children:(0,x.tZ)(_.zx.Primary,{"data-testid":"factor-plus-success-got-it",width:"100%",onClick:t,children:r("subBrand.factorPlus.success.cta")})})]})})}function i8(e){var t=e.isOpen,r=e.onClose,n=e.returnFocusRef,o=(0,N.Sj)(),i=(0,x.tZ)(i7,{onClose:r});return"mobile"===o?(0,x.tZ)(_.dy.Container,{"data-testid":"factor-plus-success-modal","aria-label":"Factor Plus success",isOpen:t,onDismiss:r,onClose:r,returnFocusRef:n,placement:"bottom",height:"auto",width:"100%",isModal:!0,isTouchMoveEnabled:!0,hideCloseButton:!0,paddingY:"global.none",paddingX:"global.none",children:i}):(0,x.tZ)(_.Vq,{"data-testid":"factor-plus-success-modal",headless:!0,hasCloseButton:!1,"aria-label":"Factor Plus success",isOpen:t,onDismiss:r,onClose:r,returnFocusRef:n,width:["auto","min(100%, 556px)"],padding:"global.none",alignHeader:"center",alignBody:"center",children:i})}
1var i9=r(26730),ae={isFactorPlusRecommendedForYouEnabled:!1,overrides:[{brand:rK.Z.factor,systemCountry:i9.Z.FJ,values:{isFactorPlusRecommendedForYouEnabled:!0}}]},at=(0,oV.Z)("factor-plus-recommended-for-you",ae).useConfig;function ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function an(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function ao(e){return{event:"gaEventTrigger",event_name:e,brand:"factor",tribe:"Customer Value Optimization",screen:"Order Summary"}}var ai=["V1","V2","V3"],aa=["V5","V6"],al=["V1","V2","V3","V4","V5","V6"];function ac(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function au(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ac(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ac(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function as(){var e,t,r,n,o,i,a,l,c,u,s,d,f,p,b,y,m,v,g,h,O,w,S,k,C,Z,A,I,E,T,B,M,R,L,q,U,X,N,F,W,z,V,H,G,Q,J,K,Y,$,ee,et,er,en,eo,ei=(T=at().isFactorPlusRecommendedForYouEnabled,M=(B=(t=(e=(0,rA.py)({runUsingStatsig:!0})).decide,r=e.isReady,o=(n=(0,r_.R)({runUsingStatsig:!0})).id,i=n.attributes,a=n.isReady,u=(c=(l=r&&a)?t({experimentKey:"factor_pass_smoke_test",experimentationUserId:o,experimentationUserAttributes:i}):{variationKey:null,parameters:{}}).variationKey,s=c.parameters,d=u&&s&&(void 0===s?"undefined":s&&"undefined"!=typeof Symbol&&s.constructor===Symbol?"symbol":typeof s)=="object"?{monthlyPrice:"string"==typeof s.monthlyPrice?s.monthlyPrice:"",annualPrice:"string"==typeof s.annualPrice?s.annualPrice:"",annualSavings:"string"==typeof s.annualSavings?s.annualSavings:""}:{monthlyPrice:"",annualPrice:"",annualSavings:""},f=null!=u&&al.includes(u),p="V4"===u,b=aa.includes(u)?"annualOption":"V4"===u||ai.includes(u)?"monthlyOnly":null,{isReady:l,variationKey:u,parameters:d,showFactorPlusCard:f,modalVariant:b,isAlternateDesign:p})).parameters,R=B.modalVariant,L=B.isAlternateDesign,q=B.showFactorPlusCard,N=(X=(y=null!=(U=B.variationKey)?U:null,m=(0,tp.Z)().push,g=null==(v=(0,j.C)())?void 0:v.plan_type,h=(0,rA.py)({runUsingStatsig:!0}).track,w=(O=(0,r_.R)({runUsingStatsig:!0})).id,S=O.attributes,k=O.isReady,{trackDisplay:(0,P.useCallback)(function(){m(an({},ao("BannerFactorPlus_Display"),null!=y&&{variation:y})),w&&k&&h({experimentationUserId:w,experimentationUserAttributes:S,eventName:"BannerFactorPass_Display",eventTags:an({},y&&{variation:y})})},[m,y,h,w,S,k]),trackClick:(0,P.useCallback)(function(){m(an({},ao("BannerFactorPlus_Click"),null!=y&&{variation:y})),w&&k&&h({experimentationUserId:w,experimentationUserAttributes:S,eventName:"BannerFactorPass_Click",eventTags:an({},y&&{variation:y})})},[m,y,h,w,S,k]),trackDetail:(0,P.useCallback)(function(e,t){var r,n;m(an((r=an({},ao("BannerFactorPlus_Detail")),n=n={gaEventCategory:"Factor Plus - Banner",gaEventAction:e,cadence:t},Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}
1)(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))}),r),null!=g&&{plan_type:g},null!=y&&{variation:y})),w&&k&&h({experimentationUserId:w,experimentationUserAttributes:S,eventName:"BannerFactorPass_Detail",eventTags:an({action:e,cadence:t},g&&{plan_type:g},y&&{variation:y})})},[m,g,y,h,w,S,k]),trackConfirm:(0,P.useCallback)(function(e){m(an({},ao("BannerFactorPlus_Confirm"),null!=y&&{variation:y})),w&&k&&h({experimentationUserId:w,experimentationUserAttributes:S,eventName:"BannerFactorPass_Confirm",eventTags:an({cadence:e},y&&{variation:y})})},[m,y,h,w,S,k])})).trackDisplay,F=X.trackClick,W=X.trackDetail,z=X.trackConfirm,H=(V=(A=(Z=function(e){if(Array.isArray(e))return e}(C=(0,rY.Z)("hf_factor_plus_joined"))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),3!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(C,3)||function(e,t){if(e){if("string"==typeof e)return ar(e,3);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ar(e,3)}}(C,3)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],I=Z[1],E=Z[2],{hasJoined:""!==A,setJoined:(0,P.useCallback)(function(){return I("true")},[I]),clearJoined:(0,P.useCallback)(function(){return E()},[E])})).hasJoined,G=V.setJoined,J=(Q=au((0,P.useState)(!1),2))[0],K=Q[1],$=(Y=au((0,P.useState)(!1),2))[0],ee=Y[1],et=(0,P.useRef)(null),er=(0,P.useRef)(!1),en=(0,P.useRef)(!1),eo=(0,P.useRef)("monthly"),((0,P.useEffect)(function(){!q||H||er.current||(N(),er.current=!0)},[q,H,N]),(0,P.useEffect)(function(){$&&!en.current&&(z(eo.current),en.current=!0)},[$,z]),T&&q&&(!H||$))?{shouldRender:!0,sectionProps:{handleJoinClick:function(){F(),eo.current=(null!=R?R:"monthlyOnly")==="annualOption"?"annual":"monthly",K(!0)},subscriptionModalOpen:J,handleSubscriptionClose:function(){W("close",eo.current),K(!1)},handleDecline:function(e){W("decline",e),K(!1)},handleCadenceChange:function(e){eo.current=e},onTrackDetail:W,handlePayNow:function(){G(),K(!1),ee(!0)},successModalOpen:$,handleSuccessClose:function(){ee(!1)},effectiveModalVariant:null!=R?R:"monthlyOnly",parameters:M,returnFocusRef:et,isAlternateDesign:L,showFactorPlusCard:q,hasJoinedFactorPlus:H}}:{shouldRender:!1,sectionProps:null}),ea=ei.shouldRender,el=ei.sectionProps,ec=(0,D.ZP)("website").translateRaw;if(!ea||!el)return null;var eu=el.handleJoinClick,es=el.subscriptionModalOpen,ed=el.handleSubscriptionClose,ef=el.handleDecline,ep=el.handleCadenceChange,eb=el.onTrackDetail,ey=el.handlePayNow,em=el.successModalOpen,ev=el.handleSuccessClose,eg=el.effectiveModalVariant,eh=el.parameters,eO=el.returnFocusRef,ew=el.isAlternateDesign,ex=el.showFactorPlusCard,eP=el.hasJoinedFactorPlus;return ex?(0,x.BX)(x.HY,{children:[!eP&&(0,x.BX)(x.HY,{children:[(0,x.tZ)(_.iz,{variant:"horizontal",my:"global.sm-1",mx:"zero"}),(0,x.BX)(_.xu,{as:"section","aria-labelledby":"recommended-for-you-heading","data-test-id":"recommended-for-you-section",ref:eO,tabIndex:-1,children:[(0,x.tZ)(_.xv,{id:"recommended-for-you-heading",as:"h3",type:"body-lg-bold",color:"global.hellofresh.action-black.900",marginBottom:"global.sm-1",children:ec("subBrand.factorPlus.card.recommendedForYou")}),(0,x.tZ)(iz,{onJoinClick:eu,isAlternateDesign:ew})]})]}),ew?(0,x.tZ)(iY,{isOpen:es,onClose:ed,onDecline:ef,onCadenceChange:ep,onTrackDetail:eb,onPayNow:ey,modalVariant:eg,parameters:eh,returnFocusRef:eO}):(0,x.tZ)(i5,{isOpen:es,onClose:ed,onDecline:ef,onCadenceChange:ep,onTrackDetail:eb,onPayNow:ey,modalVariant:eg,parameters:eh,returnFocusRef:eO}),(0,x.tZ)(i8,{isOpen:em,onClose:ev,returnFocusRef:eO})]}):null}var ad=r(509781),af=function(e){var t=e.icon,r=t.component,n=t.color,o=void 0===n?"neutral.800":n,i=e.text,a=i.top,l=i.bottom,c=e.rightSideContent,u=e.style,s=void 0===u?{}:u,d=s.backgroundColor,f=s.isSmallFont,p=void 0!==f&&f;return(0,x.BX)(_.xu,{gap:"global.xs",py:"global.xs",px:"global.sm-1",width:"100%",minHeight:"4rem",display:"flex",backgroundColor:void 0===d?"alias.interactive-alt.surface.level-1":d,borderRadius:"border-radius-md",justifyContent:"space-between",children:[(0,x.BX)(_.xu,{display:"flex",gap:"global.xs",children:[(0,x.tZ)(_.xu,{color:o,display:"flex",alignItems:"center",children:r}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",justifyContent:"center",children:[(0,x.tZ)(_.xv,{type:p?"body-sm-regular":"body-md-regular",children:a}),(0,x.tZ)(_.xv,{type:p?"body-sm-bold":"body-md-bold",children:l})]})]}),c&&(0,x.tZ)(_.xu,{color:o,display:"flex",alignItems:"center","aria-hidden":"true",children:c})]})},ap=function(){var e=(0,D.ZP)(M.cart),t=e.translate,r=e.translateRaw,n=oO().snapState;if(!(n===g.Paid||n===g.Unavailable))return null;var o=n===g.Paid?{backgroundColor:"shared-alias.positive.background.light",caption:t("".concat(M.cart,".snap.paid-with-snap.pill")),rightSideContent:(0,x.tZ)(iV.default,{})}:{backgroundColor:"shared-alias.negative.background.lightest",caption:t("".concat(M.cart,".snap.unavailable.pill")),rightSideContent:(0,x.tZ)(ad.default,{})},i=o.backgroundColor,a=o.caption,l=o.rightSideContent;return(0,x.tZ)(af,{style:{backgroundColor:i},icon:{component:(0,x.tZ)(_.xu,{display:"flex",alignItems:"center","aria-hidden":"true",pl:"global.xs",children:(0,x.tZ)("img",{src:"".concat(R,"/snap/snap-icon.svg"),alt:r("cart.snap.paid-with-snap.pill"),width:24,height:24,"aria-hidden":!0})})},text:{top:a,bottom:void 0},rightSideContent:l})},ab=function(){var e=(0,D.ZP)(M.cart).translate,t=eu().isBelowMinimum,r=eZ().isSaving;return oO().snapState!==g.Available?null:(0,x.tZ)(_.xu,{id:"snapEntry",children:(0,x.tZ)(oZ,{icon:{component:(0,x.tZ)(_.xu,{display:"flex",alignItems:"center","aria-hidden":"true",pl:"global.xs",children:(0,x.tZ)("img",{src:"".concat(R,"/snap/snap-icon.svg"),alt:"Snap icon",width:24,height:24,"aria-hidden":!0})})},text:{top:e("cart.snap.entrypoint.pill")},ariaLabelledBy:"snap-entrypoint-pill",onClick:r||t?void 0:function(){},clickIndicator:(0,x.tZ)(_.xu,{display:"flex",alignItems:"center","aria-hidden":"true",px:"global.xs",children:(0,x.tZ)(oC.default,{})})})})},ay=r(698052),am=r.n(ay),av=r(101947),ag=r(845818),ah=function(){return(0,x.tZ)(z,{width:"100%",height:"64px"})},aO=function(e){var t=e.backgroundColor,r=e.isSmallFont,n=(0,D.ZP)(M.cart).translate,o=(0,en.n6)().subscription,i=oO(),a=i.snapState,l=i.snapTransaction,c=i.isError,u=a!==g.Disabled,s=(0,av.iT)({subscriptionId:o.id},{enabled:!!o.id&&u,suspense:!1}),d=s.data,f=s.error;if(!u)return null;var p=function(){var e=null==d?void 0:d.result;if(f)return n("".concat(M.cart,".revamp.payment-delivery.payment-types.error"));if(!e)return null;switch(null==e?void 0:e.type){case"apple_pay":return n("".concat(M.cart,".revamp.payment-delivery.payment-types.apple-pay"));case"credit_card":var t=e.details.number,r=e.method;return n("".concat(M.cart,".revamp.payment-delivery.payment-types.credit-card"),{method:am()(r),number:t});case"paypal":var o=e.details.payer_email;return n("".concat(M.cart,".revamp.payment-delivery.payment-types.paypal"),{email:o});case"klarna":var i=e.details.shopper_email;return n("".concat(M.cart,".revamp.payment-delivery.payment-types.klarna"),{email:i});case"i_deal":case"sepa":var a=e.details.iban;return n("".concat(M.cart,".revamp.payment-delivery.payment-types.sepa"),{iban:a});default:return n("".concat(M.cart,".chargeAtMealSelection.paymentDetail.details.default"))}}(),b=function(){if(!l||c)return null;var e=l.details.lastFourDigits;return n("".concat(M.cart,".revamp.payment-delivery.payment-types.snap"),{number:e})}();return(0,x.tZ)(oM,{showFallback:!p,fallback:(0,x.tZ)(ah,{}),children:(0,x.tZ)(af,{icon:{component:(0,x.tZ)(ag.default,{})},text:{top:n("".concat(M.cart,".revamp.payment-delivery.payment")),bottom:(0,x.tZ)(function(){return(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",children:[p,b]})},{})},style:{backgroundColor:t||"alias.page-background.default",isSmallFont:r}})})},aw=r(21432),ax=r.n(aw),aP=r(420249),aS=r.n(aP),ak=r(461125);function aj(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var aC=function(e){var t,r=function(e){if(Array.isArray(e))return e}(t=e.split(":").map(Number))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return aj(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return aj(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=r[0],o=r[1],i=new Date(0);return ax()(aS()(i,void 0===n?0:n),void 0===o?0:o)},aZ=function(e,t){if(!e||!t)return"";var r=(0,rx.Z)(aC(e),rS.Ti),n=(0,rx.Z)(aC(t),rS.Ti);return"".concat(r," - ").concat(n)},aA=function(e){var t=e.onDeliveryPillClick,r=(0,D.ZP)(M.cart).translate,n=(0,en.n6)().delivery,o=ti(),i=(0,P.useMemo)(function(){var e=n.isHolidayShiftVisible?n.holidayDelivery:n.deliveryDate,t=aZ(n.deliveryOption.deliveryFrom,n.deliveryOption.deliveryTo),r=(0,rx.Z)((0,rP.Z)(e),rS.n1);return t?"".concat(r,", ").concat(t):r},[n]),a=r("".concat(M.cart,".revamp.delivery-info.header"));if(o)return(0,x.tZ)(af,{icon:{component:(0,x.tZ)(ak.default,{})},text:{top:a,bottom:i}});var l=r("".concat(M.cart,".revamp.delivery-info.click-indicator"));return(0,x.tZ)(oZ,{icon:{component:(0,x.tZ)(ak.default,{})},text:{top:a,bottom:i},onClick:t,clickIndicator:(0,x.tZ)(_.xv,{type:"body-md-bold",textDecoration:"underline",children:l})})},a_=function(e){var t=e.injections,r=(0,D.ZP)(M.cart),n=r.translate,o=r.translateRaw,i=ti(),a=tW(),l=(0,en.n6)().delivery,c=tX().trackEditDeliveryPillClick,u="".concat((0,rx.Z)((0,rP.Z)(l.cutoffDate),rS.n1),", ").concat((0,rx.Z)((0,rP.Z)(l.cutoffDate),rS.Ti)),s=i?"".concat(M.cart,".revamp.payment-delivery.rte-cutoff"):"".concat(M.cart,".revamp.payment-delivery.cutoff");return(0,x.BX)(_.xu,{"data-test-id":"cart-revamp-delivery-and-payment",children:[(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"sm-2",pb:["sm-2","md-1","md-1"],children:[(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"md-1",children:[(0,x.tZ)(_.xv,{as:"h3",children:n("".concat(M.cart,".revamp.payment-delivery.header"))}),(0,x.tZ)(_.xv,{type:"body-md-regular",children:(0,iR.lU)(o(s),{date:(0,x.tZ)(_.xv,{strong:!0,children:u},u)})})]}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"xs",children:[(0,x.tZ)(aA,{onDeliveryPillClick:function(e){a(e,{type:"delivery_pill_click"}),c()}}),(0,x.tZ)(aO,{}),(0,x.tZ)(ap,{}),(0,x.tZ)(ab,{})]}),(0,x.tZ)(C.Z,{scope:"recommended-for-you-factor-plus-delivery-and-payment",fallback:(0,x.tZ)(x.HY,{}),children:(0,x.tZ)(as,{})})]}),null==t?void 0:t.bottomSlot]})},aD=r(941442),aI=r(273992),aE=r(2449),aT=r(42174),aB=r(744837),aM=r(509957),aR=r(200770),aL=r(240321),aq=r(364518),aU=r(409065),aX=r(945982),aN=r(415557),aF=r(703518),aW=r(686230),az=r(502787),aV=function(e){var t,r=e.onEnrollClick,n=e.hasActiveMembership,o=(0,aR.Z)(),i=(0,nK.Z)(),a=(0,N.Sj)(),l=(0,aL.j)(),c=(0,aq.q)().isSuppressed,u=(0,aU.t)().markCartBannerInteracted,s=(0,aX.C)(),d=s.variant,f=s.benefits,p=(0,aN.t)({source:"cart",groupId:d}),b=p.trackUpsellBannerViewed,y=p.trackCtaClicked,m=(0,aM.YD)({threshold:.5,triggerOnce:!0}),v=m.ref,g=m.inView,h=(0,P.useRef)(!1),O=l&&null!==d&&!c&&!(void 0!==n&&n);if((0,P.useEffect)(function(){O&&g&&!h.current&&(h.current=!0,b({bannerType:"cart_banner"}))},[O,g,b]),!O)return null;var w=(0,x.tZ)(aW.I,{onEnrollClick:function(){y({ctaText:"Discover how",ctaLocation:"cart_banner"}),u(),r()},weeklySavings:null!==(t=(0,aF.q)(o,String(i)))&&void 0!==t?t:"",bannerRef:v,benefitsSubtext:f?{hasPremiumMealsDiscount:f.hasPremiumMealsDiscount,premiumMealsDiscountDisplay:f.premiumMealsDiscountDisplay}:void 0});return"mobile"===a?(0,x.tZ)(az.g,{children:w}):w},aH=r(816709),aG=r(204600),aQ=function(){var e=(0,D.ZP)("cart").translate;return(0,x.tZ)(_.xu,{gap:"global.xs",py:"global.xs",px:"global.sm-1",width:"100%",display:"flex",backgroundColor:"alias.messages.background.success.subtle",borderRadius:"border-radius-md",justifyContent:"space-between",children:(0,x.BX)(_.xu,{display:"flex",gap:"global.xs",children:[(0,x.tZ)(_.xu,{color:"neutral.800",display:"flex",alignItems:"center",children:(0,x.tZ)(aG.default,{})}),(0,x.tZ)(_.xu,{display:"flex",flexDirection:"column",justifyContent:"center",children:(0,x.tZ)(_.xv,{type:"body-sm-regular",children:e("cart.x-sell-one-time-order.message")})})]})})},aJ=function(e){return 100*e},aK=r(54879),aY=function(e,t){var r,n=(0,aK.N)({customerUUID:e},{suspense:!1}).data,o=(null!==(r=null==n?void 0:n.restrictedAmount)&&void 0!==r?r:0)>0;return{cashCreditAmount:Number((null==n?void 0:n.amount)||0),shouldNotApplyCredits:!!(o&&t>0)}},a$=r(989830),a0=function(){var e,t=(0,N.Sj)(),r="desktop"===t,n=["mobile","tablet"].includes(t),o=(0,en.n6)(),i=o.delivery,a=o.subscription,l=rU(),c=l.isManualApplyEnabled,u=l.optedInWeek,s=a.customer.id,d=(0,aK.N)({customerUUID:s},{enabled:c}).data,f=i.id,p=null!==(e=null==d?void 0:d.amount)&&void 0!==e?e:0,b=a.nextModifiableDeliveryWeek,y=!!b&&b===f,m=null!==u&&void 0!==b&&!(0,a$.Z)(u,b),v=!!u&&!m,g=v&&u===f,h=c&&p>0&&!v,O=!c&&y||c&&g,w=c&&g,x=c&&v,P=!c||w||x;return{showBannerManualCashApplicationBanner:h,showHelloFreshCashInPriceSummary:O,showManualCreditApplicationBannerForDesktop:h&&r,showManualCreditApplicationBannerForSmallScreen:h&&n,showHelloFreshCashDisclaimerForAppliedWeek:w,showHelloFreshCashDisclaimerForNonAppliedWeek:x,showHelloFreshCashDisclaimer:P,shouldShowCreditUndoLink:c&&g,creditBalance:p}},a1=r(868179),a2=r(606984),a6=(0,tl.cn)(!1);function a3(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function a4(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){a3(i,n,o,a,l,"next",e)}function l(e){a3(i,n,o,a,l,"throw",e)}a(void 0)})}}function a5(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var a7=function(){var e,t,r=(0,en.n6)().subscription,n=(0,tl.b9)(a6),o=(0,tl.b9)(rX),i=r.customer.uuid,a=(0,a2.r)(),l=a.mutateAsync,c=a.isLoading,u=a.isError;return{applyCredit:(0,P.useCallback)((e=a4(function(e){return a5(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,l({customerUUID:i,deliveryWeek:e,enabled:!0})];case 1:return t.sent(),o(!1),n(!0),[3,3];case 2:return t.sent(),o(!0),[3,3];case 3:return[2]}})}),function(t){return e.apply(this,arguments)}
1),[l,i,n,o]),undoCredit:(0,P.useCallback)((t=a4(function(e){return a5(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,l({customerUUID:i,deliveryWeek:e,enabled:!1})];case 1:return t.sent(),o(!1),[3,3];case 2:return t.sent(),o(!0),[3,3];case 3:return[2]}})}),function(e){return t.apply(this,arguments)}),[l,i,o]),isLoading:c,isError:u}};function a8(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function a9(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var le="CashCreditUndo",lt=function(){var e=(0,tp.Z)().push,t=(0,en.n6)(),r=t.subscription,n=t.delivery,o=a0().creditBalance,i=n.id,a=r.customerPlanId,l="".concat(i,"|").concat(a),c=(0,P.useMemo)(function(){return{event:"gaEventTrigger",gaEventCategory:"Cart|CashCredit",gaEventLabel:l,screen:"Order Summary",tribe:"Shopping Experience",cash_available:o}},[l,o]);return{trackNudgeDisplayed:(0,P.useCallback)(function(){e(a9(a8({},c),{event_name:"OrderSummary_CashCreditNudgeDisplayed",gaEventAction:"CashCreditView"}))},[e,c]),trackNudgeClick:(0,P.useCallback)(function(){e(a9(a8({},c),{event_name:"OrderSummary_CashCreditNudgeClick",gaEventAction:"CashCreditClick"}))},[e,c]),trackDrawerOpen:(0,P.useCallback)(function(){e(a9(a8({},c),{event_name:"OrderSummary_CashCreditDrawerOpen",gaEventAction:"CashCreditDrawerOpen"}))},[e,c]),trackApply:(0,P.useCallback)(function(t){e(a9(a8({},c),{event_name:"OrderSummary_CashCreditApply",gaEventAction:"CashCreditApply",cash_threshold:t}))},[e,c]),trackWithdraw:(0,P.useCallback)(function(t){e(a9(a8({},c),{event_name:"OrderSummary_CashCreditWithdraw",gaEventAction:"CashCreditWithdraw",cash_threshold:t}))},[e,c]),trackUndoBannerClick:(0,P.useCallback)(function(){e(a9(a8({},c),{event_name:"OrderSummary_CashCreditUndoBannerClick",gaEventAction:le}))},[e,c]),trackUndoLinkClick:(0,P.useCallback)(function(){e(a9(a8({},c),{event_name:"OrderSummary_CashCreditUndoLinkClick",gaEventAction:le}))},[e,c])}},lr=function(){var e=(0,D.ZP)(rL),t=e.translate,r=e.translateRaw,n=rU().optedInWeek,o=a7(),i=o.undoCredit,a=o.isLoading,l=lt().trackUndoLinkClick,c=(0,P.useCallback)(function(){n&&(l(),i(n))},[i,n,l]);return n?a?(0,x.tZ)(_.xu,{children:(0,x.tZ)(_.$j,{variant:"primary",size:"xs"})}):(0,x.tZ)(_.xu,{as:"button",textDecoration:"underline",background:"none",borderWidth:0,cursor:"pointer",disabled:a,onClick:c,"aria-label":r("cart.manual_credit.undo_link.a11y.label"),children:(0,x.tZ)(_.xv,{type:"body-sm-bold",children:t("cart.manual_credit.undo_link.label")})}):null},ln=function(){return(0,x.tZ)(C.Z,{scope:"manual-credit-undo-link",children:(0,x.tZ)(lr,{})})},lo=function(e){var t,r,n=e.customerUUID,o=(0,D.ZP)("cart").translateRaw,i=(0,en.n6)(),a=i.isNextModifiableWeek,l=i.subscription,c=nC().data,u=rU(),s=u.optedInWeek,d=u.isManualApplyEnabled,f=a0(),p=f.shouldShowCreditUndoLink,b=f.showHelloFreshCashDisclaimerForAppliedWeek,y=f.showHelloFreshCashDisclaimerForNonAppliedWeek,m=function(e){var t=e.optedInWeek,r=e.subscriptionId,n=e.isEnabled,o=(0,a1.G)({week:null!=t?t:"",subscriptionId:r},{enabled:!!(t&&r&&n),suspense:!1}).data;if(!o)return null;var i=o.isHolidayShiftVisible?o.holidayDelivery:o.deliveryDate;return i?(0,rx.Z)((0,rP.Z)(i),rS.r_):null}({optedInWeek:s,subscriptionId:l.id.toString(),isEnabled:y}),v=aY(n,(null==c?void 0:c.discountAmount)||0),g=v.cashCreditAmount,h=v.shouldNotApplyCredits,O=n$(),w=aJ((null==c?void 0:c.grandTotal)||0);if(!c||!(g>0)||0===w)return null;var P=w>g?g:w,S=g-P,k=o("cart.top-ups.orderSummary.editableWeek.disclaimerText",{balance:O(S>0?S:0)}),j=o("cart.top-ups.orderSummary.futureWeek.disclaimerText",{balance:O(g)}),C=o("cart.manual_credit.disclaimer.applied.label"),Z=o("cart.manual_credit.disclaimer.applied_elsewhere.label",{week:null!=m?m:(0,tw.Z)(s)});return r=a&&!h?"editableWeek-disclaimerText":"futureWeek.disclaimerText",d||!a||h||(t=k),d||a||(t=j),b?t=S>0?k:C:y&&(t=Z),(0,x.BX)(_.xu,{"data-test-id":r,paddingTop:"global.sm-2",display:"flex",alignItems:"center",mb:["global.sm-2","global.none"],children:[(0,x.tZ)(_.xu,{display:"flex",alignItems:"center",children:(0,x.tZ)(_.xv,{type:"body-md-regular",children:t})}),p&&(0,x.tZ)(_.xu,{ml:"global.sm-2",children:(0,x.tZ)(ln,{})})]})},li=r(871917),la=r(783045),ll=r(607445),lc=function(e){var t=e.subscriptionId,r=e.customerId,n=e.menuWeekId,o="cartBannerActive",i="display";return{tribe:"customer-benefits",squad:"price-and-benefits-communication",event_name:"Wallet_BannerDisplay",screen:"CART",user_action:i,element:o,subscription_id:t,customer_id:r,hf_week:(0,o5.Z)(),hf_menu_week:n,number_of_offers:"none",value_offer:"none",value_type_offer:"none",free_shipping_offer:"none",value_premium_offer:"none",value_premium_type_offer:"none",amazon_free_shipping_offer:"none",addon_mwd:"none",value_mealbox_offer:"none",value_mealbox_type_offer:"none",value_market_offer:"none",value_market_type_offer:"none",event:"gaEventTrigger",gaEventCategory:"wallet",gaEventAction:"".concat(o,"|").concat(i)}},lu=function(e){var t=e.subscriptionId,r=e.customerId,n=e.menuWeekId,o="cartBannerActive",i="click";return{tribe:"customer-benefits",squad:"price-and-benefits-communication",event_name:"Wallet_BannerClick",screen:"CART",user_action:i,element:o,subscription_id:t,customer_id:r,hf_week:(0,o5.Z)(),hf_menu_week:n,number_of_offers:"none",value_offer:"none",value_type_offer:"none",free_shipping_offer:"none",value_premium_offer:"none",value_premium_type_offer:"none",amazon_free_shipping_offer:"none",addon_mwd:"none",value_mealbox_offer:"none",value_mealbox_type_offer:"none",value_market_offer:"none",value_market_type_offer:"none",event:"gaEventTrigger",gaEventCategory:"wallet",gaEventAction:"".concat(o,"|").concat(i)}}
1,ls=function(){var e=(0,en.n6)(),t=e.delivery,r=e.subscription,n=(0,tp.Z)().push;return{onBannerDisplay:(0,P.useCallback)(function(){n(lc({subscriptionId:r.id,customerId:r.customer.id,menuWeekId:t.id}))},[n,r.id,r.customer.id,t.id]),onBannerClick:(0,P.useCallback)(function(){n(lu({subscriptionId:r.id,customerId:r.customer.id,menuWeekId:t.id}))},[n,r.id,r.customer.id,t.id]),onSavingsDisplay:(0,P.useCallback)(function(e){n({week:t.id,gaEventCategory:"editableOrderSummary",gaEventAction:"benefitsPill|display",event_name:"OrderSummary_SavingsDisplay",savings:e})},[t.id,n])}},ld=function(){var e,t=(0,D.ZP)(M.cart),r=t.translate,n=t.translateRaw,o=(0,la.LU)().isHelloFreshTheme,i=nC().data,a=eZ().isSaving,l=n$(),c=ls().onSavingsDisplay,u=(0,P.useMemo)(function(){var e=o?"alias.interactive.foreground":"alias.brand.foreground";return"".concat(e,".").concat(a?"disabled":"default")},[a,o]),s=null!==(e=null==i?void 0:i.discountAmount)&&void 0!==e?e:0;return(0,P.useEffect)(function(){c(s)},[c,s]),(0,x.BX)(_.xu,{"data-test-id":"savings-info-message",display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,x.BX)(_.xu,{gap:"xs",display:"flex",flexDirection:"row",alignItems:"center",children:[(0,x.tZ)(_.JO,{color:"primary.600",icon:(0,x.tZ)(ll.default,{})}),(0,x.tZ)(_.xv,{type:"body-md-bold",children:(0,x.tZ)(rI.Z,{copy:n("".concat(M.cart,".wallet.entry-point.revamp.savings"),{discount:l(aJ(s))})})})]}),(0,x.tZ)(_.xu,{children:(0,x.tZ)(_.xv,{type:"body-md-bold",color:u,textDecoration:"underline",textAlign:"right",children:r("".concat(M.cart,".wallet.entry-point.revamp.savings.cta"))})})]})},lf=function(e){var t=e.isSaving,r=(0,D.ZP)(M.cart).translate;return(0,x.BX)(_.xu,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[(0,x.tZ)(_.xu,{display:"flex",flexDirection:"row",gap:"xs",alignItems:"center",children:(0,x.tZ)(_.xu,{children:(0,x.tZ)(_.xv,{children:r("".concat(M.cart,".wallet.entry-point"))})})}),(0,x.tZ)(_.xu,{color:"primary.600",display:"flex",alignItems:"center",children:(0,x.tZ)(_.JO,{icon:(0,x.tZ)(oC.default,{}),color:t?"alias.brand.foreground.disabled":"inherit"})})]})},lp=function(){var e,t,r=eZ().isSaving,n=(0,en.n6)(),o=n.subscription,i=n.delivery,a=nC().data,l=!!(null==a?void 0:a.discountAmount),c=(0,li.U)(o.id,i.id),u=ls(),s=u.onBannerDisplay,d=u.onBannerClick,f=(0,la.LU)().isHelloFreshTheme,p=(0,P.useMemo)(function(){return{backgroundColor:f?"alias.benefits.default":"global.blue.200",borderRadius:f?"16px 0 16px 0":"global.md"}},[f]),b="benefits-entry-point-cart-screen";if((0,P.useEffect)(function(){c&&s()},[c,s]),!c)return null;var y=oX.Z.create((0,x.tZ)(iy,{}),{id:"menu-benefit-drawer"});return(0,x.tZ)(C.Z,{scope:b,children:(0,x.tZ)(nb.Z,{componentName:b,children:(0,x.tZ)(_.xu,(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({as:"button",role:"button",onClick:function(){d(),(0,oN.Tk)(y)},px:"global.sm-2",py:"global.md-1",borderWidth:0,disabled:r,cursor:r?"not-allowed":"pointer"},p),t=t={width:"100%",mb:"global.md-1",children:l?(0,x.tZ)(ld,{}):(0,x.tZ)(lf,{isSaving:r})},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e))})})},lb=r(760014),ly=r(683421),lm=r(160906),lv=r(826746),lg=r(274886),lh=r(523201),lO=r(15778),lw="rewards_hub_entry_point=cart_banner_click",lx={isRedesignEnabled:!1,backgroundColor:"#EDCAE0",textColor:"neutral.800",iconColor:"#662D55",linkColor:"global.gray.800",iconImageUrl:null,iconSize:24,rewardsHubUrl:"/my-account/loyalty?".concat(lw),overrides:[{brand:rK.Z.factor,values:{isRedesignEnabled:!0,backgroundColor:"global.factor-cyan.800",textColor:"global.white",iconColor:"global.white",linkColor:"global.white",iconImageUrl:"/hellofresh_website/loyalty/images/factor-v2/logo/icon.svg",rewardsHubUrl:"/loyalty?".concat(lw)}}]},lP=(0,oV.Z)("loyalty-program-v2.component-config.cart-points-breakdown",lx).useConfig,lS=r(671718),lk=r(447178),lj=r(140224);function lC(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function lZ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}var lA=(f=function(e,t){var r,n,o,i,a,l,c,u=arguments;return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(s){switch(s.label){case 0:return r=e.parentSpan,n=e.systemCountry,o=e.locale,i=e.grand_total_units,a=e.grand_total_nanos,l=e.grand_total_currency,c=e.items,[4,(u.length>2&&void 0!==u[2]?u[2]:lS.Z)("/loyalty/v3/programs/cart/preview",t,{method:"POST",headers:{"Content-Type":"application/json"},query:{country:n,locale:o},data:{grand_total_units:i,grand_total_nanos:a,grand_total_currency:l,items:c},parentSpan:r,fetchSpanAttributes:{"request.backend_service":"customer-achievements-service","request.backend_action":"cart-preview"}})];case 1:return[2,s.sent().json()]}})},p=function(){var e=this,t=arguments;return new Promise(function(r,n){var o=f.apply(e,t);function i(e){lC(o,r,n,i,a,"next",e)}function a(e){lC(o,r,n,i,a,"throw",e)}i(void 0)})},function(e,t){return p.apply(this,arguments)}),l_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,lk.Z)().fetch,r=(0,lj.O)(),n=[ea.Z["loyalty.v3.cart.preview"],r];return(0,ei.useMutation)(function(e){return lA(lZ({},r,e),n,t)},lZ({},e))},lD=function(e){return Math.trunc(e)},lI=function(e){return Math.round((e-Math.trunc(e))*1e9)},lE=function(){var e,t=nC(),r=t.data,n=t.isLoading,o=l_(),i=o.mutate,a=o.data,l=o.isLoading,c=(0,P.useMemo)(function(){if(r){var e=r.products.filter(function(e){return e.quantity>0&&e.unitPrice>0}).map(function(e){return{product_handle:e.handle,paid_price_units:lD(e.paidPrice),paid_price_nanos:lI(e.paidPrice)}});return{grand_total_units:lD(r.grandTotal),grand_total_nanos:lI(r.grandTotal),grand_total_currency:r.currency,items:e}}},[r]),u=c?JSON.stringify(c):void 0;return(0,P.useEffect)(function(){c&&i(c)},[u]),{storePointChanges:(0,P.useMemo)(function(){var e;return(null!==(e=null==a?void 0:a.store_point_changes)&&void 0!==e?e:[]).filter(function(e){return"debit"!==e.action})},[a]),totalPoints:null!==(e=null==a?void 0:a.total_store_points_delta)&&void 0!==e?e:0,isLoading:n||l,hasData:!!a}};function lT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function lB(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}var lM=function(e){var t,r,n,o,i,a,l=e.totalPoints,c=(0,tp.Z)().push,u=(0,lb.Z)().payloadV2,s=null!==(i=null==u?void 0:null===(r=u.enrollment)||void 0===r?void 0:null===(t=r.extra)||void 0===t?void 0:t.isEnrolled)&&void 0!==i&&i,d=null!==(a=null==u?void 0:null===(o=u.enrollment)||void 0===o?void 0:null===(n=o.data)||void 0===n?void 0:n.id)&&void 0!==a?a:"",f=(0,P.useMemo)(function(){return{event:"gaEventTrigger",event_category:"loyaltyProgram",event_label:"EarnInfoBanner",element:"loyaltyProgramCartEarnInfo",screen:"Cart",enrollment_id:d,enrollment_state:s?"enrolled":"not_enrolled",order_total_pts_to_earn:"".concat(l)}},[s,d,l]);return{trackDisplay:(0,P.useCallback)(function(){c(lB(lT({},f),{event_name:"Loyalty_Cart_EarnInfoDisplay",event_action:"display"}))},[c,f]),trackExpandClick:(0,P.useCallback)(function(){c(lB(lT({},f),{event_name:"Loyalty_Cart_EarnInfoExpandClick",event_action:"click"}))},[c,f]),trackCollapseClick:(0,P.useCallback)(function(){c(lB(lT({},f),{event_name:"Loyalty_Cart_EarnInfoCollapseClick",event_action:"click"}))},[c,f]),trackViewRewardsClick:(0,P.useCallback)(function(){c(lB(lT({},f),{event_name:"Loyalty_Cart_EarnInfoViewRewardsClick",event_action:"click",click_target:"/my-account/loyalty"}))},[c,f])}},lR=r(13924),lL=function(){var e=(0,tk.L3)().trackJanusEvent,t=(0,lb.Z)().payloadV2,r=(0,P.useRef)(!1);return{trackImpression:(0,P.useCallback)(function(){if(!r.current){r.current=!0;var n,o,i,a,l,c,u,s=lR.kg,d=null==t?void 0:t.enrollment,f=null!==(a=null==d?void 0:null===(n=d.extra)||void 0===n?void 0:n.isEnrolled)&&void 0!==a&&a,p=null==d?void 0:null===(o=d.data)||void 0===o?void 0:o.id,b=f&&null!==(l=null==d?void 0:null===(i=d.data)||void 0===i?void 0:i.store_points)&&void 0!==l?l:null;try{e(s.janusEvent({event:s.event({impressionType:lR.w7.NavigatedTo,visibilityThreshold:lR.Mc.Major}),loyaltyProgramIdentity:s.loyaltyProgramIdentity({enrollmentId:f&&p?"".concat(p):null,enrollmentState:f?lR.T_.Enrolled:lR.T_.NotEnrolled,programId:(null==t?void 0:null===(u=t.optIn)||void 0===u?void 0:null===(c=u.data)||void 0===c?void 0:c.program_id)?"".concat(t.optIn.data.program_id):null}),loyaltyProgramPointsStatusEntities:null===b?[]:[s.loyaltyProgramPointsStatus({pointsBalance:b})]}))}catch(e){(0,th.Tb)(e,{tags:{event:"Cart_Accordion_PointsEarnInfo_Impression",component:"useCartPointsEarnInfoImpressionSnowplowEvent"}})}}},[e,t])}},lq=r(786798),lU=function(){var e=(0,tk.L3)().trackJanusEvent,t=(0,lb.Z)().payloadV2;
1return{trackAccordionClick:(0,P.useCallback)(function(){var r,n,o,i,a,l,c,u=lq.dk,s=null==t?void 0:t.enrollment,d=null!==(i=null==s?void 0:null===(r=s.extra)||void 0===r?void 0:r.isEnrolled)&&void 0!==i&&i,f=null==s?void 0:null===(n=s.data)||void 0===n?void 0:n.id,p=d&&null!==(a=null==s?void 0:null===(o=s.data)||void 0===o?void 0:o.store_points)&&void 0!==a?a:null;try{e(u.janusEvent({loyaltyProgramIdentity:u.loyaltyProgramIdentity({enrollmentId:d&&f?"".concat(f):null,enrollmentState:d?lq.T_.Enrolled:lq.T_.NotEnrolled,programId:(null==t?void 0:null===(c=t.optIn)||void 0===c?void 0:null===(l=c.data)||void 0===l?void 0:l.program_id)?"".concat(t.optIn.data.program_id):null}),loyaltyProgramPointsStatusEntities:null===p?[]:[u.loyaltyProgramPointsStatus({pointsBalance:p})]}))}catch(e){(0,th.Tb)(e,{tags:{event:"Cart_View_LoyaltyPoints_Accordion_Click",component:"useCartViewLoyaltyPointsAccordionClickSnowplowEvent"}})}},[e,t])}},lX=r(677292),lN=function(){var e=(0,tk.L3)().trackJanusEvent,t=(0,lb.Z)().payloadV2;return{trackViewRewardsClick:(0,P.useCallback)(function(){var r,n,o,i,a,l,c,u=lX.G6,s=null==t?void 0:t.enrollment,d=null!==(i=null==s?void 0:null===(r=s.extra)||void 0===r?void 0:r.isEnrolled)&&void 0!==i&&i,f=null==s?void 0:null===(n=s.data)||void 0===n?void 0:n.id,p=d&&null!==(a=null==s?void 0:null===(o=s.data)||void 0===o?void 0:o.store_points)&&void 0!==a?a:null;try{e(u.janusEvent({loyaltyProgramIdentity:u.loyaltyProgramIdentity({enrollmentId:d&&f?"".concat(f):null,enrollmentState:d?lX.T_.Enrolled:lX.T_.NotEnrolled,programId:(null==t?void 0:null===(c=t.optIn)||void 0===c?void 0:null===(l=c.data)||void 0===l?void 0:l.program_id)?"".concat(t.optIn.data.program_id):null}),loyaltyProgramPointsStatusEntities:null===p?[]:[u.loyaltyProgramPointsStatus({pointsBalance:p})]}))}catch(e){(0,th.Tb)(e,{tags:{event:"Cart_View_RewardsHub_Accordion_Click",component:"useCartViewRewardsHubAccordionClickSnowplowEvent"}})}},[e,t])}},lF=function(e){var t="left"===e?0:5,r="left"===e?5:0;return["M".concat(t," 0"),"C".concat(t," ").concat(7.5," ").concat(r," ").concat(7.5," ").concat(r," ").concat(15),"C".concat(r," ").concat(22.5," ").concat(t," ").concat(22.5," ").concat(t," ").concat(30),"L".concat(r," ").concat(30),"L".concat(r," 0"),"Z"].join(" ")},lW=function(e){var t='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 '.concat(5," ").concat(30,'"><path d="').concat(lF(e),'" fill="#000"/></svg>');return'url("data:image/svg+xml,'.concat(encodeURIComponent(t),'")')},lz=function(){var e,t,r="linear-gradient(#000, #000)",n={maskImage:[lW("left"),lW("right"),r,r,r,r,r].join(", "),maskSize:["".concat(5,"px ").concat(30,"px"),"".concat(5,"px ").concat(30,"px"),"calc(100% - ".concat(10,"px) 100%"),"".concat(5,"px calc(50% - ").concat(15,"px)"),"".concat(5,"px calc(50% - ").concat(15,"px)"),"".concat(5,"px calc(50% - ").concat(15,"px)"),"".concat(5,"px calc(50% - ").concat(15,"px)")].join(", "),maskPosition:"left center, right center, center top, left top, left bottom, right top, right bottom",maskRepeat:"no-repeat"};return e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},n),t=t={WebkitMaskImage:n.maskImage,WebkitMaskSize:n.maskSize,WebkitMaskPosition:n.maskPosition,WebkitMaskRepeat:n.maskRepeat},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e},lV=function(e){var t=e.iconImageUrl,r=e.iconColor,n=e.iconSize;return t?(0,x.tZ)(r4.ZP,{fetchFormat:"svg",src:t,alt:"",width:n,height:n,draggable:!1,"data-test-id":"loyalty-points-accordion-icon-image"}):(0,x.tZ)(_.JO,{icon:(0,x.tZ)(lO.default,{}),color:r})},lH=function(e){var t=e.isOpen,r=e.totalPoints,n=e.textColor,o=e.iconColor,i=e.iconImageUrl,a=e.iconSize,l=e.linkColor,c=e.rewardsHubUrl,u=e.onToggle,s=e.onLinkClick,d=(0,D.ZP)("loyalty_cart_accordion"),f=d.translate,p=d.translateRaw;return(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",alignItems:"flex-start",ga
1p:"global.sm-1",children:[(0,x.tZ)(_.xu,{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:(0,x.tZ)(lV,{iconImageUrl:i,iconColor:o,iconSize:a})}),(0,x.BX)(_.xu,{as:"button",type:"button",flexGrow:1,pl:"global.none",borderWidth:0,backgroundColor:"global.transparent",textAlign:"left",display:"flex",flexDirection:"row",alignItems:"center",gap:"global.sm-1",cursor:"pointer","aria-expanded":t,onClick:u,children:[(0,x.BX)(_.xu,{flexGrow:1,children:[(0,x.tZ)(_.xv,{type:"body-md-regular",color:n,children:(0,x.tZ)(rI.Z,{hasMarkdown:!0,copy:p(1===r?"loyalty_cart_accordion.title.one":"loyalty_cart_accordion.title.other",{points:r})})}),(0,x.tZ)(_.xu,{children:(0,x.tZ)(_.rU,{type:"body-md-bold",href:c,"data-test-id":"loyalty-points-accordion-link",customColor:l,hoverColor:l,activeColor:l,visitedColor:l,onClick:s,children:f("loyalty_cart_accordion.title.link")})})]}),(0,x.tZ)(_.xu,{display:"flex",alignItems:"center",flexShrink:0,children:(0,x.tZ)(_.JO,{icon:t?(0,x.tZ)(lh.Z,{}):(0,x.tZ)(lg.Z,{}),color:n})})]})]})},lG=function(e){var t=e.storePointChanges,r=e.textColor,n=(0,D.ZP)("loyalty_cart_accordion").translateRaw;return(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"global.xs",pl:"calc(1.5rem + 0.75rem)",children:[t.map(function(e,t){var o=e.reason,i=e.value;return(0,x.tZ)(_.xv,{type:"body-sm-regular",color:r,children:(0,x.tZ)(rI.Z,{hasMarkdown:!0,copy:n(1===i?"loyalty_cart_accordion.item.one":"loyalty_cart_accordion.item.other",{points:i,item:o})})},"".concat(o,"-").concat(t))}),(0,x.tZ)(_.xv,{type:"body-sm-regular",color:r,children:(0,x.tZ)(rI.Z,{hasMarkdown:!0,copy:n("loyalty_cart_accordion.disclaimer")})})]})},lQ=function(e){var t=e.isOpen,r=e.isLoading,n=e.totalPoints,o=e.storePointChanges,i=e.onToggle,a=e.onLinkClick,l=lP(),c=l.backgroundColor,u=l.textColor,s=l.iconColor,d=l.iconImageUrl,f=l.iconSize,p=l.linkColor,b=l.rewardsHubUrl,y=lz();return r?(0,x.tZ)(_.xu,{"data-test-id":"loyalty-points-accordion-loading",marginBottom:["global.md-1","global.md-1","global.none"],height:98,width:"100%",backgroundColor:"neutral.400",borderRadius:"global.lg",__dangerouslySetCustomCSS:y}):(0,x.BX)(_.xu,{"data-test-id":"loyalty-points-accordion",marginBottom:["global.md-1","global.md-1","global.none"],backgroundColor:c,borderRadius:"global.lg",px:["global.md-1","global.sm-2"],py:["global.sm-1"],display:"flex",flexDirection:"column",gap:"global.sm-1",__dangerouslySetCustomCSS:y,children:[(0,x.tZ)(lH,{isOpen:t,totalPoints:n,textColor:u,iconColor:s,iconImageUrl:d,iconSize:f,linkColor:p,rewardsHubUrl:b,onToggle:i,onLinkClick:a}),t&&(0,x.tZ)(lG,{storePointChanges:o,textColor:u})]})};function lJ(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var lK=function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,P.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return lJ(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lJ(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],n=t[1],o=(0,D.ZP)("loyalty_cart_accordion"),i=o.translate,a=o.translateRaw,l=lP().isRedesignEnabled,c=lE(),u=c.storePointChanges,s=c.totalPoints,d=c.isLoading,f=c.hasData,p=lM({totalPoints:s}),b=p.trackDisplay,y=p.trackExpandClick,m=p.trackCollapseClick,v=p.trackViewRewardsClick,g=lL().trackImpression,h=lU().trackAccordionClick,O=lN().trackViewRewardsClick,w=f&&!d;(0,P.useEffect)(function(){w&&(b(),g())},[w]);var S=function(){var e=!r;e?y():m(),h(),n(e)},k=function(e){e.stopPropagation(),v(),O()};return l?(0,x.tZ)(lQ,{isOpen:r,isLoading:d,totalPoints:s,storePointChanges:u,onToggle:S,onLinkClick:k}):d?(0,x.tZ)(_.xu,{"data-test-id":"loyalty-points-accordion-loading",marginBottom:["global.md-1","global.md-1","global.none"],height:98,width:"100%",backgroundColor:"neutral.400",borderTopLeftRadius:"global.xxxl",borderTopRightRadius:"global.none",borderBottomLeftRadius:"global.none",borderBottomRightRadius:"global.xxxl"}):f?(0,x.BX)(_.xu,{"data-test-id":"loyalty-points-accordion",marginBottom:["global.md-1","global.md-1","global.none"],backgroundColor:"global.purple.100",borderTopLeftRadius:"global.xxxl",borderTopRightRadius:"global.none",borderBottomLeftRadius:"global.none",borderBottomRightRadius:"global.xxxl",px:["global.md-1","global.sm-2"],py:["global.sm-1"],display:"flex",flexDirection:"column",gap:"global.sm-1",children:[(0,x.BX)(_.xu,{display:"flex",flexDirection:"row",alignItems:"flex-start",ga
1p:"global.sm-1",children:[(0,x.tZ)(_.xu,{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,children:(0,x.tZ)(_.JO,{icon:(0,x.tZ)(lO.default,{}),color:"global.purple.800"})}),(0,x.BX)(_.xu,{as:"button",type:"button",flexGrow:1,pl:"global.none",borderWidth:0,backgroundColor:"global.transparent",textAlign:"left",display:"flex",flexDirection:"row",alignItems:"center",gap:"global.sm-1",cursor:"pointer","aria-expanded":r,onClick:S,children:[(0,x.BX)(_.xu,{flexGrow:1,children:[(0,x.tZ)(_.xv,{type:"body-md-regular",children:(0,x.tZ)(rI.Z,{hasMarkdown:!0,copy:a(1===s?"loyalty_cart_accordion.title.one":"loyalty_cart_accordion.title.other",{points:s})})}),(0,x.tZ)(_.xu,{children:(0,x.tZ)(_.rU,{type:"body-md-bold",href:"/my-account/loyalty?rewards_hub_entry_point=cart_banner_click","data-test-id":"loyalty-points-accordion-link",onClick:k,children:i("loyalty_cart_accordion.title.link")})})]}),(0,x.tZ)(_.xu,{display:"flex",alignItems:"center",flexShrink:0,children:(0,x.tZ)(_.JO,{icon:r?(0,x.tZ)(lh.Z,{}):(0,x.tZ)(lg.Z,{}),color:"inherit"})})]})]}),r&&(0,x.tZ)(lG,{storePointChanges:u,textColor:"neutral.800"})]}):null},lY=function(){return(0,x.tZ)(r3.Z,{claim:{name:"loyalty",githubTeam:"hellofresh/squad-loyalty-web",tribe:"loyalty-and-virality",alliance:"consumer",jiraPrefix:"LOYA",slackChannel:"#squad-loyalty",slackAlertsChannel:"#squad-loyalty-web-alerts",skipLabelsOnPR:!1,teamIdentifier:"loyalty"},children:(0,x.tZ)(C.Z,{scope:"loyalty-program.v2.cart.points-breakdown",fallback:(0,x.tZ)(x.HY,{}),children:(0,x.tZ)(A.Z,{componentName:"loyalty-program.v2.cart.points-breakdown",children:(0,x.tZ)(lK,{})})})})},l$=function(){var e,t,r,n,o,i,a,l,c,u,s=(0,lb.Z)(),d=s.payloadV2,f=s.isFetched,p=s.isV2Visible,b=(0,en.n6)().isNextModifiableWeek,y=(0,eE.Z)("loyalty_v2_points_breakdown").isEnabled,m=(0,eE.Z)("loyalty_v2_points_banner").isEnabled,v=null!==(c=null==d?void 0:null===(t=d.enrollment)||void 0===t?void 0:null===(e=t.extra)||void 0===e?void 0:e.isEnrolled)&&void 0!==c&&c,g=null!==(u=null==d?void 0:null===(n=d.optIn)||void 0===n?void 0:null===(r=n.extra)||void 0===r?void 0:r.canOptIn)&&void 0!==u&&u,h=(0,ly.q)({screen:"Cart",loyaltyData:{isEnrolled:v,canOptIn:g,programId:null==d?void 0:null===(i=d.optIn)||void 0===i?void 0:null===(o=i.data)||void 0===o?void 0:o.program_id,enrollmentId:null==d?void 0:null===(l=d.enrollment)||void 0===l?void 0:null===(a=l.data)||void 0===a?void 0:a.id}}),O=h.trackDisplay,w=h.trackClick,P=function(){var e,t,r,n,o=function(){var e,t=(0,en.n6)(),r=t.subscription,n=t.isNextModifiableWeek,o=nC().data,i=aY(r.customer.uuid,null!==(e=null==o?void 0:o.discountAmount)&&void 0!==e?e:0),a=i.cashCreditAmount,l=i.shouldNotApplyCredits;if(o)return{grandTotal:o.grandTotal,cashCreditAmount:a,shouldNotApplyCredits:l,isNextModifiableWeek:n}}(),i=(0,lb.Z)().payloadV2,a=null==i?void 0:null===(n=i.enrollment.data)||void 0===n?void 0:null===(r=n.metadata)||void 0===r?void 0:r.multiplier;if(void 0!==o&&void 0!==a)return(0,lv.K)((e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},o),t=t={multiplier:a},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e))}();return p?y&&b&&v?(0,x.tZ)(lY,{}):m?(0,x.tZ)(lm.Z,{loyaltyData:{isFetched:f,isV2Enrolled:v,canOptInV2:g},points:P,onDisplay:O,onClick:w}):null:null},l0=function(){return(0,x.tZ)(l$,{})},l1=r(736548),l2=r(956979),l6=function(){var e=(0,l2.y)(),t=e.isLoading,r=e.isExperimentEnabled,n=!t&&r,o=(0,l1.u)({disabled:n}),i=o.isEnabled,a=o.isLoading,l=(0,eE.Z)("running_total_belowminimum").isEnabled;return!n&&!a&&i&&l},l3=function(e){var t=e.customerUUID,r=n$(),n=(0,D.ZP)(M.cart).translate,o=(0,en.n6)().isNextModifiableWeek,i=nC().data,a=a0().showHelloFreshCashInPriceSummary,l=aY(t,(null==i?void 0:i.discountAmount)||0),c=l.cashCreditAmount,u=l.shouldNotApplyCredits,s=aJ((null==i?void 0:i.grandTotal)||0);if(!i||!(o||a)||!(c>0)||0===s||u)return null;var d=s>c?c:s,f=s-d,p="-".concat(r(d));return(0,x.BX)(x.HY,{children:[(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",alignItems:"center","data-test-id":"
1cart-total-container-top-up-balance",marginBottom:"xs",marginTop:"xs",children:[(0,x.tZ)(_.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",children:(0,x.tZ)(_.xv,{type:"body-md-bold","data-test-id":"cart-pricing-info-top-up-balance-text",children:n("cart.top-ups.order-summary.balance")})}),(0,x.tZ)(_.xu,{display:"flex",lineHeight:"line-height-sm-1",children:(0,x.tZ)(_.xv,{type:"body-md-bold",as:"span","data-test-id":"cart-top-up-balance",error:!0,children:p})})]}),(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",alignItems:"center","data-test-id":"cart-total-container-top-up-amount-due",marginTop:"global.sm-2",children:[(0,x.tZ)(_.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",children:(0,x.tZ)(_.xv,{type:"body-lg-bold","data-test-id":"cart-pricing-info-top-up-amount-due-text",children:n("cart.top-ups.order-summary.amount-due")})}),(0,x.tZ)(_.xu,{display:"flex",lineHeight:"line-height-sm-1",children:(0,x.tZ)(_.xv,{type:"body-lg-bold",as:"span","data-test-id":"
1cart-total-price",children:r(f)})})]})]})},l4=function(){var e=(0,D.ZP)(M.cart).translate,t=oO(),r=t.snapTransaction,n=t.defaultTransaction,o=t.isError,i=function(){if(!n)return null;if("CREDIT_CARD"===n.paymentMethod){var t=n.paymentMethod,r=n.details.lastFourDigits;return"".concat(t," (**").concat(r,")")}return e("".concat(M.cart,".chargeAtMealSelection.paymentDetail.details.default"))}();return{snapInfoCopy:function(){if(o)return e("".concat(M.cart,".revamp.payment-delivery.payment-types.error"));if(!r||o)return null;var t=r.paymentMethod,n=r.details.lastFourDigits;return"".concat(t," (**").concat(n,")")}(),defaultPaymentCopy:i}},l5=function(e){var t=e.shouldHighlight,r=e.paymentCopy,n=e.amount;return(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between","data-test-id":"cart-total-payment-details-row",children:[(0,x.tZ)(_.xv,{type:"body-md-bold",color:t?"alias.brand.foreground.default":"inherit",children:r}),(0,x.BX)(_.xv,{type:"body-md-bold",whiteSpace:"nowrap",color:t?"alias.brand.foreground.default":"inherit",children:["-",n]})]})},l7=function(e){var t=e.type,r=(0,D.ZP)(M.cart).translate,n=oO(),o=n.snapState,i=n.snapTransaction,a=n.defaultTransaction,l=l4(),c=l.snapInfoCopy,u=l.defaultPaymentCopy,s=n$(),d="paid"===t,f=d?g.Paid:g.Unavailable;if(!i||o!==f)return null;var p=d?"".concat(M.cart,".snap.price-summary.paid-with.title"):"".concat(M.cart,".snap.price-summary.expected-refund.title");return(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"global.xs",children:[(0,x.tZ)(_.xv,{type:"body-md-bold",children:r(p)}),(0,x.tZ)(l5,{shouldHighlight:!0,paymentCopy:null!=c?c:"",amount:s(i.amount)}),a&&(0,x.tZ)(l5,{paymentCopy:null!=u?u:"",amount:s(a.amount)})]})},l8=function(){var e=oO(),t=e.snapState,r=e.isLoading,n=t===g.Paid||t===g.Unavailable;return r?(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",children:[(0,x.tZ)(z,{width:"60%",height:"24px"}),(0,x.tZ)(z,{width:"15%",height:"24px"})]}):n?(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"global.md-1",pt:"global.md-1",children:[(0,x.tZ)(l7,{type:"paid"}),(0,x.tZ)(l7,{type:"refund"})]}):null};function l9(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ce(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l9(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l9(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ct=function(e){var t=ce((0,P.useState)(!1),2),r=t[0],n=t[1],o=(0,P.useRef)(null);return(0,P.useEffect)(function(){if(e&&!r){var t=document.getElementById(rR);if(t)return o.current=new IntersectionObserver(function(e){var t;ce(e,1)[0].isIntersecting&&(n(!0),null===(t=o.current)||void 0===t||t.disconnect())},{threshold:.5}),o.current.observe(t),function(){var e;return null===(e=o.current)||void 0===e?void 0:e.disconnect()}}},[e,r]),{hasBeenSeen:r,dismiss:(0,P.useCallback)(function(){return n(!0)},[])}},cr=function(){var e,t,r=(0,iD.Ae)("manual-cash-credit-threshold");return r.isReady?{threshold:null!==(t=null===(e=r.value)||void 0===e?void 0:e.cashThreshold)&&void 0!==t?t:500,isReady:!0}:{isReady:!1}},cn=function(e){var t=e.cashCreditBalance,r=e.formattedBalance,n=e.onApply,o=e.onDismiss,i=(0,D.ZP)(rL).translateRaw,a=cr(),l=t>=(a.isReady?a.threshold:500);return(0,P.useMemo)(function(){var e=l?"high":"low",t="cart.manual_credit.apply_drawer.".concat(e),a={label:i("".concat(t,".apply_button.label"),{balance:r}),a11yLabel:i("".concat(t,".apply_button.a11y.label"),{balance:r}),onPress:n,showsLoadingState:!0},c={label:i("".concat(t,".dismiss_button.label")),a11yLabel:i("".concat(t,".dismiss_button.a11y.label")),onPress:o,showsLoadingState:!1};return l?{title:i("".concat(t,".title"),{balance:r}),body:i("".concat(t,".body")),primaryButton:a,secondaryButton:c}:{title:i("".concat(t,".title")),body:i("".concat(t,".body")),primaryButton:c,secondaryButton:a}},[l,r,n,o,i])};function co(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ci(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var ca=function(e){var t,r,n=e.cashCreditBalance,o=e.onApply,i=e.onDismiss,a=function(e){if(Array.isArray(e))return e}(t=(0,P.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return co(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return co(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),l=a[0],c=a[1],u=n$()(n),s=lt(),d=s.trackApply,f=s.trackWithdraw,p=cr(),b=n>=(p.isReady?p.threshold:500)?"above":"below",y=cn({cashCreditBalance:n,formattedBalance:u,onApply:(0,P.useCallback)((r=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){switch(e.label){case 0:d(b),c(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,o()];case 2:return e.sent(),[3,4];case 3:return c(!1),[7];case 4:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){ci(i,n,o,a,l,"next",e)}function l(e){ci(i,n,o,a,l,"throw",e)}a(void 0)})}),[o,d,b]),onDismiss:(0,P.useCallback)(function(){f(b),i()},[i,f,b]),isApplying:l}),m=y.title,v=y.body,g=y.primaryButton,h=y.secondaryButton;return(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:["global.sm-2","global.sm-2","global.sm-2"],px:["global.sm-1","global.md-1","global.md-2"],pt:["global.sm-1","global.md-1","global.lg-1"],pb:["global.sm-1","global.md-1","global.md-3"],children:[(0,x.tZ)(_.xv,{as:"h3",children:m}),(0,x.tZ)(_.xv,{type:"body-md-regular",children:v}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",width:"100%",mt:"global.sm-1",gap:"global.sm-2",children:[(0,x.tZ)(_.zx.Primary,{onClick:g.onPress,"aria-label":g.a11yLabel,loading:g.showsLoadingState&&l,disabled:l,width:"100%",children:g.label}),(0,x.tZ)(_.zx.Secondary,{onClick:h.onPress,"aria-label":h.a11yLabel,loading:h.showsLoadingState&&l,disabled:l,width:"100%",children:h.label})]})]})},cl=function(e){return(0,x.tZ)(C.Z,{scope:"manual-credit-apply-drawer",children:(0,x.tZ)(ca,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e))})},cc=function(e){var t=e.isOpen,r=e.onClose,n=e.cashCreditBalance,o=e.onApply,i=(0,P.useRef)(null);return(0,x.tZ)(_.dy.Container,{isModal:!0,isOpen:t,onClose:r,onDismiss:r,placement:"bottom",returnFocusRef:i,width:"100%",children:(0,x.tZ)(cl,{cashCreditBalance:n,onApply:o,onDismiss:r})})},cu=function(e){return(0,x.tZ)(C.Z,{scope:"credit-application-drawer",children:(0,x.tZ)(cc,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e))})},cs=r(750619),cd=function(e){var t=e.cashCreditBalance,r=e.onApplyCredit,n=(0,D.ZP)(rL),o=n.translate,i=n.translateRaw,a=n$()(t);return(0,x.BX)(_.xu,{id:rR,display:"flex",justifyContent:"space-between",role:"region",alignItems:"center",gap:"global.md-1",px:"global.sm-2",backgroundColor:"alias.messages.background.success.subtle",borderRadius:"global.lg",width:"100%",minHeight:48,py:"global.sm-1",mt:["global.none","global.none","global.sm-2"],mb:["global.sm-2","global.sm-2","global.none"],"aria-label":i("cart.manual_credit.nudge_banner.a11y.label",{balance:a}),children:[(0,x.BX)(_.xu,{display:"flex",alignItems:"center",gap:"global.sm-1",children:[(0,x.tZ)(_.JO,{icon:(0,x.tZ)(cs.default,{}),color:"global.black"}),(0,x.tZ)(_.xv,{type:"body-sm-bold",children:o("cart.manual_credit.nudge_banner.balance_available.label",{balance:a})})]}),(0,x.tZ)(_.xu,{flexShrink:0,children:(0,x.tZ)(_.zx.Secondary,{onClick:r,size:"sm","aria-label":i("cart.manual_credit.nudge_banner.apply.a11y.label"),children:(0,x.tZ)(_.xv,{type:"body-sm-bold",children:o("cart.manual_credit.nudge_banner.apply.label")})})})]})},cf=function(e){return(0,x.tZ)(C.Z,{scope:"manual-credit-nudge-banner",children:(0,x.tZ)(cd,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e))})};function cp(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function cb(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var cy=function(){var e,t,r=a0().creditBalance,n=(0,en.n6)().delivery,o=(0,N.Sj)(),i=function(e){if(Array.isArray(e))return e}(e=(0,P.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return cp(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cp(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],l=i[1],c=n.id,u=a7().applyCredit,s=lt(),d=s.trackNudgeDisplayed,f=s.trackDrawerOpen,p=ct(!0).hasBeenSeen,b=(0,P.useRef)(!1);(0,P.useEffect)(function(){p&&!b.current&&(b.current=!0,d())},[p,d]);var y=(0,P.useCallback)(function(){"desktop"===o?(0,oN.aT)(rM):l(!1)},[o]),m=(0,P.useCallback)((t=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,3,4]),[4,u(c)];case 1:case 2:return e.sent(),[3,4];case 3:return y(),[7];case 4:return[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(e){cb(i,n,o,a,l,"next",e)}function l(e){cb(i,n,o,a,l,"throw",e)}a(void 0)})}),[u,c,y]),v=(0,P.useCallback)(function(){if(f(),"desktop"===o){var e=oX.Z.create((0,x.tZ)(cl,{cashCreditBalance:r,onApply:m,onDismiss:y}),{id:rM});(0,oN.Tk)(e)}else l(!0)},[o,r,m,y,f]);return(0,x.BX)(x.HY,{children:[(0,x.tZ)(cf,{cashCreditBalance:r,onApplyCredit:v}),"desktop"!==o&&(0,x.tZ)(cu,{isOpen:a,onClose:y,cashCreditBalance:r,onApply:m})]})},cm=function(){return a0().showBannerManualCashApplicationBanner?(0,x.tZ)(C.Z,{scope:"manual-credit-application-banner",children:(0,x.tZ)(cy,{})}):null},cv=function(e){var t=e.customerUUID,r=a0(),n=r.showHelloFreshCashInPriceSummary,o=r.showManualCreditApplicationBannerForDesktop,i=r.showManualCreditApplicationBannerForSmallScreen;return(0,x.BX)(x.HY,{children:[n&&(0,x.tZ)(l3,{customerUUID:t}),(0,x.tZ)(l8,{}),(o||i)&&(0,x.tZ)(cm,{})]})};function cg(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ch=function(e){var t,r=e.isOnSnapDrawer,n=(0,ei.useQueryClient)(),o=(0,en.n6)(),i=o.subscription,a=o.delivery,l=ti(),c=(0,ee.HZ)(),u=function(e){if(Array.isArray(e))return e}(t=(0,P.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return cg(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cg(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),s=u[0],d=u[1],f=ef().state,p=f.isLoading,b=f.courses.items,y=f.addOns.items,m=(0,D.ZP)(M.cart).translate,v=(0,N.Sj)(),g=l6(),h=i.customer.uuid,O=i.customerPlanId,w=(0,aD.s)({customerId:h,planId:O}),S=w.shouldShowBanner,k=w.isActiveSubscriber,j=w.isEligible,C=w.refetch,Z=(0,aI.E)(j),A=a0().showHelloFreshCashDisclaimer,I=nZ(),E=nC(),T=E.data,B=E.isLoading,R=E.isIdle;if(!a)return null;var L={postHeader:r?null:(0,x.tZ)(lp,{}),postSummary:(0,x.BX)(x.HY,{children:[A&&(0,x.tZ)(lo,{customerUUID:h}),I&&"desktop"===v&&(0,x.tZ)(_.xu,{marginTop:"global.sm-2",children:(0,x.tZ)(nq,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},I))})]}),postTotal:(0,x.tZ)(cv,{customerUUID:h})};return(0,x.BX)(_.xu,{gap:r?"global.sm-2":"global.md-1",display:"flex",flexDirection:"column",children:[(0,x.tZ)(_.xv,{as:r?"h4":"h3","data-test-id":"order-summary-header",children:m("".concat(M.cart,".eos.main-header.header"))}),(0,x.tZ)(aT.Z,{selections:{isLoading:p,addOns:y,courses:b},weekId:a.id,subscriptionId:i.id,injections:L,experiments:{},isBelowMinimumEstimateEnabled:g}),!(Z.isReady&&Z.isEnabled)&&(0,x.tZ)(aE.j,{customerId:i.customer.uuid,planId:i.customerPlanId,weekId:a.id,subscriptionId:i.id,courses:b,addOns:y,source:"cart",onEnrollmentSuccess:function(){n.resetQueries(ea.Z["menu-cart.calculate-price"])}}),Z.isReady&&Z.isEnabled&&S&&(0,x.tZ)(aB.R,{benefits:c.benefits,customerId:i.customer.uuid,planId:i.customerPlanId,onEnrollClick:function(){return d(!0)},context:"cart",cartPricing:T,isCartPricingLoading:B||R}),(0,x.tZ)(aV,{hasActiveMembership:k,onEnrollClick:function(){return d(!0)}}),(0,x.tZ)(aH.r,{showTrialFlow:c.showTrialFlow,isOpen:s,onClose:function(){return d(!1)},onEnrollmentSuccess:function(){C(),n.resetQueries(ea.Z["menu-cart.calculate-price"])},customerId:i.customer.uuid,planId:i.customerPlanId,subscriptionId:i.id}),!r&&"desktop"===v&&(0,x.tZ)(nP,{}),l&&(0,x.tZ)(_.xu,{marginBottom:["global.md-1","global.md-1","global.none"],children:(0,x.tZ)(aQ,{})}),(0,x.tZ)(l0,{})]})},cO=function(e){var t=e.isVisible,r=e.onUndo,n=e.onDismiss,o=e.isUndoLoading,i=(0,D.ZP)(rL),a=i.translate,l=i.translateRaw;return t?(0,x.tZ)(_.Yo,{variant:"success",icon:(0,x.tZ)(iV.default,{}),alignLeadingIconPosition:"center",onDismiss:n,"aria-label":l("cart.manual_credit.applied_bar.a11y.label"),children:(0,x.BX)(_.xu,{display:"flex",width:"100%",alignItems:"center",justifyContent:"space-between",gap:"global.md-1",children:[(0,x.tZ)(_.xu,{whiteSpace:"nowrap",children:a("cart.manual_credit.applied_bar.success.label")}),(0,x.tZ)(_.zx.Secondary,{size:"sm",onClick:r,disabled:o,loading:o,"aria-label":l("cart.manual_credit.applied_bar.undo_button.a11y.label"),children:a("cart.manual_credit.applied_bar.undo_button.label")})]})}):null},cw=function(e){return(0,x.tZ)(C.Z,{scope:"manual-credit-applied-bar",children:(0,x.tZ)(cO,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e))})};function cx(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function cP(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var cS=function(){var e,t,r=rU().isManualApplyEnabled,n=(0,en.n6)().delivery,o=function(e){if(Array.isArray(e))return e}(e=(0,tl.KO)(a6))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return cx(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cx(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=o[0],a=o[1],l=n.id,c=a7(),u=c.undoCredit,s=c.isLoading,d=lt().trackUndoBannerClick,f=r&&i;(0,P.useEffect)(function(){if(f){var e=setTimeout(function(){return a(!1)},5e3);return function(){return clearTimeout(e)}}},[f,a]);var p=(0,P.useCallback)((t=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){switch(e.label){case 0:return d(),[4,u(l)];case 1:return e.sent(),a(!1),[2]}})},function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(e){cP(i,n,o,a,l,"next",e)}function l(e){cP(i,n,o,a,l,"throw",e)}a(void 0)})}),[u,l,a,d]),b=(0,P.useCallback)(function(){a(!1)},[a]);return(0,x.tZ)(cw,{isVisible:f,onUndo:p,onDismiss:b,isUndoLoading:s})},ck=function(){return(0,x.tZ)(C.Z,{scope:"credit-applied-feedback",children:(0,x.tZ)(cS,{})})},cj=function(e){var t=e.cashCreditBalance,r=e.onView,n=e.isVisible,o=(0,D.ZP)(rL),i=o.translate,a=o.translateRaw,l=n$()(t);return n?(0,x.BX)(_.xu,{display:"flex",role:"contentinfo",alignItems:"center",gap:"global.sm-2",px:"global.md-1",py:"global.sm-1",backgroundColor:"alias.messages.background.success.subtle",borderWidth:0,width:"100%","aria-label":a("cart.manual_credit.sticky_banner.a11y.label",{balance:l}),children:[(0,x.tZ)(_.JO,{icon:(0,x.tZ)(cs.default,{}),color:"global.black"}),(0,x.tZ)(_.xu,{flexGrow:1,textAlign:"left",children:(0,x.tZ)(_.xv,{type:"body-sm-bold",children:i("cart.manual_credit.sticky_banner.balance_available.label",{balance:l})})}),(0,x.tZ)(_.xu,{as:"button",textDecoration:"underline",background:"none",borderWidth:0,cursor:"pointer",onClick:r,"aria-label":a("cart.manual_credit.sticky_banner.view.a11y.label"),children:(0,x.tZ)(_.xv,{type:"body-sm-bold",children:i("cart.manual_credit.sticky_banner.view.label")})})]}):null},cC=function(e){return(0,x.tZ)(C.Z,{scope:"manual-credit-nudge-toast",children:(0,x.tZ)(cj,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e))})},cZ=function(){var e=a0(),t=e.showBannerManualCashApplicationBanner,r=e.creditBalance,n=ct(t),o=n.hasBeenSeen,i=n.dismiss,a=lt().trackNudgeClick,l=(0,P.useCallback)(function(){var e;a(),i(),null===(e=document.getElementById(rR))||void 0===e||e.scrollIntoView({behavior:"smooth"})},[i,a]),c=t&&!o;return(0,x.tZ)(cC,{cashCreditBalance:r,onView:l,isVisible:c})},cA=function(){return(0,x.tZ)(C.Z,{scope:"credit-nudge-toast-slot",children:(0,x.tZ)(cZ,{})})},c_=r(551242);function cD(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function cI(e){return function(e){if(Array.isArray(e))return cD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return cD(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cD(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var cE={id:"",week:"",meals:[]},cT=new Set,cB=function(){var e,t,r,n,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,i=(0,eE.Z)("rnsm_recently_browsed_items"),a=i.isEnabled,l=i.isReady,c=eD().menu,u=ef().state,s=l&&a,d=s?new Set(cI((null!==(r=null==u?void 0:null===(e=u.courses)||void 0===e?void 0:e.items)&&void 0!==r?r:[]).map(function(e){return e.id})).concat(cI((null!==(n=null==u?void 0:null===(t=u.addOns)||void 0===t?void 0:t.items)&&void 0!==n?n:[]).map(function(e){return e.id})))):cT,f=(0,c_.Z)({menu:s&&null!=c?c:cE,selectedIds:d,productTypes:["addon"]}).items;return{shouldShow:s&&!!c&&f.length>=o,items:f}},cM=function(e){var t=e.navigate,r=e.carouselId,n=e.disabled;return(0,x.tZ)(_.hU.Tertiary,{id:"arrow-right-".concat(r),size:"sm",shape:"square",icon:(0,x.tZ)(oC.default,{}),onClick:t,disabled:n,"aria-label":"move carousel to next page"})},cR=function(e){var t=e.navigate,r=e.carouselId,n=e.disabled;return(0,x.tZ)(_.hU.Tertiary,{id:"arrow-left-".concat(r),size:"sm",shape:"square",icon:(0,x.tZ)(ik.default,{}),onClick:t,disabled:n,"aria-label":"move carousel to previous page"})},cL=function(e){var t,r;return"addon"!==e.type?null:(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},eG({addOn:e.addOn,groupType:e.group.groupType,sku:e.group.sku},[],[])),r=r={quantity:0},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t)},cq=function(e){var t=e.item,r=e.index,n=e.isLast,o=e.callback,i=e.onAdd,a=e.canIncrease,l=cL(t);return l?(0,x.tZ)(C.Z,{scope:"product-cards-page-level",claimOverride:i_,fallback:(0,x.tZ)(P.Fragment,{}),children:(0,x.tZ)(_.xu,{pr:n?"zero":["global.sm-3","global.sm-3","global.sm-3"],mb:"xxs",children:(0,x.tZ)(_.xu,{backgroundColor:"alias.elevation.base","data-test-id":"recently-browsed-card",width:"200px",height:"100%",children:(0,x.tZ)(e8,{index:r,addOn:l,callback:o,mutationDisableReason:a(l),source:e2.H.RECENTLY_BROWSED,onAddClick:function(){return i(l.id)}})})})}):(0,x.tZ)(P.Fragment,{})},cU=function(){var e=(0,ij.D)().isDesktop,t=(0,P.useRef)(null),r=(0,D.ZP)("recently-browsed").translate,n=(0,D.ZP)(M.cart).translate,o=ta(),i=tW(),a=tJ().canIncrease,l=tH().onAddAddOn,c=cB(),u=c.shouldShow,s=c.items;if(!u)return null;var d=e?{partialSlideView:!1,showBulletPagination:!0,showArrowNavigation:!0,showNodeBlock:!0}:{partialSlideView:!0,showBulletPagination:!1,showArrowNavigation:!1,showNodeBlock:!1},f=d.partialSlideView,p=d.showBulletPagination,b=d.showArrowNavigation,y=d.showNodeBlock;return(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",gap:"global.md-1",py:"global.md-2",children:[(0,x.BX)(_.xu,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[(0,x.tZ)(_.xv,{as:"h3",children:r("recently_browsed.carousel.title")}),(0,x.BX)(_.xu,{display:"flex",alignItems:"center",gap:"sm-1",children:[(0,x.tZ)(_.zx.Tertiary,{"data-test-id":"recently-browsed-browse-all-cta",onClick:function(){return o({referrer:"store",query:{}})},size:"sm",children:n("".concat(M.cart,".revamp.market_cross_selling_eos.browse"))}),y&&(0,x.tZ)(_.xu,{display:"flex",ref:t})]})]}),(0,x.tZ)(_.lr,{id:"recently-browsed",carouselRole:"list",arrowLeft:cR,arrowRight:cM,arrowRefs:{LEFT:t,RIGHT:t},partialSlideView:f,showBulletPagination:p,showArrowNavigation:b,hideNavigationWhenSinglePage:!0,paddingX:"zero",children:s.map(function(e,t){return(0,x.tZ)(cq,{item:e,index:t,isLast:t===s.length-1,callback:i,onAdd:function(e){return l(e,e2.H.RECENTLY_BROWSED)},canIncrease:a},"recently-browsed-card-".concat("meal"===e.type?e.meal.recipe.id:e.addOn.recipe.id))})})]})},cX=function(){ex();var e=(0,N.Sj)(),t=(0,en.n6)().delivery.cutoffDate,r=tX().trackOrderSummaryDrawerOpen,n=cB().shouldShow;(0,P.useEffect)(function(){r({cutoffDate:t}),(0,I.B1)("".concat(T,".").concat("default-view"))},[]);var o={bottomSlot:(0,x.tZ)(ra,{radiusType:"border-radius-sm"})};return(0,x.BX)(_.xu,{minHeight:"100dvh",backgroundColor:"alias.page-background.default",as:"main",children:[(0,x.BX)(_.xu,{id:"cart-container",children:[(0,x.tZ)(rQ,{}),"desktop"===e&&(0,x.tZ)(ck,{}),(0,x.BX)(_.xu,{textAlign:"left",lineHeight:"line-height-md-1",display:"flex",flexDirection:["column","column","row"],width:"100%",justifyContent:"center",alignItems:"center",children:[(0,x.BX)(F,{gap:["zero","zero","md-2"],pb:["zero","zero","md-1"],children:["desktop"!==e&&(0,x.tZ)(oq,{}),(0,x.BX)(_.xu,{display:"flex",gap:["md-2","md-2","lg-1"],flexDirection:["column","column","row"],children:[(0,x.tZ)(iS,{}),(0,x.tZ)(_.xu,{children:(0,x.BX)(_.xu,{width:["100%","100%","373px"],display:"flex",flexDirection:["column-reverse","column-reverse","column"],gap:["md-2","md-2","md-3"],position:["relative","relative","sticky"],top:[0,0,"98px"],children:[(0,x.tZ)(ch,{}),(0,x.tZ)(a_,{injections:o}),"desktop"!==e&&(n?(0,x.tZ)(cU,{}):(0,x.tZ)(iM,{}))]})})]}),"desktop"===e&&(n?(0,x.tZ)(cU,{}):(0,x.tZ)(iM,{}))]}),"desktop"!==e&&(0,x.tZ)(nU,{topSlot:(0,x.tZ)(cA,{})})]})]})," ",(0,x.tZ)(rw,{}),(0,x.tZ)(C.Z,{scope:"product-details-page-level",claimOverride:er.UW,children:(0,x.tZ)(t9,{})}),(0,x.tZ)(ro,{}),(0,x.tZ)(et.Z,{})]})},cN=r(273656);function cF(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function cW(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cF(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return cF(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var cz=function(e){var t,r,n,o,i,a,l,c,u,s=e.children,d=cW((0,P.useState)(!1),2),f=d[0],p=d[1],b=cW((0,P.useState)(),2),y=b[0],m=b[1],v=ey().preserved,g=(0,en.n6)(),h=g.delivery,O=g.subscription,w=(0,eE.Z)("rnsm_customization_double_portion").isEnabled,S=(0,cN.S_)({week:h.id,subscription:O.id,preference:O.preset,servings:h.product.specs.size,customerPlanId:O.customerPlanId,sku:null!==(c=v.sku)&&void 0!==c?c:h.product.handle,deliveryOption:h.deliveryOption.handle,postcode:O.shippingAddress.postcode,enableFilters:!1,excludeFeedback:!0,enableCategories:!0,enableVersionDegradation:!0,sortVariationsByQuantity:w},{cacheTime:0,suspense:!1,enabled:!f,refetchOnMount:"always",onSettled:function(){return p(!0)}}),k=S.data,j=S.error,C=S.isLoading;(0,P.useEffect)(function(){k&&!y&&m(k)},[k,y]);var Z=null!=k?k:y,A=(null==k?void 0:null===(r=k.addOns)||void 0===r?void 0:null===(t=r.groups)||void 0===t?void 0:t.length)===1&&(null==k?void 0:null===(i=k.addOns)||void 0===i?void 0:null===(o=i.groups)||void 0===o?void 0:null===(n=o[0])||void 0===n?void 0:n.groupType)==="modularity";return(0,x.tZ)(e_,{value:{error:null==j?void 0:j.toString(),menu:f?Z:void 0,isLoading:C||!f,isMarketAvailable:!Z||(null!==(u=null===(a=Z.addOns)||void 0===a?void 0:a.groups.length)&&void 0!==u?u:0)>0,mainCategory:(null==Z?void 0:null===(l=Z.categories)||void 0===l?void 0:l.mainCategory)||"dinners",isModularityOnlyMarket:A},children:s})};function cV(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}var cH=function(e){var t;return new Map((null!==(t=e.meals)&&void 0!==t?t:[]).filter(function(e){return e.recipe.id}).map(function(e){return[e.recipe.id,(0,eU.z)(e.itemPrice)]}))},cG=function(){var e,t,r,n=(0,oP.S)().isExperimentEnabled,o=(0,en.n6)(),i=o.delivery,a=o.subscription,l=eu().products,c=ef().patchCourseItemPrices,u=null!==(r=null===(t=l.current)||void 0===t?void 0:t.sku)&&void 0!==r?r:i.product.handle,s=(0,P.useRef)(u),d=(0,cN.sx)({week:i.id,subscription:a.id,preference:a.preset,postcode:a.shippingAddress.postcode,customerPlanId:a.customerPlanId,sku:u,servings:i.product.specs.size,deliveryOption:i.deliveryOption.handle}),f=(0,P.useCallback)((e=function(){return function(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}(this,function(e){switch(e.label){case 0:return[4,d()];case 1:return c(cH(e.sent())),[2]}})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){cV(i,n,o,a,l,"next",e)}function l(e){cV(i,n,o,a,l,"throw",e)}a(void 0)})}),[d,c]);return(0,P.useEffect)(function(){if(!n||s.current===u){s.current=u;return}s.current=u;var e=!1;return d().then(function(t){e||c(cH(t))}).catch(function(e){return(0,th.Tb)(e,{tags:{feature:"ibp-price-refresh"}})}),function(){e=!0}},[u,n]),{refreshAfterSave:(0,P.useCallback)(function(){n&&f().catch(function(e){return(0,th.Tb)(e,{tags:{feature:"ibp-price-refresh"}})})},[n,f])}},cQ=function(e){var t=e.children,r=ef(),n=r.wasCurrentSelectionChanged,o=r.isPricePatch,i=r.state.courses.items,a=r.unfilteredAddons,l=eu().isBelowExpected,c=ng(),u=c.isSaving,s=c.save,d=c.cartLimitExceeded,f=c.clearCartLimitExceeded,p=(0,eE.Z)("rn_seamless_box_downgrade_v2").isEnabled,b=rZ(),y=cG().refreshAfterSave;return(0,P.useEffect)(function(){if(!p&&!b||!l){if(o.current){o.current=!1;return}n&&(f(),s().then(function(e){e&&y()}))}},[a,i,l,p,b]),(0,x.tZ)(eC,{value:{isSaving:u,cartLimitExceeded:d},children:t})},cJ=function(e){var t=e.providers,r=e.children;return(0,x.tZ)(P.Fragment,{children:(void 0===t?[]:t).reduceRight(function(e,t){return(0,x.tZ)(t,{children:e})},r)})},cK=r(546725),cY=function(e){var t=e.products,r=e.meals,n=e.size;return t.find(function(e){var t=e.specs;return t.meals===r&&t.size===n})},c$=function(e){var t=e.products,r=e.currentMealsQuantity,n=e.subscriptionMealsQuantity,o=e.currentBoxSize;return t.reduce(function(e,t){var i=t.specs.meals;return e&&e.specs.meals<i?e:i>(r||0)&&t.specs.size===o&&(i<=n||t.isAvailableForExtraMeals)?t:e},void 0)},c0=function(e){var t=e.products,r=e.currentBoxSize;return t.reduce(function(e,t){return r===t.specs.size&&(!e||t.specs.meals<e.specs.meals&&t.isAvailableForExtraMeals)?t:e},void 0)},c1=function(e){var t=e.products,r=e.currentBoxSize;return t.reduce(function(e,t){return r===t.specs.size&&(!e||t.specs.meals>e.specs.meals&&t.isAvailableForExtraMeals)?t:e},void 0)},c2=function(e){var t,r,n,o,i,a,l=e.children,c=ef().state.courses.items,u=(0,en.n6)(),s=u.subscription,d=u.delivery,f=c.reduce(function(e,t){return t.quantity+e},0),p=(0,cK._N)({subscriptionId:s.id,zipCode:(null===(t=s.shippingAddress)||void 0===t?void 0:t.postcode)||"",all:!0},{suspense:!1}).data,b=null==p?void 0:null===(r=p.items)||void 0===r?void 0:r.find(function(e){return e.handle===d.product.family.handle}),y=null==p?void 0:null===(n=p.items)||void 0===n?void 0:n.find(function(e){return e.handle===s.productType.family.handle}),m=null!=b?b:y,v=(0,P.useMemo)(function(){var e;return null!==(e=null==m?void 0:m.products.map(eJ))&&void 0!==e?e:[]},[null==m?void 0:m.products]),g=(0,P.useMemo)(function(){return cY({products:v,size:(null==d?void 0:d.product.specs.size)||(null==s?void 0:s.productType.specs.size)||0,meals:f})},[f,null==d?void 0:d.product.specs.size,v,null==s?void 0:s.productType.specs.size]),h=(0,P.useMemo)(function(){return cY({products:v,meals:null==s?void 0:s.productType.specs.meals,size:null==d?void 0:d.product.specs.size})},[null==d?void 0:d.product.specs.size,v,null==s?void 0:s.productType.specs.meals]),O=(0,P.useMemo)(function(){return cY({products:v,meals:null==d?void 0:d.product.specs.meals,size:null==d?void 0:d.product.specs.size})},[null==d?void 0:d.product.specs.meals,null==d?void 0:d.product.specs.size,v]),w=(null==g?void 0:g.specs.size)||(null==d?void 0:d.product.specs.size)||(null==s?void 0:s.productType.specs.size)||0,S=to().selection,k=rZ(),j=S.default_expected,C=null==s?void 0:s.productType.specs.meals,Z=null==d?void 0:d.product.specs.meals,A=Math.min(null!=C?C:1/0,null!=Z?Z:1/0),_=(k?Number.isFinite(A)?A:null!==(o=null!=C?C:Z)&&void 0!==o?o:j:null!=C?C:j)||j,D=(0,P.useMemo)(function(){return c0({products:v,currentBoxSize:w})},[w,v]),I=(0,P.useMemo)(function(){return c1({products:v,currentBoxSize:w})},[w,v]),E=(0,P.useMemo)(function(){return c$({products:v,currentMealsQuantity:f,subscriptionMealsQuantity:(null==s?void 0:s.productType.specs.meals)||0,currentBoxSize:w})},[f,w,v,null==s?void 0:s.productType.specs.meals]);if(!p)return(0,x.tZ)($,{});var T=((null==D?void 0:D.specs.meals)||0)-f,B=T>0,M=f<_,R={boundaries:{min:null!==(i=null==D?void 0:D.specs.meals)&&void 0!==i?i:0,max:null!==(a=null==I?void 0:I.specs.meals)&&void 0!==a?a:0},products:{min:D,max:I,current:g,delivery:O,next:E,subscription:h},belowMinimumDelta:T,isBelowMinimum:B,isAllowedToSave:k?!M:!B,isBelowExpected:M,belowExpectedDelta:_-f};return(0,x.tZ)(ec,{value:R,children:l})},c6=r(953137),c3=function(){return(0,eo.t)().asPath.split("?")[0]}
1,c4=function(e){var t=e.delivery,r=e.subscription,n=e.triedReplaceWeekCount,o=c3(),i=(0,eo.t)(),a=i.replace,l=i.query,c=l.week,u=l.subscriptionId,s=!c&&n<2||!u,d=r&&u!==(null==r?void 0:r.id),f=t&&c!==t.id,p=(null==r?void 0:r.nextModifiableDeliveryWeek)&&c&&c<r.nextModifiableDeliveryWeek,b=s||d||f||p;(0,P.useEffect)(function(){var e,t,n;r&&b&&a({pathname:o,query:(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},l),n=n={week:p?r.nextModifiableDeliveryWeek:null!=c?c:r.nextModifiableDeliveryWeek,subscriptionId:null!==(e=r.id)&&void 0!==e?e:u},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}),t)},void 0,{shallow:!0})},[o,l,p,a,b,r,u,c,n])};function c5(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function c7(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return c5(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c5(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var c8=function(){var e=c3(),t=(0,eo.t)(),r=t.replace,n=t.query,o=c7((0,P.useState)(!1),2),i=o[0],a=o[1],l=c7((0,P.useState)(0),2),c=l[0],u=l[1];return{hasError:i,triedReplaceWeekCount:c,onDeliveryError:function(){c&&a(!0),u(c+1),r({pathname:e,query:eB()(n,["week"])},void 0,{shallow:!0})},onSubscriptionsError:function(){return a(!0)}}},c9=function(e){var t=e.children,r=(0,eo.t)().query,n=r.week,o=r.subscriptionId,i=c8(),a=i.hasError,l=i.triedReplaceWeekCount,c=i.onDeliveryError,u=i.onSubscriptionsError,s=(0,c6.u)({},{suspense:!1,onError:u}).data,d=(0,a1.G)({week:(null!=n?n:"").toString(),subscriptionId:(null!=o?o:"").toString()},{suspense:!1,refetchOnMount:"always",onError:c,enabled:!!(o&&n)}).data,f=(0,P.useMemo)(function(){if(null==s?void 0:s.items){var e,t=s.items.filter(function(e){return!e.canceledAt}),r=null==t?void 0:t[0];return o&&null!==(e=t.find(function(e){return e.id.toString()===o}))&&void 0!==e?e:r}},[o,null==s?void 0:s.items]);if(c4({subscription:f,delivery:d,triedReplaceWeekCount:l}),a)return(0,x.tZ)(X,{});if(!f||!d)return(0,x.tZ)($,{});var p=d.id===f.nextModifiableDeliveryWeek;return(0,x.tZ)(en.mc,{value:{delivery:d,subscription:f,isNextModifiableWeek:p},children:t})},ue=function(e){return e.sku};function ut(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ur(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function un(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}
1)(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function uo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||ua(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ui(e){return function(e){if(Array.isArray(e))return ut(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ua(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ua(e,t){if(e){if("string"==typeof e)return ut(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ut(e,t)}}var ul={courses:{items:[]},addOns:{items:[]},isLoading:!0},uc=function(e,t){var r=new Map;return ui(e.courses.items).concat(ui(e.addOns.items)).forEach(function(e){r.set(e.id,e.quantity)}),ui(t.courses.items).concat(ui(t.addOns.items)).some(function(e){var t;return e.quantity>(null!==(t=r.get(e.id))&&void 0!==t?t:0)})},uu=function(e){var t,r,n,o,i,a=e.children,l=eD(),c=l.menu,u=l.isLoading,s=ey(),d=s.preserved,f=s.applyPreservedSelections,p=(0,P.useRef)(!1),b=(0,P.useRef)(!1),y=(0,P.useRef)(!1),m=uo((0,P.useState)(ul),2),v=m[0],g=m[1],h=uo((0,P.useState)(ul),2),O=h[0],w=h[1],S=(0,P.useMemo)(function(){var e,t,r,n;return null!==(r=null==c?void 0:null===(t=c.addOns)||void 0===t?void 0:t.groups.filter(ue).flatMap(eV).filter((n=null===(e=d.selections)||void 0===e?void 0:e.addOns,function(e){var t,r,o,i=e.addOn;return!!((null==i?void 0:null===(t=i.selection)||void 0===t?void 0:t.oneOffQuantity)||!(null===(r=i.selection)||void 0===r?void 0:r.skipped)&&(null===(o=i.selection)||void 0===o?void 0:o.preselectedQuantity)||(null==n?void 0:n.some(function(e){var t=e.id,r=e.index;return t===i.recipe.id&&r===i.index})))})))&&void 0!==r?r:[]},[null==c?void 0:null===(t=c.addOns)||void 0===t?void 0:t.groups,null===(r=d.selections)||void 0===r?void 0:r.addOns]),k=(0,P.useMemo)(function(){var e,t,r,n;return null!==(r=null==c?void 0:null===(t=c.meals)||void 0===t?void 0:t.filter((n=null===(e=d.selections)||void 0===e?void 0:e.meals,function(e){var t;return!!((null==e?void 0:null===(t=e.selection)||void 0===t?void 0:t.quantity)||(null==n?void 0:n.some(function(t){var r=t.id,n=t.index;return r===e.recipe.id&&n===e.index})))})))&&void 0!==r?r:[]},[null==c?void 0:c.meals,null===(n=d.selections)||void 0===n?void 0:n.meals]),j=(0,P.useCallback)(function(e){var t;return eH(e,S.map(function(e){return e.addOn}),null!==(t=null==c?void 0:c.modularity)&&void 0!==t?t:[])},[S,null==c?void 0:c.modularity]),C=(0,P.useCallback)(function(e){var t;return eG(e,k,null!==(t=null==c?void 0:c.modularity)&&void 0!==t?t:[])},[k,null==c?void 0:c.modularity]),Z=(0,P.useMemo)(function(){return k.map(j)},[k,j]),A=(0,P.useMemo)(function(){var e;return e=S.map(C),Object.values(eR()(e,"id")).reduce(function(e,t){var r=t[0];return r?ez(e).concat([eW(eF({},r),{quantity:t.reduce(function(e,t){return e+t.quantity},0)})]):e},[])},[S,C]),_=(0,P.useMemo)(function(){var e;return null==c?void 0:null===(e=c.addOns)||void 0===e?void 0:e.groups.reduce(eQ,{})},[null==c?void 0:null===(o=c.addOns)||void 0===o?void 0:o.groups]),D=(0,P.useMemo)(function(){var e;return{courses:{items:Z},addOns:{items:A,limit:null==c?void 0:null===(e=c.addOns)||void 0===e?void 0:e.selectionLimit,categoryLimit:_},isLoading:!1}},[_,A,Z,null==c?void 0:null===(i=c.addOns)||void 0===i?void 0:i.selectionLimit]);(0,P.useEffect)(function(){if(c||!u){var e=f(D);
1g(e),p.current||w(e)}},[u,c,D]);var I=(0,P.useMemo)(function(){return v.addOns.items.filter(function(e){return e.quantity>0||e.isSoldOut})},[v.addOns.items]),E=(0,P.useMemo)(function(){return v.courses.items.filter(function(e){return e.quantity>0||e.isSoldOut})},[v.courses.items]);return(0,x.tZ)(ed,{value:{state:un(ur({},v),{courses:un(ur({},v.courses),{items:E}),addOns:un(ur({},v.addOns),{items:I})}),patchCourseItemPrices:function(e){y.current=!0,g(function(t){return un(ur({},t),{courses:un(ur({},t.courses),{items:t.courses.items.map(function(t){var r=e.get(t.id);return void 0!==r?un(ur({},t),{itemPrice:r}):t})})})})},setState:function(e){p.current=!0,b.current=uc(v,e),g(e),w(v)},isPricePatch:y,wasSelectionChanged:p.current||d.wasSelectionChanged,wasCurrentSelectionChanged:p.current,didLastChangeIncreaseQuantity:function(){return b.current},restorePrevious:function(){p.current=!1,g(un(ur({},O),{isLoading:!1}))},confirmSuccessfulSelection:function(){w(v)},revertAndMarkSoldOut:function(e){p.current=!1;var t=new Set(e),r=function(e,r){var n=new Set(e.map(function(e){return e.id})),o=e.map(function(e){return t.has(e.id)?un(ur({},e),{isSoldOut:!0}):e}),i=r.filter(function(e){return t.has(e.id)&&!n.has(e.id)}).map(function(e){return un(ur({},e),{quantity:0,isSoldOut:!0})});return ui(o).concat(ui(i))},n=un(ur({},O),{isLoading:!1,courses:un(ur({},O.courses),{items:r(O.courses.items,v.courses.items)}),addOns:un(ur({},O.addOns),{items:r(O.addOns.items,v.addOns.items)})});g(n),w(n)},transformAddOn:C,transformCourse:j,unfilteredAddons:v.addOns.items,quantities:{courses:v.courses.items.reduce(function(e,t){return e+t.quantity},0),addOns:I.reduce(function(e,t){return e+t.quantity},0)}},children:a})},us=r(927042),ud=r.n(us);function uf(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var up=function(e){var t,r,n=e.children,o=ef().state.addOns.items,i=eD(),a=i.menu,l=i.isLoading,c=function(e){if(Array.isArray(e))return e}(t=(0,P.useState)({upsellAddOns:[],upsellAddOnsUnfiltered:[]}))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(t,2)||function(e,t){if(e){if("string"==typeof e)return uf(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uf(e,2)}}(t,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=c[0],s=c[1],d=(0,iD.Ae)("add-ons_in_cart"),f=(0,P.useMemo)(function(){var e,t,r=(null==d?void 0:d.isReady)?null==d?void 0:d.value:null;if(!r||!r.category)return{upsellAddOns:[],upsellAddOnsUnfiltered:[]};var n=null==a?void 0:null===(e=a.addOns)||void 0===e?void 0:e.groups.find(function(e){return e.groupType===r.category});if(!n)return{upsellAddOns:[],upsellAddOnsUnfiltered:[]};var i=n.addOns.map(function(e){return eG({addOn:e,groupType:n.groupType,sku:n.sku},[],[])}),l=ud()(i,o,"id"),c=null!==(t=r.addonsCarouselCount)&&void 0!==t?t:9;return{upsellAddOns:l.slice(0,c),upsellAddOnsUnfiltered:l}},[d,o,null==a?void 0:null===(r=a.addOns)||void 0===r?void 0:r.groups]),p=f.upsellAddOns,b=f.upsellAddOnsUnfiltered;return(0,P.useEffect)(function(){(a||!l)&&s({upsellAddOns:p,upsellAddOnsUnfiltered:b})},[l,a,p,b]),(0,x.tZ)(iZ,{value:u,children:n})},ub=r(870199),uy=function(e){var t=e.children;return(0,x.tZ)(ub.Z,{registerModals:[tf.nK.genericModal],children:t})};function um(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function uv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function ug(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function uh(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return um(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return um(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var uO=function(e){var t,r,n=e.children,o=c3(),i=(0,eo.t)(),a=i.replace,l=i.query,c=l.sku,u=l.query,s=l.nextStep,d=l.selections,f=l.wasSelectionChanged,p=(0,P.useRef)(!1),b=uh((0,P.useState)({sku:null==c?void 0:c.toString(),query:u&&null!==(t=eh(u.toString()))&&void 0!==t?t:{},nextStep:null!==(r=null==s?void 0:s.toString())&&void 0!==r?r:"single-week",selections:d?eh(d.toString()):void 0,wasSelectionChanged:"true"===f}),1)[0],y=uh((0,P.useState)(null==b?void 0:b.sku),2),m=y[0],v=y[1];(0,P.useEffect)(function(){(c||u||s||d||f)&&a({pathname:o,query:eB()(l,["sku","query","nextStep","selections","wasSelectionChanged"])},void 0,{shallow:!0})},[o,u,l,s,d,c,f,a]);var g=function(e,t){return t?0===t.length?[]:e.map(function(e){var r=t.find(function(t){var r=t.id,n=t.index;return r===e.id&&n===e.index});return r&&0!==r.quantity?ug(uv({},e),{quantity:r.quantity}):null}).filter(function(e){return!!e}):e};return(0,x.tZ)(eb,{value:{oneOffSku:m,setOneOffSku:v,preserved:b,applyPreservedSelections:function(e){if(p.current)return e;var t,r,n=ug(uv({},e),{courses:ug(uv({},e.courses),{items:g(e.courses.items,null===(t=b.selections)||void 0===t?void 0:t.meals)}),addOns:ug(uv({},e.addOns),{items:g(e.addOns.items,null===(r=b.selections)||void 0===r?void 0:r.addOns)})});return p.current=!0,n}},children:n})},uw=r(530454),ux=r.n(uw),uP=function(e){var t=e.onDismiss,r=e.onConfirm,n=(0,D.ZP)("store").translateRaw;return(0,x.tZ)(nb.Z,{componentName:"SoldOutDeselectConfirmationModal",children:(0,x.tZ)(r3.Z,{claim:{name:"menu-discovery",githubTeam:"hellofresh/squad-menu-discovery-mobile",tribe:"shopping-journey",alliance:"consumer",jiraPrefix:"DISCO",slackChannel:"#squad-menu-discovery",slackAlertsChannel:"#squad-menu-discovery",skipLabelsOnPR:!1,teamIdentifier:"menu-discovery"},children:(0,x.tZ)(C.Z,{scope:"sold-out-deselect-confirmation-modal",children:(0,x.BX)(_.xu,{p:"global.xs",children:[(0,x.tZ)(_.xu,{position:"absolute",top:["0.5rem","1rem"],right:["0.5rem","1rem"],children:(0,x.tZ)(_.PZ,{onClick:t})}),(0,x.BX)(_.xu,{py:"global.md-1",children:[(0,x.tZ)(_.xv,{as:"h3",textAlign:"center",children:n("store.sold-out.pop-up.course.title")}),(0,x.tZ)(_.xu,{pt:"global.sm-2",children:(0,x.tZ)(_.xv,{type:"body-md-regular",children:n("store.sold-out.pop-up.course.description")})})]}),(0,x.BX)(_.xu,{display:"flex",flexDirection:"column",rowGap:"global.sm-2",children:[(0,x.tZ)(_.zx.Primary,{onClick:r,children:n("store.sold-out.pop-up.remove")}),(0,x.tZ)(_.zx.Secondary,{onClick:t,children:n("store.sold-out.pop-up.keep")})]})]})})})})},uS=function(){var e=(0,td.d)(tf.nK.genericModal),t=e.setModalState,r=e.openModal,n=e.closeModal;return(0,P.useCallback)(function(e){return new Promise(function(o,i){if(!e.isSoldOut)return o();t({children:(0,x.tZ)(uP,{onDismiss:function(){i(),n()},onConfirm:function(){o(),n()}}),headless:!0,onDismiss:function(){i(),n()}}),r()})},[n,r,t])};function uk(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var uj=function(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,P.useState)(!1))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||function(e,t){if(e){if("string"==typeof e)return uk(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);
1if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uk(e,2)}}(e,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),r=t[0],n=t[1],o=(0,D.ZP)("store").translateRaw,i=(0,td.d)(tf.nK.genericModal),a=i.setModalState,l=i.openModal,c=i.closeModal,u=function(e){var t;return!!(null===(t=e.tags)||void 0===t?void 0:t.some(function(e){return"alcoholic"===e.type}))};return(0,P.useCallback)(function(e){return new Promise(function(t,i){if(r||!u(e))return t();a({testId:"age-verification-add-prompt",title:o("store.age-verification-selection-flow.title"),subtitle:o("store.age-verification-selection-flow.description"),confirmButtonText:o("store.age-verification-selection-flow.proceed-cta"),cancelButtonText:o("store.age-verification-selection-flow.cancel-cta"),onConfirm:function(){n(!0),t(),c()},onClose:function(){i(),c()},onDismiss:function(){i(),c()}}),l()})},[c,l,r,a,n,o])},uC=function(e,t){var r,n=null==e?void 0:null===(r=e.quantityOptions)||void 0===r?void 0:r.find(function(e){return e.people===t});return(null==n?void 0:n.quantity)||1};function uZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function uA(e,t,r,n,o,i,a){try{var l=e[i](a),c=l.value}catch(e){r(e);return}l.done?t(c):Promise.resolve(c).then(n,o)}function u_(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){uA(i,n,o,a,l,"next",e)}function l(e){uA(i,n,o,a,l,"throw",e)}a(void 0)})}}function uD(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){uD(e,t,r[t])})}return e}function uE(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}function uT(e){return function(e){if(Array.isArray(e))return uZ(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||uB(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uB(e,t){if(e){if("string"==typeof e)return uZ(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uZ(e,t)}}function uM(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function l(i){return function(l){return function(i){if(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,l])}}}var uR=function(){var e,t,r,n,o,i=function(e){if(Array.isArray(e))return e}(e=(0,P.useState)({}))||function(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),2!==i.length);a=!0);}catch(e){l=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw n}}return i}}(e,2)||uB(e,2)||function(){throw TypeError("Invalid attempt to de
1structure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),a=i[0],l=i[1],c=eD().menu,u=(0,en.n6)().delivery,s=ef(),d=s.state,f=s.setState,p=s.transformCourse,b=s.transformAddOn,y=uS(),m=uj(),v=tX().trackAddOnSelect,g=(t=u_(function(e){var t,r,n,o;return uM(this,function(i){switch(i.label){case 0:if(-1===(r=(t=ux()(d)).courses.items.findIndex(function(t){return t.index===e})))return[2];return[4,y(n=t.courses.items[r])];case 1:return i.sent(),o=n.quantity-=1,t.addOns.items=t.addOns.items.map(function(e){return e.pairedWith.some(function(e){return n.id===e})&&(e.quantity-=uC(e,u.product.specs.size)),e.quantity?e:null}).filter(function(e){return!!e}),0===o&&t.courses.items.splice(r,1),f(t),[2]}})}),function(e){return t.apply(this,arguments)}),h=(r=u_(function(e){var t,r,n;return uM(this,function(o){switch(o.label){case 0:if(-1===(r=(t=ux()(d)).addOns.items.findIndex(function(t){return t.id===e})))return[2];return[4,y(n=t.addOns.items[r])];case 1:return o.sent(),n.quantity-=1,f(t),[2]}})}),function(e){return r.apply(this,arguments)}),O=(n=u_(function(e){return uM(this,function(t){switch(t.label){case 0:return[4,m(e)];case 1:return t.sent(),f(uE(uI({},d),{addOns:uE(uI({},d.addOns),{items:uT(d.addOns.items).concat([uE(uI({},e),{quantity:1})])})})),[2]}})}),function(e){return n.apply(this,arguments)}),w=(o=u_(function(e){var t,r;return uM(this,function(n){return r=uE(uI({},d),{courses:uE(uI({},d.courses),{items:uT(d.courses.items).concat([uE(uI({},e),{quantity:1})])})}),null===(t=a[e.id])||void 0===t||t.forEach(function(t){var n=r.addOns.items.findIndex(function(e){return e.id===t});if(-1===n){var o,i=null==c?void 0:null===(o=c.addOns)||void 0===o?void 0:o.groups.find(function(e){return e.addOns.some(function(e){return e.recipe.id===t})});if(!i)return;var a=i.addOns.find(function(e){return e.recipe.id===t});if(!a)return;r.addOns.items.push(uE(uI({},b({addOn:a,groupType:i.groupType,sku:i.sku})),{quantity:uC(a,u.product.specs.size),pairedWith:[e.id]}))}else r.addOns.items[n].quantity+=1,r.addOns.items[n].pairedWith.push(e.id)}),delete a[e.id],f(r),l(a),[2]})}),function(e){return o.apply(this,arguments)});return{onAddAddOn:function(e,t){var r,n=null==c?void 0:null===(r=c.addOns)||void 0===r?void 0:r.groups.find(function(t){return t.addOns.some(function(t){return t.recipe.id===e})});if(n){var o=n.addOns.find(function(t){return t.recipe.id===e});o&&(v({id:o.recipe.id,sku:n.sku,categoryType:n.groupType},t),O(b({addOn:o,groupType:n.groupType,sku:n.sku})))}},onAddCourse:function(e){var t=null==c?void 0:c.meals.find(function(t){return t.recipe.id===e});if(t)return w(p(t))},onSwapCourse:function(e,t){var r=ux()(d),n=r.courses.items.findIndex(function(t){return t.id===e});if(-1!==n){var o=null==c?void 0:c.meals.find(function(e){return e.recipe.id===t});o&&(r.courses.items.splice(n,1,uE(uI({},p(o)),{quantity:r.courses.items[n].quantity})),r.addOns.items=r.addOns.items.map(function(r){var n=r.pairedWith.findIndex(function(t){return t===e});return -1===n||r.pairedWith.splice(n,1,t),r}),f(r))}},onAddPairing:function(e,t){var r,n,o=ux()(d),i=o.courses.items.findIndex(function(t){return t.id===e});if(-1===i){l(uE(uI({},a),uD({},e,uT(null!==(n=a[e])&&void 0!==n?n:[]).concat([t]))));return}var s=null==c?void 0:null===(r=c.addOns)||void 0===r?void 0:r.groups.find(function(e){return e.addOns.some(function(e){return e.recipe.id===t})});if(s){var p=s.addOns.find(function(e){return e.recipe.id===t});if(p){var y=o.addOns.items.findIndex(function(e){return e.id===t});-1===y?o.addOns.items.push(uE(uI({},b({addOn:p,groupType:s.groupType,sku:s.sku})),{quantity:o.courses.items[i].quantity*uC(p,u.product.specs.size),pairedWith:[e]})):(o.addOns.items[y].quantity+=o.courses.items[i].quantity*uC(p,u.product.specs.size),o.addOns.items[y].pairedWith.push(e)),f(o)}}},onRemovePairing:function(e,t){var r=ux()(d),n=r.courses.items.findIndex(function(t){return t.id===e});
1if(-1===n){if(a[e]){var o=a[e].findIndex(function(e){return e===t});-1!==o&&(a[e].splice(o,1),l(a))}return}var i=r.addOns.items.findIndex(function(e){return e.id===t});if(-1!==i){var c=r.addOns.items[i].quantity-=r.courses.items[n].quantity*uC(r.addOns.items[i],u.product.specs.size),s=r.addOns.items[i].pairedWith.findIndex(function(t){return t===e});-1!==s&&r.addOns.items[i].pairedWith.splice(s,1),c<=0&&r.addOns.items.splice(i,1),f(r)}},onIncreaseAddOn:function(e){var t=ux()(d),r=t.addOns.items.findIndex(function(t){return t.id===e});if(-1!==r){var n=t.addOns.items[r];n.quantity+=1,f(t)}},onDecreaseAddOn:h,onIncreaseCourse:function(e){var t=ux()(d),r=t.courses.items.findIndex(function(t){return t.index===e});if(-1!==r){var n=t.courses.items[r];n.quantity+=1,t.addOns.items=t.addOns.items.reduce(function(e,t,r){return t.pairedWith.some(function(e){return n.id===e})&&(t.quantity+=uC(t,u.product.specs.size)),e[r]=t,e},t.addOns.items),f(t)}},onDecreaseCourse:g}},uL=function(e){var t=e.children,r=uR();return(0,x.tZ)(tV,{value:r,children:t})},uq=r(691093),uU=function(e){var t,r,n,o=e.children,i=(0,en.n6)(),a=i.subscription,l=i.delivery,c=(0,eE.Z)("temp_cce-3434_snap_in_cart").isEnabled,u=(null==a?void 0:null===(n=a.customer)||void 0===n?void 0:n.uuid)||"",s=(null==l?void 0:l.id)||"",d=(0,uq.T)({customerUuid:u,hfWeek:s,isEnriched:!0},{suspense:!1,enabled:!!(c&&u&&s),retry:1}),f=d.data,p=d.isLoading,b=d.isError,y=(0,rJ.Z)(),m=(0,rA.py)({runUsingStatsig:!0}),v=m.decide,h=m.isReady,O=(0,r_.R)({runUsingStatsig:!0}),w=O.isReady,S=v({experimentKey:"fincc_6714_snap",experimentationUserId:O.id,experimentationUserAttributes:(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},O.attributes),r=r={brand:y},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t)}).variationKey,k=!!(S&&"Control"!==S),j=h&&w,C=(0,P.useMemo)(function(){var e=null==f?void 0:f.find(function(e){return e.paymentMethod===U}),t=null==f?void 0:f.find(function(e){return e.paymentMethod!==U}),r=(null==t?void 0:t.status)==="FAILED";return{snapTransaction:e,defaultTransaction:t,hasDefaultPaymentFailed:r}},[f]),Z=C.snapTransaction,A=C.defaultTransaction,_=C.hasDefaultPaymentFailed,D=(0,P.useMemo)(function(){return c&&j&&k?Z?"SUCCESS"===Z.status&&"CHARGE"===Z.type?g.Paid:"SUCCESS"===Z.status&&"REFUND"===Z.type?g.Unavailable:"FAILED"===Z.status?g.Failed:g.Disabled:g.Available:g.Disabled},[c,Z,k,j]);return(0,x.tZ)(oh,{value:{isLoading:p,isError:b,snapState:D,snapTransaction:Z,defaultTransaction:A,hasDefaultPaymentFailed:_},children:o})},uX=function(e){var t=e.children,r=(0,tS.Z)(),n=ti(),o=(0,en.n6)(),i=o.subscription,a=o.delivery,l=(0,P.useMemo)(function(){switch(r){case tj.m.ReadyToEat:return"rte";case tj.m.HelloFresh:return n?"rte":"mealkit";case tj.m.WhiteLabelMealKits:return"mealkit";case tj.m.NewVentures:default:return}},[r,n]),c=(0,P.useMemo)(function(){var e,t;return{plan_type:l,hf_current_week:(0,o5.Z)(),hf_week:a.id,cut_off_date:a.cutoffDate,delivery_date:a.deliveryDate,delivery_status:a.status,subscription_id:i.id,plan_id:i.customerPlanId,customer_loyalty:(null===(t=i.customer)||void 0===t?void 0:null===(e=t.loyalty)||void 0===e?void 0:e.value)||0,customer_uuid:i.customer.uuid,customer_id:i.customer.id}},[l,a,i]);return(0,x.tZ)(j.Z,{values:c,children:t})},uN=function(e){var t,r,n,o=e.children,i=(0,eo.t)().query,a=(0,en.n6)(),l=a.subscription,c=a.delivery,u=a.isNextModifiableWeek,s=Array.isArray(i.referrer)?i.referrer[0]:i.referrer;return(0,x.tZ)(A.Z,{componentName:"cart-page",attributes:{week:c.id,"subscription.id":l.id,"subscription.product.sku":null===(t=l.product)||void 0===t?void 0:t.sku,"subscription.product.family":null===(n=l.productType)||void 0===n?void 0:null===(r=n.family)||void 0===r?void 0:r.handle,"delivery.status":c.status,"delivery.state":c.state,"delivery.substatus":c.subStatus,"delivery.is-next-modifiable-week":u,referrer:s},children:o})},uF=function(){return(0,x.tZ)(cJ,{providers:[ee.f$,uy,uO,c9,cz,uu,c2,uL,up,cQ,uU,uX,uN],children:(0,x.tZ)(cX,{})})},uW=r(54746),uz=r(231140),uV=function(){var e=(0,rJ.Z)();return(0,x.BX)(x.HY,{children:[(0,x.tZ)(S.Z,{}),(0,x.tZ)(k.Z,{fallback:null,children:(0,x.tZ)(P.Suspense,{fallback:(0,x.tZ)($,{}),children:(0,x.tZ)(C.Z,{scope:"cart",fallback:(0,x.tZ)(X,{}),children:(0,x.tZ)(j.Z,{values:{screen:"Cart",gaEventCategory:"Cart",origin:"web_cart",entry_point:"Cart",brand:e},children:(0,x.tZ)(tn,{children:(0,x.tZ)(uW.Z,{children:(0,x.tZ)(uz.Z,{children:(0,x.tZ)(uF,{})})})})})})})})]})};uV.customLayout=Z.Z;var uH=!0,uG=uV},127239:function(e,t,r){"use strict";r.d(t,{mc:function(){return i},n6:function(){return a}});var n=r(827378),o=n.createContext({}),i=o.Provider,a=function(){return(0,n.useContext)(o)}},523201:function(e,t,r){"use strict";var n=r(687800);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.Z=function(e){var t=e.title,r=e.titleId,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1rem",height:"1rem",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),a),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m8 4 6 6-1.333 1.333L8 6.667l-4.667 4.666L2 10l6-6Z",fill:"currentColor"})]}))}},749427:function(e,t,r){"use strict";var n=r(687800);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.Z=function(e){var t=e.title,r=e.titleId,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);
1return(0,n.BX)("svg",i(o(i(o({width:"1rem",height:"1rem",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),a),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{d:"M8 3.5a1 1 0 1 0 0 2 1 1 0 0 0 0-2ZM7.25 12.5v-6h1.5v6h-1.5Z",fill:"currentColor"}),(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0Zm-1.5 0a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0Z",fill:"currentColor"})]}))}},333021:function(e,t,r){"use strict";var n=r(687800);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.Z=function(e){var t=e.title,r=e.titleId,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);
1return(0,n.BX)("svg",i(o(i(o({width:"1rem",height:"1rem",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),a),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{d:"M8 4.5c.124 0 .247.006.368.02l-.722-.722.708-.707L10.263 5l-1.91 1.91-.707-.708.681-.68a2.5 2.5 0 0 0-2.743 3.126l-.78.78A3.5 3.5 0 0 1 8 4.5ZM7.673 10.479a2.5 2.5 0 0 0 2.544-3.635l.731-.731a3.5 3.5 0 0 1-3.316 5.368l.722.721-.708.707L5.737 11l1.91-1.91.707.708-.681.68Z",fill:"currentColor"}),(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15 8A7 7 0 1 1 1 8a7 7 0 0 1 14 0Zm-1.4 0A5.6 5.6 0 1 1 2.4 8a5.6 5.6 0 0 1 11.2 0Z",fill:"currentColor"})]}))}},292282:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.default=function(e){var t=e.title,r=e.titleId,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),a),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{d:"m11 3-9 9 9 9 1.333-1.334L5.667 13H22v-2H5.667l6.666-6.667L11 3Z",fill:"currentColor"})]}))}},845818:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.default=function(e){var t=e.title,r=e.titleId,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),a),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{d:"M6 13h12v2H6v-2ZM17 11a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",fill:"currentColor"}),(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5v14h20V5H2Zm18 2H4v10h16V7Z",fill:"currentColor"})]}))}},306716:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.default=function(e){var t=e.title,r=e.titleId,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),a),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"m12 6.586 8.485 8.485-1.414 1.414L12 9.415l-7.071 7.07-1.414-1.414L12 6.586Z",fill:"currentColor"})]}))}},15778:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.default=function(e){var t=e.title,r=e.titleId,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),a),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{d:"M17.151 9.581c-.086.924-.32 1.546-.636 1.99-.262.368-.602.643-1.019.87l.451-2.86h1.204ZM8.793 12.416a2.873 2.873 0 0 1-.974-.845c-.316-.444-.55-1.066-.636-1.99h1.164l.446 2.835Z",fill:"currentColor"}),(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2ZM8.185 8.549H6.167l.016.532c.04 1.365.333 2.367.864 3.113.53.746 1.253 1.176 2.035 1.484l.081.031h.014c.394.7 1.105 1.24 1.97 1.48v2.096c0 .723-1.87.544-1.87.544V19l2.805-.007 2.807.007v-1.17s-1.87.178-1.87-.545l-.001-.01v-2.05c.93-.217 1.697-.778 2.113-1.517l.045-.001.076-.03c.782-.307 1.504-.737 2.034-1.483.53-.746.826-1.748.865-3.113l.016-.532h-2.058L16.353 7H7.94l.245 1.549Z",fill:"currentColor"})]}))}},750619:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}
1))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.default=function(e){var t=e.title,r=e.titleId,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),a),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",fill:"currentColor"}),(0,n.tZ)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 6v12h18V6H3Zm16 8v-4a2 2 0 0 1-2-2H7a2 2 0 0 1-2 2v4a2 2 0 0 1 2 2h10a2 2 0 0 1 2-2Z",fill:"currentColor"})]}))}},204600:function(e,t,r){"use strict";r.r(t);var n=r(687800);function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e}r(827378),t.default=function(e){var t=e.title,r=e.titleId,a=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,["title","titleId"]);return(0,n.BX)("svg",i(o(i(o({width:"1.5rem",height:"1.5rem",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",role:t?"img":"graphics-symbol",color:"inherit","aria-hidden":!t},!t&&{focusable:!1}),{"aria-labelledby":r}),a),{children:[t?(0,n.tZ)("title",{id:r,children:t}):null,(0,n.tZ)("path",{d:"m4 4-.4 2h3.728l-.423 2H3.2l-.4 2h3.7l-.384 2H2.4L2 14h2v4h2.268a2 2 0 1 0 3.465 0h6.535a2 2 0 1 0 3.465 0H22v-6.461L17 6h-1v8H5.738l.378-2H14V4H4Z",fill:"currentColor"})]}))}}},function(e){e.O(0,[47057,38579,12737,8139,61403,17827,78526,48440,981,52463,59775,74050,64944,56360,72065,9833,77641,69585,80114,23897,87918,96715,72175,46725,49872,21232,16709,82267,13275,94242,56138,15540,4753,11184,92888,49774,40179],function(){return e(e.s=162534)}),_N_E=e.O()}]);
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.