1import{a as I}from"/build/_shared/chunk-Q6UAPYBM.js";import{a as T}from"/build/_shared/chunk-WVC4YTIO.js";import{a as w}from"/build/_shared/chunk-HHS65IS6.js";import{a as y}from"/build/_shared/chunk-RB2TP3HO.js";import{a as P}from"/build/_shared/chunk-I5UT2UAU.js";import{a as S}from"/build/_shared/chunk-UXJUA2QE.js";import{a as h}from"/build/_shared/chunk-YUUKFOQM.js";import{a as R}from"/build/_shared/chunk-L4FEFM7G.js";import{a as p}from"/build/_shared/chunk-5OBEDPFR.js";import{a as k}from"/build/_shared/chunk-H6S7FWVP.js";import{d as s}from"/build/_shared/chunk-T36URGAI.js";var b=s(k());var m=s(p()),E=15e3,L=({onClose:o})=>{let{translate:e}=h(),[i,a]=(0,b.useState)(!1);return(0,b.useEffect)(()=>{let l=setTimeout(()=>a(!0),10);return()=>clearTimeout(l)},[]),(0,m.jsx)("div",{className:"flex w-[268px] flex-col items-center gap-6",children:(0,m.jsxs)("div",{className:"flex w-full flex-col items-center gap-4",children:[(0,m.jsxs)("div",{className:"flex w-full flex-col items-center gap-2 text-center text-white",children:[(0,m.jsx)("p",{className:"text-xl font-semibold",children:e("pricePromise.modal.pollingTitle")}),(0,m.jsx)("p",{className:"text-xs font-light",children:e("pricePromise.modal.pollingSubtitle")})]}),(0,m.jsx)("div",{className:"h-[6px] w-full overflow-hidden rounded-full bg-[#323232]",children:(0,m.jsx)("div",{className:`h-full rounded-full bg-[#7be7d8] ease-linear ${i?"w-full":"w-0"}`,style:{transitionProperty:"width",transitionDuration:`${E}ms`}})}),(0,m.jsx)("p",{className:"text-center text-xs font-light text-white",children:e("pricePromise.modal.pollingEmailNotice")}),(0,m.jsx)("button",{onClick:o,className:"rounded bg-[#e8f4f2] px-2 py-2 text-xs text-[#0f0f0f]",children:e("pricePromise.modal.pollingClose")})]})})};var r=s(p()),H=({variant:o,context:e,onClose:i,navigateTo:a,amount:l})=>{let{translate:n}=h(),t=o==="approved",c=t&&e==="claim",u=()=>{a?window.location.href=a:i()};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-5",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold",children:n(t?"pricePromise.modal.approvedTitle":"pricePromise.modal.escalatedTitle")}),(0,r.jsx)("button",{onClick:i,className:"text-gray-500 hover:text-gray-700",children:(0,r.jsx)(P,{icon:I,width:16,height:16})})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-6 px-5 pb-5",children:[c?(0,r.jsxs)("p",{className:"text-sm font-light",children:[n("pricePromise.modal.claimApprovedBodyBefore"),(0,r.jsx)("span",{className:"font-semibold",children:l?w(l):""}),n("pricePromise.modal.claimApprovedBodyAfter")]}):t?(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)("p",{className:"text-sm font-light",children:n("pricePromise.modal.approvedBodyLine1")}),(0,r.jsx)("p",{className:"text-sm font-light",children:n("pricePromise.modal.approvedBodyLine2")})]}):(0,r.jsx)("p",{className:"text-sm font-light",children:n("pricePromise.modal.escalatedBody")}),(0,r.jsx)("button",{onClick:u,className:"h-[50px] w-full rounded bg-[var(--primary-aqua,#7be7d8)] px-6 py-2 text-base font-semibold uppercase",children:n(c?"pricePromise.modal.claimApprovedCta":t?"pricePromise.modal.approvedCta":"pricePromise.modal.escalatedCta")})]})]})};var V=s(R()),v=s(k());var d=s(p()),q=({show:o,onClose:e,title:i,children:a})=>{let[l,n]=(0,v.useState)(!1),[t,c]=(0,v.useState)(!1),[u,N]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{if(o)return n(!0),document.documentElement.style.overflow="hidden",()=>{document.documentElement.style.overflow=""};N(!1);let x=window.setTimeout(()=>{c(!1),n(!1),document.documentElement.style.overflow=""},300);return()=>{window.clearTimeout(x)}},[o]),(0,v.useEffect)(()=>{if(!l||t)return;let x=requestAnimationFrame(()=>{c(!0),N(!0)});return()=>cancelAnimationFrame(x)},[l,t]),l?V.default.createPortal((0,d.jsxs)("div",{className:`${t?"visible":"invisible"}`,"data-testid":"price-promise-mobile-sheet",children:[(0,d.jsx)("div",{className:`transition-opacity duration-300 fixed inset-0 z-[100] bg-black ${t&&u?"opacity-60":"opacity-0"}`,onClick:e}),(0,d.jsx)("div",{className:"fixed inset-0 flex justify-center z-[110] items-end",onClick:e,children:(0,d.jsxs)("div",{className:`bg-site-background w-full rounded-t-lg fixed bottom-0 left-0 right-0 max-h-[85vh] flex flex-col overflow-hidden transform transition-transform duration-300 ease-in-out ${t&&u?"translate-y-0":"translate-y-full"}`,onClick:x=>x.stopPropagation(),children:[i&&(0,d.jsxs)("div",{className:"flex-shrink-0 flex items-center justify-between p-5",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold",children:i}),(0,d.jsx)("button",{onClick:e,className:"text-gray-500 hover:text-gray-700","aria-label":"Close",children:(0,d.jsx)(P,{icon:T,width:16,height:16})})]}),(0,d.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:a})]})})]}),document.body):null};var f=s(p()),C=({className:o="",label:e,labelClassName:i,containerClassName:a,errors:l,inputRef:n,...t})=>{let c=t.name?l==null?void 0:l.find(u=>u.path.includes(t.name)):void 0;return(0,f.jsxs)("div",{className:`${a} flex flex-col gap-2`,children:[e&&(0,f.jsx)("label",{className:i,children:e}),(0,f.jsxs)("div",{className:`${o} flex h-[50px] items-stretch overflow-hidden rounded border bg-site-background ${c?"border-dark-red":"border-grey-3"}`,children:[(0,f.jsx)("div",{className:"flex shrink-0 items-center justify-center bg-grey-1 px-3",children:(0,f.jsx)("span",{className:"text-input font-light text-grey-6",children:"\xA3"})}),(0,f.jsx)("input",{ref:n,className:"text-input w-full min-w-0 px-4 font-light placeholder-grey-4 focus:outline-none",...t,type:"number",step:"0.01"})]}),c&&(0,f.jsx)("div",{"data-test-id":"validation-error",children:(0,f.jsx)(S,{className:"text-dark-red",children:c.message})})]})};var g=s(p()),X=o=>{let e=o.price.trim(),i=o.delivery.trim();return{...e!==""&&{price:e},...i!==""&&{deliveryPence:i},...o.inStock!==void 0&&{inStock:o.inStock},...o.sameVariant!==void 0&&{sameVariant:o.sameVariant}}},A=o=>o===!0?"true":o===!1?"false":"",Y=({namePrefix:o,state:e,issues:i})=>{let{translate:a}=h(),l=[{value:"true",label:a("pricePromise.modal.yesLabel")},{value:"false",label:a("pricePromise.modal.noLabel")}],n=t=>{var c;return(c=i==null?void 0:i.find(u=>u.path.includes(t)))==null?void 0:c.message};return(0,g.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,g.jsx)(C,{name:"price",placeholder:a("pricePromise.modal.inputCustomerPricePlaceholder"),value:e.price,onChange:t=>e.onPriceChange(t.target.value),errors:i}),(0,g.jsx)(C,{name:"deliveryPence",placeholder:a("pricePromise.modal.inputCustomerDeliveryPlaceholder"),value:e.delivery,onChange:t=>e.onDeliveryChange(t.target.value),errors:i}),(0,g.jsx)(y,{name:`${o}-inStock`,options:l,selectedOption:A(e.inStock),onSelectItem:t=>e.onInStockChange(t==="true"),placeholder:a("pricePromise.modal.inStockQuestion"),error:n("inStock")}),(0,g.jsx)(y,{name:`${o}-sameVariant`,options:l,selectedOption:A(e.sameVariant),onSelectItem:t=>e.onSameVariantChange(t==="true"),placeholder:a("pricePromise.modal.sameVariantQuestion"),error:n("sameVariant")})]})};export{L as a,H as b,q as c,X as d,Y as e};
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.