PageSourceSearch

https://www.maria-black.com/static/js/GiftCertificate.909f8e51.chunk.js

js maria-black.com collected 2026-09-26 10:09:32 UTC 11,604 bytes, 1 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[549],{43777:function(e,t,n){n.r(t),n.d(t,{default:function(){return je}});var r,i,c,o,a=n(18489),u=n(50678),s=n(17186),l=n(92421),p=n(37607),d=n(72377),f=n(61975),x=n(29832),Z=n(57393),h=n(60094),g=n(47111),m=n(53256),k=n(36926),v=n(78227),C=n(95524),S=n(30195),b=n(62976),j=n(74630),y=(0,p.Z)("div")(r||(r=(0,s.Z)(["\n    display: flex;\n    flex-wrap: wrap;\n    width: 100%;\n\n    &.disabled {\n        opacity: 0.6;\n        cursor: not-allowed;\n\n        & > * {\n            pointer-events: none;\n        }\n    }\n"]))),_=(0,p.Z)("button")(i||(i=(0,s.Z)(["\n    outline: none;\n    color: ",";\n    border: 1px solid ",";\n    display: flex;\n    justify-content: center;\n    align-items: center;\n    font: 400 1.4rem/1 'new-science';\n    background: none;\n    padding: 16px 24px;\n    min-width: calc(50% - 6px);\n    margin: 0 0 12px;\n    cursor: pointer;\n\n    &:nth-child(odd) {\n        margin-right: 12px;\n    }\n\n    "," {\n        margin: 0 12px 12px 0;\n        padding: 8px 24px;\n        min-width: 120px;\n    }\n\n    &:hover,\n    &.selected {\n        background-color: ",";\n        color: ",";\n    }\n"])),S.Z.black,S.Z.black,Z.aE.lg,S.Z.black,S.Z.white),w=(0,p.Z)("input")(c||(c=(0,s.Z)(["\n    outline: none;\n    border: none;\n    border-radius: 0;\n    border-bottom: 1px solid ",";\n    font: 400 1.4rem/1 'new-science';\n    margin: 32px 0 0;\n    width: 100%;\n    padding: 0 0 8px 0;\n\n    &::-webkit-outer-spin-button,\n    &::-webkit-inner-spin-button,\n    &[type='number'] {\n        -moz-appearance: textfield;\n        -webkit-appearance: none;\n    }\n"])),S.Z.beige),A=(0,p.Z)(x.Z)(o||(o=(0,s.Z)(["\n    margin: 16px 0 0;\n    font-size: 16px;\n    line-height: 1.2;\n    color: ",";\n\n    a {\n        color: inherit;\n    }\n"])),S.Z.error),T=function(e){var t,n=e.disabled,r=void 0!==n&&n,i=e.onSelect,c=e.giftCertificates,o=e.flexibleGiftCertPlaceholder,s=e.selectedId,p=void 0===s?null:s,d=(0,b.$)().t,f=(0,l.useState)(null),x=(0,u.Z)(f,2),Z=x[0],h=x[1],g=(0,l.useState)(null),m=(0,u.Z)(g,2),k=m[0],v=m[1];return(0,j.jsxs)(y,{className:r?"disabled":null,children:[c.map((function(e,t){return(0,j.jsx)(_,{className:e.id===p?"selected":null,onClick:function(){return function(e){r||("anyAmount"===e.type?(i((0,a.Z)((0,a.Z)({},e),{},{flexibleAmount:null})),h(e)):(i(e),v(null),h(null)))}(e)},children:e.name},"".concat(e.id,"-").concat(t))})),Z&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{type:"number",placeholder:null!==o&&void 0!==o?o:"Enter amount",onChange:function(e){return function(e){if(!r){var n=e.target.value;clearTimeout(t),t=setTimeout((function(){var e=parseInt(n,0);0===e?(v(d("checkout_gift_certificate.too_low_amount")),i((0,a.Z)((0,a.Z)({},Z),{},{flexibleAmount:null}))):isNaN(e)?(v(d("checkout_gift_certificate.invalid_input")),i((0,a.Z)((0,a.Z)({},Z),{},{flexibleAmount:null}))):(k&&v(null),i((0,a.Z)((0,a.Z)({},Z),{},{flexibleAmount:e})))}),350)}}(e)}}),k&&(0,j.jsx)(A,{children:k})]})]})},E=n(77210),L=n(43855),R=n(27166),F=n(33032),N=n(73942),G=n(92676),B=(0,F.Z)((0,R.Z)().mark((function e(){return(0,R.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,G.U2)("/gift-certificates");case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),D=function(){var e=(0,F.Z)((0,R.Z)().mark((function e(t){var n,r;return(0,R.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=[],e.prev=1,e.next=4,B();case 4:200===(r=e.sent).status?t.forEach((function(e){var t=e.gift_certificate[0],i=r.data.find((function(e){return(null===e||void 0===e?void 0:e.id)===t}));if(i){var c={id:i.id,name:e.gift_certificate_display_name||i.name,type:i.type};n.push(c)}})):console.error("transformAndFetchGiftCertificates",r),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),console.error("transformAndFetchGiftCertificates",e.t0);case 11:return e.abrupt("return",n);case 12:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(t){return e.apply(this,arguments)}}(),P=n(61361),I=function(e){var t=e.render,n=e.giftCertIdsFromCms,r=(0,N.v9)((function(e){return e.application})),i=(0,l.useState)({selectedGiftCert:null,giftCerts:[],sectionLoading:"giftCerts",giftCertCheckoutStep:1,giftCertBasket:null}),c=(0,u.Z)(i,2),o=c[0],s=c[1],p=o.selectedGiftCert,d=o.giftCerts,f=o.sectionLoading,x=o.giftCertCheckoutStep,Z=o.giftCertBasket,h=(0,l.useState)({maxStep:1,currentStep:1}),g=(0,u.Z)(h,2),m=g[0],k=g[1],v=function(){var e=(0,F.Z)((0,R.Z)().mark((function e(t){var n,i;return(0,R.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,P.Cy)(r,p);case 2:n=e.sent;try{200!==n.status&&201!==n.status||s((function(e){return(0,a.Z)((0,a.Z)({},e),{},{giftCertBasket:n.data})}))}catch(c){console.error(c)}(i=(0,a.Z)({},m)).currentStep=t,i.currentStep>m.maxStep&&(i.maxStep=i.currentStep),k(i);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){(0,F.Z)((0,R.Z)().mark((function e(){var t;return(0,R.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D(n);case 2:t=e.sent,s((function(e){return(0,a.Z)((0,a.Z)({},e),{},{sectionLoading:null,giftCerts:t})}));case 4:case"end":return e.stop()}}),e)})))()}),[n]);var C=function(){var e=(0,F.Z)((0,R.Z)().mark((function e(){var t,n;return(0,R.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s((function(e){return(0,a.Z)((0,a.Z)({},e),{},{sectionLoading:"checkout"})})),e.next=3,(0,P.Cy)(r,p);case 3:if(200!==(t=e.sent).status&&201!==t.status){e.next=11;break}return e.next=7,(0,P.Dl)(r,p);case 7:200!==(n=e.sent).status&&201!==n.status||s((function(e){return(0,a.Z)((0,a.Z)({},e),{},{giftCertCheckoutStep:2,giftCertBasket:n.data,sectionLoading:null})})),e.next=12;break;case 11:s((function(e){return(0,a.Z)((0,a.Z)({},e),{},{sectionLoading:null,errorMessage:"Error when loading checkout"})}));case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return t({proceedToCheckout:function(){return C()},onSelect:function(e){return function(e){s((function(t){return(0,a.Z)((0,a.Z)({},t),{},{selectedGiftCert:e})}))}(e)},editSelectedCard:function(){s((function(e){return(0,a.Z)((0,a.Z)({},e),{},{giftCertCheckoutStep:1})}))},readyToProceed:!!p&&("anyAmount"!==p.type||"anyAmount"===p.type&&p.flexibleAmou
1nt),selectedGiftCert:p,giftCerts:d,sectionLoading:f,giftCertCheckoutStep:x,giftCertBasket:Z,proceedToStep:v,checkoutState:m})};I.propTypes={};var z,M,O,U,H,K,$,X,q,J,Q,V,W,Y=I,ee=n(54724),te=n(67629),ne=n(13468),re=n(37811),ie=n(12249),ce=n(3825),oe=(0,p.Z)("div")(z||(z=(0,s.Z)(["\n    margin: 0 -16px;\n\n    "," {\n        margin: 0 -24px;\n    }\n"])),Z.aE.lg),ae=function(e){var t=e.basketNotFromRedux,n=e.checkoutState,r=e.proceedToStep,i=e.setShippingRef,c=e.setPaymentRef,o=e.skipShipping,a=void 0!==o&&o,u=(0,N.v9)((function(e){return e.page.template})),s=(0,ce.Z)(n.currentStep);return(0,l.useEffect)((function(){(0,ie.Z)(n.currentStep,s,u)}),[n.currentStep]),(0,j.jsxs)(oe,{children:[(0,j.jsx)(te.Z,{basketNotFromRedux:t,checkoutCurrentStep:n.currentStep,checkoutMaxStep:n.maxStep,proceedToCheckoutStep:r}),!a&&(0,j.jsx)(re.Z,{basketNotFromRedux:t,shippingRef:i,checkoutCurrentStep:n.currentStep,checkoutMaxStep:n.maxStep,proceedToCheckoutStep:r}),(0,j.jsx)(ne.Z,{skipShipping:a,basketNotFromRedux:t,paymentRef:c,checkoutCurrentStep:n.currentStep,checkoutMaxStep:n.maxStep,proceedToCheckoutStep:r})]})},ue=n(20507),se=n(3335),le=n(25824),pe=(0,p.Z)("div")(M||(M=(0,s.Z)(["\n    display: flex;\n    flex-direction: column;\n"]))),de=(0,p.Z)(pe)(O||(O=(0,s.Z)([""]))),fe=(0,p.Z)(pe)(U||(U=(0,s.Z)([""]))),xe=(0,p.Z)(pe)(H||(H=(0,s.Z)([""]))),Ze=(0,p.Z)("div")(K||(K=(0,s.Z)(["\n    width: 100%;\n    height: 100vh;\n    position: sticky;\n    top: 0;\n"]))),he=(0,p.Z)("div")($||($=(0,s.Z)(["\n    margin-top: ","px;\n    display: grid;\n    flex-direction: column;\n\n    "," {\n        margin-top: 0px;\n        grid-template: 1fr / 60% 40%;\n    }\n"])),ue.Z.mobile,Z.aE.lg),ge=(0,p.Z)("div")(X||(X=(0,s.Z)(["\n    flex: 1;\n    position: relative;\n    padding: 24px 16px 16px;\n    max-width: 570px;\n    width: 100%;\n    display: flex;\n    flex-direction: column;\n\n    "," {\n        padding: 40% 24px 24px;\n    }\n"])),Z.aE.lg),me=(0,p.Z)(x.Z)(q||(q=(0,s.Z)(["\n    margin: 20px 0 0;\n    font: 500 1.4rem/2rem 'new-science';\n\n    a {\n        color: inherit;\n    }\n"]))),ke=(0,p.Z)(x.Z)(J||(J=(0,s.Z)(["\n    margin: 20px 0 0;\n    font: 400 1.3rem/2rem 'new-science';\n\n    a {\n        color: inherit;\n    }\n"]))),ve=(0,p.Z)(f.Z)(Q||(Q=(0,s.Z)(["\n    margin: 20px 0 20px;\n"]))),Ce=(0,p.Z)("h2")(V||(V=(0,s.Z)(["\n    margin: 20px 0 20px;\n    font: 500 1.3rem/2rem 'new-science';\n"]))),Se=(0,p.Z)("div")(W||(W=(0,s.Z)(["\n    margin: 32px 0;\n"]))),be=function(e){var t,n=e.data,r=n.content,i=n.checkout,c=n.gift_certificate_setup,o=(0,l.useRef)(),s=(0,l.useState)(),p=(0,u.Z)(s,2),x=p[0],Z=p[1],S=(0,b.$)().t,y=i.heading,_=r.background_media_flexible,w=r.heading,A=r.preamble_paragraph,R=r.paragraph,F=c.heading,N=c.flexible_gift_certificate_placeholder,G=c.gift_certificates;(0,l.useEffect)((function(){if(2===x){var e,t=(null===o||void 0===o||null===(e=o.current)||void 0===e?void 0:e.offsetTop)+(null===o||void 0===o?void 0:o.current.parentElement.offsetTop)-40;(0,le.X5)({top:t})}}),[x]);var B=(0,g.Z)(_),D=B.mobile||B.desktop,P=B.desktop||B.mobile,I=(0,ee.Z)(),z=(0,u.Z)(I,2),M=(z[0],z[1],(0,ee.Z)()),O=(0,u.Z)(M,2),U=(O[0],O[1]),H=(0,ee.Z)(),K=(0,u.Z)(H,2),$=(K[0],K[1]);return(0,j.jsx)(d.Z,{children:(0,j.jsx)(se.Z,{children:(0,j.jsxs)(he,{children:[(0,j.jsx)(v.Z,{breakpoint:"lg",render:function(){return(0,j.jsx)(C.Z,{ratio:1.67,width:"100%",children:(0,j.jsx)(m.Z,{width:"100%",background:D,type:D.type})})}}),(0,j.jsx)(k.Z,{breakpoint:"lg",render:function(){return(0,j.jsx)(Ze,{children:(0,j.jsx)(m.Z,{width:"100%",height:"100%",background:P,type:P.type})})}}),(0,j.jsxs)(ge,{children:[(0,j.jsxs)(de,{children:[(null===w||void 0===w||null===(t=w.text)||void 0===t?void 0:t.length)>0&&(0,j.jsx)(f.Z,{as:w.type,size:"medium",children:w.text}),A&&(0,j.jsx)(h.Z,{data:A,textComponent:function(e){return(0,j.jsx)(me,(0,a.Z)({},e))}}),R&&(0,j.jsx)(h.Z,{data:R,textComponent:function(e){return(0,j.jsx)(ke,(0,a.Z)({},e))}})]}),(0,j.jsx)(Y,{giftCertIdsFromCms:G,render:function(e){var t=e.readyToProceed,n=e.selectedGiftCert,r=e.giftCerts,i=e.sectionLoading,c=e.giftCertCheckoutStep,a=e.proceedToCheckout,u=e.onSelect,s=e.editSelectedCard,l=e.giftCertBasket,p=e.proceedToStep,d=e.checkoutState;return Z(c),(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(fe,{children:[F.text.length>0&&(0,j.jsx)(Ce,{as:F.type,ref:o,children:F.text}),"giftCerts"===i?(0,j.jsx)(E.Z,{alignSelf:"center"}):(0,j.jsx)(T,{disabled:!!i||c>1,giftCertificates:r,flexibleGiftCertPlaceholder:N,selectedId:null===n||void 0===n?void 0:n.id,onSelect:u})]}),(0,j.jsx)(Se,{children:1===c?(0,j.jsx)(L.Z,{disabled:!t,onClick:function(){return a()},children:S("checkout.proceed_to_payment")}):(0,j.jsx)(L.Z,{onClick:function(){return s()},children:S("checkout.edit")})}),"checkout"===i&&(0,j.jsx)(E.Z,{mt:"32px",alignSelf:"center"}),2===c?(0,j.jsxs)(xe,{children:[y.text.length>0&&(0,j.jsx)(ve,{size:"small",as:y.type,children:y.text}),l&&(0,j.jsx)(ae,{skipShipping:!0,basketNotFromRedux:l,checkoutState:d,proceedToStep:p,setShippingRef:U,setPaymentRef:$})]}):null]})}})]})]})})})};be.defaultProps={data:{checkout:{},content:{},gift_certificate_setup:{}}};var je=be}}]);

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.