PageSourceSearch

https://suzuki-rekishikan.jp/cdn/shopifycloud/checkout-web/assets/c1/page-StockProblems.J_0Gmet-.js

js suzuki-rekishikan.jp collected 2026-10-01 12:21:14 UTC 7,693 bytes, 1 lines download raw bytes

1import{T as w,k as ue,q as v,h as j,u as e}from"./esnext-vendor.BDPAaZdq.js";import{h as de,Q as pe,bx as he,R as me,cd as be,ce as ge,bw as fe,bz as _e,l as V,m as ye,c as P,I as K,o as g,p as ke,bA as ve,E as Pe,H as Le,P as Ie,q as Ue,Y as Me,a3 as Se,at as Ce,aq as we,ar as T,aj as a,as as Te,an as Ae,ak as A,ao as xe,ap as Oe,L as qe,r as Be,V as Re,aA as Ee,ad as Fe,F as De}from"./hydrate.B0xlt2dG.js";import{C as He}from"./OffsitePaymentFailed.DkmtFalS.js";import{T as Ne}from"./helpers-getNormalizedPaymentMethodName.B-mE5wnL.js";import{O as Y,P as G,ba as Qe,Q as ze,aT as $e,bv as We,bw as je}from"./hooks-useReplaceShopPayInHistory.C8UL-mAH.js";import{U as Ve}from"./embed-deferred.BpEUhGVz.js";import{u as Ge,S as J}from"./hooks-usePostPurchase.BPY08f0g.js";import{u as Je,N as Ke}from"./stock-problems-useStockProblemsState.C8oRqc0h.js";import"./app.D1P6yWfp.js";import"./shared-permissions.BaDWlj5_.js";import"./hooks-useShopPayExternalAppContext.DyGXtar4.js";import"./hooks-useHasOrdersFromMultipleShops.C_XGQrjx.js";function pt(){const{i18n:t,observability:c,shop:x,url:O,source:X,router:L,embed:I}=Y(),{value:q}=G().allViolations,{value:B}=G().merchandiseLines,R=Qe("merchandiseLines").value,{progress:U}=de(),{previousPage:Z}=pe(),p=ze().merchandiseLines,E=he(),i=Je(),u=i.type,{value:F}=$e();me("stock_problems");const M=w(()=>B?.lines??[],[B]),[f]=ue(p.peek()),h=be(f,q),d=ge(f,M,q),ee=X.type==="draftOrder",_=We(I?.embedder),{hasStorefront:S}=x,{isAppLayout:D}=fe(),m=i.cartEmpty,te=m||!f?0:f.length,ae=S||te>1,H=w(()=>M.reduce((o,r)=>({...o,[r.stableId]:r}),{}),[M]),y=v(({removeUnavailableMerchandise:o=!1}={})=>{const r=p.value,n=r.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}]});n.length===r.length&&n.every((s,l)=>s===r[l])||(p.value=n)},[H,p,h]),re=v(()=>{je(I,Ve)},[I]),ne=v(()=>{y({removeUnavailableMerchandise:!0}),U("stock-problems-submit")},[U,y]),N=_e(),se=v(async()=>{await N(i.lineItems),window.location.replace(O.cart())},[N,i.lineItems,O]),le=o=>{const r=p.peek();p.value=r.filter(({stableId:n,quantity:s})=>n!==o&&s>0),U("stock-problems-remove-item")};j(()=>{E.notify({checkout_in_progress:!1})},[E]),Ge({stage:R?J.Loading:J.Complete,id:"StockProblems"}),j(()=>{let o=L.currentUrl.value;return L.currentUrl.subscribe(r=>{o!==r&&(o=r,y())})},[L,y]);const Q=w(()=>u===a.Unfulfillable?Ee([...h],F):null,[F,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()}},z=S&&!(D&&m)||_?e(ye,{children:e(V,{variant:"primary",size:"large",inlineSize:"fill",onClick:m&&_?re:ne,loading:R,children:ee||m&&!_?t.translate("stock.return_to_store_label"):t.translate("general.continue_button_label")})}):null,$=S&&Z.route&&!D&&!m&&!_?e(ke,{children:e(V,{onClick:async()=>{await se()},variant:"plain",inlineSize:"fill",textDecoration:"none",children:e(P,{direction:"inline",gap:"small-200",alignItems:"center",children:[e(K,{type:"chevron-left",size:"small"}),e(g,{children:t.translate("general.back_to_cart")})]})})}):null,W=()=>{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 Q?t.translate("stock.unfulfillable_product.message",{delivery_method:Q,count:d.length}):(c.error(new Ke),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(Re,{section:"stock-problems",children:[e(Ne,{children:C()}),e(ve,{message:W(),errorType:Pe.InventoryError,children:e(P,{gap:"large-500",children:[e(He,{status:"warning",children:[e(Le,{children:ie()}),e(Ie,{color:"subdued",children:W()})]}),e(Ue,{children:[d.length>0&&i.showLineItems?e(Me,{children:e(Se,{children:e(Ce,{titleHidden:!0,border:"outer",spacing:"none",title:oe(),children:[e(we,{blockPadding:"base",children:[e(T,{hidden:!0,children:t.translate("order_summary.product_image_label")}),e(T,{primary:!0,children:e(g,{type:"strong",children:t.translate("order_summary.description_label")})}),e(T,{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:r})=>{const n=r??o,s=o?.quantity,l=r?.quantity,{stableId:k,image:b,title:ce}=n;return e(Ae,{spacing:"base",blockPadding:"base",children:[e(A,{children:e(xe,{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(Oe,{id:null,deferredAmount:n.deferredAmount,options:n.options,properties:n.properties,recurringTotal:n.recurringTotal,sellingPlan:n.sellingPlan,subtitle:n.subtitle,title:ce,totalPrice:n.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(qe,{id:`remove-${k}`,onClick:()=>le(k),children:t.translate("stock.remove")}):null]}):e(Ye,{merchandiseIssueType:u})})]},k)})})]})})}):null,z||$?e(Be,{children:[z,$]}):null]})]})})]})}function Ye({merchandiseIssueType:t}){const{i18n:c}=Y();return e(De,{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(K,{type:"disabled",tone:"critical",size:"small"}),e(Fe,{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{pt 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.