PageSourceSearch

https://www.pullup-dip.de/cdn/shopifycloud/checkout-web/assets/c1/page-StockProblems.CFcVDm4h.js

js pullup-dip.de collected 2026-09-25 18:47:06 UTC 7,602 bytes, 1 lines download raw bytes

1import{T,k as ue,q as v,h as W,u as e}from"./esnext-vendor.B9Da21W6.js";import{f as de,J as pe,bq as he,c5 as me,c6 as be,bp as ge,bs as fe,j as G,k as P,I as V,l as g,bt as _e,A as ye,m as ke,P as ve,Y as Pe,ap as Le,am as Ie,an as w,af as a,ao as Ue,aj as Me,ag as A,ak as Se,al as Ce,L as Te,K as we,at as Ae,a8 as xe,G as Oe}from"./hydrate.DZ4YTm7p.js";import{u as qe,T as Be,C as Re,S as J}from"./stopwatch.CfKlh48v.js";import{P as Ee,a as De,b as Fe,d as He,c as Ne}from"./Page.jjGbeNkl.js";import{S as Y,a4 as K,bc as ze,T as Qe,a_ as $e,by as je,bz as We}from"./addresses-is-address-empty.Bn2lNY_L.js";import{U as Ge}from"./embed-deferred.B7xD-_a4.js";import{u as Je}from"./graphql-PaymentSessionMutation.CAXCwUvV.js";import{u as Ke,N as Ve}from"./stock-problems-useStockProblemsState.C_MqmPm-.js";import"./app.DbSrjjlA.js";import"./hooks-useShopPayExternalAppContext.DWwMuRnz.js";import"./hooks-useReplaceShopPayInHistory.DPpLejwu.js";function dt(){const{i18n:t,observability:c,shop:x,url:O,source:X,router:L,embed:I}=Y(),{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:D}=$e();Je("stock_problems");const M=T(()=>B?.lines??[],[B]),[f]=ue(p.peek()),h=me(f,q),d=be(f,M,q),ee=X.type==="draftOrder",_=je(I?.embedder),{hasStorefront:S}=x,{isAppLayout:F}=ge(),m=i.cartEmpty,te=m||!f?0:f.length,ae=S||te>1,H=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=H[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)},[H,p,h]),ne=v(()=>{We(I,Ge)},[I]),re=v(()=>{y({removeUnavailableMerchandise:!0}),U("stock-problems-submit")},[U,y]),N=fe(),se=v(async()=>{await N(i.lineItems),window.location.replace(O.cart())},[N,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")};W(()=>{E.notify({checkout_in_progress:!1})},[E]),qe({stage:R?J.Loading:J.Complete,id:"StockProblems"}),W(()=>{let o=L.currentUrl.value;return L.currentUrl.subscribe(n=>{o!==n&&(o=n,y())})},[L,y]);const z=T(()=>u===a.Unfulfillable?Ae([...h],D):null,[D,u,h]),C=()=>{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 C()}},Q=S&&!(F&&m)||_?e(Ee,{children:e(G,{variant:"primary",size:"large",inlineSize:"fill",onClick:m&&_?ne:re,loading:R,children:ee||m&&!_?t.translate("stock.return_to_store_label"):t.translate("general.continue_button_label")})}):null,$=S&&Z.route&&!F&&!m&&!_?e(De,{children:e(G,{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,j=()=>{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"):C();return e(we,{section:"stock-problems",children:[e(Be,{children:C()}),e(_e,{message:j(),errorType:ye.InventoryError,children:e(P,{gap:"large-500",children:[e(Re,{status:"warning",children:[e(ke,{children:ie()}),e(ve,{color:"subdued",children:j()})]}),e(Fe,{children:[d.length>0&&i.showLineItems?e(He,{children:e(Pe,{children:e(Le,{titleHidden:!0,border:"outer",spacing:"none",title:oe(),children:[e(Ie,{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(Ue,{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(Me,{spacing:"base",blockPadding:"base",children:[e(A,{children:e(Se,{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(Ce,{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(Xe,{quantity:l,previousQuantity:s??0}),ae?e(Te,{id:`remove-${k}`,onClick:()=>le(k),children:t.translate("stock.remove")}):null]}):e(Ye,{merchandiseIssueType:u})})]},k)})})]})})}):null,Q||$?e(Ne,{children:[Q,$]}):null]})]})})]})}function Ye({merchandiseIssueType:t}){const{i18n:c}=Y();return e(Oe,{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(xe,{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 Xe({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.