PageSourceSearch

https://www.imperfectfoods.com/assets/OrderFeedback-DG18qB_h.js

js imperfectfoods.com collected 2026-09-24 17:13:06 UTC 18,151 bytes, 2 lines download raw bytes

1import{j as e,c as W,P as d,l as ge,r as n,bq as Le,cn as qe,co as Ye,aS as me,f as Ue,bG as Fe,cp as Ve,g as Re,n as je,ci as ke,E as ve,o as Se,G as Be,A as he,L as Ne,B as ae,O as He,cq as Te,cj as We,cf as Ge,cr as Qe,cs as $e,C as ze,z as Ke,ck as Xe,ct as Ze}from"./index-CVUXbWDK.js";import{S as Je}from"./Select-BdXY5WkV.js";import"./index-DMc4EdnI.js";import{R as es,a as ss}from"./index-k-96dld2.js";import{R as pe,a as ne}from"./Radio-DmXGG0g5.js";import{B as ts}from"./Breadcrumbs-CcG9y1mh.js";import"./index-1fq4Pb41.js";import"./BackButton-Biq-2jqL.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="0940eaa0-770e-4af1-8d57-ea3fb9a22207",r._sentryDebugIdIdentifier="sentry-dbid-0940eaa0-770e-4af1-8d57-ea3fb9a22207")}catch{}})();(function(){var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r._sentryModuleMetadata=r._sentryModuleMetadata||{},(function(){var t,i=new r.Error().stack,h=r._sentryModuleMetadata[i]||{},R={"_sentryBundlerPluginAppKey:mm-sentry-boysenberry":!0},f={};for(t in h)h.hasOwnProperty(t)&&(f[t]=h[t]);for(t in R)R.hasOwnProperty(t)&&(f[t]=R[t]);r._sentryModuleMetadata[i]=f})()})();const te=[{status:"ITEM_ISSUE",name:"Item issue"},{status:"DELIVERY_ISSUE",name:"Delivery issue"},{status:"DELIVERY_PRIMARY_DIDNT_EXPECT",name:"I didn’t want this order"},{status:"OTHER",name:"None of the above"}],re=[{status:"DELIVERY_DAMAGED_DELIVERED",name:"Damaged delivery"},{status:"DELIVERY_LATE",name:"Delivery arrived late"},{status:"DELIVERY_MISSING",name:"Missing delivery"},{status:"DELIVERY_OTHER",name:"None of the above"}],rs=[{name:"Did not receive items(s)",itemCopy:"Did not receive items(s)",value:"PRODUCT_MISSING"},{name:"Incorrect items(s) sent",itemCopy:"Incorrect items(s) sent",value:"PRODUCT_INCORRECT_SENT"},{name:"Rotten or spoiled item(s)",itemCopy:"Rotten or spoiled item(s)",value:"PRODUCT_ROTTEN_SPOILED"},{name:"Broken/damaged item(s)",itemCopy:"Broken/damaged item(s)",value:"PRODUCT_BROKEN_DAMAGED"},{name:"Item(s) not as described",itemCopy:"Item(s) not as described",value:"PRODUCT_NOT_AS_DESCRIBED"},{name:"Unhappy with portion/size",itemCopy:"Unhappy with portion/size",value:"PRODUCT_UNHAPPY_WITH_PORTION_SIZE"},{name:"Past expiration date",itemCopy:"Past expiration date",value:"PRODUCT_EXPIRED"},{name:"None of the above",itemCopy:"None of the above",value:"PRODUCT_OTHER"}];function Ce({item:r}){const t=r.drinksOrderDetailID||null,i=r.photo?r.photo:"https://img-cdn.misfitsmarket.com/images/placeholder.png";return e.jsxs("div",{className:"text-body-md grid grid-cols-[50px_1fr] items-center gap-10 md:grid-cols-[70px_1fr]",children:[e.jsx("img",{className:W({"w-50 md:w-70":!t},{"h-50 md:h-70":t}),src:i,alt:r.name}),e.jsxs("div",{children:[r.isPerk&&e.jsx("p",{className:"text-body-sm font-grotesk-bold text-kale",children:"PERK"}),r.brand&&e.jsx("p",{className:"mb-5 text-grey",children:r.brand}),e.jsx("p",{children:r.name}),r.issueReported&&e.jsx("p",{className:"font-grotesk-bold",children:"Issue Reported"})]})]})}Ce.propTypes={item:d.shape({}).isRequired};function _e({issueType:r,item:t,updateItem:i,wineOrder:h}){const{isMisfitsTheme:R}=ge(),[f,k]=n.useState(t.issue||""),[y,v]=n.useState(t.checked),[u,b]=n.useState(1),[l,N]=n.useState(t.description),a=r==="DELIVERY_ISSUE",T=a?t.issue:f,x=a&&h&&t.issue==="DELIVERY_OTHER"||T==="PRODUCT_OTHER",j={id:t.id||t.sellableItemID,issue:T,drinksOrderDetailID:t.drinksOrderDetailID,price:t.price,description:l,totalQty:t.qty,isPerk:t.isPerk,qty:u,checked:y},p=()=>{u>1&&(b(u-1),i({...j,qty:u-1}))},A=()=>{u<t.qty&&(b(u+1),i({...j,qty:u+1}))};return e.jsxs("div",{children:[e.jsx("div",{className:"mb-15",children:e.jsx(Le,{id:`item-${t.id}`,label:e.jsx(Ce,{item:t}),defaultChecked:y,onCheckedChange:()=>{i({...j,checked:!y}),v(!y)},disabled:t.issueReported})}),y&&e.jsxs("div",{className:"ml-60",children:[t.qty>1&&e.jsxs("div",{className:"mb-20 flex items-center gap-30",children:[e.jsx("p",{className:"font-grotesk-bold",children:"Quantity with issue"}),e.jsxs("div",{className:"grid grid-cols-[30px_35px_30px] items-center",children:[e.jsx("button",{type:"button",onClick:p,disabled:u===1,"aria-label":"Add",children:e.jsx(qe,{className:W("w-30 rounded-full border p-5",{"border-grey-light text-grey-light":u===1},{"border-black":u>1})})}),e.jsx("p",{className:"text-center font-grotesk-bold",children:u}),e.jsx("button",{type:"button",onClick:A,disabled:u===t.qty,"aria-label":"Remove",children:e.jsx(Ye,{className:W("w-30 rounded-full border p-5",{"border-grey-light text-grey-light":u===t.qty},{"border-black":u!==t.qty})})})]})]}
1),!a&&e.jsx(Je,{labelId:"issue-select",id:`item-issue-select-${t.id}`,label:"Select issue",value:f,menuItems:rs,isMisfits:R,onChange:m=>{k(m.target.value),i({...j,issue:m.target.value})}}),(f!==""||a)&&e.jsxs("div",{className:"mt-20",children:[a&&e.jsxs("p",{className:"font-grotesk-bold",children:["Please describe your issue:",x&&e.jsx("span",{className:"text-error",children:"*"})]}),e.jsx(me,{name:"description",id:"description",label:"Issue",placeholder:`Please describe your issue ${x?"":"(Optional)"}`,value:l,onChange:m=>{N(m.target.value),i({...j,description:m.target.value})},rows:4,multiline:!0,required:x})]})]}),e.jsx(Ue,{height:1})]})}_e.propTypes={issueType:d.string.isRequired,item:d.shape({brand:d.string,checked:d.bool,description:d.string,drinksOrderDetailID:d.number,id:d.number,isPerk:d.bool,issue:d.string,issueReported:d.bool,name:d.string.isRequired,photo:d.string.isRequired,price:d.number,qty:d.number,sellableItemID:d.number}).isRequired,updateItem:d.func.isRequired,wineOrder:d.bool.isRequired};const as="order-feedback-details",ns=async(r,t,i)=>{const h=await Ve(r,t,i);return h.msg==="Success"?h.data.details:null},is=({customerID:r,enabled:t=!0,orderID:i,refundAmount:h}={})=>Fe({queryKey:[as,r,i,h],queryFn:()=>ns(r,i,{refundAmount:h}),enabled:t&&!!r&&!!i,retry:!1});function Oe({issueType:r,itemIssues:t,order:i,refundModal:h,setRefundModal:R,submitOrderFeedback:f}){var J;const{data:k={}}=Re(),{data:y={}}=je(),{id:v}=ke(),{isMisfitsTheme:u}=ge(),b=ve(),[l,N]=n.useState(!1),[a,T]=n.useState(1),[x,j]=n.useState(0),[p,A]=n.useState(0),[m,G]=n.useState(0),[I,L]=n.useState(null),[O,U]=n.useState(!1),C=n.useRef(!1),Q=t.reduce((S,D)=>S+D.price*D.qty,0),{data:_,isFetching:$,isLoading:ie}=is({customerID:k.customerID,orderID:v,refundAmount:Q,enabled:h}),F=h&&(!k.customerID||ie),z=Se(new Date().toISOString(),i.createdAt.date,-7),V=m+p,K=(_==null?void 0:_.amountRefunded)??0,w=i.charge.total>0&&i.charge.total>K&&z,E=()=>{C.current=!1,U(!1)},de=t.some(S=>S.issue==="PRODUCT_OTHER"),X=r==="ITEM_ISSUE"&&(_==null?void 0:_.autoRefundEligible)===!0&&!de;n.useEffect(()=>{!w&&I==="ORIGINAL_PAYMENT_METHOD"&&L(null)},[w,I]),n.useEffect(()=>{$&&L(null)},[$]);const q=(S=!1)=>{He(R),E(),(a===2||S)&&(T(1),b(`/account/orders/details/${v}?exp=auto_refunds`))},Z=async()=>{if(!(C.current||O))if(C.current=!0,U(!0),X){const S={automatedRefundType:I,orderID:parseInt(v,10),items:t.map(({checked:D,totalQty:B,...M})=>M),issue:"ITEM_ISSUE",source:"WEBSITE",description:"",refundTypeSelection:I,shipmentID:i.shipmentID};try{const D=await Te(k.customerID,v,S),{totalCardAmountRefunded:B,totalCreditedAmount:M,totalCreditsAmountRefunded:ee,totalEbtSnapAmountRefunded:H}=D.data;D.msg==="Success"?(N(!1),B||M||ee||H?(j(M+ee),A(B),G(H),T(2)):q(!0)):(N(!0),E())}catch{N(!0),E()}}else f({callback:E,refundType:I})};return e.jsx(Be,{onClose:q,open:h,centered:!0,children:e.jsx("div",{className:"p-20 md:p-30 lg:px-50",children:a===1?e.jsxs("div",{children:[l&&e.jsx("div",{className:"mb-20",children:e.jsx(he,{variant:"error",children:"Please try again"})}),e.jsx("p",{className:"text-body-lg mb-10 font-grotesk-bold",children:"We're sorry your order didn't go as planned"}),e.jsxs("p",{className:"text-body-md",children:[X?"We would like to make it right. How":"If this qualifies for a refund, how"," ","would you like to receive your refund?"]}),F?e.jsx("div",{className:"mt-20 flex justify-center",children:e.jsx(Ne,{width:"40px"})}):e.jsxs(e.Fragment,{children:[e.jsxs(pe,{onValueChange:L,className:"text-body-sm mt-20",children:[e.jsx(ne,{labelCopy:e.jsxs("div",{children:[e.jsxs("p",{className:"font-grotesk-bold",children:[u?"Misfits Market":"Imperfect Foods"," Credit"]}),e.jsx("p",{children:"Instantly added to your account"})]}),id:"MM_CREDIT",name:"MM_CREDIT",value:"MM_CREDIT",checked:I==="MM_CREDIT",wrapperClassName:"items-center"}),w&&e.jsx("div",{className:"mt-20",children:e.jsx(ne,{labelCopy:e.jsxs("div",{children:[e.jsx("p",{className:"font-grotesk-bold",children:"Original payment methods"}),e.jsx("p",{children:"May take up to 5 business days"})]}),id:"ORIGINAL_PAYMENT_METHOD",name:"ORIGINAL_PAYMENT_METHOD",value:"ORIGINAL_PAYMENT_METHOD",checked:I==="ORIGINAL_PAYMENT_METHOD",wrapperClassName:"items-center"})})]}),((J=y==null?void 0:y.ebtCard)==null?void 0:J.last4)&&e.jsxs("p",{className:"text-body-sm mt-15",children:[e.jsx("span",{className:"font-grotesk-bold",children:"Note:"})," EBT payments are not eligible for Misfits Market credit. EBT payment amounts will be refunded back to your EBT card within one business day."]})]}),e.jsxs("div",{className:"mt-30 text-center",children:[!F&&e.jsx(ae,{onClick:Z,disabled:!I||O,children:"Confirm Refund Selection"}),e.jsx("button",{type:"button",className:"link mt-15",onClick:q,children:"Cancel"})]})]}):a===2&&e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-10 w-80",children:x>0?e.jsx(es,{}):e.jsx(ss,{})}),e.jsx("h3",{className:"text-heading-sm mx-auto w-[450px] font-grotesk-bold",children:"Thanks for your confirmation"}),e.jsxs("div",{className:"text-body-sm mt-30 space-y-10 rounded-md bg-perks p-15 if:bg-strawberry",children:[x>0&&e.jsxs("div",{children:[e.jsxs("p",{className:"font-grotesk-bold",children:["We've credited you $",x.toFixed(2)]}),e.jsx("p",{children:"Instantly added to your Credits"})]}),V>0&&e.jsxs("div",{children:[e.jsxs("p",{className:"font-grotesk-bold",children:["We've refunded you $",V.toFixed(2)]}),e.jsx("p",{className:"mx-auto w-[320px]",children:"Your refund may take up to 3-10 business days to process."})]})]}),e.jsx("p",{className:"text-body-xs mt-10 text-grey",children:"Please note that any promotion terms and conditions my apply."}),e.jsx("div",{className:"mt-30",children:e.jsx(ae,{as:"link",to:`/account/orders/details/${v}?exp=auto_refunds`,children:"Done"})})]})})})}Oe.propTypes={issueType:d.string.isRequired,itemIssues:d.arrayOf(d.shape({})).isRequired,order:d.shape({}).isRequired,refundModal:d.bool.isRequired,setRefundModal:d.func.isRequired,submitOrderFeedback:d.func.isRequired};const Y="text-body-lg mb-20 font-grotesk-bold";function fs(){var be,xe;const{box:r,id:t}=ke(),i=ve(),{data:h}=Re(),{data:R}=je(),{data:f={},isLoading:k}=We({orderID:t}),{customerID:y,featureFlags:v}=h??{},{featureCanLateCancel:u}=v??{},b=(f==null?void 0:f.orderInfo)??{},[l,N]=n.useState([]),[a,T]=n.useState(""),[x,j]=n.useState(!1),[p,A]=n.useState([]),[m,G]=n.useState(""),[I,L]=n.useState(!1),[O,U]=n.useState(""),[C,Q]=n.useState(""),[_,$]=n.useState(0),[ie,F]=n.useState(!1),[z,V]=n.useState(!1),[K,w]=n.useState(!1),[E,de]=n.useState(!1),[X,q]=n.useState(!0),Z=()=>{A([]),G(""),Q("")},J=()=>{T(""),U(""),Z()},S=[{id:1,title:"My Orders",url:"/account/orders"},{id:2,title:`Order #${t}`,url:`/account/orders/details/${t}`}],D=s=>
1{const o=s==null?void 0:s.deliverDate;return o?Se(o,new Date().toISOString(),1):!1},B=async()=>{const{charge:s,customerDrinksOrderFeedback:o,drinksBundles:c,drinksCharge:g,drinksItems:se,drinksShipmentCount:oe,drinksShipments:Ie,hasDrinks:Pe,refundHistory:Ee,shipmentCount:De,shipments:le}=b,ce=le==null?void 0:le.map(P=>({...P,items:Xe(P.items||[])}));if(De+1===Number(r)&&Pe){de(!0);const P=c.reduce((ue,Ae)=>Ae.items.concat(ue),[]).concat(se);N({...Ie[0],items:P,customerDrinksOrderFeedback:o,refundHistory:Ee,charge:g}),D(Ie[0])||w(!0)}else{const P=ce==null?void 0:ce.filter(ue=>ue.shipmentNumber.toString()===r)[0];N({...P,refundHistory:Ee,charge:s}),D(P)||w(!0)}$(De+oe)};n.useEffect(()=>{k||(b!=null&&b.shopOrderNum?B():i("/account/orders"))},[k]),n.useEffect(()=>{a!==""&&setTimeout(()=>{j(!0)},1e3)},[a]),n.useEffect(()=>{m!==""&&setTimeout(()=>{L(!0)},1e3)},[m]);const M=()=>a==="ITEM_ISSUE"?!(p.length>0&&p.every(s=>s.issue!=="")&&p.filter(s=>s.description===""&&s.issue==="PRODUCT_OTHER").length===0):a==="DELIVERY_ISSUE"&&E?!(p.length&&p.every(s=>s.issue!=="")&&p.filter(s=>s.description===""&&s.issue==="DELIVERY_OTHER").length===0):a==="DELIVERY_ISSUE"?m===""||C==="":a==="OTHER"||a==="DELIVERY_PRIMARY_DIDNT_EXPECT"?O==="":!0,ee=s=>{let o=p,c=!1;s.checked?(o.find((g,se)=>g.id===s.id||g.id===s.drinksOrderDetailID?(o[se]=s,c=!0,!0):!1),c||o.push(s)):o=o.filter(g=>g.id!==s.id&&g.id!==s.drinksOrderDetailID),A(o),q(M())};n.useEffect(()=>{q(M())},[p,a,m,O,C]);const H=async({callback:s=()=>{},refundType:o="regular"}={})=>{const c={orderID:parseInt(t,10),items:a==="ITEM_ISSUE"||a==="DELIVERY_ISSUE"&&E?p.map(({checked:g,totalQty:se,...oe})=>oe):[],issue:a==="DELIVERY_ISSUE"?m:a,source:"WEBSITE",description:a==="DELIVERY_ISSUE"?C:O,refundTypeSelection:o,shipmentID:l.shipmentID};try{E?(c.drinksOrderDetailID=l.shipmentID,await Ze(y,l.customerDrinksOrderFeedback.drinksOrderID,c)):await Te(y,t,c),i(`/account/orders/details/${t}`),F(!1),s()}catch{F(!0),s()}},we=async()=>{(a==="ITEM_ISSUE"||a==="DELIVERY_ISSUE")&&!E&&p.filter(s=>s.isPerk).length===0?V(!0):H()},Me=(be=l.items)==null?void 0:be.filter(s=>!s.oos).map(s=>{const o=s;o.photo=s.photoExtraSmall,o.issueReported=Ge(s,l.customerOrderFeedback,l.customerDrinksOrderFeedback);const c=p.find(g=>g.id===s.id||g.id===s.drinksOrderDetailID);return o.issue=a==="DELIVERY_ISSUE"?m:(c==null?void 0:c.issue)||"",o.checked=(c==null?void 0:c.checked)||!1,o.description=(c==null?void 0:c.description)||"",e.jsx(_e,{item:o,updateItem:ee,issueType:a,wineOrder:E},s.sellableItemID)});if(!l&&!R.id||k||!(b!=null&&b.shopOrderNum))return e.jsx("div",{className:"flex h-[300px] items-center justify-center",children:e.jsx(Ne,{width:"60px"})});const fe=(s,o)=>s.find(c=>c.status===o),ye=Qe($e(l==null?void 0:l.deliverDate,1));return e.jsxs("div",{children:[e.jsx(ts,{breadcrumbs:S}),e.jsxs(ze,{marginClasses:"mt-20",children:[x?e.jsxs("div",{className:"mb-20",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("h3",{className:Y,children:"What is your issue?"}),e.jsx("button",{type:"button",onClick:()=>{j(!1),J()},className:"link text-body-md",children:"Edit"})]}),e.jsx("p",{children:fe(te,a).name})]}):e.jsxs("div",{children:[e.jsx("h3",{className:Y,children:"What is your issue?"}),e.jsx(pe,{onValueChange:s=>T(s),children:te==null?void 0:te.map(s=>e.jsx(ne,{wrapperClassName:"mb-20",value:s.status,labelCopy:s.name,id:s.name},s.name))})]}),a==="DELIVERY_ISSUE"&&x&&e.jsxs(e.Fragment,{children:[I?e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("h3",{className:Y,children:"What kind of delivery issue?"}),e.jsx("button",{type:"button",onClick:()=>{L(!1),Z()},className:"link text-body-md",children:"Edit"})]}),e.jsx("p",{className:"body-small",children:(xe=fe(re,m))==null?void 0:xe.name})]}):e.jsxs("div",{children:[e.jsx("h3",{className:Y,children:"What kind of delivery issue?"}),e.jsx(pe,{onValueChange:s=>G(s),children:re==null?void 0:re.map(s=>e.jsx(ne,{wrapperClassName:"mb-20",value:s.status,labelCopy:s.name,id:s.name},s.name))})]}),m!==""&&I&&!E&&(m==="DELIVERY_LATE"&&!D(l)&&l.shippingStatus!=="DELIVERED"?K&&e.jsxs("div",{className:"my-40 bg-malt p-20",children:[e.jsx(Ke,{variant:"dark",children:"STILL ON THE WAY"}),e.jsxs("p",{className:"text-body-sm mt-10",children:["Your order is still on its way with a one day delay. Rest assured our ice packs keep your items fresh for up to 72 hours.",ye&&e.jsxs(e.Fragment,{children:[" ","If there are any issues, you can report it in ",ye,"."]})]})]}):e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:W([Y,"mt-20"]),children:"Please describe your issue:"}),e.jsx(me,{name:"other",id:"other",label:"Issue",placeholder:"Required",value:C,onChange:s=>Q(s.target.value),rows:4,multiline:!0,required:!0})]}))]}),(a==="ITEM_ISSUE"||a==="DELIVERY_ISSUE"&&E&&I)&&x&&e.jsxs(e.Fragment,{children:[e.jsxs("h3",{className:W([Y,"mt-20"]),children:["Which items? ",_>
11&&`(Box ${r})`]}),e.jsx("div",{className:"mb-15",children:e.jsxs(he,{variant:"info-bell",children:["If you had an issue with multiple items in this order, ",e.jsx("span",{className:"font-grotesk-bold",children:"please select all the affected items here."})]})}),Me]}),(a==="OTHER"||a==="DELIVERY_PRIMARY_DIDNT_EXPECT")&&x&&e.jsxs(e.Fragment,{children:[e.jsxs("h3",{className:"mb-10 font-grotesk-bold",children:["Please describe your issue:",e.jsx("span",{className:"text-red",children:"*"})]}),u&&e.jsx("div",{className:"mt-10 mb-20",children:e.jsxs(he,{variant:"info-circle",children:[e.jsx("span",{className:"font-grotesk-bold",children:"NEW!"})," You now have the ability to cancel an order right after your window closes. If you need to cancel in the future, just head to your orders page in Account (act quickly because the time frame is limited!)."]})}),e.jsx(me,{name:"other",id:"other",label:"Issue",placeholder:"Required",value:O,onChange:s=>U(s.target.value),rows:4,multiline:!0,required:!0})]}),e.jsxs("div",{className:"fixed right-0 bottom-0 left-0 z-20 mt-30 w-full bg-white px-40 py-20 md:static md:w-[250px] md:p-0",children:[a==="DELIVERY_ISSUE"&&m==="DELIVERY_LATE"&&!D(l)&&l.shippingStatus!=="DELIVERED"&&K?e.jsx(ae,{size:"md",onClick:()=>w(!1),children:"Okay, thanks"}):e.jsx(ae,{size:"md",onClick:we,disabled:X,children:"Next"}),ie&&e.jsx("p",{className:"text-red text-body-xs",children:"There was an unexpected error. Please try again."})]})]}),z&&e.jsx(Oe,{submitOrderFeedback:H,order:l,setRefundModal:V,refundModal:z,itemIssues:p,issueType:a})]})}export{fs as Component};
2//# sourceMappingURL=OrderFeedback-DG18qB_h.js.map

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.