diff --git a/assets/build/js/react/admin/order.js b/assets/build/js/react/admin/order.js index 13d1a06e59..336678f8b7 100644 --- a/assets/build/js/react/admin/order.js +++ b/assets/build/js/react/admin/order.js @@ -1587,4 +1587,4 @@ to { z-index: 0; } ${c=>c.$disabled&&"\n\t\tpointer-events: none;\n\t\topacity: 0.5;\n\t"} -`;var G0,s0,r0,g0,x0,m0,H0,Z0,R0,I0,W0,p0,h0,y0,B0=function(c){var e=c.size,t=void 0===e?20:e,l=c.color,n=void 0===l?"#4D5761":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 20 20",fill:"none",children:(0,H.jsx)("path",{d:"M12.5 5L7.5 10L12.5 15",stroke:n,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})},V0=function(c){var e=c.size,t=void 0===e?20:e;return c.color,c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 20 20",fill:"none",children:(0,H.jsx)("path",{d:"M6.125 11.75L9.875 8L6.125 4.25",stroke:"#4D5761","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})},v0=rt.div(G0||(G0=x(["\n\tbackground: #fff;\n\tborder: 1px solid var(--directorist-color-light);\n\tborder-radius: 8px;\n\tbox-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);\n\t&:not(:last-child) {\n\t\tmargin-bottom: 24px;\n\t}\n"]))),F0=rt.div(s0||(s0=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 20px 32px;\n\tborder-bottom: 1px solid var(--color-light);\n"]))),Y0=rt.div(r0||(r0=x([""]))),J0=rt.div(g0||(g0=x(["\n\twidth: 24px;\n\theight: 24px;\n\tmargin-right: 12px;\n\tcolor: #64748b;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n"]))),C0=rt.h3(x0||(x0=x(["\n\tmargin: 0;\n\tfont-size: 16px;\n\tfont-weight: 600;\n\tcolor: var(--wpmvc-gray-900);\n"]))),N0=rt.div(m0||(m0=x(["\n\tmin-height: 20px;\n\tpadding: 24px 32px;\n"]))),f0=rt.div(H0||(H0=x([""])));function k0(c){var e=c.title,t=c.icon,l=c.headerAction,n=c.children,d=c.footer,b=c.className;return(0,H.jsxs)(v0,{className:b,children:[(0,H.jsxs)(F0,{children:[(0,H.jsxs)(f0,{children:[t&&(0,H.jsx)(J0,{children:t}),(0,H.jsx)(C0,{children:e})]}),l&&l]}),(0,H.jsx)(N0,{children:n}),(0,H.jsx)(Y0,{children:d})]})}rt.div(Z0||(Z0=x([""])));var w0,z0,S0,A0,Q0,O0,U0,T0,L0,j0=rt.div(R0||(R0=x(["\n\t.directorist-order-details-label {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tmargin: 0 0 6px;\n\t}\n\t.directorist-order-id {\n\t\tfont-size: 24px;\n\t\tfont-weight: 400;\n\t\tcolor: var(--color-gray-900);\n\t\tmargin-right: 10px;\n\t}\n\t.directorist-order-details-meta {\n\t\tfont-size: 12px;\n\t\tfont-weight: 400;\n\t\tcolor: var(--color-gray-600);\n\t}\n"]))),D0=rt.ul(I0||(I0=x(["\n\t&.directorist-has-border {\n\t\tli {\n\t\t\tborder-top: 1px solid var(--color-gray-200);\n\t\t\tpadding: 14px 0 7px;\n\t\t}\n\t}\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tmargin: 0;\n\t\tpadding-bottom: 14px;\n\n\t\t&.directorist-list-highlight {\n\t\t\tspan {\n\t\t\t\tfont-size: 14px;\n\t\t\t\tfont-weight: 500;\n\t\t\t\tcolor: var(--color-gray-900);\n\t\t\t}\n\t\t}\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t\tpadding-bottom: 0;\n\t\t}\n\t\tspan {\n\t\t\tfont-size: 12px;\n\t\t\tcolor: var(--color-gray-600);\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.directorist-list-coupon {\n\t\t\t.directorist-badge {\n\t\t\t\tmargin-right: 8px;\n\t\t\t}\n\t\t}\n\t}\n"]))),M0=rt.ul(W0||(W0=x([""]))),E0=rt.li(p0||(p0=x(["\n\tspan {\n\t\tfont-size: 12px;\n\t\tfont-weight: 400;\n\t\tmargin: 6px 0 0;\n\t\tdisplay: block;\n\t\tcolor: var(--color-gray-500);\n\t}\n\tp {\n\t\tfont-size: 14px;\n\t\tfont-weight: 400;\n\t\tmargin: 2px 0 0;\n\t\tcolor: var(--color-gray-900);\n\t}\n"]))),P0=rt.ul(h0||(h0=x(["\n\t.directorist-infobox-item {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 5px;\n\t\t&:not(:last-child) {\n\t\t\tmargin-bottom: 14px;\n\t\t}\n\t\t.directorist-infobox-item-label {\n\t\t\tfont-size: 14px;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--color-gray-900);\n\t\t}\n\t\t.directorist-infobox-item-text {\n\t\t\tfont-size: 12px;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: var(--color-gray-500);\n\t\t}\n\t}\n"])));function K0(c){var e,t,l,n,d,b=c.order,i=(null==b||null===(e=b.user)||void 0===e?void 0:e.display_name)||(null==b||null===(t=b.user)||void 0===t?void 0:t.user_email)||(0,Rt.__)("Guest customer","directorist"),a=(null==b||null===(l=b.user)||void 0===l?void 0:l.user_email)||(0,Rt.__)("No user account","directorist");return(0,H.jsx)(k0,{title:"Customer Information",children:(0,H.jsxs)(P0,{children:[(0,H.jsxs)("li",{className:"directorist-infobox-item",children:[(0,H.jsx)("span",{className:"directorist-infobox-item-label",children:i}),(0,H.jsx)("span",{className:"directorist-infobox-item-text",children:a})]}),(null==b||null===(n=b.user)||void 0===n?void 0:n.phone)&&(0,H.jsxs)("li",{className:"directorist-infobox-item",children:[(0,H.jsx)("span",{className:"directorist-infobox-item-label",children:(0,Rt.__)("Phone Number","directorist")}),(0,H.jsx)("span",{className:"directorist-infobox-item-text",children:null==b||null===(d=b.user)||void 0===d?void 0:d.phone})]})]})})}function _0(c){var e=c.order;return(0,H.jsxs)(k0,{title:(0,Rt.__)("Order Details","directorist"),children:[(0,H.jsxs)(j0,{children:[(0,H.jsxs)("div",{className:"directorist-order-details-label",children:[(0,H.jsxs)("span",{className:"directorist-order-id",children:[(0,Rt.sprintf)((0,Rt.__)("Order ID: %s","directorist"),null==e?void 0:e.id),e.legacy_id&&(0,H.jsx)("span",{style:{color:"#6b7280",fontSize:"12px",marginLeft:"8px"},children:(0,Rt.sprintf)((0,Rt.__)("Old ID: #%d","directorist"),e.legacy_id)})]}),(0,H.jsx)(_$,{className:"directorist-badge",variant:U$(null==e?void 0:e.status),children:null==e?void 0:e.status})]}),(0,H.jsx)("span",{className:"directorist-order-details-meta",children:(0,Rt.sprintf)((0,Rt.__)("Placed on: %s","directorist"),S$("en-US",null==e?void 0:e.created_at,{year:"numeric",month:"long",day:"numeric"},!0))})]}),(0,H.jsxs)(D0,{className:"directorist-has-border",children:[(null==e?void 0:e.listing_id)&&(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Listing","directorist")}),(0,H.jsx)("span",{children:null==e?void 0:e.listing_title})]}),(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Order Type","directorist")}),(0,H.jsx)("span",{children:null==e?void 0:e.order_type})]}),(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Payment Method","directorist")}),(0,H.jsx)("span",{children:null==e?void 0:e.payment_method})]}),(null==e?void 0:e.transaction_id)&&(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Transaction ID","directorist")}),(0,H.jsx)("span",{children:null==e?void 0:e.transaction_id})]}),(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Amount","directorist")}),(0,H.jsxs)("span",{children:[" ",k$(null==e?void 0:e.amount,null==e?void 0:e.currency)]})]}),(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Sub Total","directorist")}),(0,H.jsx)("span",{children:k$(null==e?void 0:e.sub_total,null==e?void 0:e.currency)})]}),(null==e?void 0:e.discount_amount)&&(0,H.jsxs)("li",{children:[(0,H.jsxs)("span",{children:[null==e?void 0:e.discount_label," ",null!=e&&e.coupon_code?(0,H.jsxs)(_$,{variant:"success",className:"directorist-badge",children:[(0,Rt.__)("Coupon:","directorist")," ",null==e?void 0:e.coupon_code]}):""]}),(0,H.jsxs)("span",{children:["-",k$(null==e?void 0:e.discount_amount,null==e?void 0:e.currency)]})]}),(null==e?void 0:e.tax_amount)&&(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:null==e?void 0:e.tax_label}),(0,H.jsx)("span",{children:k$(null==e?void 0:e.tax_amount,null==e?void 0:e.currency)})]}),(0,H.jsxs)("li",{className:"directorist-list-highlight",children:[(0,H.jsx)("span",{children:(0,Rt.__)("Total Amount","directorist")}),(0,H.jsx)("span",{children:k$(null==e?void 0:e.total_amount,null==e?void 0:e.currency)})]})]})]})}rt.div(y0||(y0=x(["\n\tpadding: 16px 32px;\n\tborder-top: 1px solid rgba(0, 0, 0, 0.1);\n\ta {\n\t\ttext-decoration: underline;\n\t\tcolor: var(--color-primary-500);\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t}\n"])));var q0=Zt(w0||(w0=x(["\n\t0% { background-position: -400px 0; }\n\t100% { background-position: 400px 0; }\n"]))),$0=rt.div(z0||(z0=x(["\n\theight: ",";\n\twidth: ",";\n\tborder-radius: ",";\n\tmargin-bottom: ",";\n\tflex-shrink: 0;\n\tbackground: linear-gradient(\n\t\t90deg,\n\t\t#e2e8f0 0%,\n\t\t#cbd5e1 50%,\n\t\t#e2e8f0 100%\n\t);\n\tbackground-size: 800px 100%;\n\tanimation: "," 1.2s ease-in-out infinite;\n"])),function(c){return c.$h||"14px"},function(c){return c.$w||"100%"},function(c){return c.$radius||"4px"},function(c){return c.$mb||"0"},q0),c5=rt.div(S0||(S0=x(["\n\tpadding: 24px;\n\tdisplay: grid;\n\tgrid-template-columns: 2fr 1fr;\n\tgap: 24px;\n"]))),e5=rt.div(A0||(A0=x([""]))),t5=rt.div(Q0||(Q0=x(["\n\tbackground: #fff;\n\tborder: 1px solid #e7ecee;\n\tborder-radius: 8px;\n\tbox-shadow: 0 1px 2px rgba( 16, 24, 40, 0.05 );\n\t&:not( :last-child ) {\n\t\tmargin-bottom: 24px;\n\t}\n"]))),l5=rt.div(O0||(O0=x(["\n\tpadding: 20px 32px;\n\tborder-bottom: 1px solid #e7ecee;\n"]))),n5=rt.div(U0||(U0=x(["\n\tpadding: 24px 32px;\n"]))),d5=rt.div(T0||(T0=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tmargin-bottom: 8px;\n"]))),b5=rt.div(L0||(L0=x(["\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tgap: 16px;\n\tpadding: 14px 0;\n\tborder-top: 1px solid #f1f5f9;\n"])));function i5(c){var e=c.count;return(0,H.jsx)(H.Fragment,{children:Array.from({length:e}).map(function(c,e){return(0,H.jsxs)(b5,{children:[(0,H.jsx)($0,{$w:"35%",$h:"12px"}),(0,H.jsx)($0,{$w:"40%",$h:"12px"})]},e)})})}function a5(){return(0,H.jsxs)(c5,{children:[(0,H.jsxs)(e5,{children:[(0,H.jsxs)(t5,{children:[(0,H.jsx)(l5,{children:(0,H.jsx)($0,{$w:"120px",$h:"18px"})}),(0,H.jsxs)(n5,{children:[(0,H.jsxs)(d5,{children:[(0,H.jsx)($0,{$w:"170px",$h:"24px"}),(0,H.jsx)($0,{$w:"64px",$h:"24px",$radius:"2px"})]}),(0,H.jsx)($0,{$w:"220px",$h:"11px",$mb:"4px"}),(0,H.jsx)(i5,{count:5})]})]}),(0,H.jsxs)(t5,{children:[(0,H.jsx)(l5,{children:(0,H.jsx)($0,{$w:"160px",$h:"18px"})}),(0,H.jsxs)(n5,{children:[(0,H.jsx)($0,{$w:"50%",$h:"13px",$mb:"8px"}),(0,H.jsx)($0,{$w:"30%",$h:"13px"})]})]})]}),(0,H.jsxs)(e5,{children:[(0,H.jsxs)(t5,{children:[(0,H.jsx)(l5,{children:(0,H.jsx)($0,{$w:"150px",$h:"18px"})}),(0,H.jsxs)(n5,{children:[(0,H.jsx)($0,{$w:"55%",$h:"14px",$mb:"8px"}),(0,H.jsx)($0,{$w:"80%",$h:"12px",$mb:"16px"}),(0,H.jsx)($0,{$w:"65%",$h:"12px"})]})]}),(0,H.jsxs)(t5,{children:[(0,H.jsx)(l5,{children:(0,H.jsx)($0,{$w:"100px",$h:"18px"})}),(0,H.jsxs)(n5,{children:[(0,H.jsx)($0,{$w:"52px",$h:"24px",$radius:"2px",$mb:"6px"}),(0,H.jsx)($0,{$w:"45%",$h:"11px",$mb:"6px"}),(0,H.jsx)($0,{$w:"90%",$h:"13px"})]})]})]})]})}function o5(c){var e,t=c.order,l=function(c){var e=c.method.replace("_"," ").toUpperCase(),t=c.currency,l=c.amount,n=c.transaction_id;switch(c.status){case"paid":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s was successfully processed via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"pending":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s is pending confirmation via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"failed":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s failed via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"cancelled":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s was cancelled via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"refunded":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s was refunded via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"unpaid":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s is unpaid via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"expired":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s has expired via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);default:return(0,Rt.sprintf)((0,Rt.__)("Payment status: %s","directorist"),c.status)}};return(0,H.jsx)(k0,{title:"Payment Log",children:(0,H.jsx)(M0,{children:null==t||null===(e=t.payments)||void 0===e?void 0:e.map(function(c,e){return(0,H.jsxs)(E0,{children:[(0,H.jsx)(_$,{className:"directorist-badge",variant:"pending"===(null==c?void 0:c.status)?"warning":"paid"===(null==c?void 0:c.status)?"success":"error",children:null==c?void 0:c.status}),(0,H.jsx)("span",{children:S$("en-US",c.created_at,{year:"numeric",month:"long",day:"numeric"},!0)}),(0,H.jsx)("p",{className:"directorist-payment-log-description",children:l(c)})]},e)})})})}var u5,X5,G5,s5=function(c){var e=c.size,t=void 0===e?12:e,l=c.color,n=void 0===l?"#3E62F5":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 12 12",fill:"none",children:(0,H.jsx)("path",{d:"M1.5 0.75L6 5.25L10.5 0.75",stroke:n,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})},r5=function(c){var e=c.size,t=void 0===e?18:e,l=c.color,n=void 0===l?"#3E62F5":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 18 18",fill:"none",children:(0,H.jsx)("path",{d:"M13.5 11.25L9 6.75L4.5 11.25",stroke:n,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})},g5=function(c){var e=c.size,t=void 0===e?28:e,l=c.color,n=void 0===l?"#DD8C08":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 28 28",fill:"none",children:(0,H.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.9974 24.8307C11.1242 24.8307 8.36872 23.6894 6.33707 21.6577C4.30543 19.6261 3.16406 16.8706 3.16406 13.9974C3.16406 11.1242 4.30543 8.36872 6.33707 6.33707C8.36872 4.30543 11.1242 3.16406 13.9974 3.16406C16.8706 3.16406 19.6261 4.30543 21.6577 6.33707C23.6894 8.36872 24.8307 11.1242 24.8307 13.9974C24.8307 16.8706 23.6894 19.6261 21.6577 21.6577C19.6261 23.6894 16.8706 24.8307 13.9974 24.8307ZM0.664062 13.9974C0.664062 10.4612 2.06882 7.06979 4.56931 4.56931C7.06979 2.06882 10.4612 0.664063 13.9974 0.664062C17.5336 0.664063 20.925 2.06882 23.4255 4.56931C25.926 7.06979 27.3307 10.4612 27.3307 13.9974C27.3307 17.5336 25.926 20.925 23.4255 23.4255C20.925 25.926 17.5336 27.3307 13.9974 27.3307C10.4612 27.3307 7.06979 25.926 4.56931 23.4255C2.06882 20.925 0.664063 17.5336 0.664062 13.9974ZM13.9974 20.6641C12.2293 20.6641 10.5336 19.9617 9.28335 18.7114C8.03311 17.4612 7.33073 15.7655 7.33073 13.9974H13.9974V7.33073C15.7655 7.33073 17.4612 8.03311 18.7114 9.28335C19.9617 10.5336 20.6641 12.2293 20.6641 13.9974C20.6641 15.7655 19.9617 17.4612 18.7114 18.7114C17.4612 19.9617 15.7655 20.6641 13.9974 20.6641Z",fill:n})})},x5=function(c){var e=c.size,t=void 0===e?28:e,l=c.color,n=void 0===l?"#14B570":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 28 28",fill:"none",children:(0,H.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.9974 24.8307C11.1242 24.8307 8.36872 23.6894 6.33707 21.6577C4.30543 19.6261 3.16406 16.8706 3.16406 13.9974C3.16406 11.1242 4.30543 8.36872 6.33707 6.33707C8.36872 4.30543 11.1242 3.16406 13.9974 3.16406C16.8706 3.16406 19.6261 4.30543 21.6577 6.33707C23.6894 8.36872 24.8307 11.1242 24.8307 13.9974C24.8307 16.8706 23.6894 19.6261 21.6577 21.6577C19.6261 23.6894 16.8706 24.8307 13.9974 24.8307ZM0.664062 13.9974C0.664062 10.4612 2.06882 7.06979 4.56931 4.56931C7.06979 2.06882 10.4612 0.664063 13.9974 0.664062C17.5336 0.664063 20.925 2.06882 23.4255 4.56931C25.926 7.06979 27.3307 10.4612 27.3307 13.9974C27.3307 17.5336 25.926 20.925 23.4255 23.4255C20.925 25.926 17.5336 27.3307 13.9974 27.3307C10.4612 27.3307 7.06979 25.926 4.56931 23.4255C2.06882 20.925 0.664063 17.5336 0.664062 13.9974ZM19.8807 11.5474L18.1141 9.78073L12.3307 15.5641L9.88073 13.1141L8.11406 14.8807L12.3307 19.0974L19.8807 11.5474Z",fill:n})})},m5=rt.div(u5||(u5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 24px 32px;\n\t.directorist-refund-summary-item {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 12px;\n\t\t&:not(:last-child) {\n\t\t\tpadding-right: 30px;\n\t\t\tmargin-right: 30px;\n\t\t\t&::before {\n\t\t\t\tcontent: '';\n\t\t\t\tposition: absolute;\n\t\t\t\tright: 0;\n\t\t\t\ttop: 50%;\n\t\t\t\ttransform: translateY(-50%);\n\t\t\t\twidth: 1px;\n\t\t\t\theight: 30px;\n\t\t\t\tbackground-color: var(--color-gray-300);\n\t\t\t}\n\t\t}\n\t}\n\t.directorist-refund-summary-item__content {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 5px;\n\t}\n\t.directorist-refund-summary-item__label {\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--color-gray-600);\n\t}\n\t.directorist-refund-summary-item__value {\n\t\tfont-size: 16px;\n\t\tfont-weight: 500;\n\t\tcolor: var(--color-gray-900);\n\t}\n"]))),H5=rt.div(X5||(X5=x(["\n\t> div {\n\t\tpadding: 0;\n\t}\n\tmargin-bottom: 24px;\n\t.components-card__body {\n\t\tpadding: 0;\n\t}\n\t.dataviews-wrapper {\n\t\tborder-top: 1px solid var(--color-light);\n\t}\n"]))),Z5=rt.span(G5||(G5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tcursor: pointer;\n\tcolor: var(--color-primary-500);\n\t.directorist-refund-table-toggle-down-icon {\n\t\tposition: relative;\n\t\ttop: 4px;\n\t}\n\tsvg {\n\t\tmargin-left: 6px;\n\t}\n"])));function R5(c){var e,t=c.refundsData,l=c.availableRefundAmount;return(0,H.jsxs)(m5,{children:[(0,H.jsxs)("div",{className:"directorist-refund-summary-item",children:[(0,H.jsx)("span",{className:"directorist-refund-summary-item__icon",children:(0,H.jsx)(x5,{})}),(0,H.jsxs)("span",{className:"directorist-refund-summary-item__content",children:[(0,H.jsx)("span",{className:"directorist-refund-summary-item__label",children:(0,Rt.__)("Amount re-funded","directorist")}),(0,H.jsxs)("span",{className:"directorist-refund-summary-item__value",children:["$",null!==(e=null==t?void 0:t.total_refunded)&&void 0!==e?e:0]})]})]}),(0,H.jsxs)("div",{className:"directorist-refund-summary-item",children:[(0,H.jsx)("span",{className:"directorist-refund-summary-item__icon",children:(0,H.jsx)(g5,{})}),(0,H.jsxs)("span",{className:"directorist-refund-summary-item__content",children:[(0,H.jsx)("span",{className:"directorist-refund-summary-item__label",children:(0,Rt.__)("Available to re-fund","directorist")}),(0,H.jsxs)("span",{className:"directorist-refund-summary-item__value",children:["$",l]})]})]})]})}var I5,W5,p5,h5,y5,B5,V5,v5=[{id:"id",label:(0,Rt.__)("Refund ID","directorist")},{id:"amount",label:(0,Rt.__)("Amount","directorist"),render:function(c){var e=c.item;return(0,H.jsx)("span",{className:"directorist-refund-amount",children:k$(null==e?void 0:e.amount,null==e?void 0:e.currency)})}},{id:"reason",label:(0,Rt.__)("Reason","directorist")},{id:"status",label:(0,Rt.__)("Status","directorist"),render:function(c){var e=c.item;return(0,H.jsx)(_$,{className:"directorist-badge",variant:U$(null==e?void 0:e.status),children:null==e?void 0:e.status})}},{id:"created_at",label:(0,Rt.__)("Date","directorist")}];function F5(c){var e,t,l=c.order,n=g((0,o.useState)(!1),2),d=n[0],b=n[1];J$({name:"directorist/order-refund",path:"/directorist/v2/admin/orders/".concat(null==l?void 0:l.id,"/refunds")});var i=function({name:c,selector:e}){const{data:t,isResolved:l}=(0,Bt.useSelect)(t=>{const{hasFinishedResolution:l,get:n,show:d}=t(c);return{data:"get"===e?n():d(),isResolved:l(e)}},[c]);return{data:t,isResolved:l}}({name:"directorist/order-refund",selector:"get"}),a=i.data,u=parseFloat(null!==(e=null==l?void 0:l.total_amount)&&void 0!==e?e:"0")-parseFloat(null!==(t=null==a?void 0:a.total_refunded)&&void 0!==t?t:"0"),X={amount:{type:"number",label:(0,Rt.__)("Refund amount","directorist")},reason:{type:"text",label:(0,Rt.__)("Reason for refund","directorist")},status:{type:"select",label:(0,Rt.__)("Status","directorist"),options:[{label:(0,Rt.__)("Pending","directorist"),value:"pending"},{label:(0,Rt.__)("Processing","directorist"),value:"processing"},{label:(0,Rt.__)("Paid","directorist"),value:"paid"},{label:(0,Rt.__)("Rejected","directorist"),value:"rejected"}],isMulti:!1,menuPosition:"fixed"}};return(0,H.jsx)(H5,{children:(0,H.jsx)(i$,{heading:(0,Rt.__)("Refund Management","directorist"),storeName:"directorist/order-refund",path:"/directorist/v2/admin/orders/".concat(null==l?void 0:l.id,"/refunds"),columns:v5,showTable:d,create:{title:(0,Rt.__)("Add Refund","directorist"),buttonLabel:(0,Rt.__)("Add Refund","directorist"),fields:X,isDisabled:u<=0},edit:{title:(0,Rt.__)("Edit Refund","directorist"),buttonLabel:(0,Rt.__)("Edit Refund","directorist"),fields:X},beforeTable:(0,H.jsx)(R5,{refundsData:a,availableRefundAmount:u}),cardFooter:(0,H.jsx)(Z5,{onClick:function(){return b(!d)},children:d?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Hide Refund History","directorist")}),(0,H.jsxs)("span",{className:"directorist-refund-table-toggle-up-icon",children:[" ",(0,H.jsx)(r5,{})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("span",{children:[" ",(0,Rt.__)("Refund History","directorist")]}),(0,H.jsxs)("span",{className:"directorist-refund-table-toggle-down-icon",children:[" ",(0,H.jsx)(s5,{})]})]})})})})}var Y5,J5=rt.div(I5||(I5=x(["\n\tpadding: 24px;\n\tdisplay: grid;\n\tgrid-template-columns: 2fr 1fr;\n\tgrid-gap: 24px;\n\t.components-card {\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid var(--color-light);\n\t\tbox-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n\t}\n\t.components-card__header {\n\t\tborder-bottom: 1px solid rgba(0, 0, 0, 0.1);\n\t}\n\t.components-card__footer {\n\t\tborder-top: 1px solid rgba(0, 0, 0, 0.1);\n\t}\n"]))),C5=rt.div(W5||(W5=x([""]))),N5=rt.div(p5||(p5=x([""]))),f5=rt.div(h5||(h5=x(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\t.directorist-single-plan-logo {\n\t\tline-height: 0;\n\t}\n"]))),k5=rt.div(y5||(y5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\t.directorist-single-plan-logo {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tline-height: 0;\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tborder-radius: 50%;\n\t\tmargin-right: 10px;\n\t\tborder: 1px solid rgba(75, 85, 99, 0.1);\n\t\tbox-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n\t}\n\tul {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tlist-style: none;\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\tli {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tmargin-bottom: 0;\n\t\t\tsvg {\n\t\t\t\tposition: relative;\n\t\t\t\ttop: 2px;\n\t\t\t}\n\t\t}\n\t}\n"]))),w5=rt.div(B5||(B5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n"]))),z5=rt.div(V5||(V5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tborder-radius: 4px;\n\tpadding: 0 8px 0 12px;\n\theight: 34px;\n\tborder: 1px solid rgba(20, 25, 33, 0.1);\n\tspan {\n\t\tfont-size: 13px;\n\t\tfont-weight: 500;\n\t\tcolor: var(--color-gray-900);\n\t}\n\t.components-base-control__field {\n\t\tmargin-bottom: 0;\n\t}\n\t.components-input-control__backdrop {\n\t\tdisplay: none;\n\t}\n\t.wpmvc__control {\n\t\tborder: 0 none;\n\t\tmin-height: 24px;\n\t\tbackground-color: transparent;\n\t\tborder-radius: 0px;\n\t\t&.wpmvc__control--is-focused {\n\t\t\tbox-shadow: 0 0;\n\t\t}\n\t\t.wpmvc__value-container {\n\t\t\tpadding-right: 0;\n\t\t\tmin-width: 80px;\n\t\t}\n\t}\n"]))),S5=[{label:(0,Rt.__)("Pending","directorist"),value:"pending"},{label:(0,Rt.__)("Re-funded","directorist"),value:"refunded"},{label:(0,Rt.__)("Failed","directorist"),value:"failed"},{label:(0,Rt.__)("Cancelled","directorist"),value:"cancelled"},{label:(0,Rt.__)("Unpaid","directorist"),value:"unpaid"},{label:(0,Rt.__)("Expired","directorist"),value:"expired"},{label:(0,Rt.__)("Paid","directorist"),value:"paid"}];function A5(c){!function(c){if(null==c)throw new TypeError("Cannot destructure "+c)}(c);var e=g((0,o.useState)(!0),2),t=e[0],l=e[1],n=g((0,o.useState)("pending"),2),d=n[0],b=n[1],i=g((0,o.useState)(!1),2),a=i[0],u=i[1],X=function(){var c=g((0,o.useState)(X0),2),e=c[0],t=c[1];return(0,o.useEffect)(function(){var c=function(){return t(X0())};return window.addEventListener("hashchange",c),window.addEventListener("popstate",c),function(){window.removeEventListener("hashchange",c),window.removeEventListener("popstate",c)}},[]),e}(),G=(0,o.useMemo)(function(){return X?"/directorist/v2/admin/orders/".concat(X):""},[X]),s=X?"directorist/single-order/".concat(X):"directorist/single-order";!function(c){if((0,Bt.select)(c.name))return;const e=(0,Bt.createReduxStore)(c.name,function({path:c}){const e={path:c,values:{}};return{reducer(c=e,t){return WP(c,c=>{switch(t.type){case"SET":Object.assign(c.values,t.values);break;case"REMOVE":delete c.values[t.key]}})},actions:{...{set(c,e){return{type:"SET",values:"string"==typeof c?{[c]:e}:c}},remove(c){return{type:"REMOVE",key:c}}},refresh:()=>({dispatch:c})=>{c.invalidateResolution("get")},save:e=>async({dispatch:t})=>{let l=await zi({path:c,data:e,method:"POST"});return t.refresh(),l}},selectors:{get(c){return c.values},getByKey(c){return c.values}},resolvers:{get(){return async({dispatch:e})=>{const t=await zi({path:c});e.set(t)}}}}}(c));(0,Bt.register)(e)}({name:s,path:G});var r=function({name:c}){const{set:e,remove:t,refresh:l,save:n}=(0,Bt.useDispatch)(c);return{set:e,remove:t,refresh:l,save:n}}({name:s,path:G}),x=r.refresh,Z=function({name:c}){const{data:e,isResolved:t}=(0,Bt.useSelect)(e=>{const{get:t,hasFinishedResolution:l}=e(c);return{data:t(),isResolved:l("get")}},[c]);return{data:e,isResolved:t}}({name:s,path:G}),R=Z.data,I=Z.isResolved,W=null==R?void 0:R.order,p=I;(0,o.useEffect)(function(){l(!0)},[X]),(0,o.useEffect)(function(){t&&p&&(l(!1),b(null==W?void 0:W.status))},[p,t]);var h=function(){var c=y$(V$().mark(function c(){var e;return V$().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(X){c.next=1;break}return c.abrupt("return");case 1:return u(!0),c.prev=2,c.next=3,Si()({path:"directorist/v2/admin/orders/".concat(X,"/status"),method:"POST",data:{status:d}});case 3:(0,m.doAction)("wpmvc-toast",{message:(0,Rt.__)("Order status updated successfully","directorist-pricing-plans")}),x(),c.next=5;break;case 4:c.prev=4,e=c.catch(2),console.error("Failed to update order status:",e),(0,m.doAction)("wpmvc-toast",{type:"error",message:(0,Rt.__)("Oppps! Something went wrong","directorist-pricing-plans")});case 5:return c.prev=5,u(!1),x(),c.finish(5);case 6:case"end":return c.stop()}},c,null,[[2,4,5,6]])}));return function(){return c.apply(this,arguments)}}();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(It.Fill,{name:"wpmvc-header",children:(0,H.jsxs)(f5,{children:[(0,H.jsxs)(k5,{children:[(0,H.jsx)("a",{href:"#",className:"directorist-single-plan-logo",children:(0,H.jsx)(B0,{})}),(0,H.jsxs)("ul",{children:[(0,H.jsx)("li",{children:(0,H.jsx)("span",{children:(0,Rt.__)("Orders","directorist")})}),(0,H.jsxs)("li",{children:[(0,H.jsx)(V0,{}),(0,H.jsx)("span",{children:(0,Rt.__)("View Order","directorist")})]})]})]}),(0,H.jsxs)(w5,{children:[(0,H.jsxs)(z5,{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Order Status:","directorist")}),(0,H.jsx)(u0,{options:S5,onChange:function(c){b(c)},isSearchable:!1,value:d,isDisabled:a})]}),(0,H.jsx)(i0,{variant:"primary",onClick:h,isBusy:a,disabled:a,children:a?(0,Rt.__)("Saving...","directorist"):(0,Rt.__)("Save Order","directorist")})]})]})}),p?(0,H.jsxs)(J5,{children:[(0,H.jsxs)(C5,{children:[W&&(0,H.jsx)(_0,{order:W}),W&&(0,H.jsx)(F5,{order:W}),(0,H.jsx)(It.Slot,{name:"directorist-order-refund-after",children:function(c){if(c.length)return c}})]}),(0,H.jsxs)(N5,{children:[(0,H.jsx)(K0,{order:W}),(0,H.jsx)(o5,{order:W})]})]}):(0,H.jsx)(a5,{})]})}function Q5(c,e){var t=Object.keys(c);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(c);e&&(l=l.filter(function(e){return Object.getOwnPropertyDescriptor(c,e).enumerable})),t.push.apply(t,l)}return t}function O5(c){for(var e=1;e0?i(O5(O5({},b),{},G({},n,null===(a=u)||void 0===a?void 0:a.errors))):i(G({},n,[]))}};(0,m.addAction)("wpmvc-field-on-blur","directorist-form-validation",c),(0,m.addAction)("wpmvc-field-on-change","directorist-form-validation",c),(0,o.useEffect)(function(){var c=function(c){var e=c.target;if(e instanceof Element){var t=e.closest("#menu-posts-at_biz_dir a.wp-first-item");null!=t&&t.href&&(c.preventDefault(),c.stopPropagation(),window.location.assign(t.href))}};return document.addEventListener("click",c,!0),function(){document.removeEventListener("click",c,!0)}},[]);var e=[{path:"/",element:(0,H.jsx)(n0,{}),index:!0},{path:"/edit/:id",element:(0,H.jsx)(A5,{})}];return(0,H.jsx)(L5,{children:(0,H.jsx)(_q,{pageTopLevelID:"#menu-posts-at_biz_dir",rootPaths:U5,colors:{primary:"#3e62f5",error:"#D94A4A",gray:"#141921"},header:{logo:(0,H.jsx)("img",{src:"https://directorist.com/wp-content/uploads/2020/08/directorist_logo.png",alt:"Directorist",width:116}),actionItems:T5},routes:(0,m.applyFilters)("directorist_order_routes",e)})})}a()(function(){var c=document.querySelector(".directorist-orders-page");c&&(0,o.createRoot)(c).render((0,H.jsx)(j5,{}))})}()}(); \ No newline at end of file +`;var G0,s0,r0,g0,x0,m0,H0,Z0,R0,I0,W0,p0,h0,y0,B0=function(c){var e=c.size,t=void 0===e?20:e,l=c.color,n=void 0===l?"#4D5761":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 20 20",fill:"none",children:(0,H.jsx)("path",{d:"M12.5 5L7.5 10L12.5 15",stroke:n,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})},V0=function(c){var e=c.size,t=void 0===e?20:e;return c.color,c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 20 20",fill:"none",children:(0,H.jsx)("path",{d:"M6.125 11.75L9.875 8L6.125 4.25",stroke:"#4D5761","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})},v0=rt.div(G0||(G0=x(["\n\tbackground: #fff;\n\tborder: 1px solid var(--directorist-color-light);\n\tborder-radius: 8px;\n\tbox-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);\n\t&:not(:last-child) {\n\t\tmargin-bottom: 24px;\n\t}\n"]))),F0=rt.div(s0||(s0=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 20px 32px;\n\tborder-bottom: 1px solid var(--color-light);\n"]))),Y0=rt.div(r0||(r0=x([""]))),J0=rt.div(g0||(g0=x(["\n\twidth: 24px;\n\theight: 24px;\n\tmargin-right: 12px;\n\tcolor: #64748b;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n"]))),C0=rt.h3(x0||(x0=x(["\n\tmargin: 0;\n\tfont-size: 16px;\n\tfont-weight: 600;\n\tcolor: var(--wpmvc-gray-900);\n"]))),N0=rt.div(m0||(m0=x(["\n\tmin-height: 20px;\n\tpadding: 24px 32px;\n"]))),f0=rt.div(H0||(H0=x([""])));function k0(c){var e=c.title,t=c.icon,l=c.headerAction,n=c.children,d=c.footer,b=c.className;return(0,H.jsxs)(v0,{className:b,children:[(0,H.jsxs)(F0,{children:[(0,H.jsxs)(f0,{children:[t&&(0,H.jsx)(J0,{children:t}),(0,H.jsx)(C0,{children:e})]}),l&&l]}),(0,H.jsx)(N0,{children:n}),(0,H.jsx)(Y0,{children:d})]})}rt.div(Z0||(Z0=x([""])));var w0,z0,S0,A0,Q0,O0,U0,T0,L0,j0=rt.div(R0||(R0=x(["\n\t.directorist-order-details-label {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tmargin: 0 0 6px;\n\t}\n\t.directorist-order-id {\n\t\tfont-size: 24px;\n\t\tfont-weight: 400;\n\t\tcolor: var(--color-gray-900);\n\t\tmargin-right: 10px;\n\t}\n\t.directorist-order-details-meta {\n\t\tfont-size: 12px;\n\t\tfont-weight: 400;\n\t\tcolor: var(--color-gray-600);\n\t}\n"]))),D0=rt.ul(I0||(I0=x(["\n\t&.directorist-has-border {\n\t\tli {\n\t\t\tborder-top: 1px solid var(--color-gray-200);\n\t\t\tpadding: 14px 0 7px;\n\t\t}\n\t}\n\tli {\n\t\tdisplay: flex;\n\t\tjustify-content: space-between;\n\t\tmargin: 0;\n\t\tpadding-bottom: 14px;\n\n\t\t&.directorist-list-highlight {\n\t\t\tspan {\n\t\t\t\tfont-size: 14px;\n\t\t\t\tfont-weight: 500;\n\t\t\t\tcolor: var(--color-gray-900);\n\t\t\t}\n\t\t}\n\t\t&:last-child {\n\t\t\tborder-bottom: none;\n\t\t\tpadding-bottom: 0;\n\t\t}\n\t\tspan {\n\t\t\tfont-size: 12px;\n\t\t\tcolor: var(--color-gray-600);\n\t\t\tfont-weight: 500;\n\t\t}\n\t\t.directorist-list-coupon {\n\t\t\t.directorist-badge {\n\t\t\t\tmargin-right: 8px;\n\t\t\t}\n\t\t}\n\t}\n"]))),M0=rt.ul(W0||(W0=x([""]))),E0=rt.li(p0||(p0=x(["\n\tspan {\n\t\tfont-size: 12px;\n\t\tfont-weight: 400;\n\t\tmargin: 6px 0 0;\n\t\tdisplay: block;\n\t\tcolor: var(--color-gray-500);\n\t}\n\tp {\n\t\tfont-size: 14px;\n\t\tfont-weight: 400;\n\t\tmargin: 2px 0 0;\n\t\tcolor: var(--color-gray-900);\n\t}\n"]))),P0=rt.ul(h0||(h0=x(["\n\t.directorist-infobox-item {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 5px;\n\t\t&:not(:last-child) {\n\t\t\tmargin-bottom: 14px;\n\t\t}\n\t\t.directorist-infobox-item-label {\n\t\t\tfont-size: 14px;\n\t\t\tfont-weight: 500;\n\t\t\tcolor: var(--color-gray-900);\n\t\t}\n\t\t.directorist-infobox-item-text {\n\t\t\tfont-size: 12px;\n\t\t\tfont-weight: 400;\n\t\t\tcolor: var(--color-gray-500);\n\t\t}\n\t}\n"])));function K0(c){var e,t,l,n,d,b=c.order,i=(null==b||null===(e=b.user)||void 0===e?void 0:e.display_name)||(null==b||null===(t=b.user)||void 0===t?void 0:t.user_email)||(0,Rt.__)("Guest customer","directorist"),a=(null==b||null===(l=b.user)||void 0===l?void 0:l.user_email)||(0,Rt.__)("No user account","directorist");return(0,H.jsx)(k0,{title:"Customer Information",children:(0,H.jsxs)(P0,{children:[(0,H.jsxs)("li",{className:"directorist-infobox-item",children:[(0,H.jsx)("span",{className:"directorist-infobox-item-label",children:i}),(0,H.jsx)("span",{className:"directorist-infobox-item-text",children:a})]}),(null==b||null===(n=b.user)||void 0===n?void 0:n.phone)&&(0,H.jsxs)("li",{className:"directorist-infobox-item",children:[(0,H.jsx)("span",{className:"directorist-infobox-item-label",children:(0,Rt.__)("Phone Number","directorist")}),(0,H.jsx)("span",{className:"directorist-infobox-item-text",children:null==b||null===(d=b.user)||void 0===d?void 0:d.phone})]})]})})}function _0(c){var e=c.order;return(0,H.jsxs)(k0,{title:(0,Rt.__)("Order Details","directorist"),children:[(0,H.jsxs)(j0,{children:[(0,H.jsxs)("div",{className:"directorist-order-details-label",children:[(0,H.jsxs)("span",{className:"directorist-order-id",children:[(0,Rt.sprintf)((0,Rt.__)("Order ID: %s","directorist"),null==e?void 0:e.id),e.legacy_id&&(0,H.jsx)("span",{style:{color:"#6b7280",fontSize:"12px",marginLeft:"8px"},children:(0,Rt.sprintf)((0,Rt.__)("Old ID: #%d","directorist"),e.legacy_id)})]}),(0,H.jsx)(_$,{className:"directorist-badge",variant:U$(null==e?void 0:e.status),children:null==e?void 0:e.status})]}),(0,H.jsx)("span",{className:"directorist-order-details-meta",children:(0,Rt.sprintf)((0,Rt.__)("Placed on: %s","directorist"),S$("en-US",null==e?void 0:e.created_at,{year:"numeric",month:"long",day:"numeric"},!0))})]}),(0,H.jsxs)(D0,{className:"directorist-has-border",children:[(null==e?void 0:e.listing_id)&&(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Listing","directorist")}),(0,H.jsx)("span",{children:null==e?void 0:e.listing_title})]}),(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Order Type","directorist")}),(0,H.jsx)("span",{children:null==e?void 0:e.order_type})]}),(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Payment Method","directorist")}),(0,H.jsx)("span",{children:null==e?void 0:e.payment_method})]}),(null==e?void 0:e.transaction_id)&&(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Transaction ID","directorist")}),(0,H.jsx)("span",{children:null==e?void 0:e.transaction_id})]}),(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Amount","directorist")}),(0,H.jsxs)("span",{children:[" ",k$(null==e?void 0:e.amount,null==e?void 0:e.currency)]})]}),(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Sub Total","directorist")}),(0,H.jsx)("span",{children:k$(null==e?void 0:e.sub_total,null==e?void 0:e.currency)})]}),(null==e?void 0:e.discount_amount)&&(0,H.jsxs)("li",{children:[(0,H.jsxs)("span",{children:[null==e?void 0:e.discount_label," ",null!=e&&e.coupon_code?(0,H.jsxs)(_$,{variant:"success",className:"directorist-badge",children:[(0,Rt.__)("Coupon:","directorist")," ",null==e?void 0:e.coupon_code]}):""]}),(0,H.jsxs)("span",{children:["-",k$(null==e?void 0:e.discount_amount,null==e?void 0:e.currency)]})]}),(null==e?void 0:e.tax_amount)&&(0,H.jsxs)("li",{children:[(0,H.jsx)("span",{children:null==e?void 0:e.tax_label}),(0,H.jsx)("span",{children:k$(null==e?void 0:e.tax_amount,null==e?void 0:e.currency)})]}),(0,H.jsxs)("li",{className:"directorist-list-highlight",children:[(0,H.jsx)("span",{children:(0,Rt.__)("Total Amount","directorist")}),(0,H.jsx)("span",{children:k$(null==e?void 0:e.total_amount,null==e?void 0:e.currency)})]})]})]})}rt.div(y0||(y0=x(["\n\tpadding: 16px 32px;\n\tborder-top: 1px solid rgba(0, 0, 0, 0.1);\n\ta {\n\t\ttext-decoration: underline;\n\t\tcolor: var(--color-primary-500);\n\t\tfont-size: 12px;\n\t\tfont-weight: 600;\n\t}\n"])));var q0=Zt(w0||(w0=x(["\n\t0% { background-position: -400px 0; }\n\t100% { background-position: 400px 0; }\n"]))),$0=rt.div(z0||(z0=x(["\n\theight: ",";\n\twidth: ",";\n\tborder-radius: ",";\n\tmargin-bottom: ",";\n\tflex-shrink: 0;\n\tbackground: linear-gradient(\n\t\t90deg,\n\t\t#e2e8f0 0%,\n\t\t#cbd5e1 50%,\n\t\t#e2e8f0 100%\n\t);\n\tbackground-size: 800px 100%;\n\tanimation: "," 1.2s ease-in-out infinite;\n"])),function(c){return c.$h||"14px"},function(c){return c.$w||"100%"},function(c){return c.$radius||"4px"},function(c){return c.$mb||"0"},q0),c5=rt.div(S0||(S0=x(["\n\tpadding: 24px;\n\tdisplay: grid;\n\tgrid-template-columns: 2fr 1fr;\n\tgap: 24px;\n"]))),e5=rt.div(A0||(A0=x([""]))),t5=rt.div(Q0||(Q0=x(["\n\tbackground: #fff;\n\tborder: 1px solid #e7ecee;\n\tborder-radius: 8px;\n\tbox-shadow: 0 1px 2px rgba( 16, 24, 40, 0.05 );\n\t&:not( :last-child ) {\n\t\tmargin-bottom: 24px;\n\t}\n"]))),l5=rt.div(O0||(O0=x(["\n\tpadding: 20px 32px;\n\tborder-bottom: 1px solid #e7ecee;\n"]))),n5=rt.div(U0||(U0=x(["\n\tpadding: 24px 32px;\n"]))),d5=rt.div(T0||(T0=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n\tmargin-bottom: 8px;\n"]))),b5=rt.div(L0||(L0=x(["\n\tdisplay: flex;\n\tjustify-content: space-between;\n\talign-items: center;\n\tgap: 16px;\n\tpadding: 14px 0;\n\tborder-top: 1px solid #f1f5f9;\n"])));function i5(c){var e=c.count;return(0,H.jsx)(H.Fragment,{children:Array.from({length:e}).map(function(c,e){return(0,H.jsxs)(b5,{children:[(0,H.jsx)($0,{$w:"35%",$h:"12px"}),(0,H.jsx)($0,{$w:"40%",$h:"12px"})]},e)})})}function a5(){return(0,H.jsxs)(c5,{children:[(0,H.jsxs)(e5,{children:[(0,H.jsxs)(t5,{children:[(0,H.jsx)(l5,{children:(0,H.jsx)($0,{$w:"120px",$h:"18px"})}),(0,H.jsxs)(n5,{children:[(0,H.jsxs)(d5,{children:[(0,H.jsx)($0,{$w:"170px",$h:"24px"}),(0,H.jsx)($0,{$w:"64px",$h:"24px",$radius:"2px"})]}),(0,H.jsx)($0,{$w:"220px",$h:"11px",$mb:"4px"}),(0,H.jsx)(i5,{count:5})]})]}),(0,H.jsxs)(t5,{children:[(0,H.jsx)(l5,{children:(0,H.jsx)($0,{$w:"160px",$h:"18px"})}),(0,H.jsxs)(n5,{children:[(0,H.jsx)($0,{$w:"50%",$h:"13px",$mb:"8px"}),(0,H.jsx)($0,{$w:"30%",$h:"13px"})]})]})]}),(0,H.jsxs)(e5,{children:[(0,H.jsxs)(t5,{children:[(0,H.jsx)(l5,{children:(0,H.jsx)($0,{$w:"150px",$h:"18px"})}),(0,H.jsxs)(n5,{children:[(0,H.jsx)($0,{$w:"55%",$h:"14px",$mb:"8px"}),(0,H.jsx)($0,{$w:"80%",$h:"12px",$mb:"16px"}),(0,H.jsx)($0,{$w:"65%",$h:"12px"})]})]}),(0,H.jsxs)(t5,{children:[(0,H.jsx)(l5,{children:(0,H.jsx)($0,{$w:"100px",$h:"18px"})}),(0,H.jsxs)(n5,{children:[(0,H.jsx)($0,{$w:"52px",$h:"24px",$radius:"2px",$mb:"6px"}),(0,H.jsx)($0,{$w:"45%",$h:"11px",$mb:"6px"}),(0,H.jsx)($0,{$w:"90%",$h:"13px"})]})]})]})]})}function o5(c){var e,t=c.order,l=function(c){var e=c.method.replace("_"," ").toUpperCase(),t=c.currency,l=c.amount,n=c.transaction_id;switch(c.status){case"paid":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s was successfully processed via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"pending":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s is pending confirmation via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"failed":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s failed via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"cancelled":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s was cancelled via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"refunded":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s was refunded via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"unpaid":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s is unpaid via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);case"expired":return(0,Rt.sprintf)((0,Rt.__)("Payment of %1$s %2$s has expired via %3$s. Transaction ID: %4$s","directorist"),t,l,e,n);default:return(0,Rt.sprintf)((0,Rt.__)("Payment status: %s","directorist"),c.status)}};return(0,H.jsx)(k0,{title:"Payment Log",children:(0,H.jsx)(M0,{children:null==t||null===(e=t.payments)||void 0===e?void 0:e.map(function(c,e){return(0,H.jsxs)(E0,{children:[(0,H.jsx)(_$,{className:"directorist-badge",variant:"pending"===(null==c?void 0:c.status)?"warning":"paid"===(null==c?void 0:c.status)?"success":"error",children:null==c?void 0:c.status}),(0,H.jsx)("span",{children:S$("en-US",c.created_at,{year:"numeric",month:"long",day:"numeric"},!0)}),(0,H.jsx)("p",{className:"directorist-payment-log-description",children:l(c)})]},e)})})})}var u5,X5,G5,s5=function(c){var e=c.size,t=void 0===e?12:e,l=c.color,n=void 0===l?"#3E62F5":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 12 12",fill:"none",children:(0,H.jsx)("path",{d:"M1.5 0.75L6 5.25L10.5 0.75",stroke:n,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})},r5=function(c){var e=c.size,t=void 0===e?18:e,l=c.color,n=void 0===l?"#3E62F5":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 18 18",fill:"none",children:(0,H.jsx)("path",{d:"M13.5 11.25L9 6.75L4.5 11.25",stroke:n,"stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})})},g5=function(c){var e=c.size,t=void 0===e?28:e,l=c.color,n=void 0===l?"#DD8C08":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 28 28",fill:"none",children:(0,H.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.9974 24.8307C11.1242 24.8307 8.36872 23.6894 6.33707 21.6577C4.30543 19.6261 3.16406 16.8706 3.16406 13.9974C3.16406 11.1242 4.30543 8.36872 6.33707 6.33707C8.36872 4.30543 11.1242 3.16406 13.9974 3.16406C16.8706 3.16406 19.6261 4.30543 21.6577 6.33707C23.6894 8.36872 24.8307 11.1242 24.8307 13.9974C24.8307 16.8706 23.6894 19.6261 21.6577 21.6577C19.6261 23.6894 16.8706 24.8307 13.9974 24.8307ZM0.664062 13.9974C0.664062 10.4612 2.06882 7.06979 4.56931 4.56931C7.06979 2.06882 10.4612 0.664063 13.9974 0.664062C17.5336 0.664063 20.925 2.06882 23.4255 4.56931C25.926 7.06979 27.3307 10.4612 27.3307 13.9974C27.3307 17.5336 25.926 20.925 23.4255 23.4255C20.925 25.926 17.5336 27.3307 13.9974 27.3307C10.4612 27.3307 7.06979 25.926 4.56931 23.4255C2.06882 20.925 0.664063 17.5336 0.664062 13.9974ZM13.9974 20.6641C12.2293 20.6641 10.5336 19.9617 9.28335 18.7114C8.03311 17.4612 7.33073 15.7655 7.33073 13.9974H13.9974V7.33073C15.7655 7.33073 17.4612 8.03311 18.7114 9.28335C19.9617 10.5336 20.6641 12.2293 20.6641 13.9974C20.6641 15.7655 19.9617 17.4612 18.7114 18.7114C17.4612 19.9617 15.7655 20.6641 13.9974 20.6641Z",fill:n})})},x5=function(c){var e=c.size,t=void 0===e?28:e,l=c.color,n=void 0===l?"#14B570":l;return c.className,(0,H.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,viewBox:"0 0 28 28",fill:"none",children:(0,H.jsx)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.9974 24.8307C11.1242 24.8307 8.36872 23.6894 6.33707 21.6577C4.30543 19.6261 3.16406 16.8706 3.16406 13.9974C3.16406 11.1242 4.30543 8.36872 6.33707 6.33707C8.36872 4.30543 11.1242 3.16406 13.9974 3.16406C16.8706 3.16406 19.6261 4.30543 21.6577 6.33707C23.6894 8.36872 24.8307 11.1242 24.8307 13.9974C24.8307 16.8706 23.6894 19.6261 21.6577 21.6577C19.6261 23.6894 16.8706 24.8307 13.9974 24.8307ZM0.664062 13.9974C0.664062 10.4612 2.06882 7.06979 4.56931 4.56931C7.06979 2.06882 10.4612 0.664063 13.9974 0.664062C17.5336 0.664063 20.925 2.06882 23.4255 4.56931C25.926 7.06979 27.3307 10.4612 27.3307 13.9974C27.3307 17.5336 25.926 20.925 23.4255 23.4255C20.925 25.926 17.5336 27.3307 13.9974 27.3307C10.4612 27.3307 7.06979 25.926 4.56931 23.4255C2.06882 20.925 0.664063 17.5336 0.664062 13.9974ZM19.8807 11.5474L18.1141 9.78073L12.3307 15.5641L9.88073 13.1141L8.11406 14.8807L12.3307 19.0974L19.8807 11.5474Z",fill:n})})},m5=rt.div(u5||(u5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tpadding: 24px 32px;\n\t.directorist-refund-summary-item {\n\t\tposition: relative;\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 12px;\n\t\t&:not(:last-child) {\n\t\t\tpadding-right: 30px;\n\t\t\tmargin-right: 30px;\n\t\t\t&::before {\n\t\t\t\tcontent: '';\n\t\t\t\tposition: absolute;\n\t\t\t\tright: 0;\n\t\t\t\ttop: 50%;\n\t\t\t\ttransform: translateY(-50%);\n\t\t\t\twidth: 1px;\n\t\t\t\theight: 30px;\n\t\t\t\tbackground-color: var(--color-gray-300);\n\t\t\t}\n\t\t}\n\t}\n\t.directorist-refund-summary-item__content {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: 5px;\n\t}\n\t.directorist-refund-summary-item__label {\n\t\tfont-size: 11px;\n\t\tfont-weight: 500;\n\t\ttext-transform: uppercase;\n\t\tcolor: var(--color-gray-600);\n\t}\n\t.directorist-refund-summary-item__value {\n\t\tfont-size: 16px;\n\t\tfont-weight: 500;\n\t\tcolor: var(--color-gray-900);\n\t}\n"]))),H5=rt.div(X5||(X5=x(["\n\t> div {\n\t\tpadding: 0;\n\t}\n\tmargin-bottom: 24px;\n\t.components-card__body {\n\t\tpadding: 0;\n\t}\n\t.dataviews-wrapper {\n\t\tborder-top: 1px solid var(--color-light);\n\t}\n"]))),Z5=rt.span(G5||(G5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tcursor: pointer;\n\tcolor: var(--color-primary-500);\n\t.directorist-refund-table-toggle-down-icon {\n\t\tposition: relative;\n\t\ttop: 4px;\n\t}\n\tsvg {\n\t\tmargin-left: 6px;\n\t}\n"])));function R5(c){var e,t=c.refundsData,l=c.availableRefundAmount;return(0,H.jsxs)(m5,{children:[(0,H.jsxs)("div",{className:"directorist-refund-summary-item",children:[(0,H.jsx)("span",{className:"directorist-refund-summary-item__icon",children:(0,H.jsx)(x5,{})}),(0,H.jsxs)("span",{className:"directorist-refund-summary-item__content",children:[(0,H.jsx)("span",{className:"directorist-refund-summary-item__label",children:(0,Rt.__)("Amount re-funded","directorist")}),(0,H.jsxs)("span",{className:"directorist-refund-summary-item__value",children:["$",null!==(e=null==t?void 0:t.total_refunded)&&void 0!==e?e:0]})]})]}),(0,H.jsxs)("div",{className:"directorist-refund-summary-item",children:[(0,H.jsx)("span",{className:"directorist-refund-summary-item__icon",children:(0,H.jsx)(g5,{})}),(0,H.jsxs)("span",{className:"directorist-refund-summary-item__content",children:[(0,H.jsx)("span",{className:"directorist-refund-summary-item__label",children:(0,Rt.__)("Available to re-fund","directorist")}),(0,H.jsxs)("span",{className:"directorist-refund-summary-item__value",children:["$",l]})]})]})]})}var I5,W5,p5,h5,y5,B5,V5,v5=[{id:"id",label:(0,Rt.__)("Refund ID","directorist")},{id:"amount",label:(0,Rt.__)("Amount","directorist"),render:function(c){var e=c.item;return(0,H.jsx)("span",{className:"directorist-refund-amount",children:k$(null==e?void 0:e.amount,null==e?void 0:e.currency)})}},{id:"reason",label:(0,Rt.__)("Reason","directorist")},{id:"status",label:(0,Rt.__)("Status","directorist"),render:function(c){var e=c.item;return(0,H.jsx)(_$,{className:"directorist-badge",variant:U$(null==e?void 0:e.status),children:null==e?void 0:e.status})}},{id:"created_at",label:(0,Rt.__)("Date","directorist")}];function F5(c){var e,t,l=c.order,n=g((0,o.useState)(!1),2),d=n[0],b=n[1];J$({name:"directorist/order-refund",path:"/directorist/v2/admin/orders/".concat(null==l?void 0:l.id,"/refunds")});var i=function({name:c,selector:e}){const{data:t,isResolved:l}=(0,Bt.useSelect)(t=>{const{hasFinishedResolution:l,get:n,show:d}=t(c);return{data:"get"===e?n():d(),isResolved:l(e)}},[c]);return{data:t,isResolved:l}}({name:"directorist/order-refund",selector:"get"}),a=i.data,u=parseFloat(null!==(e=null==l?void 0:l.total_amount)&&void 0!==e?e:"0")-parseFloat(null!==(t=null==a?void 0:a.total_refunded)&&void 0!==t?t:"0"),X={amount:{type:"number",label:(0,Rt.__)("Refund amount","directorist")},reason:{type:"text",label:(0,Rt.__)("Reason for refund","directorist")},status:{type:"select",label:(0,Rt.__)("Status","directorist"),options:[{label:(0,Rt.__)("Pending","directorist"),value:"pending"},{label:(0,Rt.__)("Processing","directorist"),value:"processing"},{label:(0,Rt.__)("Paid","directorist"),value:"paid"},{label:(0,Rt.__)("Rejected","directorist"),value:"rejected"}],isMulti:!1,menuPosition:"fixed"}};return(0,H.jsx)(H5,{children:(0,H.jsx)(i$,{heading:(0,Rt.__)("Refund Management","directorist"),storeName:"directorist/order-refund",path:"/directorist/v2/admin/orders/".concat(null==l?void 0:l.id,"/refunds"),columns:v5,showTable:d,create:{title:(0,Rt.__)("Add Refund","directorist"),buttonLabel:(0,Rt.__)("Add Refund","directorist"),fields:X,isDisabled:u<=0},edit:{title:(0,Rt.__)("Edit Refund","directorist"),buttonLabel:(0,Rt.__)("Edit Refund","directorist"),fields:X},beforeTable:(0,H.jsx)(R5,{refundsData:a,availableRefundAmount:u}),cardFooter:(0,H.jsx)(Z5,{onClick:function(){return b(!d)},children:d?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Hide Refund History","directorist")}),(0,H.jsxs)("span",{className:"directorist-refund-table-toggle-up-icon",children:[" ",(0,H.jsx)(r5,{})]})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)("span",{children:[" ",(0,Rt.__)("Refund History","directorist")]}),(0,H.jsxs)("span",{className:"directorist-refund-table-toggle-down-icon",children:[" ",(0,H.jsx)(s5,{})]})]})})})})}var Y5,J5=rt.div(I5||(I5=x(["\n\tpadding: 24px;\n\tdisplay: grid;\n\tgrid-template-columns: 2fr 1fr;\n\tgrid-gap: 24px;\n\t.components-card {\n\t\tborder-radius: 8px;\n\t\tborder: 1px solid var(--color-light);\n\t\tbox-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n\t}\n\t.components-card__header {\n\t\tborder-bottom: 1px solid rgba(0, 0, 0, 0.1);\n\t}\n\t.components-card__footer {\n\t\tborder-top: 1px solid rgba(0, 0, 0, 0.1);\n\t}\n"]))),C5=rt.div(W5||(W5=x([""]))),N5=rt.div(p5||(p5=x([""]))),f5=rt.div(h5||(h5=x(["\n\twidth: 100%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: space-between;\n\t.directorist-single-plan-logo {\n\t\tline-height: 0;\n\t}\n"]))),k5=rt.div(y5||(y5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 8px;\n\t.directorist-single-plan-logo {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tline-height: 0;\n\t\twidth: 32px;\n\t\theight: 32px;\n\t\tborder-radius: 50%;\n\t\tmargin-right: 10px;\n\t\tborder: 1px solid rgba(75, 85, 99, 0.1);\n\t\tbox-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);\n\t}\n\tul {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: 8px;\n\t\tlist-style: none;\n\t\tpadding: 0;\n\t\tmargin: 0;\n\t\tli {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tmargin-bottom: 0;\n\t\t\tsvg {\n\t\t\t\tposition: relative;\n\t\t\t\ttop: 2px;\n\t\t\t}\n\t\t}\n\t}\n"]))),w5=rt.div(B5||(B5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tgap: 12px;\n"]))),z5=rt.div(V5||(V5=x(["\n\tdisplay: flex;\n\talign-items: center;\n\tborder-radius: 4px;\n\tpadding: 0 8px 0 12px;\n\theight: 34px;\n\tborder: 1px solid rgba(20, 25, 33, 0.1);\n\tspan {\n\t\tfont-size: 13px;\n\t\tfont-weight: 500;\n\t\tcolor: var(--color-gray-900);\n\t}\n\t.components-base-control__field {\n\t\tmargin-bottom: 0;\n\t}\n\t.components-input-control__backdrop {\n\t\tdisplay: none;\n\t}\n\t.wpmvc__control {\n\t\tborder: 0 none;\n\t\tmin-height: 24px;\n\t\tbackground-color: transparent;\n\t\tborder-radius: 0px;\n\t\t&.wpmvc__control--is-focused {\n\t\t\tbox-shadow: 0 0;\n\t\t}\n\t\t.wpmvc__value-container {\n\t\t\tpadding-right: 0;\n\t\t\tmin-width: 80px;\n\t\t}\n\t}\n"]))),S5=[{label:(0,Rt.__)("Pending","directorist"),value:"pending"},{label:(0,Rt.__)("Re-funded","directorist"),value:"refunded"},{label:(0,Rt.__)("Failed","directorist"),value:"failed"},{label:(0,Rt.__)("Cancelled","directorist"),value:"cancelled"},{label:(0,Rt.__)("Unpaid","directorist"),value:"unpaid"},{label:(0,Rt.__)("Expired","directorist"),value:"expired"},{label:(0,Rt.__)("Paid","directorist"),value:"paid"}];function A5(c){!function(c){if(null==c)throw new TypeError("Cannot destructure "+c)}(c);var e=g((0,o.useState)(!0),2),t=e[0],l=e[1],n=g((0,o.useState)("pending"),2),d=n[0],b=n[1],i=g((0,o.useState)(!1),2),a=i[0],u=i[1],X=function(){var c=g((0,o.useState)(X0),2),e=c[0],t=c[1];return(0,o.useEffect)(function(){var c=function(){return t(X0())};return window.addEventListener("hashchange",c),window.addEventListener("popstate",c),function(){window.removeEventListener("hashchange",c),window.removeEventListener("popstate",c)}},[]),e}(),G=(0,o.useMemo)(function(){return X?"/directorist/v2/admin/orders/".concat(X):""},[X]),s=X?"directorist/single-order/".concat(X):"directorist/single-order";!function(c){if((0,Bt.select)(c.name))return;const e=(0,Bt.createReduxStore)(c.name,function({path:c}){const e={path:c,values:{}};return{reducer(c=e,t){return WP(c,c=>{switch(t.type){case"SET":Object.assign(c.values,t.values);break;case"REMOVE":delete c.values[t.key]}})},actions:{...{set(c,e){return{type:"SET",values:"string"==typeof c?{[c]:e}:c}},remove(c){return{type:"REMOVE",key:c}}},refresh:()=>({dispatch:c})=>{c.invalidateResolution("get")},save:e=>async({dispatch:t})=>{let l=await zi({path:c,data:e,method:"POST"});return t.refresh(),l}},selectors:{get(c){return c.values},getByKey(c){return c.values}},resolvers:{get(){return async({dispatch:e})=>{const t=await zi({path:c});e.set(t)}}}}}(c));(0,Bt.register)(e)}({name:s,path:G});var r=function({name:c}){const{set:e,remove:t,refresh:l,save:n}=(0,Bt.useDispatch)(c);return{set:e,remove:t,refresh:l,save:n}}({name:s,path:G}),x=r.refresh,Z=function({name:c}){const{data:e,isResolved:t}=(0,Bt.useSelect)(e=>{const{get:t,hasFinishedResolution:l}=e(c);return{data:t(),isResolved:l("get")}},[c]);return{data:e,isResolved:t}}({name:s,path:G}),R=Z.data,I=Z.isResolved,W=null==R?void 0:R.order,p=I;(0,o.useEffect)(function(){l(!0)},[X]),(0,o.useEffect)(function(){t&&p&&(l(!1),b(null==W?void 0:W.status))},[p,t]);var h=function(){var c=y$(V$().mark(function c(){var e;return V$().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:if(X){c.next=1;break}return c.abrupt("return");case 1:return u(!0),c.prev=2,c.next=3,Si()({path:"directorist/v2/admin/orders/".concat(X,"/status"),method:"POST",data:{status:d}});case 3:(0,m.doAction)("wpmvc-toast",{message:(0,Rt.__)("Order status updated successfully","directorist")}),x(),c.next=5;break;case 4:c.prev=4,e=c.catch(2),console.error("Failed to update order status:",e),(0,m.doAction)("wpmvc-toast",{type:"error",message:(0,Rt.__)("Oppps! Something went wrong","directorist")});case 5:return c.prev=5,u(!1),x(),c.finish(5);case 6:case"end":return c.stop()}},c,null,[[2,4,5,6]])}));return function(){return c.apply(this,arguments)}}();return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(It.Fill,{name:"wpmvc-header",children:(0,H.jsxs)(f5,{children:[(0,H.jsxs)(k5,{children:[(0,H.jsx)("a",{href:"#",className:"directorist-single-plan-logo",children:(0,H.jsx)(B0,{})}),(0,H.jsxs)("ul",{children:[(0,H.jsx)("li",{children:(0,H.jsx)("span",{children:(0,Rt.__)("Orders","directorist")})}),(0,H.jsxs)("li",{children:[(0,H.jsx)(V0,{}),(0,H.jsx)("span",{children:(0,Rt.__)("View Order","directorist")})]})]})]}),(0,H.jsxs)(w5,{children:[(0,H.jsxs)(z5,{children:[(0,H.jsx)("span",{children:(0,Rt.__)("Order Status:","directorist")}),(0,H.jsx)(u0,{options:S5,onChange:function(c){b(c)},isSearchable:!1,value:d,isDisabled:a})]}),(0,H.jsx)(i0,{variant:"primary",onClick:h,isBusy:a,disabled:a,children:a?(0,Rt.__)("Saving...","directorist"):(0,Rt.__)("Save Order","directorist")})]})]})}),p?(0,H.jsxs)(J5,{children:[(0,H.jsxs)(C5,{children:[W&&(0,H.jsx)(_0,{order:W}),W&&(0,H.jsx)(F5,{order:W}),(0,H.jsx)(It.Slot,{name:"directorist-order-refund-after",children:function(c){if(c.length)return c}})]}),(0,H.jsxs)(N5,{children:[(0,H.jsx)(K0,{order:W}),(0,H.jsx)(o5,{order:W})]})]}):(0,H.jsx)(a5,{})]})}function Q5(c,e){var t=Object.keys(c);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(c);e&&(l=l.filter(function(e){return Object.getOwnPropertyDescriptor(c,e).enumerable})),t.push.apply(t,l)}return t}function O5(c){for(var e=1;e0?i(O5(O5({},b),{},G({},n,null===(a=u)||void 0===a?void 0:a.errors))):i(G({},n,[]))}};(0,m.addAction)("wpmvc-field-on-blur","directorist-form-validation",c),(0,m.addAction)("wpmvc-field-on-change","directorist-form-validation",c),(0,o.useEffect)(function(){var c=function(c){var e=c.target;if(e instanceof Element){var t=e.closest("#menu-posts-at_biz_dir a.wp-first-item");null!=t&&t.href&&(c.preventDefault(),c.stopPropagation(),window.location.assign(t.href))}};return document.addEventListener("click",c,!0),function(){document.removeEventListener("click",c,!0)}},[]);var e=[{path:"/",element:(0,H.jsx)(n0,{}),index:!0},{path:"/edit/:id",element:(0,H.jsx)(A5,{})}];return(0,H.jsx)(L5,{children:(0,H.jsx)(_q,{pageTopLevelID:"#menu-posts-at_biz_dir",rootPaths:U5,colors:{primary:"#3e62f5",error:"#D94A4A",gray:"#141921"},header:{logo:(0,H.jsx)("img",{src:"https://directorist.com/wp-content/uploads/2020/08/directorist_logo.png",alt:"Directorist",width:116}),actionItems:T5},routes:(0,m.applyFilters)("directorist_order_routes",e)})})}a()(function(){var c=document.querySelector(".directorist-orders-page");c&&(0,o.createRoot)(c).render((0,H.jsx)(j5,{}))})}()}(); \ No newline at end of file diff --git a/assets/src/js/react/admin/pages/orders/edit/index.tsx b/assets/src/js/react/admin/pages/orders/edit/index.tsx index 5212a4f85a..a0425642ee 100644 --- a/assets/src/js/react/admin/pages/orders/edit/index.tsx +++ b/assets/src/js/react/admin/pages/orders/edit/index.tsx @@ -237,7 +237,7 @@ export default function OrderEdit({}: EditProps) { doAction('wpmvc-toast', { message: __( 'Order status updated successfully', - 'directorist-pricing-plans' + 'directorist' ), }); refresh(); @@ -247,7 +247,7 @@ export default function OrderEdit({}: EditProps) { type: 'error', message: __( 'Oppps! Something went wrong', - 'directorist-pricing-plans' + 'directorist' ), }); } finally { diff --git a/includes/asset-loader/init.php b/includes/asset-loader/init.php index 4bbfa76bc2..ba158b8257 100644 --- a/includes/asset-loader/init.php +++ b/includes/asset-loader/init.php @@ -342,6 +342,7 @@ public static function admin_scripts( string $hook_suffix ) { Enqueue::style( 'directorist/admin-order-dataview', 'build/css/admin/style-app', ['wp-components'] ); Enqueue::style( 'directorist/admin-app', 'build/css/admin/app' ); Enqueue::script( 'directorist/admin-order', 'build/js/react/admin/order' ); + wp_set_script_translations( 'directorist/admin-order', 'directorist', ATBDP_DIR . 'languages' ); $c_position = directorist_get_currency_position(); $currency = directorist_get_currency(); diff --git a/includes/checkout/class-checkout.php b/includes/checkout/class-checkout.php index 3902736d1e..2e977b4cd2 100644 --- a/includes/checkout/class-checkout.php +++ b/includes/checkout/class-checkout.php @@ -72,7 +72,7 @@ public function payment_receipt() { $order_db = $order_repository->get_by_id( $order_id ); if ( ! $order_db ) { - return __( "Order not found" ); + return __( "Order not found", 'directorist' ); } $order = apply_filters( 'directorist_payment_receipt_order_dto', $order_repository->to_dto( $order_db ) ); @@ -464,4 +464,4 @@ public function transaction_failure() { return ob_get_clean(); } -} // ends class \ No newline at end of file +} // ends class diff --git a/includes/classes/class-ajax-handler.php b/includes/classes/class-ajax-handler.php index 9c66973f78..6d2d58cb25 100644 --- a/includes/classes/class-ajax-handler.php +++ b/includes/classes/class-ajax-handler.php @@ -1048,7 +1048,7 @@ public function atbdp_post_attachment_upload() { } if ( empty( $status['url'] ) ) { - throw new \Exception( __( 'Could not upload your file, please try again.' ), 400 ); + throw new \Exception( __( 'Could not upload your file, please try again.', 'directorist' ), 400 ); } // Update the meta when post id is available. diff --git a/includes/classes/class-payment-checkout-service.php b/includes/classes/class-payment-checkout-service.php index 3032aadd76..51ec49af01 100644 --- a/includes/classes/class-payment-checkout-service.php +++ b/includes/classes/class-payment-checkout-service.php @@ -51,15 +51,15 @@ public function validate_checkout( string $checkout_type, WP_REST_Request $reque $order = directorist_get_order_by_id( $request->get_param( 'order_id' ) ); if ( ! $order ) { - throw new Exception( __( 'Order not found.', 'directorist-pricing-plans' ) ); + throw new Exception( __( 'Order not found.', 'directorist' ) ); } if ( (int) $order->user_id !== get_current_user_id() ) { - throw new Exception( __( 'You do not have permission to pay for this order.', 'directorist-pricing-plans' ) ); + throw new Exception( __( 'You do not have permission to pay for this order.', 'directorist' ) ); } if ( Status::PENDING !== $order->status ) { - throw new Exception( __( 'This order is not pending payment.', 'directorist-pricing-plans' ) ); + throw new Exception( __( 'This order is not pending payment.', 'directorist' ) ); } } @@ -124,7 +124,7 @@ public function handle_checkout_create_order( DTO $dto, string $checkout_type, W $order = directorist_get_order_by_id( $request->get_param( 'order_id' ) ); if ( ! $order ) { - throw new Exception( __( 'Order not found.', 'directorist-pricing-plans' ) ); + throw new Exception( __( 'Order not found.', 'directorist' ) ); } // Set the existing order ID on the DTO so the core skips order creation @@ -136,4 +136,4 @@ public function before_checkout_form_end() { echo ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended } } -} \ No newline at end of file +} diff --git a/includes/classes/class-settings-panel.php b/includes/classes/class-settings-panel.php index 9081ecf7f7..742f413c11 100644 --- a/includes/classes/class-settings-panel.php +++ b/includes/classes/class-settings-panel.php @@ -1319,7 +1319,7 @@ public function prepare_settings() { // single listing settings 'disable_single_listing' => [ 'type' => 'toggle', - 'label' => __( 'Disable Single Listing View' ), + 'label' => __( 'Disable Single Listing View', 'directorist' ), 'value' => false, ], 'restrict_single_listing_for_logged_in_user' => [ diff --git a/includes/model/ListingDashboard.php b/includes/model/ListingDashboard.php index 98a915eb35..e4b0b4c468 100644 --- a/includes/model/ListingDashboard.php +++ b/includes/model/ListingDashboard.php @@ -495,7 +495,7 @@ public function dashboard_tabs() { if ( $user_order_history ) { $dashboard_tabs[ 'order_history' ] = array( - 'title' => __( 'Order History', 'directorist-pricing-plans' ), + 'title' => __( 'Order History', 'directorist' ), 'content' => Helper::get_template_contents( 'dashboard/tab-orders', [ 'dashboard' => $this ] ), 'icon' => 'las la-clock', ); @@ -726,4 +726,4 @@ public function get_action_dropdown_item() { return apply_filters( 'directorist_dashboard_listing_action_items_end', $dropdown_items, $post_id, $this ); } -} \ No newline at end of file +} diff --git a/includes/repositories/refund-repository.php b/includes/repositories/refund-repository.php index ed7b69e910..ecd4903971 100644 --- a/includes/repositories/refund-repository.php +++ b/includes/repositories/refund-repository.php @@ -61,7 +61,7 @@ public function create( $dto ) { $order = $this->order_repository->to_dto( $this->order_repository->get_by_id( $dto->get_order_id() ) ); if ( ! $order ) { - throw new Exception( esc_html__( "Order not found" ) ); + throw new Exception( esc_html__( "Order not found", 'directorist' ) ); } $total = $order->get_sub_total(); @@ -75,7 +75,7 @@ public function create( $dto ) { // Prevent refunding if order is already fully refunded if ( $already_refunded >= $total ) { - throw new Exception( esc_html__( "Order is already refunded" ) ); + throw new Exception( esc_html__( "Order is already refunded", 'directorist' ) ); } // Calculate remaining amount that can still be refunded @@ -111,4 +111,4 @@ public function create( $dto ) { public function get_order_total_refunded( int $order_id ) { return $this->get_query_builder()->where( 'order_id', $order_id )->where( 'status', Status::PAID )->sum( 'amount' ); } -} \ No newline at end of file +} diff --git a/includes/rest-api/Version1/class-checkout-controller.php b/includes/rest-api/Version1/class-checkout-controller.php index 8dafcbff97..93259617f7 100644 --- a/includes/rest-api/Version1/class-checkout-controller.php +++ b/includes/rest-api/Version1/class-checkout-controller.php @@ -27,14 +27,14 @@ public function register_routes() { 'permission_callback' => [ $this, 'auth_permissions_check' ], 'args' => [ 'checkout_type' => [ - 'description' => __( 'The type of checkout to be performed.' ), + 'description' => __( 'The type of checkout to be performed.', 'directorist' ), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'enum' => directorist_get_checkout_types(), 'required' => true, ], 'payment_gateway' => [ - 'description' => __( 'The payment gateway to be used for the checkout.' ), + 'description' => __( 'The payment gateway to be used for the checkout.', 'directorist' ), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'required' => false, @@ -54,7 +54,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'auth_permissions_check' ], 'args' => [ 'order_id' => [ - 'description' => __( 'The order id to be retried.' ), + 'description' => __( 'The order id to be retried.', 'directorist' ), 'type' => 'integer', 'sanitize_callback' => 'absint', 'required' => true, @@ -84,7 +84,7 @@ public function checkout( WP_REST_Request $request ) { $order = $repository->get_by_id( $dto->get_id() ); if ( ! $order ) { - return new WP_Error( 'rest_not_found', __( 'Order not found.' ) ); + return new WP_Error( 'rest_not_found', __( 'Order not found.', 'directorist' ) ); } $dto = $repository->to_dto( $order ); @@ -98,13 +98,13 @@ public function checkout( WP_REST_Request $request ) { $payment_gateway = $request->get_param( 'payment_gateway' ); if ( ! $payment_gateway ) { - return new WP_Error( 'rest_empty_value', __( 'Payment gateway is required.' ) ); + return new WP_Error( 'rest_empty_value', __( 'Payment gateway is required.', 'directorist' ) ); } $payment_processors = directorist_get_payment_processors(); if ( ! isset( $payment_processors[ $payment_gateway ] ) ) { - return new WP_Error( 'rest_invalid_value', __( 'Invalid payment gateway.' ) ); + return new WP_Error( 'rest_invalid_value', __( 'Invalid payment gateway.', 'directorist' ) ); } /** @@ -113,7 +113,7 @@ public function checkout( WP_REST_Request $request ) { $processor_instance = directorist_make( $payment_processors[ $payment_gateway ], __( 'Invalid payment gateway.', 'directorist' ) ); if ( ! $processor_instance instanceof PaymentInterface ) { - return new WP_Error( 'rest_invalid_value', __( 'Invalid payment gateway.' ) ); + return new WP_Error( 'rest_invalid_value', __( 'Invalid payment gateway.', 'directorist' ) ); } do_action( 'directorist_checkout_validate_payment_processor', $processor_instance, $dto, $checkout_type, $request ); @@ -165,27 +165,27 @@ public function retry_payment( WP_REST_Request $request ) { $order = $order_repository->get_by_id( $order_id ); if ( ! $order ) { - return new WP_Error( 'rest_not_found', __( 'Order not found.' ) ); + return new WP_Error( 'rest_not_found', __( 'Order not found.', 'directorist' ) ); } $order = $order_repository->to_dto( $order ); if ( ! in_array( $order->get_status(), [ OrderStatus::PENDING, OrderStatus::FAILED ], true ) ) { - return new WP_Error( 'rest_invalid_value', __( 'Order is not pending or failed.' ) ); + return new WP_Error( 'rest_invalid_value', __( 'Order is not pending or failed.', 'directorist' ) ); } $payment_repository = directorist_payment_repository(); $payment = $payment_repository->get_last_payment( $order_id ); if ( ! $payment ) { - return new WP_Error( 'rest_not_found', __( 'Payment not found.' ) ); + return new WP_Error( 'rest_not_found', __( 'Payment not found.', 'directorist' ) ); } $payment = $payment_repository->to_dto( $payment ); $payment_processors = directorist_get_payment_processors(); if ( ! isset( $payment_processors[$payment->get_method()] ) ) { - return new WP_Error( 'rest_invalid_value', __( 'Invalid payment gateway.' ) ); + return new WP_Error( 'rest_invalid_value', __( 'Invalid payment gateway.', 'directorist' ) ); } /** @@ -203,4 +203,4 @@ public function retry_payment( WP_REST_Request $request ) { ] ); } -} \ No newline at end of file +} diff --git a/includes/rest-api/Version1/class-listings-controller.php b/includes/rest-api/Version1/class-listings-controller.php index 68c9e0f5d3..6090280ace 100644 --- a/includes/rest-api/Version1/class-listings-controller.php +++ b/includes/rest-api/Version1/class-listings-controller.php @@ -613,7 +613,7 @@ public function update_status( WP_REST_Request $request ) { return rest_ensure_response( [ - 'message' => esc_html__( 'The listing status was updated successfully', 'directorist-pricing-plans' ) + 'message' => esc_html__( 'The listing status was updated successfully', 'directorist' ) ] ); } diff --git a/includes/rest-api/Version1/class-order-controller.php b/includes/rest-api/Version1/class-order-controller.php index 1ae691157c..b9fe983c2e 100644 --- a/includes/rest-api/Version1/class-order-controller.php +++ b/includes/rest-api/Version1/class-order-controller.php @@ -46,7 +46,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'admin_permissions_check' ], 'args' => [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -60,7 +60,7 @@ public function register_routes() { $this->store_args(), [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -73,7 +73,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'admin_permissions_check' ], 'args' => [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -92,12 +92,12 @@ public function register_routes() { 'permission_callback' => [ $this, 'admin_permissions_check' ], 'args' => [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], 'status' => [ - 'description' => __( 'The status of the order.' ), + 'description' => __( 'The status of the order.', 'directorist' ), 'type' => 'string', 'enum' => OrderStatus::all(), 'required' => true, @@ -131,7 +131,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'auth_permissions_check' ], 'args' => [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'sanitize_callback' => 'absint', 'required' => true, @@ -176,7 +176,7 @@ public function store( WP_REST_Request $request ) { return rest_ensure_response( [ - "message" => esc_html__( "Order was created successfully" ), + "message" => esc_html__( "Order was created successfully", 'directorist' ), "data" => [ "id" => $id ] @@ -189,7 +189,7 @@ public function show( WP_REST_Request $request ) { $order = $repository->single( $request->get_param( "id" ) ); if ( ! $order ) { - return new WP_Error( 'rest_not_found', __( 'The order was not found' ) ); + return new WP_Error( 'rest_not_found', __( 'The order was not found', 'directorist' ) ); } return rest_ensure_response( @@ -209,7 +209,7 @@ public function update( WP_REST_Request $request ) { return rest_ensure_response( [ - "message" => esc_html__( "Order was updated successfully" ) + "message" => esc_html__( "Order was updated successfully", 'directorist' ) ] ); } @@ -219,7 +219,7 @@ public function delete( WP_REST_Request $request ) { return rest_ensure_response( [ - "message" => esc_html__( "Order was deleted successfully" ) + "message" => esc_html__( "Order was deleted successfully", 'directorist' ) ] ); } @@ -229,7 +229,7 @@ public function update_status( WP_REST_Request $request ) { $old_item = $repository->get_by_id( $request->get_param( "id" ) ); if ( ! $old_item ) { - return new WP_Error( 'rest_not_found', __( 'The order was not found' ) ); + return new WP_Error( 'rest_not_found', __( 'The order was not found', 'directorist' ) ); } $dto = $repository->to_dto( $old_item ); @@ -239,7 +239,7 @@ public function update_status( WP_REST_Request $request ) { $repository->update( $dto ); return rest_ensure_response( [ - 'message' => esc_html__("Status updated successfully") + 'message' => esc_html__("Status updated successfully", 'directorist') ] ); } @@ -248,15 +248,15 @@ public function cancel( WP_REST_Request $request ) { $order = $repository->get_by_id( $request->get_param( 'id' ) ); if ( ! $order ) { - return new WP_Error( 'rest_not_found', __( 'The order was not found' ), [ 'status' => 404 ] ); + return new WP_Error( 'rest_not_found', __( 'The order was not found', 'directorist' ), [ 'status' => 404 ] ); } if ( (int) $order->user_id !== get_current_user_id() ) { - return new WP_Error( 'rest_forbidden', __( 'You are not authorized to cancel this order.' ), [ 'status' => 403 ] ); + return new WP_Error( 'rest_forbidden', __( 'You are not authorized to cancel this order.', 'directorist' ), [ 'status' => 403 ] ); } if ( OrderStatus::PENDING !== $order->status ) { - return new WP_Error( 'rest_invalid_status', __( 'Only pending orders can be cancelled.' ), [ 'status' => 400 ] ); + return new WP_Error( 'rest_invalid_status', __( 'Only pending orders can be cancelled.', 'directorist' ), [ 'status' => 400 ] ); } $dto = $repository->to_dto( $order ); @@ -266,7 +266,7 @@ public function cancel( WP_REST_Request $request ) { return rest_ensure_response( [ - 'message' => esc_html__( 'Order was cancelled successfully' ), + 'message' => esc_html__( 'Order was cancelled successfully', 'directorist' ), ] ); } @@ -274,17 +274,17 @@ public function cancel( WP_REST_Request $request ) { protected function store_args(): array { return [ 'user_id' => [ - 'description' => __( 'The user ID.' ), + 'description' => __( 'The user ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], 'listing_id' => [ - 'description' => __( 'The listing ID.' ), + 'description' => __( 'The listing ID.', 'directorist' ), 'type' => 'integer', 'required' => false, ], 'status' => [ - 'description' => __( 'The status of the order.' ), + 'description' => __( 'The status of the order.', 'directorist' ), 'type' => 'string', 'required' => true, 'enum' => OrderStatus::all(), @@ -295,21 +295,21 @@ protected function store_args(): array { protected function index_args(): array { return [ 'page' => [ - 'description' => __( 'The page number.' ), + 'description' => __( 'The page number.', 'directorist' ), 'type' => 'integer', 'sanitize_callback' => 'absint', 'default' => 1, 'required' => false, ], 'perPage' => [ - 'description' => __( 'The number of items per page.' ), + 'description' => __( 'The number of items per page.', 'directorist' ), 'type' => 'integer', 'sanitize_callback' => 'absint', 'default' => 10, 'required' => false, ], 'search' => [ - 'description' => __( 'The search query.' ), + 'description' => __( 'The search query.', 'directorist' ), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'required' => false, diff --git a/includes/rest-api/Version1/class-order-refund-controller.php b/includes/rest-api/Version1/class-order-refund-controller.php index 349a4d4285..8aa4a1567f 100644 --- a/includes/rest-api/Version1/class-order-refund-controller.php +++ b/includes/rest-api/Version1/class-order-refund-controller.php @@ -47,7 +47,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'admin_permissions_check' ], 'args' => [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -61,7 +61,7 @@ public function register_routes() { $this->store_args(), [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -74,7 +74,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'admin_permissions_check' ], 'args' => [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -113,7 +113,7 @@ public function store( WP_REST_Request $request ) { return rest_ensure_response( [ - "message" => esc_html__( "Refund was created successfully" ), + "message" => esc_html__( "Refund was created successfully", 'directorist' ), "data" => [ "id" => $id ] @@ -126,7 +126,7 @@ public function show( WP_REST_Request $request ) { $refund = $repository->get_by_id( $request->get_param( "id" ) ); if ( ! $refund ) { - return new WP_Error( 'rest_not_found', __( 'The refund was not found' ) ); + return new WP_Error( 'rest_not_found', __( 'The refund was not found', 'directorist' ) ); } return rest_ensure_response( @@ -148,7 +148,7 @@ public function update( WP_REST_Request $request ) { return rest_ensure_response( [ - "message" => esc_html__( "Refund was updated successfully" ) + "message" => esc_html__( "Refund was updated successfully", 'directorist' ) ] ); } @@ -159,7 +159,7 @@ public function delete( WP_REST_Request $request ) { return rest_ensure_response( [ - "message" => esc_html__( "Refund was deleted successfully" ) + "message" => esc_html__( "Refund was deleted successfully", 'directorist' ) ] ); } @@ -169,7 +169,7 @@ public function update_status( WP_REST_Request $request ) { $old_item = $repository->get_by_id( $request->get_param( "id" ) ); if ( ! $old_item ) { - return new WP_Error( 'rest_not_found', __( 'The order was not found' ) ); + return new WP_Error( 'rest_not_found', __( 'The order was not found', 'directorist' ) ); } $dto = $repository->to_dto( $old_item ); @@ -179,31 +179,31 @@ public function update_status( WP_REST_Request $request ) { $repository->update( $dto ); return rest_ensure_response( [ - 'message' => esc_html__("Status updated successfully") + 'message' => esc_html__("Status updated successfully", 'directorist') ] ); } protected function store_args(): array { return [ 'order_id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], 'amount' => [ - 'description' => __( 'The listing ID.' ), + 'description' => __( 'The listing ID.', 'directorist' ), 'type' => 'integer', 'required' => true, 'minimum' => 1, ], 'status' => [ - 'description' => __( 'The status of the order.' ), + 'description' => __( 'The status of the order.', 'directorist' ), 'type' => 'string', 'required' => true, 'enum' => RefundStatus::all(), ], 'reason' => [ - 'description' => __( 'The reason for the refund.' ), + 'description' => __( 'The reason for the refund.', 'directorist' ), 'type' => 'string', 'required' => false, ], @@ -213,31 +213,31 @@ protected function store_args(): array { protected function index_args(): array { return [ 'page' => [ - 'description' => __( 'The page number.' ), + 'description' => __( 'The page number.', 'directorist' ), 'type' => 'integer', 'sanitize_callback' => 'absint', 'default' => 1, 'required' => false, ], 'per_page' => [ - 'description' => __( 'The number of items per page.' ), + 'description' => __( 'The number of items per page.', 'directorist' ), 'type' => 'integer', 'sanitize_callback' => 'absint', 'default' => 10, 'required' => false, ], 'search' => [ - 'description' => __( 'The search query.' ), + 'description' => __( 'The search query.', 'directorist' ), 'type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'required' => false, ], 'order_id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'sanitize_callback' => 'absint', 'required' => false, ], ]; } -} \ No newline at end of file +} diff --git a/includes/rest-api/Version1/class-payments-controller.php b/includes/rest-api/Version1/class-payments-controller.php index d91fcd49f6..1aafad1d00 100644 --- a/includes/rest-api/Version1/class-payments-controller.php +++ b/includes/rest-api/Version1/class-payments-controller.php @@ -26,7 +26,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'admin_permissions_check' ], 'args' => [ 'order_id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -51,7 +51,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'admin_permissions_check' ], 'args' => [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -65,7 +65,7 @@ public function register_routes() { $this->store_args(), [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -78,7 +78,7 @@ public function register_routes() { 'permission_callback' => [ $this, 'admin_permissions_check' ], 'args' => [ 'id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], @@ -112,7 +112,7 @@ public function store( WP_REST_Request $request ) { return rest_ensure_response( [ - "message" => esc_html__( "Payment was created successfully" ), + "message" => esc_html__( "Payment was created successfully", 'directorist' ), "data" => [ "id" => $id ] @@ -125,7 +125,7 @@ public function show( WP_REST_Request $request ) { $payment = $repository->get_by_id( $request->get_param( "id" ) ); if ( ! $payment ) { - return new WP_Error( 'rest_not_found', __( 'The payment was not found' ) ); + return new WP_Error( 'rest_not_found', __( 'The payment was not found', 'directorist' ) ); } return rest_ensure_response( @@ -145,7 +145,7 @@ public function update( WP_REST_Request $request ) { return rest_ensure_response( [ - "message" => esc_html__( "Payment was updated successfully" ) + "message" => esc_html__( "Payment was updated successfully", 'directorist' ) ] ); } @@ -156,7 +156,7 @@ public function delete( WP_REST_Request $request ) { return rest_ensure_response( [ - "message" => esc_html__( "Payment was deleted successfully" ) + "message" => esc_html__( "Payment was deleted successfully", 'directorist' ) ] ); } @@ -164,28 +164,28 @@ public function delete( WP_REST_Request $request ) { protected function store_args(): array { return [ 'order_id' => [ - 'description' => __( 'The order ID.' ), + 'description' => __( 'The order ID.', 'directorist' ), 'type' => 'integer', 'required' => true, ], 'status' => [ - 'description' => __( 'The status of the payment.' ), + 'description' => __( 'The status of the payment.', 'directorist' ), 'type' => 'string', 'required' => true, 'enum' => PaymentStatus::all(), ], 'transaction_id' => [ - 'description' => __( 'The transaction ID.' ), + 'description' => __( 'The transaction ID.', 'directorist' ), 'type' => 'string', 'required' => true, 'maxlength' => 100, ], 'method' => [ - 'description' => __( 'The method of the payment.' ), + 'description' => __( 'The method of the payment.', 'directorist' ), 'type' => 'string', 'required' => true, 'maxlength' => 30, ], ]; } -} \ No newline at end of file +} diff --git a/templates/checkout/checkout-order-discount.php b/templates/checkout/checkout-order-discount.php index 5013028133..db43c0628d 100644 --- a/templates/checkout/checkout-order-discount.php +++ b/templates/checkout/checkout-order-discount.php @@ -8,18 +8,18 @@ - + " data-subtotal=""> - + diff --git a/templates/checkout/checkout-order-tax.php b/templates/checkout/checkout-order-tax.php index 23de2bd149..0b0c3f810f 100644 --- a/templates/checkout/checkout-order-tax.php +++ b/templates/checkout/checkout-order-tax.php @@ -8,18 +8,18 @@ - + -

+

@@ -285,4 +285,4 @@ - \ No newline at end of file +