1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[566],{23163:(e,t,r)=>{r.d(t,{A:()=>M});var i=r(89379),n=(r(65043),r(77217)),s=r(55346),o=r(24141),d=r(44356),l=r(61254),a=r(89413),c=r(18689),u=r(23220),m=r(70579);const{Money:h,UUID:y}=s.gK,p=(e,t)=>{const r=e.reduce(((e,t)=>{const r=(0,l.ot)(t.lineTotal);return new n.A(r).add(e)}),new n.A(0)),i=e[0]&&e[0].unitPrice?e[0].unitPrice.currency:t;return new h((0,l.H5)(r.toNumber(),(0,l.Ft)(i)),i)},v=function(e,t,r){const n={start:e,end:t};return{id:new y("estimated-booking"),type:"booking",attributes:(0,i.A)({},n)}},M=e=>{const{breakdownData:t={},lineItems:r,timeZone:n,currency:s,marketplaceName:l,processName:h}=e,{startDate:M,endDate:g}=t;let O=null;try{O=(0,a.wz)(h)}catch(j){return(0,m.jsx)("div",{className:u.A.error,children:(0,m.jsx)(o.sA,{id:"OrderPanel.unknownTransactionProcess"})})}const f=null===r||void 0===r?void 0:r.find((e=>d.gB.includes(e.code)&&!e.reversal)),P=null===f||void 0===f?void 0:f.code,_=[d.Mi,d.se].includes(P),k=r&&r.length>0,F=!_||M&&g,b=P===d.er?d.ko:d.bC,x=k&&F?((e,t,r,n,s,o,d,l)=>{const c=null===o||void 0===o?void 0:o.transitions,u=new Date,m=e.filter((e=>e.includeFor.includes("customer"))),h=e.filter((e=>e.includeFor.includes("provider"))),M=p(m,l),g=p(h,l),O=t&&r?{booking:v(t,r,n,s)}:{};return(0,i.A)({id:new y("estimated-transaction"),type:"transaction",attributes:{createdAt:u,processName:d,lastTransitionedAt:u,lastTransition:c.REQUEST_PAYMENT,payinTotal:M,payoutTotal:g,lineItems:m,transitions:[{createdAt:u,by:a.CG,transition:c.REQUEST_PAYMENT}]}},O)})(r,M,g,P,n,O,h,s):null;return x?(0,m.jsx)(c.Qs,{className:u.A.receipt,userRole:"customer",transaction:x,booking:x.booking,dateType:b,timeZone:n,currency:s,marketplaceName:l}):null}},69602:(e,t,r)=>{r.r(t),r.d(t,{default:()=>x});var i=r(89379),n=r(65043),s=r(77775),o=r(24141),d=(r(44356),r(23526)),l=r(89413),a=r(18689),c=r(23163);const u="ProductOrderForm_bookingBreakdownTitle__yExmi",m="ProductOrderForm_totalDivider__ERvo6",h="ProductOrderForm_quantityField__Ti7+l",y="ProductOrderForm_deliveryField__DtEVs",p="ProductOrderForm_singleDeliveryMethodLabel__S0SYD label",v="ProductOrderForm_singleDeliveryMethodSelected__w-VgQ",M="ProductOrderForm_breakdownWrapper__7Nt0E",g="ProductOrderForm_submitButton__9--hP",O="ProductOrderForm_finePrint__3EidD marketplaceTinyFontStyles",f="ProductOrderForm_error__gcKg2 h4";var P=r(70579);const _=e=>{let{quantity:t,deliveryMethod:r,displayDeliveryMethod:n,listingId:s,isOwnListing:o,fetchLineItemsInProgress:d,onFetchTransactionLineItems:l}=e;const a=Number.parseInt(t,10),c=r?{deliveryMethod:r}:{};!("undefined"!==typeof window)||!a||n&&!r||d||l({orderData:(0,i.A)({stockReservationQuantity:a},c),listingId:s,isOwnListing:o})},k=e=>{const{displayDeliveryMethod:t,hasMultipleDeliveryMethods:r,deliveryMethod:i,hasStock:n,formId:s,intl:o}=e,l=t&&i;return n?t&&r?(0,P.jsxs)(a.HU,{id:"".concat(s,".deliveryMethod"),className:y,name:"deliveryMethod",label:o.formatMessage({id:"ProductOrderForm.deliveryMethodLabel"}),validate:(0,d.mw)(o.formatMessage({id:"ProductOrderForm.deliveryMethodRequired"})),children:[(0,P.jsx)("option",{disabled:!0,value:"",children:o.formatMessage({id:"ProductOrderForm.selectDeliveryMethodOption"})}),(0,P.jsx)("option",{value:"pickup",children:o.formatMessage({id:"ProductOrderForm.pickupOption"})}),(0,P.jsx)("option",{value:"shipping",children:o.formatMessage({id:"ProductOrderForm.shippingOption"})})]}):l?(0,P.jsxs)("div",{className:y,children:[(0,P.jsx)(a.H3,{rootClassName:p,children:o.formatMessage({id:"ProductOrderForm.deliveryMethodLabel"})}),(0,P.jsx)("p",{className:v,children:"shipping"===i?o.formatMessage({id:"ProductOrderForm.shippingOption"}):o.formatMessage({id:"ProductOrderForm.pickupOption"})}),(0,P.jsx)(a.k7,{id:"".concat(s,".deliveryMethod"),className:y,name:"deliveryMethod",type:"hidden"})]}):(0,P.jsx)(a.k7,{id:"".concat(s,".deliveryMethod"),className:y,name:"deliveryMethod",type:"hidden"}):null},F=e=>{const[t,r]=(0,n.useState)(!1),{handleSubmit:i,form:y,intl:p,formId:v,currentStock:f,allowOrdersOfMultipleItems:F,hasMultipleDeliveryMethods:b,displayDeliveryMethod:x,listingId:j,isOwnListing:D,onFetchTransactionLineItems:N,onContactUser:A,lineItems:I,fetchLineItemsInProgress:L,fetchLineItemsError:w,price:E,payoutDetailsWarning:S,marketplaceName:q,values:T}=e;(0,n.useEffect)((()=>{r(!0);const{quantity:t,deliveryMethod:i}=T;t&&!e.hasMultipleDeliveryMethods&&_({quantity:t,deliveryMethod:i,displayDeliveryMethod:x,listingId:j,isOwnListing:D,fetchLineItemsInProgress:L,onFetchTransactionLineItems:N})}),[]);const C={},U=C&&I&&!L&&!w,B="function"===typeof A,H=(0,P.jsx)(a.bG,{onClick:e=>{e.preventDefault(),A()},children:(0,P.jsx)(o.sA,{id:"ProductOrderForm.finePrintNoStockLinkText"})}),R=p.formatMessage({id:"ProductOrderForm.quantityRequired"}),Q=null!=typeof f&&0===f,V=f&&f>0,G=1===f,K=V?[...Array(f>100?100:f).keys()].map((e=>e+1)):[],Y=L,z=!V;return(0,P.jsxs)(a.lV,{onSubmit:e=>{const{quantity:t,deliveryMethod:r}=T||{};!t||t<1?(e.preventDefault(),y.blur("quantity"),y.focus("quantity")):x&&!r?(e.preventDefault(),y.blur("deliveryMethod"),y.focus("deliveryMethod")):i(e)},children:[(0,P.jsx)(s.Pc,{subscription:{values:!0},onChange:e=>{const{quantity:r,deliveryMethod:i}=e.values;t&&_({quantity:r,deliveryMethod:i,listingId:j,isOwnListing:D,fetchLineItemsInProgress:L,onFetchTransactionLineItems:N})}}),Q?null:G||!F?(0,P.jsx)(a.k7,{id:"".concat(v,".quantity"),className:h,name:"quantity",type:"hidden",validate:(0,d.G7)(R,1)}):(0,P.jsxs)(a.HU,{id:"".concat(v,".quantity"),className:h,name:"quantity",disabled:!V,label:p.formatMessage({id:"ProductOrderForm.quantityLabel"}),validate:(0,d.G7)(R,1),children:[(0,P.jsx)("option",{disabled:!0,value:"",children:p.formatMessage({id:"ProductOrderForm.selectQuantityOption"})}),K.map((e=>(0,P.jsx)("option",{value:e,children:p.formatMessage({id:"ProductOrderForm.quantityOption"},{quantity:e})},e)))]}),(0,P.jsx)(k,{displayDeliveryMethod:x,hasMultipleDeliveryMethods:b,deliveryMethod:null===T||void 0===T?void 0:T.deliveryMethod,hasStock:V,formId:v,intl:p}),U?(0,P.jsxs)("div",{className:M,children:[(0,P.jsx)(a.H6,{as:"h3",className:u,children:(0,P.jsx)(o.sA,{id:"ProductOrderForm.breakdownTitle"})}),(0,P.jsx)("hr",{className:m}),(0,P.jsx)(c.A,{breakdownData:C,lineItems:I,currency:E.currency,marketplaceName:q,processName:l.C7})]}):null,(0,P.jsx)("div",{className:g,children:(0,P.jsx)(a.jn,{type:"submit",inProgress:Y,disabled:z,children:V?(0,P.jsx)(o.sA,{id:"ProductOrderForm.ctaButton"}):(0,P.jsx)(o.sA,{id:"ProductOrderForm.ctaButtonNoStock"})})}),(0,P.jsx)("p",{className:O,children:S||(V&&D?(0,P.jsx)(o.sA,{id:"ProductOrderForm.ownListing"}):V?(0,P.jsx)(o.sA,{id:"ProductOrderForm.finePrint"}):B?(0,P.jsx)(o.sA,{id:"ProductOrderForm.finePrintNoStock",values:{contactSellerLink:H}}):null)})]})},b=e=>{const t=(0,o.tz)(),{price:r,currentStock:n,pickupEnabled:d,shippingEnabled:l,displayDeliveryMethod:a,allowOrdersOfMultipleItems:c}=e;if(a&&!d&&!l)return(0,P.jsx)("p",{className:f,children:(0,P.jsx)(o.sA,{id:"ProductOrderForm.noDeliveryMethodSet"})});const u=n&&1===n||!c&&n>0?{quantity:"1"}:{},m=l&&!d?{deliveryMethod:"shipping"}:!l&&d?{deliveryMethod:"pickup"}:l||d?{}:{deliveryMethod:"none"},h=d&&l,y=(0,i.A)((0,i.A)({},u),m);return(0,P.jsx)(s.lV,(0,i.A)((0,i.A)({initialValues:y,hasMultipleDeliveryMethods:h,displayDeliveryMethod:a},e),{},{intl:t,render:F}))};b.defaultProps={rootClassName:null,className:null,price:null,currentStock:null,listingId:null,isOwnListing:!1,pickupEnabled:!1,shippingEnabled:!1,displayDeliveryMethod:!1,lineItems:null,fetchLineItemsError:null};const x=b}}]); 2//# sourceMappingURL=ProductOrderForm.de0bf080.chunk.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.