PageSourceSearch

https://assets.atshop.io/bundle/vite-assets/items-be79d76a.js

js atshop.io collected 2026-10-05 23:22:38 UTC 18,197 bytes, 1 lines download raw bytes

1import{p as D,r as y,n as _,b as R}from"./__vendor_core-97a3651d.js";import{n as x,aC as A,a as I,aD as O,f as S,R as z}from"./entrypoint_vite-299adf10.js";import{O as T}from"./OrderItemsBlock-461d5cbe.js";import{O as M}from"./OrderItemsDropdown-087f9b34.js";import{D as F}from"./DarkTooltip-8079b39d.js";import{D as $}from"./Dropdown-c89c34e4.js";import{D as E}from"./DropdownItem-33a048e9.js";import{M as P}from"./MarkdownContent-0164b426.js";import{P as q}from"./PageContentLoader-ef7e3c8d.js";import{c as L}from"./DataModels-7b7b177a.js";import{h as C}from"./__vendor_moment-6fab0959.js";import{s as V}from"./__vendor_lodash-e079e428.js";import"./__vendor_misc-b903af47.js";import"./__vendor_schema-5dc9cb56.js";import"./__vendor_valibot-df580c86.js";import"./__vendor_icons-93767b49.js";import"./__vendor_axios-455637ad.js";import"./Conversations-49b88d00.js";import"./groupOrderStockByLines-bfbd37bd.js";import"./Clipboard-16b2cbde.js";import"./index-f96983da.js";import"./OrderItems-96989f47.js";import"./IconClipboardCheck-9d8dc159.js";import"./LoadingOverlay-fac87b98.js";const H={name:"as-admin-discard-order-modal",props:["order","active"],inheritAttrs:!1,data(){return{reasonTag:"",notes:"",modalActive:this.active}},watch:{modalActive(i){this.$emit("update:active",i)},active(i){this.modalActive=i}},methods:{close(){this.active=!1},confirmDiscard(){if(this.isRefunded)return this.discard();this.$dialog.confirm({title:"Order not refunded!",message:"It appears the order you're trying to discard isn't yet refunded. Please make sure you have issued a refund to the customer before you proceed with discarding the order.",type:"is-danger",confirmText:"Discard Anyway",onConfirm:()=>this.discard()})},discard(){Meteor.call("order.discard",{orderId:this.order._id,tag:this.reasonTag,notes:this.notes},(i,e)=>{if(i){this.$notifyError(i);return}this.$snackbar.open("Successfully discarded order.")})}},meteor:{"admin.order.events"(){return[{orderId:this.order._id}]},isRefunded:{params(){return{orderId:this.order._id,name:{$in:["order_status_refunded","order_status_reversed"]}}},update(i){return A.find(i).count()>0}}}};var j=function(){var e=this,t=e._self._c;return t("b-modal",{staticClass:"dialog",attrs:{active:e.modalActive,width:460,"has-modal-card":!0},on:{"update:active":function(s){e.modalActive=s}}},[t("div",{staticClass:"modal-card"},[t("header",{staticClass:"modal-card-head"},[t("p",{staticClass:"modal-card-title"},[e._v("Discard order?")]),t("br")]),t("section",{staticClass:"modal-card-body"},[t("p",[e._v(" Are you certain you want to discard this order? The ordered items will "),t("b",[e._v("not")]),e._v(" be issued to the customer. ")]),t("b-field",{attrs:{label:"Select a reason for discarding this order:"}},[t("b-select",{attrs:{expanded:""},model:{value:e.reasonTag,callback:function(s){e.reasonTag=s},expression:"reasonTag"}},[t("option",{attrs:{value:"suspected_fraud"}},[e._v("Suspected fraud")]),t("option",{attrs:{value:"other"}},[e._v("Other")])])],1),t("b-field",{attrs:{label:"Any notes? (optional)",message:"Some notes that will appear in the order's timeline. Won't be displayed to the customer."}},[t("b-input",{attrs:{placeholder:"..."},model:{value:e.notes,callback:function(s){e.notes=s},expression:"notes"}})],1)],1),t("footer",{staticClass:"modal-card-foot"},[t("button",{staticClass:"button",on:{click:function(s){return s.preventDefault(),e.close()}}},[e._v("Cancel")]),t("button",{staticClass:"button is-danger is-outlined",on:{click:function(s){return s.preventDefault(),e.confirmDiscard()}}},[e._v(" Discard Order ")])])])])},W=[],B=x(H,j,W,!1,null,null,null,null);const Y=B.exports,N=new class{difference(e,t){const s=C(e).diff(t,"second");return C.duration(s,"seconds").humanize()}},U=D({__name:"items",props:{orderDetails:null},setup(i){const e=i,{data:t,items:s,events:c,replacements:u}=e.orderDetails,v=y(!1),w=y(),m=y(),n=y(),f=_(()=>{var l,g,b;const r=((l=u.data.value)==null?void 0:l.map((p,k)=>({_id:p._id,index:k+1,label:"Replacement",shortId:p.humanId,quantity:p.quantity,date:p.createdAt||new Date,select:()=>{n.value=p}})))||[];return n.value&&r.push({_id:"",index:0,label:"Original Order",date:((g=t.value)==null?void 0:g.viewModel.itemFulfillmentDate)||new Date,shortId:"",quantity:((b=t.value)==null?void 0:b.quantity)||0,select:()=>{n.value=void 0}}),r.reverse()}),h=_(()=>{var r,l;return window.App.$pluralize(((r=n.value)==null?void 0:r.quantity)||((l=t.value)==null?void 0:l.quantity)||0,"items")}),a=_(()=>n.value?{entries:o.data.value,ready:o.ready.value}:{entries:s.stock.value||[],ready:s.ready.value}),d=_(()=>{var r;return(r=n.value)==null?void 0:r._id}),o=I.subscribe("order.replacement.items",d,"").track(()=>O.find({replacementId:d.value}));return R(c.data,r=>{r==null||r.forEach(l=>{l.is("order_on_hold")&&(w.value=l),l.is("order_viewed")&&(m.value=l)})},{immediate:!0}),{__sfc:!0,props:e,order:t,items:s,events:c,replacements:u,discardModalActive:v,orderHoldEvent:w,orderViewedEvent:m,activeReplacement:n,replacementDropdown:f,itemCountStr
1ing:h,itemList:a,replacementId:d,replacementItems:o,AsAdminDiscardOrderModal:Y,OrderItemsBlock:T,OrderItemsDropdown:M,DarkTooltip:F,AsDropdown:$,DropdownItem:E,IconLoadingSpinner:S,MarkdownContent:P,PageContentLoader:q,catchRelationshipError:L,RouteHelper:z,startCase:V,TimeFormatter:N}}});var G=function(){var e=this,t=e._self._c,s=e._self._setupProxy;return t("div",[t(s.PageContentLoader,{attrs:{ready:!!s.order},scopedSlots:e._u([{key:"no-loading-requirement",fn:function(){var c,u,v,w,m,n,f,h;return[((c=s.order)==null?void 0:c.status)==="hold"?t("article",{staticClass:"tw-space-y-4"},[t("div",{staticClass:"tw-rounded-md tw-bg-gray-900/70 tw-px-14 tw-py-8 tw-space-y-4"},[t("h4",{staticClass:"tw-mb-2 tw-text-lg tw-font-medium tw-leading-loose"},[e._v("⚠️ Manual Review Required")]),t("p",{staticClass:"tw-leading-relaxed tw-text-gray-300/80"},[e._v(" We flag orders for manual review to protect your store from fraudulent transactions. We recommend that you review the customer's past activity and determine whether or not you want to fulfill their order. ")]),t("div",{staticClass:"tw-py-4"},[t("div",{staticClass:"tw-border-l-4 tw-border-purple-700 tw-bg-purple-700/5 tw-py-4 tw-pl-4"},[t("h5",{staticClass:"tw-mb-2 tw-font-medium"},[e._v("Why this order was flagged")]),t("div",{staticClass:"tw-py-2 tw-pl-4 tw-text-gray-300/80"},[(v=(u=s.orderHoldEvent)==null?void 0:u.data)!=null&&v.message?t(s.MarkdownContent,{staticClass:"tw-flex tw-flex-col tw-gap-2",attrs:{source:(m=(w=s.orderHoldEvent)==null?void 0:w.data)==null?void 0:m.message}}):t("div",[e._v(" Ooops! Looks like we couldn't recover the original reason for flagging this order. 😱 "),t("span",{staticClass:"tw-mt-4 tw-block"},[e._v("Please contact us if this happens again.")])])],1)])]),t("div",{staticClass:"tw-leading-loose"},[t("h5",{staticClass:"tw-mb-2 tw-font-medium"},[e._v("Remember to refund")]),t("p",{staticClass:"tw-leading-normal tw-text-gray-300/80"},[e._v(" Please note that this order may have been paid for by the customer. Should you choose to not fulfill the order, you will have to manually issue a refund through the payment system your customer used. ")])]),t("div",{staticClass:"tw-pt-6 tw-space-x-2"},[t("button",{staticClass:"tw-bg-green-600/50 tw-transition-colors tw-button hover:tw-bg-green-600",on:{click:function(a){return a.preventDefault(),e.orderDetails.approve()}}},[e._v(" Approve order ")]),t("button",{staticClass:"tw-bg-transparent tw-text-red-400 tw-transition-colors tw-button hover:tw-bg-red-600/70 hover:tw-text-white",on:{click:function(a){a.preventDefault(),s.discardModalActive=!0}}},[e._v(" Discard ")])])])]):((n=s.order)==null?void 0:n.status)==="awaiting-manual-payment-verification"?t("article",{staticClass:"tw-space-y-4"},[t("div",{staticClass:"tw-rounded-md tw-bg-gray-900/70 tw-px-14 tw-py-8 tw-space-y-4"},[t("h4",{staticClass:"tw-mb-2 tw-text-lg tw-font-medium tw-leading-loose"},[e._v("✅ Payment verification needed")]),t("p",{staticClass:"tw-leading-relaxed tw-text-gray-300/80"},[e._v(" The customer has submitted a payment through a custom payment method. You will need to verify that the payment has been received before fulfilling the order. ")]),t("div",{staticClass:"tw-border-l-4 tw-border-purple-700 tw-bg-purple-700/5 tw-py-4 tw-pl-4"},[t("h5",{staticClass:"tw-mb-2 tw-font-medium"},[e._v("Custom gateway: "+e._s(s.startCase(s.order.paymentMethod)))]),(f=s.order.paymentFormData)!=null&&f.input?t("div",{staticClass:"tw-py-2 tw-pl-4 tw-text-gray-300/80"},[t("pre",[t("code",[e._v(e._s((h=s.order.paymentFormData)==null?void 0:h.input))])])]):e._e()]),t("div",{staticClass:"tw-leading-loose"},[t("h5",{staticClass:"tw-mb-2 tw-font-medium"},[e._v("Remember to double check that all is in order")]),t("p",{staticClass:"tw-leading-normal tw-text-gray-300/80"},[e._v(" You should never fulfill an order until you have made certain that you have indeed received payment in full for the order. ")])]),t("div",{staticClass:"tw-pt-6 tw-space-x-2"},[t("button",{staticClass:"tw-bg-green-600/50 tw-transition-colors tw-button hover:tw-bg-green-600",on:{click:function(a){return a.preventDefault(),e.orderDetails.approve()}}},[e._v(" Approve order ")]),t("button",{staticClass:"tw-bg-transparent tw-text-red-400 tw-transition-colors tw-button hover:tw-bg-red-600/70 hover:tw-text-white",on:{click:function(a){a.preventDefault(),s.discardModalActive=!0}}},[e._v(" Discard ")])])])]):s.order.status==="discarded"?t("article",[t("section",{staticClass:"section"},[t("div",{staticClass:"content has-text-centered"},[t("p",[t("b-icon",{attrs:{icon:"playlist-remove",size:"is-large"}})],1),t("p",[e._v(" This order has been discarded. ")])])])]):!s.order.paid&&!s.order.fulfilled?t("article",[t("div",{staticClass:"tw-grid tw-place-items-center tw-bg-gray-900/50 tw-px-4 tw-py-6 tw-shadow-inner"},[t("div",{staticClass:"tw-max-w-md tw-py-8 tw-text-center tw-text-sm tw-space-y-4"},[t("b-icon",{staticClass:"tw-opacity-80",attrs:{icon:"cash-lock",size:"is-large"}}),t("p",{staticClass:"tw-text-lg tw-font-bold"},[e._v(" Order not paid ")]),t("p",{staticClass:"tw-mt-2"},[e._v(" Once the customer completes the checkout process, we'll pull out the requested items from your stock and add them to the user's order. ")]),t("p",[e._v(" A confirmation email linking the user to their order will also be sent out to the email address they specified. ")]),t("p",[t("router-link",{staticClass:"tw-font-medium tw-underline tw-transition-colors is-capitalized hover:tw-text-purple-400",attrs:{to:s.RouteHelper.merchant.viewOrder(s.order)}},[e._v(" View order as customer ")])],1)],1)]),t("div",{staticClass:"tw-mt-4 tw-flex tw-justify-end"},[t("a",{staticClass:"tw-inline-flex tw-items-center tw-gap-2 tw-bg-indigo-600/70 tw-text-indigo-100 tw-transition-colors tw-button hover:tw-text-indigo-100/90 hover:tw-bg-indigo-600/60",attrs:{href:"#"},on:{click:function(a){return a.preventDefault(),e.orderDetails.markAsPaid()}}},[t("b-icon",{staticClass:"tw-opacity-80",attrs:{icon:"tag",size:"is-small"}}),e._v(" Paid with another payment method? ")],1)])]):t("article",{key:"items"}
1,[t(s.OrderItemsBlock,{attrs:{loading:s.items.hasStatus("loading")||!s.itemList.ready,"hover-events":s.items.hasStatus("restricted"),"can-hide-overlay":!0,"line-items":s.itemList.entries,order:s.order},scopedSlots:e._u([{key:"header",fn:function(){var a,d;return[t("b-icon",{staticClass:"tw-mt-1 tw-opacity-75",attrs:{icon:s.activeReplacement?"basket-plus-outline":"basket-outline",size:"is-small"}}),t("div",{staticClass:"tw-text-sm md:tw-text-base"},[t("div",{staticClass:"tw-mb-1 tw-flex tw-items-center tw-gap-3 tw-font-medium"},[s.activeReplacement?t("span",[e._v("Replacement")]):t("span",[e._v("Original Order")]),s.activeReplacement?t("span",{staticClass:"tw-text-xs tw-tracking-wide tw-opacity-50"},[e._v("#"+e._s(s.activeReplacement.humanId))]):e._e(),t("div",[t(s.OrderItemsDropdown,{attrs:{items:s.itemList.entries}})],1)]),t("div",{staticClass:"tw-flex tw-gap-2 tw-text-xs tw-font-medium tw-opacity-75 md:tw-text-sm"},[t("span",[e._v(e._s(s.itemCountString))]),t("span",{staticClass:"tw-opacity-50"},[e._v("•")]),t("span",[e._v(e._s(e.$formatDate(((a=s.activeReplacement)==null?void 0:a.createdAt)||s.order.viewModel.itemFulfillmentDate)))]),s.activeReplacement?t("span",{staticClass:"tw-opacity-50"},[e._v("•")]):e._e(),s.activeReplacement?t("span",[e._v(" Issued by "+e._s(s.catchRelationshipError({get:()=>s.activeReplacement.user.name,fallbackValue:"unknown user"}))+" ")]):e._e()])]),t("div",{staticClass:"tw-flex-grow"}),(d=e.orderDetails.replacements.data.value)!=null&&d.length?t(s.AsDropdown,{attrs:{menu:{padding:"none"}},scopedSlots:e._u([{key:"trigger",fn:function(){return[t("div",{staticClass:"tw-mx-2 tw-rounded tw-bg-gray-800 tw-py-1 tw-text-sm tw-font-medium"},[t("div",{staticClass:"tw-flex tw-items-center tw-gap-2 tw-px-3"},[s.activeReplacement?t("span",{staticClass:"tw-ml-1"},[t("span",[e._v("Replacement")])]):e._e(),s.activeReplacement?t("span",[t("span",{staticClass:"tw-text-xs tw-opacity-50"},[e._v("#"+e._s(s.activeReplacement.humanId))])]):t("span",[e._v(" View replacements ")]),t("b-icon",{attrs:{icon:"chevron-down",size:"is-small"}})],1)])]},proxy:!0},{key:"menu",fn:function(){return[t(s.DropdownItem,e._l(s.replacementDropdown,function(o){return!s.activeReplacement||s.activeReplacement._id!==o._id?t("a",{staticClass:"tw-block tw-px-6 tw-py-2 tw-text-slate-300 tw-transition-colors md:tw-w-64 hover:tw-bg-slate-800",attrs:{href:"#"},on:{click:function(r){return r.preventDefault(),o.select()}}},[t("div",{staticClass:"tw-flex tw-justify-between"},[t("div",{staticClass:"tw-font-bold"},[e._v(" "+e._s(o.label)+" "),o.index?t("span",[e._v("#"+e._s(o.index))]):e._e()]),t("div",{staticClass:"tw-font-medium tw-opacity-75"},[e._v(e._s(e.$pluralize(o.quantity,"items")))])]),t("div",{staticClass:"tw-flex tw-justify-between"},[t("div",{staticClass:"tw-font-medium tw-opacity-75"},[e._v(e._s(e.$formatDate(o.date)))]),t("div",{staticClass:"tw-text-xs tw-font-medium tw-opacity-50"},[o.shortId?t("span",[e._v("#"+e._s(o.shortId))]):e._e()])])]):e._e()}),0)]},proxy:!0}],null,!1,1375977552)}):e._e(),t("div",{staticClass:"tw-z-10 tw-inline-block tw-group/tooltip"},[t(s.DarkTooltip,{attrs:{align:"right",position:"bottom"}},[s.orderViewedEvent?t("span",[e._v(" The customer accessed the order items "+e._s(s.TimeFormatter.difference(s.orderViewedEvent.createdAt,s.order.paidAt))+" after the order was fulfilled. ")]):t("span",[e._v(" The customer hasn't yet accessed their order items ")])]),s.orderViewedEvent?t("span",{staticClass:"tw-inline-flex tw-items-center tw-gap-1 tw-rounded tw-border-2 tw-border-green-500/30 tw-px-2 tw-py-1 tw-text-xs tw-font-bold tw-text-green-300/70 tw-transition-colors hover:tw-border-green-500/40 hover:tw-text-green-300/80"},[t("b-icon",{attrs:{icon:"eye",size:"is-small"}}),e._v(" Accessed ")],1):t("span",{staticClass:"tw-items-center tw-rounded tw-bg-gray-600 tw-px-1 tw-text-xs tw-opacity-75 tw-py-0.5 md:tw-py-1"},[e._v(" Not accessed yet ")])],1)]},proxy:!0},s.items.hasStatus("restricted")?{key:"overlay",fn:function(){return[t("div",{staticClass:"tw-space-y-4"},[t("b-icon",{attrs:{icon:"alert",size:"is-large"}}),t("p",[e._v("Order items have been restricted")]),t("div",[e._v(' "'+e._s(s.order.restrictedReason)+'" ')])],1)]},proxy:!0}:s.items.hasStatus("no-items")?{key:"overlay",fn:function(){return[t("div",{staticClass:"tw-space-y-4"},[t("b-icon",{attrs:{icon:"alert-octagon",size:"is-large"}}),t("p",{staticClass:"tw-font-bold"},[e._v(" Something went horribly wrong! ")]),t("p",{staticClass:"tw-mt-2"},[e._v(" Looks like your order wasn't fulfilled properly. Please contact support for more info. ")])],1)]},proxy:!0}:s.items.hasStatus("partially-fulfilled")?{key:"overlay",fn:function(){return[t("div",{staticClass:"tw-space-y-4"},[t("p",[t("b-icon",{attrs:{icon:"sync-alert",size:"is-large"}})],1),t("p",{staticClass:"tw-mx-auto tw-w-64"},[e._v(" An unexpected issue prevented this order from fulfilling ")]),t("p",[t("a",{staticClass:"tw-font-sans button is-primary",class:s.items.loading.class("retryFulfillment"),attrs:{href:"#"},on:{click:function(a){return a.preventDefault(),s.items.retryFulfillment()}}},[e._v(" Retry ")])])])]},proxy:!0}:s.items.hasStatus("pending")?{key:"overlay",fn:function(){return[t("div",{key:"loading",staticClass:"tw-flex tw-gap-4 tw-text-left"},[t(s.IconLoadingSpinner,{staticClass:"tw-mt-1 tw-h-5 tw-w-5"}),t("div",[t("h6",{staticClass:"tw-mb-2 tw-font-medium"},[e._v("Order is being fulfilled...")]),t("p",{staticClass:"tw-mx-auto tw-w-80"},[e._v(" This order is currently pending fulfillment. It shouldn't take more than a minute or two. ")])])],1)]},proxy:!0}:null],null,!0)}),t("div",{staticClass:"tw-mt-4 tw-flex tw-flex-col tw-justify-end tw-gap-4 sm:tw-flex-row"},[s.order.status==="completed"?t("a",{staticClass:"tw-bg-transparent tw-text-slate-200 tw-transition-colors tw-button hover:tw-bg-red-600/80 hover:tw-text-red-50",attrs:{href:"#"},on:{click:function(a){return a.preventDefault(),s.items.restrict()}}},[t("b-icon",{staticClass:"tw-opacity-90",attrs:{icon:"lock",size:"is-small"}}),e._v(" Restrict items ")],1):s.order.status==="restricted"?t("a",{staticClass:"tw-bg-gray-600/75 tw-text-slate-200 tw-transition-colors tw-button hover:tw-bg-red-600/40 hover:tw-text-red-100",attrs:{href:"#"},on:{click:function(a){return a.preventDefault(),s.items.unRestrict()}}},[t("b-icon",{staticClass:"tw-opacity-90",attrs:{icon:"lock-open",size:"is-small"}}
1),e._v(" Un-restrict items ")],1):e._e(),t("a",{staticClass:"tw-bg-indigo-600 tw-text-indigo-100 tw-transition-colors tw-button hover:tw-bg-indigo-600/90 hover:tw-text-white/80",class:e.orderDetails.loading.class("replaceItems"),attrs:{href:"#"},on:{click:function(a){return a.preventDefault(),e.orderDetails.replaceItems()}}},[t("b-icon",{staticClass:"tw-opacity-90",attrs:{icon:"basket-plus",size:"is-small"}}),e._v(" Add Replacement Items ")],1)])],1)]},proxy:!0}])},[t(s.AsAdminDiscardOrderModal,{staticClass:"tw-text-gray-800",attrs:{order:s.order,active:s.discardModalActive}})],1)],1)},J=[],K=x(U,G,J,!1,null,null,null,null);const Ct=K.exports;export{Ct 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.