1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},a=(new e.Error).stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="9122d332-b56f-4330-b4d8-8c400b941eaf",e._sentryDebugIdIdentifier="sentry-dbid-9122d332-b56f-4330-b4d8-8c400b941eaf")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8812],{54436:(e,a,t)=>{t.d(a,{A:()=>o});var l=t(37876),c=t(8440),s=t(56720),i=t(12212),r=t(21468),d=t(37908),n=t(75130);let o=e=>{let{t:a}=(0,i.B)(),{checkoutObject:t,checkoutForm:o}=e;if(0===e.userGiftcards.length)return null;let m=[],f=[];e.inAccountPage&&(m=e.userGiftcards.filter(e=>e.is_activated&&e.balance>0),f=e.userGiftcards.filter(e=>!e.is_activated&&e.balance>0));let u=async e=>{let a=window.open("","PRINT");return a?(await (0,n.HY)(e.id).then(e=>{a.document.write("<title>Impression</title>"),a.document.write(e.data),a.document.body.setAttribute("onafterprint","window.close();");let[t]=a.document.getElementsByTagName("img");t&&t.setAttribute("onLoad","window.print();"),a.focus()}),!0):(console.warn("[GiftCardList] window.open() returned null â popup likely blocked by browser"),!1)};return(0,l.jsx)(l.Fragment,{children:e.inAccountPage?(0,l.jsxs)(l.Fragment,{children:[0!==m.length&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:"headline headline--block mb-3 mt-0",children:a("account.modal.giftcard.activedgiftcard")}),(0,l.jsx)("ul",{className:"giftcard-list d-flex flex-wrap mt-3 mb-3",children:m.map(e=>(0,l.jsx)("li",{className:"col-12 col-md-6 mb-2 d-flex",children:(0,l.jsx)(c.A,{placement:"top",overlay:(0,l.jsx)(s.A,{id:"tooltip1",children:(0,l.jsx)(d.A,{src:e.image_url,className:"d-block w-100 h-auto",alt:a("staticpages.giftcard.title"),title:a("staticpages.giftcard.title")})}),children:(0,l.jsx)("label",{className:"filter-checkbox filter-checkbox--giftcard",onClick:()=>u(e),children:(0,l.jsxs)("span",{className:"giftcard-box d-flex flex-column align-items-start",children:[(0,l.jsxs)("div",{className:"d-flex",children:[(0,l.jsxs)("span",{className:"giftcard-box__icon",children:[(0,l.jsx)(r.A,{value:"giftcard-icon"})," "]}),(0,l.jsx)("div",{className:"d-flex flex-column ps-3 pe-3",children:(0,l.jsxs)("strong",{className:"giftcard-box__num",children:[e.number," "]})}),(0,l.jsx)("span",{className:"giftcard-box__amount",title:"Balance",children:a("utils.price",{price:e.balance})})]}),(0,l.jsx)("span",{className:"span--fs-12 d-block text-center mt-1",children:null!==e.activated_at?a("account.modal.giftcard.activatedate",{date:new Date(e.activated_at)}):""})]})})})},e.number))})]}),0!==f.length&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("h2",{className:"headline headline--block mb-3 mt-2",children:a("account.modal.giftcard.notactivegiftcard")}),(0,l.jsx)("ul",{className:"giftcard-list d-flex flex-wrap mt-3 mb-3",children:f.map(e=>(0,l.jsx)("li",{className:"col-12 col-md-6 mb-2 d-flex",children:(0,l.jsx)(c.A,{placement:"top",overlay:(0,l.jsx)(s.A,{id:"tooltip1",children:(0,l.jsx)(d.A,{src:e.image_url,className:"d-block w-100 h-auto",alt:a("staticpages.giftcard.title"),title:a("staticpages.giftcard.title")})}),children:(0,l.jsx)("label",{className:"filter-checkbox filter-checkbox--giftcard",onClick:()=>u(e),children:(0,l.jsxs)("span",{className:"giftcard-box d-flex flex-column align-items-start",children:[(0,l.jsxs)("div",{className:"d-flex",children:[(0,l.jsxs)("span",{className:"giftcard-box__icon",children:[(0,l.jsx)(r.A,{value:"giftcard-icon"})," "]}),(0,l.jsx)("div",{className:"d-flex flex-column ps-3 pe-3",children:(0,l.jsxs)("strong",{className:"giftcard-box__num",children:[e.number," "]})}),(0,l.jsx)("span",{className:"giftcard-box__amount",title:"Balance",children:a("utils.price",{price:e.balance})})]}),(0,l.jsx)("span",{className:"span--fs-12 d-block text-center mt-1",children:null!==e.created_at?a("account.modal.giftcard.buydate",{date:new Date(e.created_at)}):""})]})})})},e.number))})]})]}):(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("ul",{className:"giftcard-list d-flex flex-wrap mt-3 mb-3",children:e.userGiftcards.map(c=>(0,l.jsx)("li",{className:"col-12 col-md-6 mb-2 d-flex",children:(0,l.jsxs)("label",{className:"filter-checkbox filter-checkbox--giftcard",children:[(0,l.jsx)("input",{name:"giftcard",type:"checkbox",id:"giftcard_"+c.id,onChange:a=>{a.target.checked?e.addGiftCardAmountToCheckout(c):e.addGiftCardAmountToCheckout(null)},checked:void 0!==o.gift_card&&o.gift_card===c.id&&0!==t.giftcard_usage.length}),(0,l.jsxs)("span",{className:"giftcard-box",children:[(0,l.jsxs)("span",{className:"giftcard-box__icon",children:[(0,l.jsx)(r.A,{value:"giftcard-icon"})," "]}),(0,l.jsx)("div",{className:"d-flex flex-column ps-3 pe-3 ",children:(0,l.jsxs)("strong",{className:"giftcard-box__num",children:[c.number," "]})}),(0,l.jsx)("span",{className:"giftcard-box__amount",title:"Balance",children:a("utils.price",{price:c.balance})})]})]})},c.number))})})})}},84621:(e,a,t)=>{t.d(a,{A:()=>o});
1var l=t(37876),c=t(14232),s=t(12212),i=t(75130),r=t(21468),d=t(48992),n=t(60691);t(34924);let o=e=>{let{t:a}=(0,s.B)(),t=(0,c.useRef)(null),o=(0,c.useRef)(null);(0,n.A)(t,a);let[m,f]=(0,c.useState)(""),[u,g]=(0,c.useState)(null),[x,h]=(0,c.useState)(!1),[b,p]=(0,c.useState)(!1),[j,v]=(0,c.useState)(!1),N=()=>{v(!0)},_=()=>{v(!1)},w=function(){let a=arguments.length>0&&void 0!==arguments[0]&&arguments[0];h(!1),p(!0),(0,i.q)(m,a).catch(e=>{h(!0),p(!1),o.current?.focus(),console.info("An error occured while trying to activate a gift card with id",m,e)}).then(a=>{void 0!==a&&200===a.status&&(h(!1),g(!0),e.refreshGiftCards(m),f(""),_(),setTimeout(()=>{g(!1),p(!1)},4e3))})};return(0,l.jsxs)("form",{id:"add-giftcard-form",className:"pt-1 pb-3",onSubmit:a=>{a.preventDefault(),void 0===e.userGiftcards.filter(e=>{let{is_activated:a}=e;return!a}).find(e=>{let{number:a}=e;return a.trim().toUpperCase()===m.trim().toUpperCase()})?w():N()},ref:t,children:[(0,l.jsxs)("div",{className:"row align-items-center",children:[(0,l.jsx)("div",{className:"col-12 col-lg-8",children:(0,l.jsxs)("div",{className:"form-group",children:[(0,l.jsx)("label",{htmlFor:"giftcard_number",children:a(e.fullTitle?"account.modal.giftcard.activefull":"account.modal.giftcard.active")}),(0,l.jsx)("input",{ref:o,className:"form-control",id:"giftcard_number",name:"giftcard_number",value:m,required:!0,placeholder:a("account.modal.giftcard.input"),type:"text",onChange:e=>f(e.target.value.trim().toUpperCase()),"aria-invalid":x,"aria-describedby":x?"giftcard-error":void 0}),(0,l.jsx)("div",{className:"invalid-feedback"})]})}),(0,l.jsx)("div",{className:"col-12 col-lg-4 mt-2",children:(0,l.jsx)("button",{id:"giftcardbtn_active",form:"add-giftcard-form",disabled:b,className:"btn btn--small btn--outline btn--outline--forest","aria-describedby":x?"giftcard-error":u?"giftcard-success":void 0,children:a("account.modal.giftcard.activeaction")})}),u&&(0,l.jsxs)("div",{id:"giftcard-success",className:"alert alert--success alert--small mb-0 mt-1 alert--withfade",role:"alert","aria-live":"polite","aria-atomic":"true",children:[(0,l.jsx)("div",{className:"alert__icon",children:(0,l.jsx)(r.A,{value:"confirm"})}),(0,l.jsx)("div",{className:"alert__message",children:(0,l.jsx)("strong",{className:"strong--fs-14 strong--weight--smbold",children:a("account.modal.giftcard.cardactived")})})]}),x&&(0,l.jsxs)("div",{id:"giftcard-error",className:"alert alert--danger alert--small mb-0 mt-1 alert--withfade",role:"alert","aria-live":"polite","aria-atomic":"true",children:[(0,l.jsx)("div",{className:"alert__icon",children:(0,l.jsx)(r.A,{value:"danger"})}),(0,l.jsx)("div",{className:"alert__message",children:(0,l.jsx)("strong",{className:"strong--fs-14 strong--weight--smbold",children:a("account.modal.giftcard.codenotvalid")})})]})]}),(0,l.jsx)(d.A,{show:j,onShow:N,onHide:_,footer:!0,footerContent:(0,l.jsxs)("form",{id:"confirmActivation",onSubmit:()=>w(!0),className:"d-flex",children:[(0,l.jsx)("div",{className:"me-2",children:(0,l.jsx)("button",{className:"btn btn--outline btn--outline--forest btn--small",onClick:_,children:a("utils.cancel")})}),(0,l.jsx)("div",{children:(0,l.jsx)("button",{className:"btn btn--raised btn--raised--tomato btn--small",type:"submit",autoFocus:!0,form:"confirmActivation",children:a("staticpages.giftcard.modal.confirm")})})]}),title:a("staticpages.giftcard.modal.title"),className:"modal-dialog--login",children:a("staticpages.giftcard.modal.content")})]})}}}]);
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.