PageSourceSearch

https://selltrade.theproscloset.com/_next/static/chunks/pages/submissions/[id]-4459e5f108dbb560.js

js theproscloset.com collected 2026-09-24 21:14:34 UTC 81,141 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[751],{28842:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/submissions/[id]",function(){return t(46694)}])},44876:function(e,n,t){"use strict";t.d(n,{Z:function(){return x}});var r=t(47568),i=t(26042),o=t(69396),s=t(34051),a=t.n(s),l=t(85893),c=t(67294),d=t(87600),u=t(81323),p=["403","API key","quota","billing","permission"];var m=t(62461),f=function(e){var n=e.value,t=e.onChange,s=e.onAddressSelect,f=e.label,x=e.required,h=void 0!==x&&x,v=e.error,g=void 0!==v&&v,y=e.helperText,b=e.placeholder,j=void 0===b?"Start typing your address...":b,S=e.disabled,C=void 0!==S&&S,T=(0,c.useRef)(null),_=(0,c.useState)(n),I=_[0],k=_[1],E=(0,c.useState)(!1),D=E[0],A=E[1],w=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=(0,u.kY)("places"),s=(0,c.useRef)(null),l=(0,c.useRef)(0),d=(0,c.useRef)({isInProgress:!1,shouldStop:!1,lastProcessedInput:"",lastError:null,requestId:0}),m=(0,c.useRef)({isProcessing:!1,selectedStreetAddress:""}),f=(0,c.useState)([]),x=f[0],h=f[1],v=(0,c.useState)(!1),g=v[0],y=v[1],b=(0,c.useState)(null),j=b[0],S=b[1],C=(0,c.useCallback)((function(e){var n=d.current,r=n.isInProgress,i=n.shouldStop,o=n.lastProcessedInput,s=m.current,a=s.isProcessing,l=s.selectedStreetAddress;return!t||i||r||a||l===e||o===e}),[t]),T=(0,c.useCallback)((function(e){return p.some((function(n){return e.includes(n)}))}
1),[]),_=(0,c.useCallback)((function(e,n){n===d.current.requestId&&(h(e.suggestions),l.current=e.suggestions.length,y(!1),d.current.lastError=null),d.current.isInProgress=!1}),[]),I=(0,c.useCallback)((function(e,n){if(n===d.current.requestId){var t=e.message||"Failed to fetch suggestions";if(console.error("Error fetching autocomplete suggestions:",t),d.current.lastError===t)return void(d.current.isInProgress=!1);S(t),y(!1),d.current.lastError=t,T(t)&&(d.current.shouldStop=!0,console.warn("STOPPING ALL FUTURE API CALLS due to persistent error:",t))}d.current.isInProgress=!1}),[T]),k=(0,c.useCallback)(function(){var e=(0,r.Z)(a().mark((function e(n){var t,r,i,o,l;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t="AIzaSyDM3XsKjjNOXUjyoFu0Z2_WKMDTa-QlA6I"){e.next=4;break}return console.error("Google Maps API key not configured"),e.abrupt("return",null);case 4:return e.prev=4,i=null===(r=s.current)||void 0===r?void 0:r.token,o="https://places.googleapis.com/v1/places/".concat(n,"?sessionToken=").concat(i),e.next=10,fetch(o,{method:"GET",headers:{"Content-Type":"application/json","X-Goog-Api-Key":t,"X-Goog-FieldMask":"addressComponents,formattedAddress,location"}});case 10:if((l=e.sent).ok){e.next=13;break}throw new Error("Place details request failed: ".concat(l.status," ").concat(l.statusText));case 13:return s.current=null,e.next=16,l.json();case 16:return e.abrupt("return",e.sent);case 19:return e.prev=19,e.t0=e.catch(4),console.error("Error fetching place details:",e.t0),e.abrupt("return",null);case 23:case"end":return e.stop()}}),e,null,[[4,19]])})));return function(n){return e.apply(this,arguments)}}(),[]),E=(0,c.useCallback)((function(e){if(t&&!C(e)){d.current.isInProgress=!0,d.current.lastProcessedInput=e;var r=t.AutocompleteSessionToken,a=t.AutocompleteSuggestion;s.current||(s.current=new r);var c=(0,o.Z)((0,i.Z)({},n),{input:e,sessionToken:s.current});if(""===e)return l.current>0&&(h([]),l.current=0),S(null),void(d.current.isInProgress=!1);var u=++d.current.requestId;y(!0),S(null),a.fetchAutocompleteSuggestions(c).then((function(e){return _(e,u)})).catch((function(e){return I(e,u)}))}}),[t,n,C,_,I]);(0,c.useEffect)((function(){if(""===e)return h([]),S(null),void(d.current.lastProcessedInput="");e.trim().length<3||m.current.isProcessing||E(e)}),[e,E]);var D=(0,c.useCallback)((function(){s.current=null,h([]),S(null),y(!1),d.current={isInProgress:!1,shouldStop:!1,lastProcessedInput:"",lastError:null,requestId:0},m.current={isProcessing:!1,selectedStreetAddress:""},l.current=0}),[]),A=(0,c.useCallback)((function(e){m.current.isProcessing=!0,m.current.selectedStreetAddress=e.split(",")[0].trim(),d.current.lastProcessedInput="",setTimeout((function(){m.current.isProcessing=!1,m.current.selectedStreetAddress=""}),1e3)}),[]);return{suggestions:x,isLoading:g,error:j,resetSession:D,markSelectionProcessing:A,getPlaceDetails:k}}(I,{includedPrimaryTypes:["street_address"],includedRegionCodes:["us"]}),Z=w.suggestions,O=w.isLoading,N=w.error,P=w.markSelectionProcessing,L=w.getPlaceDetails;(0,c.useEffect)((function(){k(n)}),[n]);var R=(0,c.useCallback)((function(e){var n=e.target.value;k(n),t(n),n.trim().length>2?A(!0):A(!1)}),[t]),B=(0,c.useCallback)(function(){var e=(0,r.Z)(a().mark((function e(n){var r,i,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(A(!1),!n.placePrediction){e.next=11;break}return r=n.placePrediction.placeId,i=n.placePrediction.text.text,P(i),k(i),t(i),e.next=9,(0,m.W7)(r,L);case 9:(o=e.sent)&&(null===s||void 0===s||s(o));case 11:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),[t,s,P,L]),F=(0,c.useCallback)((function(){setTimeout((function(){A(!1)}),200)}),[]),M=(0,c.useCallback)((function(){Z.length>0&&A(!0)}),[Z.length]);return(0,l.jsxs)(d.Box,{position:"relative",children:[(0,l.jsx)(d.TextField,{fullWidth:!0,required:h,label:f,value:I,onChange:R,onBlur:F,onFocus:M,error:g||!!N,helperText:N||y,placeholder:O?"Loading suggestions...":j,disabled:C,inputRef:T}),D&&Z.length>0&&(0,l.jsx)(d.Box,{sx:{position:"absolute",top:"100%",left:0,right:0,zIndex:1e3,maxHeight:200,overflow:"auto",border:"1px solid #e0e0e0",borderRadius:"4px",boxShadow:"0 2px 4px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",padding:"8px"},children:(0,l.jsx)(d.List,{dense:!0,children:Z.map((function(e){var n,t;return(0,l.jsx)(d.ListItemButton,{onClick:function(){return B(e)},children:(0,l.jsx)(d.ListItemText,{primary:null===(n=e.placePrediction)||void 0===n?void 0:n.text.text})},(null===(t=e.placePrediction)||void 0===t?void 0:t.placeId)||Math.random())}))})})]})},x=function(e){var n="AIzaSyDM3XsKjjNOXUjyoFu0Z2_WKMDTa-QlA6I";return(0,l.jsx)(u.un,{apiKey:n,libraries:["places"],children:(0,l.jsx)(f,(0,i.Z)({},e))})}},43101:function(e,n,t){"use strict";var r=t(26042),i=t(69396),o=t(99534),s=t(29815),a=t(85893),l=t(42443),c=t(87600),d=t(67294);n.Z=function(e){var n=e.name,t=e.label,u=e.rows,p=void 0===u?l.oj:u,m=e.multiline,f=e.required,x=void 0!==f&&f,h=e.placeholder,v=e.maxLength,g=void 0===v?l.iw:v,y=e.sx,b=void 0===y?[]:y,j=e.defaultValue,S=e.pattern,
1C=e.errorMsg,T=e.readOnly,_=(e.isDealerRequired,(0,o.Z)(e,["name","label","rows","multiline","required","placeholder","maxLength","sx","defaultValue","pattern","errorMsg","readOnly","isDealerRequired"])),I=(0,d.useState)(!1),k=I[0],E=I[1],D=(0,d.useState)(j),A=D[0],w=D[1],Z=(m||T)&&{inputProps:{maxLength:m?g:void 0,readOnly:T}},O=S&&new RegExp(S),N=!O||A&&O.test(A.toString()),P=x?A&&N:N||!A;return(0,a.jsx)(c.TextField,(0,i.Z)((0,r.Z)({label:(0,a.jsxs)(a.Fragment,{children:[t,!x&&(0,a.jsx)("span",{children:" (optional)"})]}),sx:[{mt:1}].concat((0,s.Z)(Array.isArray(b)?b:[b]))},Z,_),{variant:"filled",name:n,multiline:m,rows:p,required:x,placeholder:h,onChange:function(e){return w(e.target.value)},onBlur:function(){return E(!0)},error:k&&!P,helperText:k&&!P?C:"",defaultValue:A,fullWidth:!0}))}},67642:function(e,n,t){"use strict";var r=t(26042),i=t(69396),o=t(85893),s=t(87600),a=t(42443);n.Z=function(e){var n=e.openAlert,t=e.setOpenAlert;return(0,o.jsx)(s.Snackbar,{open:n.open,autoHideDuration:a.pN,anchorOrigin:{vertical:"top",horizontal:"left"},onClose:function(){return t((0,i.Z)((0,r.Z)({},n),{open:!1}))},message:n.message,children:(0,o.jsx)("div",{children:(0,o.jsx)(s.Alert,{onClose:function(){return t((0,i.Z)((0,r.Z)({},n),{open:!1}))},severity:n.type||"info",sx:{width:"100%"},children:n.message})})})}},46694:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return ve},default:function(){return ge}});var r=t(85893),i=t(47438),o=t(18679),s=t(18435),a=t(87600),l=t(62461),c=t(26042),d=t(67294),u=t(25675),p=t.n(u),m=t(47568),f=t(69396),x=t(34051),h=t.n(x),v=t(26209),g=t(11163),y=(0,d.createContext)({}),b=function(e){var n=e.children,t=e.value,i=(0,d.useState)(t.submission),o=i[0],s=i[1],a=(0,d.useState)(!1),l=a[0],u=a[1],p=(0,d.useState)(),x=p[0],b=p[1],j=(0,d.useState)(),S=j[0],C=j[1],T=(0,g.useRouter)(),_=function(){var e=(0,m.Z)(h().mark((function e(n){var t,r;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),e.prev=1,e.next=5,(0,v.L9)(n);case 5:r=e.sent,(null===(t=r)||void 0===t?void 0:t.id)?(b(!0),s((function(e){return r||e}))):(console.error("We have an acceptance error"),C(r),b(!1),"Not Authorized"===r.error&&T.reload()),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),C({statusCode:500,error:"An unexpected error occured - please retry or reach out to support"}),console.error(e.t0);case 13:return e.prev=13,u(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,9,13,16]])})));return function(n){return e.apply(this,arguments)}}(),I=function(){var e=(0,m.Z)(h().mark((function e(n){var t,r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),e.prev=1,e.next=5,(0,v.Wm)(n);case 5:r=e.sent,(null===(t=r)||void 0===t?void 0:t.id)?(b(!0),s((function(e){return r||e}))):(console.error("We have a consignment cancellation error"),C(r),b(!1),"Not Authorized"===(null===(i=r)||void 0===i?void 0:i.error)&&T.reload()),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),C({statusCode:500,error:"An unexpected error occured - please retry or reach out to support"}),console.error(e.t0);case 13:return e.prev=13,u(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,9,13,16]])})));return function(n){return e.apply(this,arguments)}}(),k=function(){var e=(0,m.Z)(h().mark((function e(n,t,r){var i,o,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u(!0),e.prev=1,e.next=5,(0,v.xA)(n,t,r);case 5:o=e.sent,(null===(i=o)||void 0===i?void 0:i.id)?(b(!0),s((function(e){return o||e}))):(console.error("We have a consignment cancellation error"),C(o),b(!1),"Not Authorized"===(null===(a=o)||void 0===a?void 0:a.error)&&T.reload()),e.next=13;break;case 9:e.prev=9,e.t0=e.catch(1),C({statusCode:500,error:"An unexpected error occured - please retry or reach out to support"}),console.error(e.t0);case 13:return e.prev=13,u(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[1,9,13,16]])})));return function(n,t,r){return e.apply(this,arguments)}}();return(0,r.jsx)(y.Provider,{value:(0,f.Z)((0,c.Z)({},t),{isActionContainerLoading:l,actionSucceeded:x,actionError:S,submission:o,setSubmission:s,submitOfferAcceptance:_,submitConsignmentCancellationRequest:I,cancelConsignmentCancellationRequest:k}),children:n})},j=function(){return(0,d.useContext)(y)},S=t(42443),C=function(){var e=j(),n=e.submission,t=e.submissionDetailVie
1wSettings.submissionSettings,i=t.descriptionLabel,o=t.infoLabel,s=t.noDescriptionText,u=t.notesLabel,m=t.noNotesText,f=n.Items[0],x=f.description,h=f.Images,v=n.Notes,g=void 0===v?[]:v,y=(0,d.useState)(0),b=y[0],C=y[1],T=function(e){var n=e.currentTarget.id;C(Number.parseInt(n,10))};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Typography,{component:"h2",variant:"h6",sx:{pb:2,mb:3,borderBottom:1,borderBottomColor:"divider"},children:o}),(0,r.jsx)(a.Box,{sx:{mb:3},children:h.map((function(e,n){return(0,r.jsx)(a.Box,{id:"".concat(n),onClick:T,sx:{cursor:"pointer",position:"relative",height:n===b?"250px":"64px",width:"100%",mb:1,filter:n===b?"":"saturate(0)",opacity:n===b?1:.5,transition:function(e){return"all ".concat(e.transitions.defaults.standard)}},children:(0,r.jsx)(p(),{alt:"Submission photo ".concat(n+1),src:e.url,layout:"fill",objectFit:"cover"})},e.url)}))}),(0,r.jsx)(a.Accordion,{defaultExpanded:Boolean(x),id:"description",header:i,size:"small",children:x?(0,r.jsx)(a.Typography,{variant:"body2",children:x}):(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"body2",children:s})}),(0,r.jsx)(a.Accordion,{defaultExpanded:Boolean(g.length>0),id:"notes",header:u,size:"small",children:g.length>0?g.map((function(e,t){var i=e.note,o=e.created,s=e.type,d=s===S.FE;return(0,r.jsxs)(a.Box,{sx:(0,c.Z)({display:"flex",flexDirection:"column"},d?{alignItems:"flex-start",mr:3}:{alignItems:"flex-end",ml:3}),children:[(0,r.jsx)(a.Typography,{component:"p",fontFamily:"bold",variant:"caption",sx:{mb:.25},children:d?"TPC Buyer":n.firstName}),(0,r.jsx)(a.Box,{dangerouslySetInnerHTML:{__html:i},sx:{backgroundColor:"grey.50",mb:.5,p:1.5,maxWidth:"360px"}}),(0,r.jsx)(a.Typography,{component:"p",variant:"caption",color:"text.secondary",sx:{mb:2},children:(0,l.o0)(o)})]},"".concat(n.id,"-note-").concat(s,"-").concat(t))})):(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"body2",children:m})})]})},T=t(828),_=t(5814),I=t(86099),k=t(67642),E=t(79661),D=t(14924),A=t(69353),w=function(e){return(0,D.Z)({},"@container (min-width: 700px)",{".offer-options--list &":(0,c.Z)({},e)})},Z=function(e){return(0,D.Z)({},"@container (min-width: 315px)",(0,c.Z)({},e))},O=function(e){var n=e.id,t=e.label,i=e.infoBox,o=e.description,s=e.onClick,u=e.selected,p=e.value,m=e.featured,x=e.difference,h=e.consignmentDetailsViewSettings,v=e.consignmentProperties,g=(0,d.useState)(!1),y=g[0],b=g[1],j=(0,d.useState)(null),S=j[0],C=j[1],T=function(){b((function(e){return!e}))},k=(0,d.useState)(!1),E=k[0],D=k[1],O=(0,d.useState)(null),N=O[0],P=O[1],L=function(){D((function(e){return!e}))};return(0,r.jsx)(a.Box,{sx:{height:"100%",containerType:"inline-size"},children:(0,r.jsxs)(a.Box,{component:"button",id:n,onClick:s,sx:(0,f.Z)((0,c.Z)({display:"grid",gridTemplateAreas:"\n            'title'\n            'description'\n            'value'\n            'button'\n          ",gridTemplateColumns:"1fr auto",alignItems:"center",justifyContent:"space-between",rowGap:2,position:"relative",width:"100%",height:"100%",px:3,py:2,border:2,borderColor:"divider",textAlign:"center",bgcolor:"common.white",cursor:"pointer",transition:function(e){return e.transitions.defaults.standard},WebkitTapHighlightColor:"transparent"},Z({gridTemplateAreas:"\n            'title value'\n            'description description'\n            'button button'\n          ",gap:2,textAlign:"initial"}),w({gridTemplateAreas:"\n                'title value button'\n                'description value button'\n              ",rowGap:0,alignItems:"center",textAlign:"left"}),u&&{bgcolor:"grey.50",cursor:"pointer",color:"text.primary",borderColor:m?"electricBlue.main":"primary.main"}),{"&:hover":{bgcolor:"grey.50"}}),children:[!!m&&(0,r.jsx)(a.Typography,{sx:(0,c.Z)({position:"absolute",top:0,left:"50%",px:1.5,py:.5,borderRadius:function(e){return e.rounded.full},transform:"translate(-50%, -50%)",color:u?"electricBlue.contrastText":"grey.50",backgroundColor:u?"electricBlue.main":"grey.700"},w({left:a.echelonTheme.spacing(3),transform:"translate(0, -50%)"})),variant:"caption",children:m}),(0,r.jsxs)(a.Typography,{variant:"h6",color:"text.primary",sx:(0,c.Z)({gridArea:"title",justifySelf:"center"},Z({fontSize:"typography.body1.fontSize",justifySelf:"flex-start"})),children:[t," ",i&&(0,r.jsx)(a.InfoCircleIcon,{onClick:function(e){return P(e.currentTarget),void L()}})]}),i&&(0,r.jsx)(a.Popover,{open:E,onClose:function(){C(null),L()},anchorEl:N,anchorReference:"anchorEl",anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{horizontal:"center",vertical:"top"},sx:{mx:0},children:(0,r.jsx)(a.Box,{sx:{alignItems:"center",padding:1,border:1,width:{xs:"100%",sm:"22rem"}},children:(0,r.jsx)(_.YI,{value:i,components:I.Z})})}),"string"===typeof o?(0,r.jsx)(a.Typography,{variant:"body2",color:"text.secondary",sx:(0,c.Z)({gridArea:"description",justifySelf:"center"},Z({justifySelf:"flex-start"})),children:o}):(0,r.jsx)(a.Box,{color:"text.secondary",sx:(0,c.Z)({gridArea:"description",justifySelf:"center"},Z({justifySelf:"flex-start"}
1)),children:(0,r.jsx)(_.YI,{value:o,components:I.Z})}),(0,r.jsxs)(a.Box,{sx:(0,c.Z)({display:"flex",alignItems:"center",gap:1,gridArea:"value",justifySelf:"center",flexDirection:"row"},w({flexDirection:"row-reverse"}),Z({justifySelf:"flex-end",flexDirection:"row-reverse"})),children:[!v&&(0,r.jsx)(a.Typography,{variant:"h5",color:"text.primary",sx:function(e){return(0,c.Z)({},Z({fontSize:e.typography.h6.fontSize}))},children:(0,l.xG)(p)}),!v&&x&&(0,r.jsx)(a.Typography,{variant:"caption",sx:(0,c.Z)({color:"grey.100",backgroundColor:"grey.700",px:1,py:.25,fontFamily:"bold",borderRadius:function(e){return e.rounded.full}},x<0&&{color:"crimson.shades.700",bgcolor:"crimson.shades.100"},x>0&&{color:"secondary.shades.700",bgcolor:"secondary.shades.100"}),children:x>0?"+".concat(x,"%"):"".concat(x,"%")}),v&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.Typography,{children:[(0,r.jsx)(a.Typography,{variant:"h5",color:"text.primary",sx:function(e){return{fontSize:e.typography.body2.fontSize}},children:"Up to"}),(0,r.jsxs)(a.Typography,{variant:"h5",color:"text.primary",sx:function(e){return(0,c.Z)({},Z({fontSize:e.typography.h6.fontSize}))},children:["".concat((0,l.xG)(v.estimatedPaymentRange.maximumPayment)),(0,r.jsx)(a.InfoCircleIcon,{onClick:function(e){return C(e.currentTarget),void T()}})]})]}),(0,r.jsx)(a.Popover,{open:y,onClose:function(){C(null),T()},anchorEl:S,anchorReference:"anchorEl",anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{horizontal:"right",vertical:"top"},sx:{mx:0},children:(0,r.jsx)(A.Z,{consignorSplit:v.consignorSplit,consignmentPeriodDays:v.consignmentPeriodDays,estimatedPaymentRange:v.estimatedPaymentRange,fallbackAmount:v.fallbackAmount,consignmentDetailsViewSettings:h})})]})]}),(0,r.jsxs)(a.Button,{color:u?"primary":"inherit",variant:"contained",startIcon:u?(0,r.jsx)(a.CheckCircleIcon,{}):null,fullWidth:!0,component:"div",sx:function(e){return(0,c.Z)({gridArea:"button",mixBlendMode:"multiply",minWidth:100,px:0,height:"100%",maxHeight:42,pointerEvents:u?"none":"auto",borderRadius:"21px",transition:e.transitions.defaults.standard},u&&{marginInline:e.spacing(-3),width:"calc(100% + ".concat(e.spacing(6),")"),borderRadius:0},w((0,c.Z)({".MuiButton-startIcon":{display:"none"},width:"auto"},u&&{marginInline:"auto",marginBlock:e.spacing(-3),height:"calc(100% + ".concat(e.spacing(6),")"),maxHeight:"none",width:"auto",borderRadius:0,display:"flex",flexDirection:"column"})))},children:[u&&(0,r.jsx)(a.CheckCircleIcon,{sx:(0,c.Z)({display:"none",position:"absolute",transform:"translateY(".concat(a.echelonTheme.spacing(-1.5),")")},w({display:"inline-block"}))}),(0,r.jsx)(a.Box,{sx:(0,c.Z)({},w((0,c.Z)({},u&&{transform:"translateY(".concat(a.echelonTheme.spacing(1.5),")")}))),children:u?"Selected":"Select"})]})]})})},N=t(87536),P=t(75027),L=function(e){var n,t=e.activeStepIndex,i=e.control,o=e.offers,s=e.onOfferClick,l=e.selectedOfferType,u=e.selectedOfferId,p=j(),m=p.submission.Dealer,x=p.submissionDetailViewSettings,h=x.submissionSettings.consignmentDetailsViewSettings,v=x.acceptanceModal.offerSelection,g=v.paypalEmailLabel,y=v.paypalEmailValidationText,b=v.dealerLocationLabel,C=v.dealerLocationButton,T=v.dealerLocationValidationText,_=(0,N.bc)({control:i,name:"paypalEmail",rules:{required:{value:0===t&&!!l&&S.om.includes(l),message:y},pattern:{value:S.u,message:y}}}),I=_.field,k=_.fieldState.error,E=null===k||void 0===k?void 0:k.message,A=(0,N.bc)({control:i,name:"dealer",rules:{required:{value:0===t&&!!l&&S.Uw.includes(l),message:T}}}),w=A.field,Z=A.fieldState.error,L=null===Z||void 0===Z?void 0:Z.message,R=function(e){w.onChange(e)};return m&&m.name!==(null===w||void 0===w||null===(n=w.value)||void 0===n?void 0:n.name)&&R(m),(0,r.jsx)(a.Box,{sx:{width:"100%",display:"grid",gap:1,mt:2,containerType:"inline-size",gridTemplateColumns:o.length>3?"1fr":"repeat(auto-fill, minmax(".concat(S.Lu,"px, 1fr))")},className:o.length>3?"offer-options--list":"",children:o.map((function(e){var n,t,i,o,p,x,v=e.label,y=e.infoBox,j=e.price,T=e.type,_=e.description,k=e.difference,A=e.featured,N=e.consignmentProperties,B=e.id;return j?(0,r.jsxs)(d.Fragment,{children:[(0,r.jsx)(O,{id:T,label:v,infoBox:y,description:_,onClick:s,selected:B===u,value:j,featured:A,difference:k,consignmentDetailsViewSettings:h,consignmentProperties:N}),S.om.includes(T)&&l===T&&(0,r.jsx)(a.Box,{sx:(x={order:1,width:"50%",test:"".concat(2*S.Lu,"px) + ").concat(a.echelonTheme.spacing(1)),gridColumn:"1 / -1"},(0,D.Z)(x,"@container (max-width: calc(".concat(2*S.Lu,"px + ").concat(a.echelonTheme.spacing(1),"))"),{order:"initial",width:"100%"}),(0,D.Z)(x,".offer-options--list &",{order:"initial",width:"100%"}),x),children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},I),{error:!!E,helperText:E,label:g,sx:{my:1.5,width:"100%",maxWidth:"350px"}}))}),S.Uw.includes(T)&&l===T&&(0,r.jsxs)(a.Box,{sx:(0,D.Z)({order:1,width:"100%",gridColumn:"1 / -1"},"@container (max-width: calc(".concat(2*S.Lu,"px + ").concat(a.echelonTheme.spacing(1),"))"),{order:"initial"}),children:[(0,r.jsx)(a.Box,{sx:{my:2},children:(!!w.value||(null===m||void 0===m?void 0:m.active))&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Typography,{variant:"overline",color:"text.secondary",children:b}),(0,r.jsx)(a.Typography,{variant:"h6",children:null===w||void 0===w||null===(n=w.value)||void 0===n?void 0:n.name}),(0,r.jsx)(a.Typography,{variant:"body2",children:null===w||void 0===w||null===(t=w.value)||void 0===t?void 0:t.address}),(0,r.jsxs)(a.Typography,{variant:"body2",children:[null===w||void 0===w||null===(i=w.value)||void 0===i?void 0:i.city,", ",null===w||void 0===w||null===(o=w.value)||void 0===o?void 0:o.state," ",null===w||void 0===w||null===(p=w.value)||void 0===p?void 0:p.zip]})]})}),(0,r.jsx)(a.Box,{children:Z&&(0,r.jsx)(a.Typography,{sx:{color:a.echelonTheme.palette.error.main,mt:2},variant:"body2",children:L})}),!(null===m||void 0===m?void 0:m.active)&&(0,r.jsx)(P.Z,{onDealerSelect:R,dealerLocationButton:C})]})]},T):null}))})},R=t(19971),B=function(e){var n=e.disabled,t=e.identityStatusDisplayOptions,i=e.verificationStatus,o=e.underEighteen,s=void 0!==o&&o,l=e.veriffUrl,d=e.isMobile,u=e.loading,p=e.handleClick,m=(0,f.Z)((0,c.Z)({},I.Z),{marks:(0,f.Z)((0,c.Z)({},I.Z.marks),{variableLink:function(e){var n=e.value.variable,t=e.children;return l&&"veriffLink"===n?(0,r.jsx)(a.Link,{href:l,target:S.j,children:t}):t}})}),x=function(e,n,t){if(n)return e.underEighteen;var r=t?["resubmission_requested","inflow_completed"].includes(t)?"fallback":t:"default";return e&&e[r]}
1(t,s,i),h=u?null===x||void 0===x?void 0:x.loadingButton:null===x||void 0===x?void 0:x.staticButton,v=u?null===x||void 0===x?void 0:x.loadingStatusMsg:null===x||void 0===x?void 0:x.staticStatusMsg,g="string"===typeof v?(0,r.jsx)(a.Typography,{sx:{mb:2},children:v}):(0,r.jsx)(a.Box,{sx:{mb:2},children:(0,r.jsx)(_.YI,{value:v,components:m})});return x?(0,r.jsxs)(r.Fragment,{children:[g,(i!==S.br||!s)&&(0,r.jsx)(a.Button,{color:"primary",fullWidth:d,onClick:p,disabled:n||x.disableStaticButton,sx:{mb:2},children:(0,r.jsxs)(r.Fragment,{children:[u&&(h.icon?(0,r.jsx)(R.Z,(0,c.Z)({},h.icon)):(0,r.jsx)(a.CircularProgress,{color:"inherit",size:24})),h.text]})})]}):(0,r.jsx)(a.Box,{children:(0,r.jsxs)(a.Typography,{sx:{mb:2},children:["An unexpected error occurred - please contact customer support"," - ",(0,r.jsx)(a.Link,{href:"mailto:[email protected]",children:"[email protected]"})]})})},F=t(60977),M=function(e){var n=e.onVerificationApproved,t=j(),i=t.fakeIDV,o=t.submissionDetailViewSettings.acceptanceModal.identityVerification,s=o.verifiedNote,l=o.nonVerifiedNote,c=o.identityStatusDisplayOptions,u=t.veriffCookie,p=(0,a.useMediaQuery)(a.echelonTheme.breakpoints.down("md")),f=(0,d.useState)(!1),x=f[0],g=f[1],y=(0,d.useState)(null===u||void 0===u?void 0:u.status),b=y[0],C=y[1],T=(0,d.useState)(null===u||void 0===u?void 0:u.underEighteen),k=T[0],E=T[1],D=(0,d.useState)(),A=D[0],w=D[1],Z=function(){var e=(0,m.Z)(h().mark((function e(n){var t,r,o,s,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),g(!0),e.next=4,(0,v.ai)();case 4:if(t=e.sent,!i){e.next=19;break}return console.log("fakeIDV::".concat(i)),e.next=9,(0,v.En)(null===t||void 0===t?void 0:t.vendorData,null===t||void 0===t?void 0:t.id);case 9:return e.next=11,(0,v.EF)(S.px.ID,!0);case 11:r=e.sent,o=r.decision,s=r.underEighteen,C(o),E(s),g(!1),e.next=20;break;case 19:t?(w(t.url),a=(0,F.f)({url:t.url,onEvent:function(){var e=(0,m.Z)(h().mark((function e(n){var r,i,o,s,a,l;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=void 0,e.t0=n,e.next=e.t0===F.X.STARTED?4:e.t0===F.X.CANCELED?6:e.t0===F.X.FINISHED?12:29;break;case 4:return r=setInterval((0,m.Z)(h().mark((function e(){var n;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v.eR)(t.validationType);case 2:(n=e.sent)&&C(n);case 4:case"end":return e.stop()}}),e)}))),3e3),e.abrupt("break",29);case 6:return e.next=8,(0,v.eR)(t.validationType);case 8:return(i=e.sent)&&C(i),g(!1),e.abrupt("break",29);case 12:return r&&clearInterval(r),e.next=15,(0,v.EF)(t.validationType);case 15:if(o=e.sent,s=o.decision,a=o.underEighteen,E(a),!s){e.next=23;break}C(s),g(!1),e.next=28;break;case 23:return e.next=25,(0,v.eR)(t.validationType);case 25:(l=e.sent)&&C(l),g(!1);case 28:return e.abrupt("break",29);case 29:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),onReload:function(){a.close(),window.location.reload()}})):(console.log({type:"error",message:"Error calling Veriff",open:!0}),g(!1));case 20:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),O=(null===u||void 0===u?void 0:u.validationType)===S.px.BIOMETRIC?{severity:"success",text:s,color:a.echelonTheme.palette.success.light}:{severity:"info",text:l,color:a.echelonTheme.palette.info.light};return(0,d.useEffect)((function(){b===S.br&&n(!0,k)}),[n,b,k]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Alert,{severity:O.severity,sx:{mb:2},children:O.text&&(0,r.jsx)(_.YI,{value:O.text,components:I.Z})}),(0,r.jsx)(B,{handleClick:Z,isMobile:p,loading:x,underEighteen:k,verificationStatus:b,veriffUrl:A,identityStatusDisplayOptions:c})]})},G=t(1132),V=t(23972),q=function(e,n){var t,r,i,o,s,a,c,d;if("BRAND"===e)return n.Items[0].brand;if("MODEL"===e)return n.Items[0].model;if("CREDIT_PRICE"===e)return(0,l.ur)(n.ActiveOfferGroup.Offers,S.m_.CREDIT);if("CASH_PRICE"===e)return(0,l.ur)(n.ActiveOfferGroup.Offers,S.m_.CASH);if("PROMO_CASH_PRICE"===e)return(0,l.ur)(n.ActiveOfferGroup.Offers,S.m_.PROMO_CASH);if("TRADE_IN_PRICE"===e)return(0,l.ur)(n.ActiveOfferGroup.Offers,S.m_.TRADE);if("DELAYED_30_PRICE"===e)return(0,l.ur)(n.ActiveOfferGroup.Offers,S.m_.DELAYED_CASH_30D);if("DELAYED_45_PRICE"===e)return(0,l.ur)(n.ActiveOfferGroup.Offers,S.m_.DELAYED_CASH_45D);if("DELAYED_60_PRICE"===e)return(0,l.ur)(n.ActiveOfferGroup.Offers,S.m_.DELAYED_CASH_60D);if("CONSIGNMENT_PRICE"===e)return(0,l.QJ)(n.ActiveOfferGroup.Offers);if("CUSTOMER_FIRST_NAME"===e)return n.firstName;if("CUSTOMER_PAYPAL_EMAIL"===e)return null===(t=n.AcceptedOffer)||void 0===t||null===(r=t.customer_payment_details)||void 0===r?void 0:r.paypal_email;if("SUBMISSION_TYPE"===e)return(0,l.jc)(n);if("TRACKING_NUMBER"===e)return n.trackingNumber;if("RETURN_TRACKING_NUMBERS"===e)return null===(i=n.SubmissionReturns)||void 0===i?void 0:i.map((function(e){return e.shippingTrackingNumber})).join(" ,");if("CREDIT_PRICE_RANGE"===e)return(0,l.$9)(n.ActiveOfferGroup.Offers,S.m_.CREDIT);if("CASH_PRICE_RANGE"===e)return(0,l.$9)(n.ActiveOfferGroup.Offers,S.m_.CASH);if("TRADEUP_PRICE_RANGE"===e)return(0,l.$9)(n.ActiveOfferGroup.Offers,S.m_.TRADE);if("DELAYED_30_PRICE_RANGE"===e)return(0,l.$9)(n.ActiveOfferGroup.Offers,S.m_.DELAYED_CASH_30D);if("DELAYED_45_PRICE_RANGE"===e)return(0,l.$9)(n.ActiveOfferGroup.Offers,S.m_.DELAYED_CASH_45D);if("DELAYED_60_PRICE_RANGE"===e)return(0,l.$9)(n.ActiveOfferGroup.Offers,S.m_.DELAYED_CASH_60D);if("TRADEUP_DEALER_NAME"===e)return n.Dealer?n.Dealer.name:"No Trade Dealer";if("TRADEUP_DEALER_PHONE"===e)return n.Dealer?n.Dealer.phone:"";if("TRADEUP_DEALER_EMAIL"===e)return n.Dealer?n.Dealer.contactEmail:"";if("TRADEUP_DEALER_ADDRESS"===e)return n.Dealer?"".concat(n.Dealer.address," ").concat(n.Dealer.city,", ").concat(n.Dealer.state," ").concat(n.Dealer.zip):"";if("CONSIGNMENT_MAX_DAYS"===e)return null===(o=n.ActiveOfferGroup.Offers.find((function(e){return e.consignor_split})))||void 0===o?void 0:o.OfferPaymentTerm.days_till_due;if("CONSIGNMENT_SPLIT"===e){var u,p,m=null===(u=n.ActiveOfferGroup.Offers.find((function(e){return e.consignor_split})))||void 0===u?void 0:u.consignor_split;return null!==(p=m&&(0,l.rl)(m))&&void 0!==p?p:"zz.zz%"}if("CONSIGNMENT_SALE_PRICE"===e){var f,x,h,v,g,y=null===(f=n.ActiveOfferGroup.Offers.find((function(e){return e.consignor_split})))||void 0===f||null===(x=f.customer_payment_details)||void 0===x||null===(h=x.consignment_details)||void 0===h||null===(v=h.sale_details)||void 0===v?void 0:v.sale_price_usd;return null!==(g=y&&(0,l.xG)(y))&&void 0!==g?g:"$x,xxx.xx"}if("CONSIGNMENT_AMOUNT_PAID"===e){var b,j,C,T,_,I=null===(b=n.ActiveOfferGroup.Offers.find((function(e){return e.consignor_split})))||void 0===b||null===(j=b.customer_payment_details)||void 0===j||null===(C=j.consignment_details)||void 0===C||null===(T=C.sale_details)||void 0===T?void 0:T.consignor_payment_amount_usd;return null!==(_=I&&(0,l.xG)(I))&&void 0!==_?_:"$y,yyy.yy"}if("CONSIGNMENT_DATE_SOLD"===e){var k,E,D,A,w,Z=null===(k=n.ActiveOfferGroup.Offers.find((function(e){return e.consignor_split})))||void 0===k||null===(E=k.customer_payment_details)||void 0===E||null===(D=E.consignment_details)||void 0===D||null===(A=D.sale_details)||void 0===A?void 0:A.date_sold;return null!==(w=Z&&(0,l.p6)(Z))&&void 0!==w?w:"Month Day, Year"}return"CONSIGNMENT_CANCEL_TRACKING_NUMBER"===e?null!==(c=null===(s=n.ConsignmentCancellation)||void 0===s?void 0:s.shippingTrackingNumber)&&void 0!==c?c:"No Ship Tracking Number availalble":"CONSIGNMENT_CANCEL_DRAFT_ORDER_ID"===e?null!==(d=null===(a=n.ConsignmentCancellation)||void 0===a?void 0:a.shopifyDraftOrderId)&&void 0!==d?d:"Not Shopify Consignment Return Order Found":void 0},z=function(e,n,t){if("TRACKING_URL"===e)return(0,r.jsx)(a.Link,{href:t.trackingUrl,target:"_blank",children:n});var i,o,s,l;if("CONSIGNMENT_CANCEL_TRACKING_URL"===e)return(null===(i=t.ConsignmentCancellation)||void 0===i?void 0:i.shippingTrackingUrl)?(0,r.jsx)(a.Link,{href:null===(o=t.ConsignmentCancellation)||void 0===o?void 0:o.shippingTrackingUrl,target:"_blank",children:n}):(0,r.jsxs)(V.Z,{children:[n," - link not yet available"]});if("CONSIGNMENT_CANCEL_DRAFT_INVOICE_ORDER_URL"===e)return(null===(s=t.ConsignmentCancellation)||void 0===s?void 0:s.shopifyDraftOrderInvoiceUrl)?(0,r.jsx)(a.Link,{href:null===(l=t.ConsignmentCancellation)||void 0===l?void 0:l.shopifyDraftOrderInvoiceUrl,target:"_blank",children:n}):(0,r.jsxs)(V.Z,{children:[n," - link not yet available"]});if("SHIPPING_LABEL_URL"===e)return(0,r.jsx)(a.Link,{href:t.shippingLabelUrl,target:"_blank",children:n});if("ITEM_PDP_URL"===e){var c,d=(null===(c=t.shopifyProduct)||void 0===c?void 0:c.shopifyHandle)?"http://".concat("the-pros-closet.myshopify.com","/products/").concat(t.shopifyProduct.shopifyHandle,"?utm_source=consignment_listings&utm_medium=referral&utm_campaign=us_x:ecomm_y:bau_a:pros_b:brd_c:20240611_d:consignment_listings_o:bike_z:link&utm_content=consignment_listing_link"):void 0;return d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Link,{href:d,target:"_blank",children:n}),(0,r.jsx)(a.Tooltip,{title:"Copy Sale Page URL",children:(0,r.jsx)(a.IconButton,{size:"small",onClick:function(e){e.preventDefault(),navigator.clipboard.writeText(d)},children:(0,r.jsx)(G.Z,{fontSize:"small"})})})]}):null}return null},W=function(e,n){return n&&"SELECTED_OFFER_PRICE"===e?n.consignmentProperties?"".concat((0,l.rl)(n.consignmentProperties.consignorSplit)," of the sale price"):(0,l.xG)(n.price):n&&"SELECTED_OFFER_TYPE"===e?n.label:e},U=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if("FAILED_IMAGES"===e){var t=n.reduce((function(e,n){return n.imageUrl1&&e.push(n.imageUrl1),n.imageUrl2&&e.push(n.imageUrl2),e}),[]);
1return(0,r.jsx)(a.Box,{component:"span",sx:{display:"flex",flexDirection:{xs:"column",md:"row"},gap:2,width:{xs:"250px",md:"600px"}},children:t.map((function(e,n){return(0,r.jsx)(a.Box,{component:"span",sx:{position:"relative",width:"100%"},children:(0,r.jsx)(p(),{alt:"Failed Submission photo ".concat(n+1),src:e,layout:"responsive",width:"280px",height:"280px",objectFit:"contain"})},"failed-image-".concat(n))}))})}return null},H=function(e){var n=e.control,t=e.selectedOffer,i=j().submissionDetailViewSettings.acceptanceModal.offerAcceptedSuccess,o=i.sellerNotesSettings,s=i.successMessage,l=(0,f.Z)((0,c.Z)({},I.Z),{marks:(0,f.Z)((0,c.Z)({},I.Z.marks),{variable:function(e){return e.children.map((function(e){return W(e,t)}))}})}),d=(0,N.bc)({control:n,name:"sellerNote"}).field;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_.YI,{value:s,components:l}),(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},d),{fullWidth:!0,label:o.label,multiline:o.multiline,placeholder:o.placeholder,rows:o.rows,sx:{mt:2}}))]})},Y=function(e){var n=e.activeStepIndex,t=e.dooStepIndex,i=e.control,o=e.onCheckboxChange,s=e.submissionType,l=n===t,u=j(),p=u.submission,m=p.type,x=p.partnerSiteId,h=u.submissionDetailViewSettings.acceptanceModal.declarationOfOwnership,v=h.legalCheckboxes,g=v.header,y=v.checkboxes,b=h.checkboxesValidationText,C=h.serialNumberLabel,T=h.serialNumberValidationText,k=(0,d.useState)(!1),E=k[0],D=k[1],A=x===S.q7,w=(0,N.bc)({control:i,name:"serialNumber",rules:{minLength:1,pattern:{value:S.kR,message:T},required:{value:l&&s!==S.qO.GEAR,message:T}}}),Z=w.field,O=w.fieldState.error,P=(0,N.bc)({control:i,name:"legalCheckboxes",rules:{validate:{value:function(e){var n=y.filter((function(e){return e.display[m]})).every((function(n,t){return e[t]}));return l&&!n?b:void 0}}}}),L=P.field,R=P.fieldState.error;return(0,d.useEffect)((function(){D(A&&!!Z.value)}),[]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Typography,{sx:{mb:2},children:g}),y.map((function(e,n){var t=L.value[n];return e.display[m]?(0,r.jsx)(a.Checkbox,{checked:t,error:!t&&!!(null===R||void 0===R?void 0:R.message),helperText:t?"":null===R||void 0===R?void 0:R.message,label:(0,r.jsx)(_.YI,{value:e.text,components:I.Z}),onChange:function(){var e=L.value;e[n]=!L.value[n],o("legalCheckboxes",e)}},n):null})),m!==S.qO.GEAR&&(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},Z),{disabled:E,error:!!(null===O||void 0===O?void 0:O.message),helperText:null===O||void 0===O?void 0:O.message,label:C,sx:{my:1.5,width:{xs:"100%",sm:"50%"}}}))]})},X=function(e){var n=e.activeStepIndex,t=e.ctStepIndex,i=e.control,o=e.onCheckboxChange,s=e.submissionType,l=n===t,c=j(),d=c.submission.type,u=c.submissionDetailViewSettings.acceptanceModal.consignmentTerms,p=u.consignmentTermsLegalText,m=u.ctLegalCheckboxes,f=m.header,x=m.checkboxes,h=u.checkboxesValidationText,v=(0,N.bc)({control:i,name:"ctLegalCheckboxes",rules:{validate:{value:function(e){var n=x.filter((function(e){return e.display[d]})).every((function(n,t){return e[t]}));return l&&!n?h:void 0}}}}),g=v.field,y=v.fieldState.error;return[S.qO.WHEEL].includes(s)?(0,r.jsx)(a.Box,{children:(0,r.jsx)(a.Typography,{sx:{mb:2},children:"Invalid submission type for consignment"})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Typography,{sx:{mb:2},children:f}),(0,r.jsx)(a.Box,{sx:{mb:2},children:(0,r.jsx)(_.YI,{value:p,components:I.Z})}),x.map((function(e,n){var t,i=null===(t=g.value)||void 0===t?void 0:t[n];return e.display[d]?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(a.Checkbox,{checked:i,error:!i&&!!(null===y||void 0===y?void 0:y.message),helperText:i?"":null===y||void 0===y?void 0:y.message,label:(0,r.jsx)(_.YI,{value:e.text,components:I.Z}),onChange:function(){var e,t=g.value;t[n]=!(null===(e=g.value)||void 0===e?void 0:e[n]),o("ctLegalCheckboxes",t)}},n)}):null}))]})},K=t(59562),$=t(13876),Q=function(e){var n,t,i,o=e.actionDisplayName,s=(0,d.useState)(null),u=s[0],p=s[1],x=(0,d.useState)({message:"",open:!1}),g=x[0],y=x[1],b=function(e){e.preventDefault(),p(null)},C=Boolean(u),_=C?"consignment-step-label-popover":void 0,I=j(),D=I.isActionContainerLoading,w=I.actionError,Z=I.actionSucceeded,O=I.sellerCookie,P=I.setSubmission,R=I.submitOfferAcceptance,B=I.submission,F=I.submissionDetailVie
1wSettings,G=F.submissionSettings.consignmentDetailsViewSettings,V=F.acceptanceModal,q=V.title,z=V.editSubmitButtonText,W=V.errorMessageText,U=V.offerSelection,Q=U.button.text,J=U.label.text,ee=U.paypalEmailLabel,ne=U.paypalEmailValidationText,te=U.dealerLocationLabel,re=U.dealerLocationValidationText,ie=U.title,oe=V.consignmentTerms,se=oe.button.text,ae=oe.label.text,le=oe.ctLegalCheckboxes.checkboxes,ce=oe.title,de=oe.summary,ue=V.declarationOfOwnership,pe=ue.button.text,me=ue.label.text,fe=ue.legalCheckboxes.checkboxes,xe=ue.serialNumberLabel,he=ue.title,ve=ue.serialNumberValidationText,ge=ue.summary,ye=V.identityVerification,be=ye.button.text,je=ye.label.text,Se=ye.title,Ce=V.offerAcceptedSuccess,Te=Ce.button.text,_e=Ce.label.text,Ie=Ce.title,ke=V.offerTypeOptions,Ee=V.differenceBase,De=V.featuredOffer,Ae=V.featuredOfferLabel,we=I.veriffCookie,Ze=(0,K.b)().customer,Oe=(0,d.useState)(!1),Ne=Oe[0],Pe=Oe[1],Le=(0,T.Z)((0,E._)("".concat(B.id,"-isIdentityVerified"),!1),2),Re=Le[0],Be=Le[1],Fe=(0,T.Z)((0,E._)("".concat(B.id,"-isUnderEighteen"),!!(null===we||void 0===we?void 0:we.underEighteen)),2),Me=Fe[0],Ge=Fe[1],Ve=(0,T.Z)((0,E._)("".concat(B.id,"-activeStepIndex"),0),2),qe=Ve[0],ze=Ve[1],We=(0,T.Z)((0,E._)("".concat(B.id,"-completedStepIndex"),-1),2),Ue=We[0],He=We[1],Ye=(0,T.Z)((0,E._)("".concat(B.id,"-ctLegalCheckboxes"),le.map((function(){return!1}))),2),Xe=Ye[0],Ke=Ye[1],$e=(0,T.Z)((0,E._)("".concat(B.id,"-legalCheckboxes"),fe.map((function(){return!1}))),2),Qe=$e[0],Je=$e[1],en=(0,T.Z)((0,E._)("".concat(B.id,"-serialNumber"),B.serialNumber||""),2),nn=en[0],tn=en[1],rn=(0,T.Z)((0,E._)("".concat(B.id,"-sellerNote"),""),2),on=rn[0],sn=rn[1],an=(0,d.useMemo)((function(){return(0,l.cS)(B)}),[B]),ln=(0,d.useMemo)((function(){return ke.reduce((function(e,n){var t=n.description,r=n.enabled,i=n.id,o=n.title,s=n.infoBox,a=B.ActiveOfferGroup.Offers.find((function(e){return e.offer_type_name===i}));if(a&&a.available_to_seller&&r){var l=parseFloat(a.amount_usd),c=Ee?an[Ee]:0,d=[S.m_.CONSIGNMENT_V1].includes(a.offer_type_name),u=a.consignor_split?{consignorSplit:a.consignor_split,consignmentPeriodDays:a.OfferPaymentTerm.days_till_due,estimatedPaymentRange:a.estimatedPaymentRange,fallbackAmount:d?a.amount_usd:void 0}:void 0;e.push({id:a.id,label:o,infoBox:s,description:t,price:l,type:a.offer_type_name,featured:De===a.offer_type_name?Ae:void 0,difference:l&&c&&c!==l?Math.floor(100*(l/c-1)):void 0,consignmentProperties:u})}return e}),[])}),[an,Ee,De,Ae,ke,B.ActiveOfferGroup.Offers]),cn=(0,T.Z)((0,E._)("".concat(B.id,"-selectedOffer"),!1),2),dn=cn[0],un=cn[1],pn=(0,N.cI)({defaultValues:{paypalEmail:(null===O||void 0===O?void 0:O.paypalEmail)||"",dealer:(null===O||void 0===O?void 0:O.dealer)||void 0,ctLegalCheckboxes:Xe,legalCheckboxes:Qe,serialNumber:B.serialNumber||"",sellerNote:on},mode:"onSubmit"}),mn=pn.handleSubmit,fn=pn.control,xn=pn.getValues,hn=pn.resetField,vn=pn.setError,gn=pn.setValue,yn=pn.formState.errors,bn=(0,d.useMemo)((function(){return qe<=Ue}),[qe,Ue]),jn=(0,d.useMemo)((function(){return dn&&dn.consignmentProperties,1}),[dn]),Sn=(0,d.useMemo)((function(){return dn&&dn.consignmentProperties?2:1}),[dn]),Cn=(0,d.useMemo)((function(){return dn&&dn.consignmentProperties?3:2}),[dn]),Tn=(0,d.useMemo)((function(){return dn&&dn.consignmentProperties?4:3}),[dn]),_n=(0,d.useMemo)((function(){var e;return{available_offers:an,submission_brand:B.Items[0].brand,submission_id:B.id,submission_model:B.Items[0].model,submission_type:B.type,submission_year:(null===(e=B.Items[0])||void 0===e?void 0:e.year)||void 0}}),[an,B]),In=(0,d.useCallback)((function(e,n){Be(e),Ge(n)}),[Be,Ge]),kn=(0,d.useCallback)((function(){var e=window.localStorage.getItem("".concat(B.id,"-selectedOffer"));e&&dn&&!ln.find((function(e){return e.id===(null===dn||void 0===dn?void 0:dn.id)}))?un(!1):e||un(ln.find((function(e){return e.type===De}))||ln[0]),Pe(!0)}),[De,ln,dn,un,B]),En=(0,d.useCallback)((function(){Pe(!1),He(qe-1)}),[qe,He]),Dn=(0,d.useCallback)(function(){var e=(0,m.Z)(h().mark((function e(n){var t,r,i,o,s,a;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=n.legalCheckboxes,r=n.ctLegalCheckboxes,i=n.paypalEmail,o=n.serialNumber,s=n.dealer,a=n.sellerNote,e.next=3,(0,v.kH)((0,f.Z)((0,c.Z)({},O),{paypalEmail:i,dealer:s}));case 3:if(Ke(r),Je(t),tn(o),sn(a),qe!==Tn||!R||!dn){e.next=12;break}return e.next=10,R({offerId:dn.id,sellerNote:a,serialNumber:o,submission:B});case 10:e.next=34;break;case 12:if(0!==qe||!dn||!S.om.includes(dn.type)){e.next=18;break}return hn("dealer"),e.next=16,(0,v.kH)((0,f.Z)((0,c.Z)({},O),{paypalEmail:i,dealer:void 0}));case 16:e.next=33;break;case 18:if(0!==qe||!dn||!S.Uw.includes(dn.type)){e.next=24;break}return hn("paypalEmail"),e.next=22,(0,v.kH)((0,f.Z)((0,c.Z)({},O),{paypalEmail:void 0,dealer:s}));case 22:e.next=33;break;case 24:if(0!==qe||void 0!==dn){e.next=28;break}return e.abrupt("return");case 28:if(0!==qe){e.next=33;break}return hn("paypalEmail"),hn("dealer"),e.next=33,(0,v.kH)((0,f.Z)((0,c.Z)({},O),{paypalEmail:void 0,dealer:void 0}));case 33:ze((function(e){var n=0===e?0:Ue;return 0===e?He(0):e>Ue&&He(e),bn?n+1:e+1}));case 34:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),[O,Ke,Je,tn,sn,qe,Tn,R,B,dn,ze,hn,Ue,bn,He]);(0,d.useEffect)((function(){dn&&Z&&"undefined"!==typeof window.localStorage&&(window.localStorage.removeItem("".concat(B.id,"-isIdentityVerified")),window.localStorage.removeItem("".concat(B.id,"-activeStepIndex")),window.localStorage.removeItem("".concat(B.id,"-completedStepIndex")),window.localStorage.removeItem("".concat(B.id,"-selectedOffer")),window.localStorage.removeItem("".concat(B.id,"-ctLegalCheckboxes")),window.localStorage.removeItem("".concat(B.id,"-legalCheckboxes")),window.localStorage.removeItem("".concat(B.id,"-serialNumber")),window.localStorage.removeItem("".concat(B.id,"-sellerNote")),window.localStorage.removeItem("".concat(B.id,"-isUnderEighteen")),(0,v.kH)((0,f.Z)((0,c.Z)({},O),{paypalEmail:void 0,dealer:void 0})))}),[Ze,Z,dn,O,B,_n]),(0,d.useEffect)((function(){if(w){console.error("[Error] Server Side error ".concat(w.statusCode,":  ").concat(w.error));var e="There was an issue submiting your offer acceptance.";switch(w.statusCode){case S.xM:e="There was an issue with your ID verification, please reverify and try again.",Be(!1),In(!1,!1),ze(Cn);break;
1case S.y3:w.error.includes("Serial Number")?(e="A serial number is required when accepting an offer on a bike or frame.",ze(Sn),vn("serialNumber",{type:"required",message:ve},{shouldFocus:!0})):w.error.includes("PayPal")?(e="A PayPal email address is required when accepting a cash based offer.",ze(0),vn("paypalEmail",{type:"required",message:ne},{shouldFocus:!0})):w.error.includes("Dealer")?(e="You must select a participating bike dealer when accepting a TradeUp offer.",ze(0),vn("dealer",{type:"required",message:re},{shouldFocus:!0})):w.error===S.er&&(e="Your offers have been updated, please reselect the offer you want to accept.",un(!1),ze(0));break;case S.ii:e="An error has occured, please reselect the offer you want to accept.",un(!1),ze(0)}y({type:"error",message:"[Error] ".concat(e),open:!0})}}),[w,re,Sn,Cn,ne,ve,ze,vn,In,Be,un,P,B]),(0,d.useEffect)((function(){if(!dn&&!D){var e=function(){var e=(0,m.Z)(h().mark((function e(n){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=P,e.next=3,(0,v.g3)(n);case 3:e.t1=e.sent,(0,e.t0)(e.t1);case 5:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}();e(B.id),ze(0),w||y({type:"warning",message:"Your offers have been updated, please reselct your offer",open:!0})}}),[w,D,dn,ze,P,B.id]);var An=(0,d.useCallback)((function(e){dn?dn.type!==e.currentTarget.id&&un(ln.find((function(n){return n.type===e.currentTarget.id}))):un(ln.find((function(n){return n.type===e.currentTarget.id})))}),[ln,dn,un]),wn=(0,d.useMemo)((function(){var e,n,t={title:ie,label:J,content:(0,r.jsx)(L,{activeStepIndex:qe,control:fn,offers:ln,onOfferClick:An,selectedOfferType:dn?null===dn||void 0===dn?void 0:dn.type:void 0,selectedOfferId:dn?dn.id:void 0}),summary:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"caption",children:"Offer"}),dn&&(null===dn||void 0===dn?void 0:dn.consignmentProperties)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.Typography,{component:"span",fontFamily:"bold",children:[(0,r.jsx)(a.Typography,{variant:"body2",children:"Up to "}),(0,l.xG)(dn.consignmentProperties.estimatedPaymentRange.maximumPayment)," - ".concat(dn.label)]}),(0,r.jsxs)(a.Link,{sx:{px:0,display:"flex",alignItems:"center"},onClick:function(e){return function(e){e.preventDefault(),p(e.currentTarget)}(e)},children:[(null===(e=G.consignmentDetailPopoverButton.echelonIcon)||void 0===e?void 0:e.icon)&&(0,r.jsx)($.Z,{echelonIcon:G.consignmentDetailPopoverButton.echelonIcon}),G.consignmentDetailPopoverButton.text&&(0,r.jsx)(a.Typography,{sx:{ml:1},variant:"caption",children:G.consignmentDetailPopoverButton.text})]}),(0,r.jsx)(a.Popover,{id:_,open:C,anchorEl:u,onClose:b,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:(0,r.jsx)(A.Z,{consignorSplit:dn.consignmentProperties.consignorSplit,consignmentPeriodDays:dn.consignmentProperties.consignmentPeriodDays,estimatedPaymentRange:dn.consignmentProperties.estimatedPaymentRange,fallbackAmount:dn.consignmentProperties.fallbackAmount,consignmentDetailsViewSettings:G})})]}):dn?(0,r.jsxs)(a.Typography,{component:"span",fontFamily:"bold",children:[(0,l.xG)(dn.price)," - ",dn.label]}):(0,r.jsxs)(a.Typography,{component:"span",variant:"body2",children:["Your offers have been updated.",(0,r.jsx)("br",{}),"Reselect your offer"]}),dn&&S.om.includes(dn.type)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Typography,{color:"text.secondary",sx:{mt:1},variant:"caption",children:ee}),(0,r.jsx)(a.Typography,{fontFamily:"bold",children:xn("paypalEmail")})]}),dn&&S.Uw.includes(dn.type)&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"caption",sx:{mt:1},children:"".concat(te," ")}),(0,r.jsx)(a.Typography,{fontFamily:"bold",children:null===(n=xn("dealer"))||void 0===n?void 0:n.name})]})]}),buttonText:Q,isEditable:!0},i={title:ce,label:ae,content:(0,r.jsx)(X,{activeStepIndex:qe,ctStepIndex:jn,control:fn,onCheckboxChange:gn,submissionType:B.type}),summary:de?(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"caption",children:de}):null,buttonText:se,isEditable:!0},o={title:he,label:me,content:(0,r.jsx)(Y,{activeStepIndex:qe,dooStepIndex:Sn,selectedOfferType:dn?dn.type:void 0,control:fn,onCheckboxChange:gn,submissionType:B.type}),summary:B.type!==S.qO.GEAR&&(0,r.jsxs)(r.Fragment,{children:[ge&&(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"caption",children:ge}),(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"caption",children:xe}),(0,r.jsx)(a.Typography,{fontFamily:"bold",children:nn})]}),buttonText:pe,isEditable:!0},s={title:Se,label:je,content:(0,r.jsx)(M,{onVerificationApproved:In}),buttonText:be,isEditable:!1,summary:void 0},c={title:Ie,label:_e,content:(0,r.jsx)(H,{control:fn,selectedOffer:dn||void 0}),buttonText:Te,isEditable:!1,summary:void 0};return dn&&dn.consignmentProperties?[t,i,o,s,c]:[t,o,s,c]}),[ie,J,qe,fn,ln,An,dn,G,_,C,u,ee,xn,te,Q,ce,ae,jn,gn,B.type,de,se,he,me,Sn,ge,xe,nn,pe,Se,je,In,be,Ie,_e,Te]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Button,{color:"primary",onClick:kn,sx:{width:{xs:"100%",sm:"auto"}},children:o}),(0,r.jsxs)(a.Dialog,{"aria-labelledby":"modal-title",open:Ne,fullWidth:!0,onClose:En,sx:{"& .MuiDialog-paper":{display:"flex",justifyContent:"center",flexDirection:{xs:"column",md:"row"},maxWidth:"1300px",height:"100%",maxHeight:{xs:"100%",sm:"800px"}}},fullScreen:!0,children:[(0,r.jsxs)(a.Box,{sx:{bgcolor:{md:"grey.100"},flex:{xs:1,md:"none"},overflowY:"auto",p:{xs:2,md:3}},children:[(w||!dn)&&(0,r.jsx)(k.Z,{openAlert:(0,f.Z)((0,c.Z)({},g),{type:"error"}),setOpenAlert:y}),(0,r.jsx)(a.Typography,{component:"h2",id:"modal-title",sx:{mb:1,typography:{xs:"h5",sm:"h3"}},children:q}),(0,r.jsx)(a.Stepper,{activeStep:qe,orientation:"vertical",children:wn.map((function(e,n){return e&&(0,r.jsxs)(a.Step,{completed:n<=Ue,children:[(0,r.jsx)(a.StepLabel,{StepIconProps:{sx:{color:bn&&n!==qe?function(e){return"".concat(e.palette.action.disabled," !important")}:""}},children:(0,r.jsxs)(a.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(a.Typography,{noWrap:!0,variant:"body2",children:e.label}),e.isEditable&&(0,r.jsx)(a.Button,{onClick:function(){return ze(n)},size:"small",sx:{opacity:bn||n>Ue?0:1,pointerEvents:bn||n>Ue?"none":"auto"},tabIndex:bn||n>Ue?-1:0,variant:"outlined",children:"Edit"})]})}),(0,r.jsx)(a.StepContent,{sx:{display:{md:"none"}},TransitionProps:{unmountOnExit:!1},children:e.content}),e.summary&&Ue>=n&&(0,r.jsx)(a.Box,{sx:{pl:2.5,pt:1,ml:1.5,borderLeft:1,borderColor:"grey.400",display:"flex",flexDirection:"column"},children:e.summary})]},e.label)}))})]}),(0,r.jsxs)(a.Box,{sx:{height:{md:"100%"},width:"100%",display:"flex",flexDirection:"column"},children:[(0,r.jsxs)(a.Box,{sx:{pt:10,pb:3,px:8,flex:1,display:{xs:"none",md:"flex"},flexDirection:"column",overflowY:"auto",alignItems:"flex-start"},children:[(0,r.jsx)(a.Typography,{component:"h3",variant:"h6",sx:{mb:2},children:null===(n=wn[qe])||void 0===n?void 0:n.title}),null===(t=wn[qe])||void 0===t?void 0:t.content]}
1),(qe!==Cn||Re&&!Me)&&(0,r.jsxs)(a.Box,{sx:{p:2,borderTop:1,borderColor:"divider",display:"flex",alignItems:"center",justifyContent:Object.keys(yn).length>0?"space-between":"flex-end",width:"100%"},children:[Object.keys(yn).length>0&&(0,r.jsx)(a.Typography,{color:"error.main",variant:"caption",children:W}),(0,r.jsx)(a.Button,{color:"primary",disabled:D||!dn,startIcon:D?(0,r.jsx)(a.CircularProgress,{color:"inherit",size:16}):null,onClick:mn(Dn),children:bn?z:null===(i=wn[qe])||void 0===i?void 0:i.buttonText})]})]})]})]})},J=t(41664),ee=t.n(J),ne=t(13779),te=t(91749),re=t.n(te),ie=t(44876),oe=(0,d.forwardRef)((function(e,n){return(0,r.jsx)(re(),(0,c.Z)({guide:!1,mask:S.N_},e))})),se=function(e){var n,t,i=e.activeStepIndex,o=e.thisStepIndex,s=e.control,l=j().submissionDetailViewSettings.cancelConsignmentModal.cancelConsignmentAddress.addressForm,d=l.firstNameLabel,u=l.lastNameLabel,p=l.addressLabel,m=l.addressPlaceholder,x=l.address2Label,h=l.cityLabel,v=l.postalCodeLabel,g=l.postalCodeValidationMessage,y=l.stateLabel,b=l.phoneLabel,C=l.phoneValidationMessage,T=l.countryLabel,_=l.countries,I=l.addressFormValidationMessage,k=i===o,E=(0,N.bc)({control:s,name:"address.country",rules:{required:{value:k,message:I}}}),D=E.field,A=E.fieldState,w=(0,N.bc)({control:s,name:"address.phone",rules:{minLength:S.tA,maxLength:S.tA,required:{value:k,message:C}}}),Z=w.field,O=w.fieldState,P=(0,N.bc)({control:s,name:"address.firstName",rules:{required:{value:k,message:I}}}),L=P.field,R=P.fieldState,B=(0,N.bc)({control:s,name:"address.lastName",rules:{required:{value:k,message:I}}}),F=B.field,M=B.fieldState,G=(0,N.bc)({control:s,name:"address.address",rules:{required:{value:k,message:I}}}),V=G.field,q=G.fieldState,z=(0,N.bc)({control:s,name:"address.address2"}).field,W=(0,N.bc)({control:s,name:"address.city",rules:{required:{value:k,message:I}}}),U=W.field,H=W.fieldState,Y=(0,N.bc)({control:s,name:"address.state",rules:{required:{value:k,message:I}}}),X=Y.field,K=Y.fieldState,$=(0,N.bc)({control:s,name:"address.postalCode",rules:{required:{value:k,message:g},pattern:{value:S.Ze,message:g}}}),Q=$.field,J=$.fieldState;return(0,r.jsxs)(a.Grid,{container:!0,spacing:2,children:[_.length>1&&(0,r.jsx)(a.Grid,{item:!0,xs:12,children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},D),{fullWidth:!0,select:!0,label:T,error:A.invalid,helperText:A.invalid?I:"",children:null===_||void 0===_?void 0:_.map((function(e){return(0,r.jsx)(a.MenuItem,{value:e.value,children:e.text},e.value)}))}))}),(0,r.jsx)(a.Grid,{item:!0,xs:12,children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},Z),{fullWidth:!0,label:b,type:"tel",placeholder:"(000) 000-0000",InputLabelProps:{shrink:!0},InputProps:{inputComponent:oe},error:O.invalid,helperText:O.invalid?C:""}))}),(0,r.jsx)(a.Grid,{item:!0,xs:12,sm:6,children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},L),{fullWidth:!0,label:d,error:R.invalid,helperText:R.invalid?null===(n=R.error)||void 0===n?void 0:n.message:""}))}),(0,r.jsx)(a.Grid,{item:!0,xs:12,sm:6,children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},F),{fullWidth:!0,label:u,name:"lastName",type:"text",error:M.invalid,helperText:M.invalid?null===(t=M.error)||void 0===t?void 0:t.message:""}))}),(0,r.jsx)(a.Grid,{item:!0,xs:12,children:(0,r.jsx)(ie.Z,{value:V.value,onChange:function(e){V.onChange(e)},onAddressSelect:function(e){V.onChange(e.street),e.street2&&z.onChange(e.street2),U.onChange(e.city),X.onChange(e.state),Q.onChange(e.zip)},label:p,required:!0,error:q.invalid,helperText:q.invalid?I:"",placeholder:m||""})}),(0,r.jsx)(a.Grid,{item:!0,xs:12,children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},z),{fullWidth:!0,label:x}))}),(0,r.jsx)(a.Grid,{item:!0,xs:12,sm:5,children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},U),{fullWidth:!0,label:h,error:H.invalid,helperText:H.invalid?I:""}))}),(0,r.jsx)(a.Grid,{item:!0,xs:12,sm:3,children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},X),{fullWidth:!0,select:!0,label:y,"data-cy":"state-input",error:K.invalid,helperText:K.invalid?I:"",children:null===_||void 0===_?void 0:_.map((function(e){var n;return null===(n=e.states)||void 0===n?void 0:n.map((function(e){return(0,r.jsx)(a.MenuItem,{value:e.value,children:e.text},e.value)}))}))}))}),(0,r.jsx)(a.Grid,{item:!0,xs:12,sm:4,children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},Q),{fullWidth:!0,label:v,inputProps:{inputMode:"numeric",pattern:"[0-9]*"},error:J.invalid,helperText:J.invalid?g:""}))}),(0,r.jsx)(a.Grid,{item:!0,xs:12,children:(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},D),{fullWidth:!0,label:T,disabled:!0}))})]})},ae=function(e){var n=e.activeStepIndex,t=e.thisStepIndex,i=e.onCheckboxChange,o=e.control,s=n===t,l=j(),d=l.submission,u=l.submissionDetailVie
1wSettings.cancelConsignmentModal.cancelConsignmentTerms,p=u.legalCheckboxes,m=p.header,x=p.checkboxes,h=u.checkboxesValidationText,v=d.type,g=(0,f.Z)((0,c.Z)({},I.Z),{marks:(0,f.Z)((0,c.Z)({},I.Z.marks),{variable:function(e){return e.children.map((function(e){return q(e,d)}))},variableLink:function(e){var n=e.value.variable,t=e.children;return z(n,t,d)}})}),y=(0,N.bc)({control:o,name:"legalCheckboxes",rules:{validate:{value:function(e){var n=x.filter((function(e){return e.display[v]})).every((function(n,t){return e[t]}));return s&&!n?h:void 0}}}}),b=y.field,S=y.fieldState.error;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Typography,{sx:{mb:2},children:m}),x.map((function(e,n){var t,o=null===(t=b.value)||void 0===t?void 0:t[n];return e.display[v]?(0,r.jsx)(a.Checkbox,{checked:o,error:!o&&!!(null===S||void 0===S?void 0:S.message),helperText:o?"":null===S||void 0===S?void 0:S.message,label:(0,r.jsx)(_.YI,{value:e.text,components:g}),onChange:function(){var e,t=b.value;t[n]=!(null===(e=b.value)||void 0===e?void 0:e[n]),i("legalCheckboxes",t)}},n):null}))]})},le=function(e){var n=e.control,t=j().submissionDetailViewSettings.cancelConsignmentModal.cancelConsignmentSuccess,i=t.sellerNotesSettings,o=t.successMessage,s=(0,f.Z)((0,c.Z)({},I.Z),{marks:(0,f.Z)((0,c.Z)({},I.Z.marks),{variable:function(e){return e.children.map((function(e){return W(e)}))}})}),l=(0,N.bc)({control:n,name:"sellerNote"}).field;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_.YI,{value:o,components:s}),(0,r.jsx)(a.TextField,(0,f.Z)((0,c.Z)({},l),{fullWidth:!0,label:i.label,multiline:i.multiline,placeholder:i.placeholder,rows:i.rows,sx:{mt:2}}))]})},ce=function(e){var n,t,i,o=e.actionDisplayName,s=(0,K.b)().customer,u=(0,d.useState)(!1),p=u[0],x=u[1],v=(0,d.useState)({message:"",open:!1}),g=v[0],y=v[1],b=j(),C=b.isActionContainerLoading,T=b.actionError,E=b.actionSucceeded,D=b.submission,A=b.submitConsignmentCancellationRequest,w=b.submissionDetailViewSettings.cancelConsignmentModal,Z=w.title,O=w.processDescription,P=w.editSubmitButtonText,L=w.errorMessageText,R=w.cancelConsignmentAddress,B=w.cancelConsignmentTerms,F=B.title,M=B.button,G=B.label.text,V=B.legalCheckboxes.checkboxes,W=B.summary,U=w.cancelConsignmentSuccess,H=U.button,Y=U.label.text,X=U.title,$=(0,d.useMemo)((function(){return(0,f.Z)((0,c.Z)({},I.Z),{marks:(0,f.Z)((0,c.Z)({},I.Z.marks),{variable:function(e){return e.children.map((function(e){return q(e,D)}))},variableLink:function(e){var n=e.value.variable,t=e.children;return z(n,t,D)}})})}),[D]),Q=(0,d.useState)(-1),J=Q[0],ee=Q[1],ne=(0,d.useState)(0),te=ne[0],re=ne[1],ie=(0,d.useState)(V.map((function(){return!1}))),oe=ie[0],ce=ie[1],de=(0,d.useState)()[0],ue={country:"US",phone:(0,l.Cx)(null===D||void 0===D?void 0:D.phone),firstName:(null===D||void 0===D?void 0:D.firstName)||"",lastName:(null===D||void 0===D?void 0:D.lastName)||"",address:(null===D||void 0===D?void 0:D.address)||"",address2:"",city:(null===D||void 0===D?void 0:D.city)||"",state:(null===D||void 0===D?void 0:D.state)||"",postalCode:(null===D||void 0===D?void 0:D.zip)||""},pe=(0,N.cI)({defaultValues:{address:ue,legalCheckboxes:oe,sellerNote:de},mode:"onSubmit"}),me=pe.handleSubmit,fe=pe.control,xe=pe.formState.errors,he=pe.setError,ve=pe.setValue,ge=(0,pe.watch)("address"),ye=(0,d.useMemo)((function(){return[{title:"How to cancel your consignment",label:"Process Description",content:(0,r.jsx)(_.YI,{value:O,components:$}),isEditable:!1,summary:null,buttonText:"Begin"},{title:R.title,label:R.label.text,buttonText:R.button.text,content:(0,r.jsx)(se,{activeStepIndex:te,thisStepIndex:1,control:fe}),summary:(0,r.jsx)(a.Grid,{container:!0,alignItems:"center",children:(0,r.jsx)(a.Grid,{item:!0,xs:!0,children:(0,r.jsx)(a.Grid,{container:!0,spacing:2,children:(0,r.jsxs)(a.Grid,{item:!0,xs:!0,children:[(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"body2",children:"".concat(ge.firstName," ").concat(ge.lastName)}),(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"body2",children:ge.address}),ge.address2&&(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"body2",children:ge.address2})," ",(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"body2",children:"".concat(ge.city,", ").concat(ge.state," ").concat(ge.postalCode," ").concat(ge.country)}),(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"body2",children:ge.phone})]})})})}),isEditable:!0},{title:F,label:G,content:(0,r.jsx)(ae,{activeStepIndex:te,thisStepIndex:2,control:fe,onCheckboxChange:ve}),summary:W?(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"caption",children:W}):null,buttonText:M.text,isEditable:!1},{title:X,label:Y,content:(0,r.jsx)(le,{control:fe}),buttonText:H.text,isEditable:!1,summary:void 0}]}),[te,R.button.text,R.label.text,R.title,fe,W,ge.address,ge.address2,ge.city,ge.country,ge.firstName,ge.lastName,ge.phone,ge.postalCode,ge.state,O,ve,H.text,Y,X,M.text,G,F,$]),be=(0,d.useMemo)((function(){var e;return{submission_brand:D.Items[0].brand,submission_id:D.id,submission_model:D.Items[0].model,submission_type:D.type,submission_year:(null===(e=D.Items[0])||void 0===e?void 0:e.year)||void 0}}),[D]),je=(0,d.useMemo)((function(){return te<=J&&0!==te}),[te,J]),Se=(0,d.useCallback)(function(){var e=(0,m.Z)(h().mark((function e(n){var t,r,i;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=n.legalCheckboxes,r=n.address,i=n.sellerNote,ce(t),ee(te),re(te+1),3!==te||!r||!A){e.next=7;break}return e.next=7,A({submissionId:D.id,address:r,sellerNote:i});case 7:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),[te,D.id,A]);return(0,d.useEffect)((function(){if(T){var e=(0,l.Gr)(T.error)&&JSON.parse(T.error);console.error("[Error] Server Side error ".concat(T.statusCode,":  ").concat(T.error));var n="There was an issue submiting your consignment cancellation request.";switch(T.statusCode){case S.y3:n="Not all required fields have been completed.",re(0),null===e||void 0===e||e.error.details.map((function(e){switch(e.context.key){case"phone":he("address.phone",{type:"required",message:e.message},{shouldFocus:!0});break;case"firstName":he("address.firstName",{type:"required",message:e.message},{shouldFocus:!0});break;case"lastName":he("address.lastName",{type:"required",message:e.message},{shouldFocus:!0});break;case"address":he("address.address",{type:"required",message:e.message},{shouldFocus:!0});break;case"city":he("address.city",{type:"required",message:e.message},{shouldFocus:!0});break;case"state":he("address.state",{type:"required",message:e.message},{shouldFocus:!0});break;case"country":he("address.country",{type:"required",message:e.message},{shouldFocus:!0});break;case"zip":he("address.postalCode",{type:"required",message:e.message},{shouldFocus:!0})}}));break;case S.ii:n="An error has occured, please retry cancelling your consignment.",re(0)}y({type:"error",message:"[Error] ".concat(n),open:!0})}}),[T,E,s,re,he,D.id,be]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Button,{onClick:function(){return x(!0)},color:"primary",variant:"outlined",children:o}),(0,r.jsxs)(a.Dialog,{"aria-labelledby":"modal-title",open:p,fullWidth:!0,onClose:function(){return x(!1)}
1,sx:{"& .MuiDialog-paper":{display:"flex",justifyContent:"center",flexDirection:{xs:"column",md:"row"},maxWidth:"1300px",height:"100%",maxHeight:{xs:"100%",sm:"800px"}}},fullScreen:!0,children:[(0,r.jsxs)(a.Box,{sx:{maxWidth:{md:"30%",sm:"100%"},bgcolor:{md:"grey.100"},flex:{xs:1,md:"none"},overflowY:"auto",p:{xs:2,md:3}},children:[T&&(0,r.jsx)(k.Z,{openAlert:(0,f.Z)((0,c.Z)({},g),{type:"error"}),setOpenAlert:y}),(0,r.jsx)(a.Typography,{component:"h2",id:"modal-title",sx:{mb:1,typography:{xs:"h5",sm:"h3"}},children:Z}),(0,r.jsx)(a.Stepper,{activeStep:te,orientation:"vertical",children:ye.map((function(e,n){return e&&(0,r.jsxs)(a.Step,{completed:n<=J,children:[(0,r.jsx)(a.StepLabel,{StepIconProps:{sx:{color:je&&n!==te?function(e){return"".concat(e.palette.action.disabled," !important")}:""}},children:(0,r.jsxs)(a.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(a.Typography,{noWrap:!0,variant:"body2",children:e.label}),e.isEditable&&(0,r.jsx)(a.Button,{onClick:function(){return re(n)},size:"small",sx:{opacity:je||n>J?0:1,pointerEvents:je||n>J?"none":"auto"},tabIndex:je||n>J?-1:0,variant:"outlined",children:"Edit"})]})}),(0,r.jsx)(a.StepContent,{sx:{display:{md:"none"}},TransitionProps:{unmountOnExit:!1},children:e.content}),e.summary&&J>=n&&(0,r.jsx)(a.Box,{sx:{pl:2.5,pt:1,ml:1.5,borderLeft:1,borderColor:"grey.400",display:"flex",flexDirection:"column"},children:e.summary})]},e.label)}))})]}),(0,r.jsxs)(a.Box,{sx:{height:{md:"100%"},width:"100%",display:"flex",flexDirection:"column"},children:[(0,r.jsxs)(a.Box,{sx:{pt:10,pb:3,px:8,flex:1,display:{xs:"none",md:"flex"},flexDirection:"column",overflowY:"auto",alignItems:"flex-start"},children:[(0,r.jsx)(a.Typography,{component:"h3",variant:"h6",sx:{mb:2},children:null===(n=ye[te])||void 0===n?void 0:n.title}),null===(t=ye[te])||void 0===t?void 0:t.content]}),(0,r.jsxs)(a.Box,{sx:{p:2,borderTop:1,borderColor:"divider",display:"flex",alignItems:"center",justifyContent:Object.keys(xe).length>0?"space-between":"flex-end",width:"100%"},children:[Object.keys(xe).length>0&&(0,r.jsx)(a.Typography,{color:"error.main",variant:"caption",sx:{mr:3},children:L}),(0,r.jsx)(a.Button,{color:"primary",disabled:C&&Object.keys(xe).length>0,startIcon:C?(0,r.jsx)(a.CircularProgress,{color:"inherit",size:16}):null,onClick:me(Se),children:je?P:null===(i=ye[te])||void 0===i?void 0:i.buttonText})]})]})]})]})},de=function(e){var n=e.actionDisplayName,t=(0,K.b)().customer,i=(0,d.useState)(!1),o=i[0],s=i[1],l=(0,d.useState)({message:"",open:!1}),u=l[0],p=l[1],x=(0,d.useState)(""),v=x[0],g=x[1],y=j(),b=y.isActionContainerLoading,S=y.actionError,C=y.actionSucceeded,T=y.submission,I=y.cancelConsignmentCancellationRequest,E=y.submissionDetailViewSettings.cancelConsignmentCancelModal,D=E.title,A=E.sellerNotesSettings,w=E.submitButton,Z=E.processDescription,O=(0,d.useMemo)((function(){var e;return{submission_brand:T.Items[0].brand,submission_id:T.id,submission_model:T.Items[0].model,submission_type:T.type,submission_year:(null===(e=T.Items[0])||void 0===e?void 0:e.year)||void 0}}),[T]),N=(0,d.useCallback)((0,m.Z)(h().mark((function e(){var n,t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!I||!(null===(n=T.ConsignmentCancellation)||void 0===n?void 0:n.id)){e.next=4;break}return e.next=4,I(T.id,null===(t=T.ConsignmentCancellation)||void 0===t?void 0:t.id,v);case 4:case"end":return e.stop()}}),e)}))),[I,T,v]);return(0,d.useEffect)((function(){if(S){console.error("[Error] Server Side error ".concat(S.statusCode,":  ").concat(S.error));p({type:"error",message:"[Error] ".concat("There was an issue submiting your consignment cancellation request."),open:!0})}}),[S,C,t,T.id,O]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Button,{onClick:function(){return s(!0)},color:"primary",variant:"outlined",children:n}),(0,r.jsx)(a.Dialog,{"aria-labelledby":"modal-title",open:o,fullWidth:!0,onClose:function(){return s(!1)},sx:{"& .MuiDialog-paper":{display:"flex",justifyContent:"center",flexDirection:{xs:"column",md:"row"},width:{xs:"100%",sm:"50%"},height:{xs:"100%",sm:"80%"}}},fullScreen:!0,children:(0,r.jsxs)(a.Box,{sx:{flex:{xs:1,md:"none"},overflowY:"auto",width:"80%",p:2},children:[S&&(0,r.jsx)(k.Z,{openAlert:(0,f.Z)((0,c.Z)({},u),{type:"error"}),setOpenAlert:p}),(0,r.jsx)(a.Typography,{component:"h2",id:"modal-title",sx:{mb:1,typography:{xs:"h5",sm:"h3"}},children:D}),(0,r.jsxs)(a.Box,{children:[(0,r.jsx)(_.YI,{value:Z}
1),(0,r.jsx)(a.TextField,{value:v,onChange:function(e){return g(e.currentTarget.value)},fullWidth:!0,label:A.label,multiline:A.multiline,placeholder:A.placeholder,rows:A.rows,sx:{mt:2}})]}),(0,r.jsx)(a.Box,{sx:{p:2,borderTop:1,borderColor:"divider",display:"flex",alignItems:"center",justifyContent:"flex-end",width:"100%"},children:(0,r.jsx)(a.Button,{color:"primary",disabled:b,startIcon:b?(0,r.jsx)(a.CircularProgress,{color:"inherit",size:16}):null,onClick:function(){return N()},children:w.text})})]})})]})},ue=t(43101),pe=function(e){var n=e.shippingDimensionSettings,t=e.submissionId,i=e.existingSubmissionMetadata,o=j(),s=o.submission,l=o.setSubmission,u=(0,d.useState)(!1),p=u[0],x=u[1],g=(0,d.useRef)(null),y=function(){var e=(0,m.Z)(h().mark((function e(n,t){return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,v.Wt)(n,t);case 2:l((function(e){return(0,f.Z)((0,c.Z)({},e),{metadata:(0,c.Z)({},e.metadata,t)})}));case 3:case"end":return e.stop()}}),e)})));return function(n,t){return e.apply(this,arguments)}}(),b=function(){var e=(0,m.Z)(h().mark((function e(n){var t;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={shippingWidth:null,shippingHeight:null,shippingLength:null,calculatedSize:null},e.next=3,y(n,t);case 3:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),S=function(){var e=(0,m.Z)(h().mark((function e(n){var t,r,i,o,s,a,l,c,d,u,p,m;return h().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n.preventDefault(),(s=n.target).checkValidity()){e.next=5;break}return e.abrupt("return");case 5:if(a=parseFloat(null===(t=s.width)||void 0===t?void 0:t.value),l=parseFloat(null===(r=s.height)||void 0===r?void 0:r.value),c=parseFloat(null===(i=s.length)||void 0===i?void 0:i.value),0!=a&&0!=l&&0!=c){e.next=11;break}return console.log("In the invalid"),e.abrupt("return");case 11:return d=[a,l,c].sort((function(e,n){return e-n})),u=2*(d[0]+d[1])+d[2],p={shippingWidth:a,shippingHeight:l,shippingLength:c,calculatedSize:u},m=parseInt(null===(o=s.submissionId)||void 0===o?void 0:o.value),e.next=17,y(m,p);case 17:case"end":return e.stop()}}),e)})));return function(n){return e.apply(this,arguments)}}(),C=(0,f.Z)((0,c.Z)({},I.Z),{marks:(0,f.Z)((0,c.Z)({},I.Z.marks),{variable:function(e){return e.children.map((function(e){var n,t,r;return"WIDTH"===e?null===(n=s.metadata)||void 0===n?void 0:n.shippingWidth:"LENGTH"===e?null===(t=s.metadata)||void 0===t?void 0:t.shippingLength:"HEIGHT"===e?null===(r=s.metadata)||void 0===r?void 0:r.shippingHeight:q(e,s)}))},variableImages:function(e){return e.children.map((function(e){return U(e,s.SubmissionReturns)}))},variableLink:function(e){var n=e.value.variable,t=e.children;return z(n,t,s)}})}),T=(0,r.jsx)(a.Box,{children:(0,r.jsx)(_.YI,{value:n.messageAfterProvidingDimensions,components:C})});if(!(null===n||void 0===n?void 0:n.collectShippingDimensions))return(0,r.jsx)(r.Fragment,{children:T});var k,E,D,A,w=null!=(null===i||void 0===i?void 0:i.calculatedSize);w&&((null!==(k=null===i||void 0===i?void 0:i.calculatedSize)&&void 0!==k?k:0)>n.maxDimension&&(T=(0,r.jsxs)(a.Box,{style:{marginBottom:"16px"},children:[(0,r.jsx)(_.YI,{value:n.oversizedErrorWarning,components:C}),(0,r.jsx)(a.Typography,{style:{marginBottom:"16px"},children:(0,r.jsx)("a",{href:"#",onClick:function(){return b(t)},children:n.resetDimensionsLinkText})}),(null===n||void 0===n?void 0:n.blockingShippingDimensions)?(0,r.jsx)(r.Fragment,{}):T]})));return(0,r.jsx)(r.Fragment,{children:w?(0,r.jsx)(r.Fragment,{children:T}):(0,r.jsxs)(a.Box,{component:"form",ref:g,onSubmit:S,onChange:function(){var e,t,r;if(g.current&&x(g.current.checkValidity()),n){var i=g.current;if(null===(e=n.shippingWidth)||void 0===e?void 0:e.pattern){var o,s,a,l=new RegExp(null===(o=n.shippingWidth)||void 0===o?void 0:o.pattern);(null===l||void 0===l?void 0:l.test(null!==(a=null===(s=i.width)||void 0===s?void 0:s.value)&&void 0!==a?a:""))||x(!1)}if(null===(t=n.shippingHeight)||void 0===t?void 0:t.pattern){var c,d,u,p=new RegExp(null===(c=n.shippingHeight)||void 0===c?void 0:c.pattern);(null===p||void 0===p?void 0:p.test(null!==(u=null===(d=i.height)||void 0===d?void 0:d.value)&&void 0!==u?u:""))||x(!1)}if(null===(r=n.shippingLength)||void 0===r?void 0:r.pattern){var m,f,h,v=new RegExp(null===(m=n.shippingLength)||void 0===m?void 0:m.pattern);(null===v||void 0===v?void 0:v.test(null!==(h=null===(f=i.length)||void 0===f?void 0:f.value)&&void 0!==h?h:""))||x(!1)}}else x(!0)}
1,style:{marginBottom:"16px"},children:[(0,r.jsx)(_.YI,{value:n.messageBeforeProvidingDimensions,components:C}),(0,r.jsxs)(a.Box,{children:[(0,r.jsx)("input",{type:"hidden",name:"submissionId",value:t}),(0,r.jsx)(ue.Z,(0,f.Z)((0,c.Z)({},n.shippingLength),{defaultValue:null!==(E=null===i||void 0===i?void 0:i.shippingLength)&&void 0!==E?E:"",name:"length"})),(0,r.jsx)(ue.Z,(0,f.Z)((0,c.Z)({},n.shippingHeight),{defaultValue:null!==(D=null===i||void 0===i?void 0:i.shippingHeight)&&void 0!==D?D:"",name:"height"})),(0,r.jsx)(ue.Z,(0,f.Z)((0,c.Z)({},n.shippingWidth),{defaultValue:null!==(A=null===i||void 0===i?void 0:i.shippingWidth)&&void 0!==A?A:"",name:"width"}))]}),(0,r.jsx)(a.Box,{children:(0,r.jsx)(a.Button,{size:"large",color:"primary",variant:"contained",type:"submit",sx:{mt:2},disabled:!p,children:"Save"})})]})})},me=function(){var e,n,t,i,o,s,d,u,p,m,x,h,v,g,y,b,S,C,k=j(),E=k.submission,D=k.submissionDetailViewSettings,A=D.statuses,w=D.acceptanceModal.offerTypeOptions,Z=D.submissionSettings.shippingDimensionSettings,O=A.find((function(e){return e.statusId===E.derivedStatusId})),N=O.content,P=O.availableActions,L=void 0===P?[]:P,R=(0,f.Z)((0,c.Z)({},I.Z),{marks:(0,f.Z)((0,c.Z)({},I.Z.marks),{variable:function(e){return e.children.map((function(e){return q(e,E)}))},variableImages:function(e){return e.children.map((function(e){return U(e,E.SubmissionReturns)}))},variableLink:function(e){var n=e.value.variable,t=e.children;return z(n,t,E)}})}),B=null===(e=w.find((function(e){var n;return e.id===(null===E||void 0===E||null===(n=E.AcceptedOffer)||void 0===n?void 0:n.offer_type_name)})))||void 0===e?void 0:e.title,F=(null===(n=E.AcceptedOffer)||void 0===n?void 0:n.consignor_split)?"".concat(B," - ").concat((0,l.rl)(null===(t=E.AcceptedOffer)||void 0===t?void 0:t.consignor_split)):B,M=(null===(i=E.AcceptedOffer)||void 0===i?void 0:i.consignor_split)?(null===(o=E.AcceptedOffer)||void 0===o||null===(s=o.customer_payment_details)||void 0===s||null===(d=s.consignment_details)||void 0===d||null===(u=d.sale_details)||void 0===u?void 0:u.consignor_payment_amount_usd)&&(0,l.xG)(E.AcceptedOffer.customer_payment_details.consignment_details.sale_details.consignor_payment_amount_usd):(null===(p=E.AcceptedOffer)||void 0===p?void 0:p.amount_usd)&&(0,l.xG)(parseFloat(null===(m=E.AcceptedOffer)||void 0===m?void 0:m.amount_usd)),V={"Gift Card(s)":(0,l._t)(null===(x=E.AcceptedOffer)||void 0===x||null===(h=x.customer_payment_details)||void 0===h?void 0:h.gift_cards),"Paypal Email"
1:null===(v=E.AcceptedOffer)||void 0===v||null===(g=v.customer_payment_details)||void 0===g?void 0:g.paypal_email,"Dealer Name":null===(y=E.Dealer)||void 0===y?void 0:y.name,"Dealer Location":function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E.Dealer;if(!e)return"";var n=e.address,t=e.city,r=e.state,i=e.zip;return n&&t&&r&&i?"".concat(n,", ").concat(t,", ").concat(r," ").concat(i):""}(E.Dealer)};if(null===(b=E.AcceptedOffer)||void 0===b?void 0:b.payment_date)V["Payment Date"]=(0,l.p6)(null===(C=E.AcceptedOffer)||void 0===C?void 0:C.payment_date);else if(null===(S=E.AcceptedOffer)||void 0===S?void 0:S.estimated_payment_date){var W;V["Expected Payment Date"]=(0,l.p6)(null===(W=E.AcceptedOffer)||void 0===W?void 0:W.estimated_payment_date)}var H=(0,r.jsx)(_.YI,{value:N,components:R});return"pending"===E.derivedStatus&&(H=(0,r.jsxs)(r.Fragment,{children:[H,(0,r.jsx)(pe,{shippingDimensionSettings:Z,submissionId:E.id,existingSubmissionMetadata:E.metadata})]})),(0,r.jsxs)(r.Fragment,{children:[H,(0,r.jsx)(a.Box,{sx:{display:"flex",gap:1,mt:2},children:L.map((function(e){var n=e.action,t=e.displayName;return"acceptOffer"===n?(0,r.jsx)(Q,{actionDisplayName:t},n):"resubmit"===n?(0,r.jsx)(ee(),{href:"".concat(ne.Z.SUBMISSIONS,"/").concat(E.id,"/resubmit"),children:(0,r.jsx)(a.Button,{color:"primary",variant:L.length>1?"outlined":"contained",children:t})},n):"cancelConsignment"===n?(0,r.jsx)(ce,{actionDisplayName:t},n):"cancelConsignmentCancellation"===n?(0,r.jsx)(de,{actionDisplayName:t},n):void 0}))}),["completed","item_sold_payment_pending","item_sold_paid"].includes(E.derivedStatus)&&(0,r.jsxs)(a.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",maxWidth:"500px",borderWidth:"1px",borderStyle:"solid",borderColor:"grey.300",boxShadow:function(e){return e.shadow.md}},children:[(0,r.jsxs)(a.Box,{sx:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",p:3},children:[(0,r.jsxs)(a.Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[(0,r.jsx)(a.Box,{sx:{p:2.5,bgcolor:"grey.900",color:"white",borderRadius:"999px",display:"flex"},children:(0,r.jsx)(a.MoneyCircleIcon,{fontSize:"medium"})}),(0,r.jsxs)(a.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"flex-start"},children:[(0,r.jsx)(a.Typography,{variant:"body2",color:"text.secondary",children:null!==F&&void 0!==F?F:"Offer"}),(0,r.jsx)(a.Typography,{variant:"h3",color:"text.primary",children:null!==M&&void 0!==M?M:"Error"})]})]}),(0,r.jsx)(a.Button,{component:"a",variant:"contained",size:"small",color:"secondary",href:"https://www.theproscloset.com/",target:"_blank",rel:"noopener noreferrer",children:"Start Shopping"})]}),(0,r.jsx)(a.Box,{sx:{p:1.5,bgcolor:"grey.100","& > * + *":{borderTop:"1px solid",borderColor:"grey.300"}},children:Object.entries(V).map((function(e){var n=(0,T.Z)(e,2),t=n[0],i=n[1];return(0,r.jsx)(r.Fragment,{children:i&&Array.isArray(i)?(0,r.jsxs)(a.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:1.5},children:[(0,r.jsx)(a.Typography,{variant:"body2",color:"text.secondary",children:t}),(0,r.jsx)(a.Box,{children:i.map((function(e,n){return(0,r.jsx)(a.ListItem,{alignItems:"center",sx:{padding:0,justifyContent:"right"},children:(0,r.jsxs)(a.Typography,{variant:"body2",color:"text.primary",children:[e.amountUsd," issued on Gift Card Code:"," ",(0,r.jsx)(a.Typography,{variant:"body2",color:"text.primary",component:"span",sx:{fontFamily:"bold"},children:e.giftCardCode}),!!e.giftCardCode&&(0,r.jsx)(a.IconButton,{size:"small",onClick:function(){navigator.clipboard.writeText(e.giftCardCode)},children:(0,r.jsx)(G.Z,{fontSize:"small"})})]})},n)}))})]},t):i&&(0,r.jsxs)(a.Box,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",p:1.5},children:[(0,r.jsx)(a.Typography,{variant:"body2",color:"text.secondary",children:t}),(0,r.jsx)(a.Typography,{variant:"body2",color:"text.primary",fontFamily:"bold",children:i})]},t)})}))})]})]})},fe=function(e){var n=e.children,t=(0,d.useState)(!1),i=t[0],o=t[1];return(0,d.useEffect)((function(){o(!0)}),[]),i?(0,r.jsx)(r.Fragment,{children:n}):null},xe=function(){var e,n=j(),t=n.submission,i=n.submissionDetailVie
1wSettings.submissionSettings,o=i.activityLabel,s=i.statusFlow,c=t.partnerSiteId===S.q7,u=t.Notes,p=void 0===u?[]:u,m=(0,d.useMemo)((function(){return p.filter((function(e){return e.type===S.FE}))}),[p]),f=(0,T.Z)((0,E._)("visibleNote-".concat(t.id,"-").concat(null===m||void 0===m||null===(e=m[0])||void 0===e?void 0:e.id),!0),2),x=f[0],h=f[1],v=s.find((function(e){return e.statusIds.includes(t.derivedStatusId)})).displayAlone,g=s.filter((function(e){var n;return!e.displayAlone&&(!e.displayOnlyWhenActive||e.statusIds.includes(t.derivedStatusId))&&(!e.restrictDisplayToOfferTypes||e.restrictDisplayToOfferTypes&&e.restrictDisplayToOfferTypes.includes(null===(n=t.AcceptedOffer)||void 0===n?void 0:n.offer_type_name))})).map((function(e){return{color:e.color,label:c&&e.tradeupDisplayName?e.tradeupDisplayName:e.displayName,statusIds:e.statusIds}})),y=g.findIndex((function(e){return e.statusIds.includes(t.derivedStatusId)}));return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(a.Typography,{component:"h2",variant:"h6",sx:{pb:2,mb:3,borderBottom:1,borderBottomColor:"divider"},children:o}),(0,r.jsx)(fe,{children:m&&m.length>0&&x&&(0,r.jsxs)(a.Alert,{severity:"info",sx:{mb:3,position:"relative"},children:[(0,r.jsxs)(a.AlertTitle,{sx:{display:"flex",flexDirection:"column"},children:["Recent Note from TPC Buyer",(0,r.jsx)(a.Typography,{variant:"caption",color:"text.secondary",children:(0,l.o0)(m[0].created)})]}),(0,r.jsx)(a.Box,{dangerouslySetInnerHTML:{__html:m[0].note},sx:{mt:2}},"buyer-recent-note-".concat(m[0].note)),(0,r.jsx)(a.IconButton,{onClick:function(){h(!1)},sx:{position:"absolute",top:8,right:8},children:(0,r.jsx)(a.CloseIcon,{})})]})}),v?(0,r.jsx)(a.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",py:8,gap:1,textAlign:"center"},children:(0,r.jsx)(me,{})}):(0,r.jsx)(a.Stepper,{activeStep:y,orientation:"vertical",children:g.map((function(e,n){return(0,r.jsxs)(a.Step,{children:[(0,r.jsx)(a.StepLabel,{children:(0,r.jsxs)(a.Box,{sx:{display:"flex",gap:2,alignItems:"center",pl:1},children:[(0,r.jsx)(a.Chip,{disabled:n>y,label:e.label,size:"small",sx:[{backgroundColor:"".concat(e.color,".shades.100"),color:"".concat(e.color,".shades.700"),fontFamily:"bold"},n<y&&{backgroundColor:"transparent",color:"".concat(e.color,".shades.500"),border:1,borderColor:"".concat(e.color,".shades.500")}]}),n===y&&(0,r.jsx)(a.Typography,{color:"text.secondary",variant:"caption",children:(0,l.p6)(t.modified)})]})}),(0,r.jsx)(a.StepContent,{children:(0,r.jsx)(a.Box,{sx:{pt:2,pl:1,maxWidth:"640px"},children:(0,r.jsx)(me,{})})})]},e.label)}))})]})},he=function(){var e=j(),n=e.submission,t=e.submissionDetailViewSettings,c=t.submissionSettings,d=t.acceptanceModal.offerTypeOptions,u=n.partnerSiteId===S.q7,p=c.expiredLabel,m=c.pendingExpirationLabel,f=c.pendingExpirationDays,x=c.statusFlow,h=(0,l.xe)(n,x),v=h.color,g=h.displayName,y=h.tradeupDisplayName,b=h.isExpirable,T=h.isExpired;return(0,r.jsx)(i.Z,{HeaderAction:(0,r.jsx)(s.Z,{daysToExpiration:n.daysToExpiration,expiredLabel:p,isExpirable:b,isExpired:T,pendingExpirationDays:f,pendingExpirationLabel:m}),title:(0,r.jsx)(o.Z,{color:v,displayName:u&&y?y:g,isExpired:T,submission:n,submissionViewSettings:c,offerTypeOptions:d}),children:(0,r.jsxs)(a.Grid,{container:!0,spacing:3,children:[(0,r.jsx)(a.Grid,{item:!0,xs:12,lg:8,children:(0,r.jsx)(xe,{})}),(0,r.jsx)(a.Grid,{item:!0,xs:12,lg:4,children:(0,r.jsx)(C,{})})]})})},ve=!0,ge=function(e){var n=e.sellerCookie,t=e.submissionDetailViewSettings,i=e.submission,o=e.veriffCookie,s=e.fakeIDV;return(0,r.jsx)(b,{value:{sellerCookie:n,submissionDetailViewSettings:t,submission:i,veriffCookie:o,fakeIDV:s},children:(0,r.jsx)(he,{})})}}},function(e){e.O(0,[536,342,908,774,888,179],(function(){return n=28842,e(e.s=n);var n}));var n=e.O();_N_E=n}]);

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.