PageSourceSearch

https://helloned.com/cdn/shopifycloud/checkout-web/assets/c1/page-StockProblems.C28abPpL.js

js helloned.com collected 2026-09-29 07:29:15 UTC 7,586 bytes, 1 lines download raw bytes

1import{T,k as ue,q as v,h as G,u as e}from"./esnext-vendor.DDpcaSqU.js";import{e as de,N as pe,by as he,cd as me,ce as be,bx as ge,bA as _e,i as j,j as fe,k as P,I as V,l as g,m as ye,bB as ke,C as ve,n as Pe,P as Le,o as Ie,R as Ue,a0 as Me,ar as Ce,ao as Se,ap as w,ah as a,aq as Te,al as we,ai as A,am as Ae,an as xe,L as Oe,p as qe,O as Be,aw as Re,aa as Ee,G as Fe}from"./hydrate.BcfGVx0L.js";import{u as De,C as Ne,S as J}from"./CalloutHeader.DC7jgv42.js";import{T as He}from"./stopwatch.B56VZk5r.js";import{T as X,a5 as K,bm as ze,W as Qe,b0 as We,ag as $e,bF as Ge,bG as je}from"./utilities-previous.Cnwy8G2v.js";import{U as Je}from"./embed-deferred.i0beB2Jf.js";import{u as Ke,N as Ve}from"./stock-problems-useStockProblemsState.UjVAS9K4.js";import"./app.DdDscdWN.js";import"./graphql-PaymentSessionMutation.C-nDEOnn.js";import"./shared-permissions.B59tuyWB.js";import"./hooks-useShopPayExternalAppContext.R6pnDxYu.js";function dt(){const{i18n:t,observability:c,shop:x,url:O,source:Y,router:L,embed:I}=X(),{value:q}=K().allViolations,{value:B}=K().merchandiseLines,R=ze("merchandiseLines").value,{progress:U}=de(),{previousPage:Z}=pe(),p=Qe().merchandiseLines,E=he(),i=Ke(),u=i.type,{value:F}=We();$e("stock_problems");const M=T(()=>B?.lines??[],[B]),[_]=ue(p.peek()),h=me(_,q),d=be(_,M,q),ee=Y.type==="draftOrder",f=Ge(I?.embedder),{hasStorefront:C}=x,{isAppLayout:D}=ge(),m=i.cartEmpty,te=m||!_?0:_.length,ae=C||te>1,N=T(()=>M.reduce((o,n)=>({...o,[n.stableId]:n}),{}),[M]),y=v(({removeUnavailableMerchandise:o=!1}={})=>{const n=p.value,r=n.flatMap(s=>{const l=N[s.stableId];return o&&(!l||l.quantity===0||h.has(s.stableId))?[]:!l||l.quantity===0||h.has(s.stableId)?[s]:s.quantity===l.quantity&&s.totalPrice===l.totalPrice?[s]:[{...s,quantity:l.quantity,totalPrice:l.totalPrice}]});r.length===n.length&&r.every((s,l)=>s===n[l])||(p.value=r)},[N,p,h]),ne=v(()=>{je(I,Je)},[I]),re=v(()=>{y({removeUnavailableMerchandise:!0}),U("stock-problems-submit")},[U,y]),H=_e(),se=v(async()=>{await H(i.lineItems),window.location.replace(O.cart())},[H,i.lineItems,O]),le=o=>{const n=p.peek();p.value=n.filter(({stableId:r,quantity:s})=>r!==o&&s>0),U("stock-problems-remove-item")};G(()=>{E.notify({checkout_in_progress:!1})},[E]),De({stage:R?J.Loading:J.Complete,id:"StockProblems"}),G(()=>{let o=L.currentUrl.value;return L.currentUrl.subscribe(n=>{o!==n&&(o=n,y())})},[L,y]);const z=T(()=>u===a.Unfulfillable?Re([...h],F):null,[F,u,h]),S=()=>{if(!i.showLineItems)return i.title;switch(u){case a.Unavailable:return t.translate("contextual_availability.title",{count:d.length});case a.UnpurchasableB2B:return t.translate("stock.unpurchasable_product.title");case a.Unpurchasable:return t.translate("stock.unpurchasable_product_generic.title");case a.QuantityChange:return t.translate("stock.quantity_update.title");case a.Unshippable:return t.translate("stock.unshippable_product.title");case a.Unfulfillable:return t.translate("stock.unfulfillable_product.title");default:return t.translate("stock.title")}},ie=()=>{if(!i.showLineItems)return i.title;switch(u){case a.UnpurchasableB2B:return t.translate("stock.unpurchasable_product.header");case a.Unpurchasable:return t.translate("stock.unpurchasable_product_generic.header");case a.Unshippable:return t.translate("stock.unshippable_product.header",{count:d.length});case a.Unfulfillable:return t.translate("stock.unfulfillable_product.title");default:return S()}},Q=C&&!(D&&m)||f?e(fe,{children:e(j,{variant:"primary",size:"large",inlineSize:"fill",onClick:m&&f?ne:re,loading:R,children:ee||m&&!f?t.translate("stock.return_to_store_label"):t.translate("general.continue_button_label")})}):null,W=C&&Z.route&&!D&&!m&&!f?e(ye,{children:e(j,{onClick:async()=>{await se()},variant:"plain",inlineSize:"fill",textDecoration:"none",children:e(P,{direction:"inline",gap:"small-200",alignItems:"center",children:[e(V,{type:"chevron-left",size:"small"}),e(g,{children:t.translate("general.back_to_cart")})]})})}):null,$=()=>{if(!i.showLineItems)return i.subtitle;switch(u){case a.Unavailable:return m?t.translate("contextual_availability.all_products_in_cart_unavailable",{count:d.length}):t.translate("contextual_availability.products_not_available",{count:d.length});case a.UnpurchasableB2B:return t.translate("stock.unpurchasable_product.message");case a.Unpurchasable:return t.translate("stock.unpurchasable_product_generic.message");case a.QuantityChange:return t.translate("stock.quantity_update.description");case a.Unshippable:return t.translate("stock.unshippable_product.message",{count:d.length});case a.Unfulfillable:return z?t.translate("stock.unfulfillable_product.message",{delivery_method:z,count:d.length}):(c.error(new Ve),t.translate("stock.unfulfillable_product.default_message",{count:d.length}));default:return t.translate("stock.items_unavailable_notice")}},oe=()=>u===a.QuantityChange?t.translate("stock.quantity_update.page_title"):S();return e(Be,{section:"stock-problems",children:[e(He,{children:S()}),e(ke,{message:$(),errorType:ve.InventoryError,children:e(P,{gap:"large-500",children:[e(Ne,{status:"warning",children:[e(Pe,{children:ie()}),e(Le,{color:"subdued",children:$()})]}),e(Ie,{children:[d.length>0&&i.showLineItems?e(Ue,{children:e(Me,{children:e(Ce,{titleHidden:!0,border:"outer",spacing:"none",title:oe(),children:[e(Se,{blockPadding:"base",children:[e(w,{hidden:!0,children:t.translate("order_summary.product_image_label")}),e(w,{primary:!0,children:e(g,{type:"strong",children:t.translate("order_summary.description_label")})}),e(w,{hidden:u!==a.OutOfStock,children:e(g,{type:"strong",children:u===a.OutOfStock?t.translate("order_summary.quantity_label"):t.translate("order_summary.description_label")})})]}),e(Te,{children:d.map(({proposed:o,negotiated:n})=>{const r=n??o,s=o?.quantity,l=n?.quantity,{stableId:k,image:b,title:ce}=r;return e(we,{spacing:"base",blockPadding:"base",children:[e(A,{children:e(Ae,{src:b?.one,srcSet:b?`${b.one} 1x, ${b.two} 2x, ${b.four} 4x`:void 0,alt:b?.altText})}),e(A,{primary:!0,children:e(xe,{id:null,deferredAmount:r.deferredAmount,options:r.options,properties:r.properties,recurringTotal:r.recurringTotal,sellingPlan:r.sellingPlan,subtitle:r.subtitle,title:ce,totalPrice:r.totalPrice})}),e(A,{noWrap:!0,children:l!=null&&l>0&&!h.has(k)?e(P,{alignItems:"end",gap:"small-400",children:[e(Ye,{quantity:l,previousQuantity:s??0}),ae?e(Oe,{id:`remove-${k}`,onClick:()=>le(k),children:t.translate("stock.remove")}):null]}):e(Xe,{merchandiseIssueType:u})})]},k)})})]})})}):null,Q||W?e(qe,{children:[Q,W]}):null]})]})})]})}function Xe({merchandiseIssueType:t}){const{i18n:c}=X();return e(Fe,{gridAutoFlow:"column",gridAutoColumns:"minmax(auto, max-content)",gridTemplateColumns:"minmax(auto, max-content)",gridTemplateRows:"minmax(0, 1fr)",gap:"small-400",alignItems:"center",alignContent:"center",children:[e(V,{type:"disabled",tone:"critical",size:"small"}),e(Ee,{children:(()=>{switch(t){case a.Unfulfillable:case a.Unavailable:return c.translate("contextual_availability.unavailable_label");case a.UnpurchasableB2B:return c.translate("stock.unpurchasable_product.status_column_header");case a.Unpurchasable:return c.translate("stock.unpurchasable_product_generic.status_column_header");case a.Unshippable:return c.translate("stock.unshippable_product.status_column_header");default:return c.translate("stock.sold_out_label")}})()})]})}function Ye({quantity:t,previousQuantity:c}){return e(P,{direction:"inline",gap:"small-200",children:[e(g,{color:"subdued",children:c}),e(g,{color:"subdued",children:"→"}),e(g,{type:"strong",children:t})]})}
1export{dt as default};

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.