"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4633],{2178:(e,a,i)=>{i.d(a,{A:()=>s});let t=(e,a,i,t)=>{let n=document.createElement("FORM");if(n.method="POST",n.enctype="application/x-www-form-urlencoded",n.style.display="none",n.action=e,t){let e=JSON.parse(a);Object.keys(e).forEach(a=>{let i=document.createElement("INPUT");i.name=a,i.value=e[a],n.appendChild(i)})}else{let e=document.createElement("INPUT");e.type="hidden",e.name=i?"cXML-urlencoded":"cXML-base64",e.value=i?decodeURIComponent(Array.from(atob(a)).map(e=>"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)).join("")):a,n.appendChild(e)}document.body.appendChild(n),n.submit()},n=e=>{let a=new URL(e);return(a.username||a.password)&&(a.username="",a.password=""),a.toString()},r=e=>e.header&&Array.isArray(e.header)&&e.header.length>0&&e.header[0].username&&e.header[0].password,l=(e,a,i)=>{let{username:t,password:r}=e.header[0],l=btoa("".concat(t,":").concat(r)),s=n(a);fetch(s,{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Basic ".concat(l)},body:JSON.stringify(e)}).then(e=>{if(!e.ok)throw Error("Network response was not ok: ".concat(e.statusText));return e.json()}).then(()=>{let e=i||s;window.location.href=e}).catch(e=>{console.error("There was an error with the JSON request:",e)})},s=(e,a,i,n,s)=>{let o;try{o=JSON.parse(a)}catch(r){t(e,a,i,n);return}r(o)?l(o,e,s):t(e,a,i,n)}},4641:(e,a,i)=>{i.d(a,{A:()=>t.A});var t=i(16819)},16819:(e,a,i)=>{i.d(a,{A:()=>j});var t=i(37876);i(14232);var n=i(49995),r=i(8733),l=i(61261),s=i(35877),o=i(15329),d=i(71541),c=i(8335),u=i(57869),m=i(20573),p=i(30373),h=i(5411),v=i(59587),x=i(54753);let g=(0,l.A)(e=>({paper:{minWidth:182},title:{display:"flex",justifyContent:"space-between",fontSize:e.typography.pxToRem(20),fontWeight:e.typography.fontWeightBold,margin:e.spacing(5,6,0),textTransform:"uppercase",[e.breakpoints.down("xs")]:{fontWeight:e.typography.fontWeightBold,margin:e.spacing(5,4,0)}},actions:{padding:e.spacing(2,5,3),[e.breakpoints.down("xs")]:{flexDirection:"column-reverse",padding:e.spacing(2,4,3)}},dialogContent:{flex:"none",[e.breakpoints.down("xs")]:{padding:e.spacing(2,4)}},dialogText:{color:e.palette.common.black},button:{[e.breakpoints.down("xs")]:{width:"100%",padding:e.spacing(2.5)}},cancelButton:{color:e.palette.primary.main},closeButton:{color:e.palette.common.black,padding:0,height:"fit-content"},cancelIcon:{fontSize:"2rem"}})),A=e=>{let{onDismiss:a}=e,i=g();return(0,t.jsx)(o.A,{className:i.closeButton,onClick:a,children:(0,t.jsx)(v.default,{className:i.cancelIcon})})},j=e=>{let{open:a,loading:i,title:l,description:o,cancelText:v=(0,t.jsx)(r.A,{...x.A.CANCEL}),confirmText:j=(0,t.jsx)(r.A,{...x.A.AGREE}),onConfirm:b,onCancel:y,onDismiss:f,fullscreen:N,...C}=e,w=g(),T=(0,s.A)(),k=!0===(0,d.A)(T.breakpoints.down("xs"),{defaultMatches:!0});return(0,t.jsxs)(c.A,{open:a,onClose:y,classes:{paper:w.paper},fullScreen:N,...C,children:[l&&(0,t.jsxs)("div",{className:w.title,children:[l,f&&(0,t.jsx)(A,{onDismiss:f})]}),o&&(0,t.jsx)(u.A,{className:w.dialogContent,children:(0,t.jsx)(m.A,{className:w.dialogText,children:o})}),(0,t.jsxs)(p.A,{className:w.actions,children:[(0,t.jsx)(h.A,{onClick:y,disabled:i,className:(0,n.A)(w.button,w.cancelButton),color:"primary",variant:k?"text":"outlined","data-testid":"alert-dialog-cancel",id:"alert-dialog-cancel",children:v}),(0,t.jsx)(h.A,{onClick:b,color:"primary",disabled:i,className:w.button,variant:"contained","data-testid":"alert-dialog-confirm",id:"alert-dialog-confirm",style:{margin:8*!k},children:j})]})]})}},34341:(e,a,i)=>{i.d(a,{A:()=>t.A});var t=i(31591)},35654:(e,a,i)=>{i.d(a,{e:()=>t});let t=e=>({...e.pricing,currency:e.currency,listPriceCurrency:e.listPriceCurrency,promotionalMessage:e.promotionalMessage,supplementaryMessage:e.supplementaryMessage,availabilityOverwriteMessage:e.availabilityOverwriteMessage})},36677:(e,a,i)=>{i.d(a,{gA:()=>d});var t=i(28888);i(37876);var n=i(82897);i(14232);var r=i(78248);function l(){let e=(0,t._)(["\n query B2bShoppingCart($cartType: String) {\n getB2bShoppingCart(cartType: $cartType) {\n punchoutResponseMsg\n isDecodeNeeded\n postBackURL\n isSapOci\n redirectUrl\n }\n}\n "]);return l=function(){return e},e}let s={},o=(0,n.J1)(l());function d(e){let a={...s,...e};return r._(o,a)}},38890:(e,a,i)=>{i.d(a,{A:()=>c});var t=i(37876),n=i(14232),r=i(49995),l=i(16703),s=i(15743),o=i(70524),d=i(68002);let c=e=>{let{rootClass:a,rootStyle:i,label:c,required:u,help:m,size:p,error:h,name:v,value:x,handleSave:g,saveOnError:A,onChange:j,delay:b=500,component:y=s.A,displayError:f=!0,...N}=e,C=n.useRef(x),[w,T]=n.useState(x);return(0,l.A)(()=>{(!h||A)&&w!==C.current&&(g(w),C.current=w)},b,[w,!!h]),(0,t.jsxs)("div",{className:(0,r.A)({[String(a)]:a}),style:i,children:[c&&(0,t.jsx)(o.A,{htmlFor:v,size:p,required:u,error:!!(f&&h),children:c}),(0,t.jsx)(y,{id:v,size:p,error:!!(f&&h),value:x,onChange:e=>{T(e.target.value),j(e)},...N}),(!!(f&&h&&y===s.A)||m)&&(0,t.jsx)(d.A,{id:"".concat(v,"-help-text"),error:!!h,children:h||m||null})]})}},53471:(e,a,i)=>{i.d(a,{u7:()=>d});var t=i(28888);i(37876);var n=i(82897),r=i(64177);function l(){let e=(0,t._)(["\n mutation GenerateQuote($addressInfo: AddressInfoType, $input: [ItemToQuote!]!) {\n generateQuote(addressInfo: $addressInfo, input: $input) {\n orderNumber\n sapOrderNumber\n orderStatus\n }\n}\n "]);return l=function(){return e},e}i(14232);let s={},o=(0,n.J1)(l());function d(e){let a={...s,...e};return r.n(o,a)}},64760:(e,a,i)=>{i.d(a,{A:()=>u});var t=i(37876);i(14232);var n=i(8288),r=i(17685),l=i(88373),s=i(71211),o=i(11788),d=i(27651),c=i(94295);let u=e=>{let{className:a,attentionTo:i,organizationName:u,department:m,buildingRoom:p,street:h,street3:v,street4:x,postOfficeBox:g,city:A,state:j,showStateName:b=!1,postalCode:y,country:f,recipientName:N,mobile:C,isShippingAddress:w=!1,phoneNumber1:T}=e,{userSession:k}=(0,r.j)(),{country:E,language:S}=k,I=(0,c.L)(d.CN.countryCode),R=(0,n.ds)(f)||f,{isDarmstadtUser:_}=(0,o.iZ)(),B=(0,c.D)(d.JP.countryCode),{data:O,loading:M,error:L}=(0,l.kN)({variables:{country:f||E,locale:"en"===S?"en_US":"".concat(S,"_").concat(E)},skip:!b}),W=e=>{if(M||L)return e;if(I)return(0,s.u)(I,e);let a=null==O?void 0:O.getCountryStates.find(a=>(null==a?void 0:a.stateCode)===e);return(null==a?void 0:a.stateName)||e};return I&&w?(0,t.jsxs)("div",{className:a,children:[(0,t.jsx)("div",{"data-scrub":!0,children:N}),(0,t.jsx)("div",{"data-scrub":!0,children:i}),(0,t.jsx)("div",{"data-scrub":!0,children:C}),(0,t.jsx)("div",{"data-scrub":!0,children:u}),(0,t.jsx)("div",{"data-scrub":!0,children:m}),(0,t.jsxs)("div",{children:[j&&(0,t.jsxs)("span",{"data-scrub":!0,children:[b?W(j):j,","," "]}),(0,t.jsx)("span",{"data-scrub":!0,children:A})]}),(0,t.jsx)("div",{"data-scrub":!0,children:h}),(0,t.jsxs)("div",{children:[p&&(0,t.jsxs)("span",{"data-scrub":!0,children:[p,", "]}),(0,t.jsx)("span",{"data-scrub":!0,children:y})]})]}):(0,t.jsxs)("div",{className:a,children:[(0,t.jsx)("div",{"data-scrub":!0,children:N}),(0,t.jsx)("div",{"data-scrub":!0,children:i}),B&&(0,t.jsx)("div",{"data-scrub":!0,children:T}),(0,t.jsx)("div",{"data-scrub":!0,children:u}),(0,t.jsx)("div",{"data-scrub":!0,children:m}),(0,t.jsx)("div",{"data-scrub":!0,children:p}),(0,t.jsx)("div",{"data-scrub":!0,children:h}),_&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{"data-scrub":!0,children:v}),(0,t.jsx)("div",{"data-scrub":!0,children:x})]}),(0,t.jsx)("div",{"data-scrub":!0,children:g}),(0,t.jsxs)("div",{children:[A&&(0,t.jsxs)("span",{"data-scrub":!0,children:[A,", "]}),j&&(0,t.jsxs)("span",{"data-scrub":!0,children:[b?W(j):j," "]}),y&&(0,t.jsx)("span",{"data-scrub":!0,children:y})]}),(0,t.jsx)("div",{"data-scrub":!0,children:R})]})}},79632:(e,a,i)=>{i.d(a,{A:()=>c});var t=i(37876);i(14232);var n=i(77742),r=i(61261),l=i(54753),s=i(15093),o=i(49995);let d=(0,r.A)(e=>({sdsRoot:{display:"flex",alignItems:"center",color:e.palette.primary.main,"&:hover":{"& > svg, span":{color:e.palette.primary.dark}}},message:{color:e.palette.primary.main,fontWeight:e.typography.fontWeightBold,marginLeft:e.spacing(2),fontSize:"14px"},hideBelowSm:{[e.breakpoints.down("xs")]:{display:"none"}}})),c=e=>{let{label:a="SDS",alwaysShowLabel:i}=e,r=d(),{formatMessage:c}=(0,n.A)();return(0,t.jsxs)("span",{className:r.sdsRoot,children:[(0,t.jsx)(s.A,{color:"primary"}),(0,t.jsx)("span",{className:(0,o.A)(r.message,{[r.hideBelowSm]:!i}),children:c(l.A[a])})]})}},83128:(e,a,i)=>{i.d(a,{A:()=>en});var t=i(37876),n=i(14232),r=i(74985),l=i(5411),s=i(49995),o=i(54753),d=i(5325),c=i(77742),u=i(8733),m=i(61261),p=i(37929),h=i(71541),v=i(36382),x=i(77660),g=i(11148),A=i(11788),j=i(82250),b=i(35967),y=i(12197),f=i(36503),N=i(39069),C=i(34415),w=i(52413),T=i(61206),k=i(43343);let E=(0,m.A)(e=>({container:{display:"flex",marginBottom:e.spacing(5)},details:{overflow:"hidden"},imageContainer:{width:60,height:60,display:"flex",flexShrink:0,justifyContent:"center",alignItems:"center",backgroundColor:e.palette.common.white,border:"solid 1px ".concat(e.palette.grey[400]),borderRadius:e.shape.borderRadius,marginRight:e.spacing(2),wordWrap:"break-word"},image:{maxWidth:"100%",maxHeight:"100%"},materialNumber:{color:e.palette.primary.main,cursor:"pointer",display:"block",fontSize:e.typography.pxToRem(14),overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},materialName:{fontWeight:e.typography.fontWeightBold,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},quantity:{fontSize:e.typography.pxToRem(12)}})),S=e=>{var a,i,n,r,l,s,d,c,m,p,h,v,x,A,j;let{item:b}=e,y=E(),f=null==b?void 0:null===(i=b.material)||void 0===i?void 0:null===(a=i.product)||void 0===a?void 0:a.replace(/[\W_]+/g,"");return(0,t.jsxs)("div",{className:y.container,children:[(0,t.jsx)("div",{className:y.imageContainer,children:(null==b?void 0:null===(n=b.material)||void 0===n?void 0:n.image)?(0,t.jsx)(k.A,{alt:null==b?void 0:null===(r=b.material)||void 0===r?void 0:r.number,className:y.image,sizes:"60px",src:null==b?void 0:null===(l=b.material)||void 0===l?void 0:l.image.smallUrl,urls:[null==b?void 0:null===(s=b.material)||void 0===s?void 0:s.image.smallUrl,null==b?void 0:null===(d=b.material)||void 0===d?void 0:d.image.mediumUrl,null==b?void 0:null===(c=b.material)||void 0===c?void 0:c.image.largeUrl]}):null}),(0,t.jsxs)("div",{className:y.details,children:[(null==b?void 0:null===(m=b.material)||void 0===m?void 0:m.brand)?(0,t.jsx)(w.N,{...g.aR.index(((null==b?void 0:null===(p=b.material)||void 0===p?void 0:p.brand.key)||(null==b?void 0:null===(h=b.material)||void 0===h?void 0:h.brand.name)||"").replace(" ","").toLowerCase(),f||(null==b?void 0:null===(v=b.material)||void 0===v?void 0:v.id.split("-")[0])),passHref:!0,children:(0,t.jsx)(C.A,{className:y.materialNumber,children:null==b?void 0:null===(x=b.material)||void 0===x?void 0:x.number})}):null,(null==b?void 0:null===(A=b.material)||void 0===A?void 0:A.name)?(0,t.jsx)("div",{className:y.materialName,children:(0,t.jsx)(T.A,{value:null==b?void 0:null===(j=b.material)||void 0===j?void 0:j.name})}):null,(0,t.jsxs)("div",{className:y.quantity,children:[(0,t.jsx)(u.A,{...o.A.QUANTITY}),":"," ",(null==b?void 0:b.quantity)===""?"1":null==b?void 0:b.quantity]})]})]})};var I=i(78206),R=i(28975),_=i(34341),B=i(89099),O=i(78272),M=i(64760),L=i(38890),W=i(38582),D=i(77274),U=i(11631),q=i(51996),z=i(52710),F=i(35654);let H=(0,m.A)(e=>({editLink:{marginTop:e.spacing(1)},divider:{backgroundColor:e.palette.grey[300],height:2,margin:e.spacing(4,0),width:"100%"},input:{alignItems:"center",backgroundColor:e.palette.primary.light,borderBottom:"2px solid ".concat(e.palette.grey[300]),borderTop:"2px solid ".concat(e.palette.grey[300]),display:"flex",marginBottom:e.spacing(4),padding:e.spacing(4),flexDirection:"column",gridRowGap:e.spacing(4)},cvvInput:{backgroundColor:e.palette.common.white,[e.breakpoints.up("md")]:{maxWidth:70}},poInput:{backgroundColor:e.palette.common.white,[e.breakpoints.up("md")]:{minWidth:290}},inputLabel:{marginRight:e.spacing(3)},actionContainer:{marginTop:e.spacing(8),[e.breakpoints.up("md")]:{display:"flex",justifyContent:"flex-start"}},availabilityMessage:{fontSize:e.typography.pxToRem(14),paddingLeft:e.spacing(5)},totalLabel:{marginLeft:e.spacing(1)},merchantLocation:{margin:e.spacing(2,0)},columnOffset:{paddingLeft:e.spacing(5)},infoContainer:{display:"flex",marginBottom:e.spacing(3),lineHeight:1.71},cvvInputWrapper:{alignItems:"center",backgroundColor:e.palette.primary.light,borderBottom:"2px solid ".concat(e.palette.grey[300]),borderTop:"2px solid ".concat(e.palette.grey[300]),display:"flex",marginBottom:e.spacing(4),padding:e.spacing(4)},gridAlign:{alignItems:"center"}})),P=e=>{var a,i,n;let{onClose:s,cart:d}=e,c=H(),m=(0,B.useRouter)(),[p,{loading:h}]=(0,v.Q2)(),{setSnackbar:j}=(0,W.W)(),[C,{loading:w}]=(0,v.M3)(),{country:k,language:E}=m.query,{required:P}=(0,D.dz)(),{getCountryDetails:$}=(0,q.Y)(),{currentUser:G}=(0,A.iZ)(),Q=$((null==G?void 0:G.__typename)==="LoggedInUser"?null==G?void 0:null===(a=G.metadata)||void 0===a?void 0:a.country:""),V=!!(null==Q?void 0:Q.isCCVRequired),{items:[Y],totals:J,paymentMethods:K,selectedPaymentMethod:Z,shippingAddress:X,currency:ee,merchantLocation:ea,count:ei}=d,et="CC"===Z,en="STD"===Z,er=!!(null==X?void 0:null===(i=X.attentionTo)||void 0===i?void 0:i.value),el=async e=>{try{C({variables:{input:e,action:x.yb.Buyitnowcartmini}})}catch(e){j(W.iZ.GenericError)}},es=async e=>{let{cardSecret:a}=e;if(!w)try{var i,t;let{data:e}=await p({variables:{action:(0,O.KW)(g.TK.BuyNowCart),isDuplicateCheck:!1,isQuote:!1,totalProduct:null!=ei?ei:1,cvv:V?a:void 0}});(null==e?void 0:null===(i=e.submitCart)||void 0===i?void 0:i.orderNumber)&&m.push("/".concat(k,"/").concat(E,"/").concat(g.m[g.GT.OrderAcknowledgement](g.TK.BuyNowCart,(null==e?void 0:null===(t=e.submitCart)||void 0===t?void 0:t.orderNumber)||"")))}catch(e){j(W.iZ.GenericError)}},eo=()=>{var e;m.push("/".concat(k,"/").concat(E,"/").concat(g.m.checkout(g.TK.BuyNowCart),"&material=").concat(null==Y?void 0:null===(e=Y.material)||void 0===e?void 0:e.number))};return(0,t.jsxs)(t.Fragment,{children:[h&&(0,t.jsx)(r.A,{open:!0,hideBackdrop:!0,children:(0,t.jsx)(U.A,{})}),(0,t.jsx)(R.Ay,{open:!0,onClose:(e,a)=>s(a),size:R.Ih.Large,renderTitle:()=>(0,t.jsx)(y.A,{variant:"h2",children:(0,t.jsx)(u.A,{...o.A.BUY_IT_NOW})}),children:(0,t.jsxs)(R.Uh,{children:[Y.quoteNumber?(0,t.jsx)("div",{className:c.infoContainer,children:(0,t.jsx)(y.A,{variant:"inherit",children:(0,t.jsx)(u.A,{id:"QUOTE_DISCLAIMER",defaultMessage:"Clicking “Submit Order” will confirm the purchase of your quoted items. {br} It will not affect any items in your Shopping Cart.",values:{br:(0,t.jsx)("br",{})}})})}):(0,t.jsx)(S,{item:Y}),(0,t.jsx)(I.l1,{validateOnMount:!0,initialValues:{poNumber:null==K?void 0:null===(n=K.purchaseOrder)||void 0===n?void 0:n.value,cardSecret:null},onSubmit:es,children:e=>{var a,i,n,r,s,d,m,p;return(0,t.jsxs)(I.lV,{children:[(!er||en)&&(0,t.jsxs)("div",{className:c.input,children:[!er&&(0,t.jsxs)(f.A,{container:!0,className:c.gridAlign,children:[(0,t.jsx)(f.A,{xs:5,sm:3,children:(0,t.jsx)(y.A,{variant:"subtitle2",children:(0,t.jsx)(u.A,{id:"ATTENTION_TO_REQUIRED",defaultMessage:"Attention to (required)"})})}),(0,t.jsx)(f.A,{xs:7,sm:4,children:(0,t.jsx)(I.D0,{name:"attentionTo",validate:P,children:e=>{let{field:a}=e;return(0,t.jsx)(L.A,{rootClass:c.poInput,...a,filled:!0,saveOnError:!0,handleSave:e=>{el({shippingAddress:{attentionTo:e.trim()}})}})}})})]}),en&&(0,t.jsxs)(f.A,{container:!0,className:c.gridAlign,children:[(0,t.jsx)(f.A,{xs:5,sm:3,children:(0,t.jsx)(y.A,{variant:"subtitle2",className:c.inputLabel,children:(0,t.jsx)(u.A,{id:"BIN_PO_NUMBER_REQUIRED",defaultMessage:"PO Number (required)"})})}),(0,t.jsx)(f.A,{xs:7,sm:4,children:(0,t.jsx)(I.D0,{name:"poNumber",validate:P,children:e=>{let{field:a}=e;return(0,t.jsx)(L.A,{rootClass:c.poInput,...a,filled:!0,saveOnError:!0,handleSave:e=>{el({paymentMethods:{purchaseOrder:e.trim()}})}})}})})]})]}),et?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.A,{container:!0,children:[(0,t.jsx)(f.A,{item:!0,xs:3,sm:2,children:(0,t.jsxs)(y.A,{variant:"subtitle2",children:[(0,t.jsx)(u.A,{...o.A.CREDIT_CARD_LABEL}),":"]})}),(0,t.jsx)(f.A,{item:!0,xs:9,sm:10,children:(0,t.jsx)(y.A,{variant:"inherit",className:c.columnOffset,children:null==K?void 0:null===(a=K.creditCard)||void 0===a?void 0:a.maskedCardNumber})})]}),(0,t.jsxs)(f.A,{container:!0,className:c.merchantLocation,children:[(0,t.jsx)(f.A,{item:!0,sm:2,xs:3,children:(0,t.jsxs)(y.A,{variant:"subtitle2",children:[(0,t.jsx)(u.A,{...o.A.MERCHANT_LOCATION}),":"]})}),(0,t.jsx)(f.A,{className:c.columnOffset,item:!0,sm:10,xs:9,children:(0,t.jsx)(y.A,{variant:"inherit",children:(0,t.jsx)(T.A,{value:null==ea?void 0:ea.split(",").join("
")})})})]}),!V&&(0,t.jsx)(N.A,{className:c.divider}),V?(0,t.jsxs)(f.A,{className:c.cvvInputWrapper,children:[(0,t.jsx)(f.A,{item:!0,xs:8,sm:4,children:(0,t.jsx)(y.A,{variant:"subtitle2",className:c.inputLabel,children:(0,t.jsx)(u.A,{id:"CREDIT_CARD_CVV_REQUIRED",defaultMessage:"Credit Card CVV Number (required)"})})}),(0,t.jsx)(f.A,{item:!0,xs:4,sm:1,children:(0,t.jsx)(I.D0,{name:"cardSecret",validate:e=>{var a;return P(e)&&(null==K?void 0:null===(a=K.creditCard)||void 0===a?void 0:a.cardType)==="AX"?(null==e?void 0:e.length)!==4:(null==e?void 0:e.length)!==3},children:e=>{let{field:a,form:i}=e;return(0,t.jsx)(L.A,{rootClass:c.cvvInput,...a,filled:!0,saveOnError:!0,handleSave:e=>{i.setFieldValue("cardSecret",e)}})}})})]}):null]}):null,Y.quoteNumber&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.A,{container:!0,children:[(0,t.jsx)(f.A,{item:!0,xs:3,sm:2,children:(0,t.jsxs)(y.A,{variant:"subtitle2",children:[(0,t.jsx)(u.A,{...o.A.QUOTE_NUMBER}),":"]})}),(0,t.jsx)(f.A,{item:!0,xs:9,sm:10,children:(0,t.jsx)(y.A,{variant:"inherit",className:c.columnOffset,children:Y.quoteNumber})})]}),(0,t.jsx)(N.A,{className:c.divider})]}),(0,t.jsxs)(f.A,{children:[(0,t.jsxs)(f.A,{container:!0,children:[(0,t.jsx)(f.A,{item:!0,xs:3,sm:2,children:(0,t.jsxs)(y.A,{variant:"subtitle2",children:[(0,t.jsx)(u.A,{...o.A.SHIP_TO}),":"]})}),(0,t.jsx)(f.A,{item:!0,xs:9,sm:10,children:(0,t.jsx)(M.A,{className:c.columnOffset,attentionTo:null==X?void 0:null===(i=X.attentionTo)||void 0===i?void 0:i.value,organizationName:null==X?void 0:null===(n=X.organizationName)||void 0===n?void 0:n.value,street:null==X?void 0:null===(r=X.street1)||void 0===r?void 0:r.value,city:null==X?void 0:null===(s=X.city)||void 0===s?void 0:s.value,state:null==X?void 0:null===(d=X.state)||void 0===d?void 0:d.value,postalCode:null==X?void 0:null===(m=X.postalCode)||void 0===m?void 0:m.value,country:null==X?void 0:null===(p=X.country)||void 0===p?void 0:p.value,showStateName:!0})})]}),(0,t.jsx)(N.A,{className:c.divider}),Y.quoteNumber?null:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(f.A,{container:!0,children:[(0,t.jsx)(f.A,{item:!0,xs:3,sm:2,children:(0,t.jsxs)(y.A,{variant:"subtitle2",children:[(0,t.jsx)(u.A,{...o.A.AVAILABILITY}),":"]})}),(0,t.jsx)(f.A,{item:!0,xs:9,sm:10,children:(0,t.jsxs)(y.A,{variant:"inherit",className:c.columnOffset,children:[null==Y?void 0:Y.carrierName,(null==Y?void 0:Y.availabilityMessages)&&(0,t.jsx)(z.M,{source:"buy it now modal",item:Y.material.number||void 0,brand:Y.material.brand.key||Y.brand||void 0,pricing:(0,F.e)(Y),children:(0,t.jsx)(_.A,{className:c.availabilityMessage,availabilities:null==Y?void 0:Y.availabilityMessages.map(e=>({key:e&&e.key,date:e&&e.date,plantLoc:e&&e.plantLoc,quantity:e&&e.quantity}))})})]})})]}),(0,t.jsx)(N.A,{className:c.divider})]}),(0,t.jsxs)(f.A,{container:!0,children:[(0,t.jsx)(f.A,{item:!0,xs:3,sm:2,children:(0,t.jsxs)(y.A,{variant:"subtitle2",children:[(0,t.jsx)(u.A,{id:"TOTAL",defaultMessage:"Total"}),":"]})}),ee&&(null==J?void 0:J.total)?(0,t.jsx)(f.A,{className:c.columnOffset,item:!0,sm:10,xs:9,children:(0,t.jsxs)(y.A,{variant:"inherit",children:[(0,t.jsx)(b.Gr,{style:"currency",currencyDisplay:"symbol",currency:ee,value:null==J?void 0:J.total}),(0,t.jsx)(y.A,{className:c.totalLabel,component:"span",children:(0,t.jsx)(u.A,{...o.A.INCLUDES_TAXES_FEES_AND_SHIPPING})})]})}):null]})]}),(0,t.jsxs)(R.fW,{className:c.actionContainer,children:[(0,t.jsx)(l.A,{color:"secondary",disabled:e.isSubmitting||!e.isValid,size:"large",onClick:()=>es(null==e?void 0:e.values),variant:"contained",children:(0,t.jsx)(u.A,{...o.A.SUBMIT_ORDER})}),(0,t.jsx)(l.A,{onClick:eo,children:(0,t.jsx)(u.A,{...o.A.EDIT_DETAILS})})]})]})}})]})})]})};var $=i(20534),G=i(42778),Q=i(21826),V=i(20114),Y=i(36677),J=i(17685),K=i(2178),Z=i(1539),X=i(42689),ee=i(86680);let ea=(0,m.A)(e=>({actionContainer:{display:"flex",justifyContent:"flex-start",marginTop:e.spacing(8)}})),ei=e=>{let{cart:a,onClose:i}=e,s=ea(),d=(0,B.useRouter)(),{cartType:m}=(0,Z.LU)(),{setSnackbar:p,setGlobalSnackbarState:h}=(0,W.W)(),{clearGlobalModalComponent:A}=(0,G.g)(),{userSessionActions:b}=(0,J.j)(),[f]=(0,v.AP)(),N=(0,c.A)(),[C]=null==a?void 0:a.items,[w,{data:T,loading:k,error:E}]=(0,Y.gA)({variables:{cartType:x.yb.Buyitnowcart}}),_=async()=>{try{await w(),(0,ee.p4)()}catch(a){let{displayableError:e}=(0,j.Mw)(a);h({open:!0,message:e||(0,t.jsx)(u.A,{...o.A.GENERIC_ERROR}),variant:W.m$.Error})}},M=async()=>{var e;let a=null==C?void 0:null===(e=C.material)||void 0===e?void 0:e.number,i=null==C?void 0:C.quantity;try{await f({variables:{input:{items:[{materialNumber:a,quantity:i}]}},refetchQueries:[{query:X.l,variables:{id:(0,O.KW)(m)}}],awaitRefetchQueries:!0}),(0,ee.kx)(),A()}catch(a){let{displayableError:e}=(0,j.Mw)(a);h({open:!0,message:e||(0,t.jsx)(u.A,{...o.A.GENERIC_ERROR}),variant:W.m$.Error})}},L=async()=>{let e=N.formatMessage({id:"DATA_ERROR",defaultMessage:"Error"});p(W.iZ.OciCheckoutError,e),await b.b2bLogout(),d.replace(g.HF.index())},D=async e=>{let{postBackURL:a,punchoutResponseMsg:i,isDecodeNeeded:t,isSapOci:n}=e;await b.b2bLogout(),(0,K.A)(a,i,t,n)};return(0,n.useEffect)(()=>{if(!(null==T?void 0:T.getB2bShoppingCart))return;let{postBackURL:e,punchoutResponseMsg:a}=null==T?void 0:T.getB2bShoppingCart;void 0===e||""===e?L():a&&e&&""!==e&&D(null==T?void 0:T.getB2bShoppingCart)},[T]),(0,n.useEffect)(()=>{if(!E)return;let{displayableError:e}=(0,j.Mw)(E);h({open:!0,message:e||(0,t.jsx)(u.A,{...o.A.GENERIC_ERROR}),variant:W.m$.Error})},[E]),(0,t.jsxs)(t.Fragment,{children:[k&&(0,t.jsx)(r.A,{open:!0,hideBackdrop:!0,children:(0,t.jsx)(U.A,{})}),(0,t.jsx)(R.Ay,{open:!0,onClose:i,size:R.Ih.Large,renderTitle:()=>(0,t.jsx)(y.A,{variant:"h2",children:(0,t.jsx)(u.A,{...o.A.BUY_IT_NOW})}),children:(0,t.jsxs)(R.Uh,{children:[(0,t.jsx)(S,{item:C}),(0,t.jsx)(I.l1,{initialValues:{},onSubmit:_,children:e=>(0,t.jsxs)(I.lV,{children:[(0,t.jsx)(Q.A,{severity:"warning",icon:(0,t.jsx)(V.A,{style:{fontSize:20}}),children:(0,t.jsx)(u.A,{...o.A.TRANSFER_ITEM_MESSAGE,values:{br:(0,t.jsx)("br",{}),thisItemOnly:(0,t.jsx)("u",{children:(0,t.jsx)(u.A,{...o.A.THIS_ITEM_ONLY})})}})}),(0,t.jsxs)(R.fW,{className:s.actionContainer,children:[(0,t.jsx)(l.A,{color:"secondary",disabled:e.isSubmitting,onClick:_,size:"large",variant:"contained",children:(0,t.jsx)(u.A,{...o.A.TRANSFER_ITEM})}),(0,t.jsx)(l.A,{color:"secondary",disabled:e.isSubmitting,onClick:M,size:"large",variant:"contained",children:(0,t.jsx)(u.A,{id:"ADD_TO_CART",defaultMessage:"Add to Cart"})})]})]})})]})})]})},et=(0,m.A)(e=>({buyNowButton:{backgroundColor:e.palette.common.white,minWidth:75},buyNowButtonMobile:{minHeight:48}})),en=e=>{let{materialNumber:a,quantity:i,size:m="large",fullWidth:b=!1,onSuccess:y,items:f,marketplace:N,disabled:C,gaEcommerceEvent:w,gaType:T,subscriptionFrequency:k,promoCode:E}=e,S=(0,p.A)(),I=et(),R=(0,h.A)(S.breakpoints.up("md")),_=(0,g.rd)(),B=(0,c.A)(),[O]=(0,v.AP)(),{setGlobalSnackbarState:M}=(0,W.W)(),{isB2BUser:L}=(0,A.iZ)(),{setGlobalModalComponent:D,clearGlobalModalComponent:U}=(0,G.g)(),q=N?x.yb.Marketplacebuyitnowcart:x.yb.Buyitnowcart,z="small"===m?{...o.A.BUY_NOW}:{...o.A.BUY_IT_NOW},F=(null==f?void 0:f.length)?f:[{materialNumber:null!=a?a:"",quantity:null!=i?i:1,subscriptionFrequency:null!=k?k:null,promoCode:null!=E?E:null}],[H,{data:Q,loading:V,error:Y}]=(0,v.bZ)({variables:{id:q},fetchPolicy:"network-only"}),J=async()=>{w&&w(),await O({variables:{input:{items:null!=F?F:[],action:q,marketplace:N}}}),await H()};return(0,n.useEffect)(()=>{if(!(null==Q?void 0:Q.getCart))return;let{headerSAPError:e,cartEligibleForBuyItNow:i}=Q.getCart,n=()=>{U()};switch(!0){case!!e:{let a=null==e?void 0:e.message;M({open:!0,message:null!=a?a:(0,t.jsx)(u.A,{...d.A.TECHNICAL_DIFFICULTIES}),variant:W.m$.Error});break}case L:D((0,t.jsx)(ei,{cart:Q.getCart,onClose:U})),y&&y();break;case i:D((0,t.jsx)(P,{cart:Q.getCart,onClose:()=>n()})),y&&y();break;default:{let e=g.m.checkout(N?g.TK.MarketplaceBuyNowCart:g.TK.BuyNowCart);_.push("".concat(e,"&material=").concat(a));let i=Q.getCart;(0,ee.e8)({products:i,pageName:T,isMarketplace:N})}}},[Q]),(0,n.useEffect)(()=>{var e;if(!Y)return;let a=B.formatMessage(d.A.TECHNICAL_DIFFICULTIES),{errors:i}=(0,j.Mw)(Y);(null===(e=i[0])||void 0===e?void 0:e.code)||(a=B.formatMessage(o.A.GENERIC_ERROR)),M({open:!0,message:a,variant:W.m$.Error})},[Y]),(0,t.jsxs)(t.Fragment,{children:[V&&(0,t.jsx)(r.A,{open:!0,hideBackdrop:!0,children:(0,t.jsx)($.A,{})}),(0,t.jsx)(l.A,{className:(0,s.A)(I.buyNowButton,{[I.buyNowButtonMobile]:!R}),color:"secondary",fullWidth:!R||b,onClick:J,size:m,variant:"outlined",disabled:C,children:(0,t.jsx)(u.A,{...z})})]})}},88373:(e,a,i)=>{i.d(a,{cG:()=>u,kN:()=>c});var t=i(28888);i(37876);var n=i(82897);i(14232);var r=i(54431),l=i(78248);function s(){let e=(0,t._)(["\n query CountryStates($country: String!, $locale: String!) {\n getCountryStates(country: $country, locale: $locale) {\n countryCode\n locale\n stateCode\n stateName\n }\n}\n "]);return s=function(){return e},e}let o={},d=(0,n.J1)(s());function c(e){let a={...o,...e};return r.IT(d,a)}function u(e){let a={...o,...e};return l._(d,a)}},92827:(e,a,i)=>{i.d(a,{D:()=>d});var t=i(37876);i(14232);var n=i(61261),r=i(12197),l=i(49995),s=i(61206);let o=(0,n.A)(e=>({mainContent:{display:"flex"},stackedAndCentered:{display:"flex",alignItems:"center",flexDirection:"column",textAlign:"center"},mainContentImage:{height:88,width:88,flexShrink:0,borderRadius:4,border:"1px solid ".concat(e.palette.grey[400]),textAlign:"center",backgroundColor:e.palette.common.white,overflow:"hidden"},image:{position:"relative",top:"50%",transform:"translateY(-50%)",maxHeight:"100%",maxWidth:"100%",width:"auto",height:"auto"},mainContentText:{width:"100%",display:"flex",flexDirection:"column",marginLeft:e.spacing(6)},productNumber:{color:e.palette.primary.main,fontSize:e.typography.pxToRem(16),fontWeight:e.typography.fontWeightBold,lineHeight:1.5,textTransform:"uppercase"},productName:{maxHeight:66,fontSize:e.typography.pxToRem(16),fontWeight:e.typography.fontWeightMedium,lineHeight:1.5,"& sup, sub":{verticalAlign:"baseline",position:"relative",top:"-0.4em"},"& sub":{top:"0.1em"}},productBrand:{fontSize:e.typography.pxToRem(12),fontWeight:e.typography.fontWeightMedium,lineHeight:1.25},clampLines:{display:"-webkit-box","-webkit-box-orient":"vertical","-webkit-line-clamp":"2",overflow:"hidden",wordBreak:"break-word",textOverflow:"ellipsis"},mainContentHeight:{height:120},vr1:{marginBottom:e.spacing(1)},vr2:{marginBottom:e.spacing(2)}})),d=e=>{let{productNumber:a,brand:i,name:n,description:d,image:c,isRaisedCardLayout:u,displayDiscount:m,discount:p,productSku:h,additionalInfo:v}=e,x=h||a,g=!(null==x?void 0:x.startsWith("CB_")),A=o();return(0,t.jsxs)("div",{className:(0,l.A)(A.mainContent,{[A.stackedAndCentered]:u,[A.mainContentHeight]:!!p||!!v}),children:[c&&(0,t.jsx)("div",{className:A.mainContentImage,children:(0,t.jsx)("img",{className:A.image,src:c.mediumUrl,alt:c.altText||d||n,width:"112",height:"50"})}),u&&(0,t.jsx)("div",{className:A.vr2}),(0,t.jsxs)("div",{className:(0,l.A)({[A.mainContentText]:!u,[A.stackedAndCentered]:u}),children:[(0,t.jsx)(r.A,{className:A.productBrand,children:i.name}),g&&(0,t.jsx)(r.A,{className:A.productNumber,children:x}),u&&(0,t.jsx)("div",{className:A.vr1}),(0,t.jsx)(r.A,{className:(0,l.A)(A.productName,A.clampLines),children:(0,t.jsx)(s.A,{value:n})}),p&&m&&m(p),v]})]})}}}]); //# sourceMappingURL=4633-8e9070db855eb099.js.map