Files
2026-04-28 15:13:50 +02:00

2 lines
91 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! For license information please see order.js.LICENSE.txt */
(()=>{var e={5955:(e,t,r)=>{"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),u=["gridicon","gridicons-checkmark",i,!1,!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:u,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M9 19.414l-6.707-6.707 1.414-1.414L9 16.586 20.293 5.293l1.414 1.414z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},4275:(e,t,r)=>{"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),u=["gridicon","gridicons-info-outline",i,!!function(e){return 0==e%18}(r)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:u,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M13 9h-2V7h2v2zm0 2h-2v6h2v-6zm-1-7c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8m0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},9031:(e,t,r)=>{"use strict";t.A=function(e){var t=e.size,r=void 0===t?24:t,o=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var r,o,n=function(e,t){if(null==e)return{};var r,o,n={},a=Object.keys(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||(n[r]=e[r]);return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],0<=t.indexOf(r)||Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,a),u=["gridicon","gridicons-notice-outline",i,!!function(e){return 0==e%18}(r)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return n.default.createElement("svg",s({className:u,height:r,width:r,onClick:o},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),n.default.createElement("g",null,n.default.createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var o,n=(o=r(1609))&&o.__esModule?o:{default:o},a=["size","onClick","icon","className"];function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t,r=1;r<arguments.length;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},s.apply(this,arguments)}},5338:(e,t,r)=>{"use strict";var o=r(5795);t.H=o.createRoot,o.hydrateRoot},1020:(e,t,r)=>{"use strict";var o=r(1609),n=Symbol.for("react.element"),a=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,r){var o,a={},u=null,d=null;for(o in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(d=t.ref),t)s.call(t,o)&&!c.hasOwnProperty(o)&&(a[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===a[o]&&(a[o]=t[o]);return{$$typeof:n,type:e,key:u,ref:d,props:a,_owner:i.current}}t.Fragment=a,t.jsx=u,t.jsxs=u},4848:(e,t,r)=>{"use strict";e.exports=r(1020)},1609:e=>{"use strict";e.exports=window.React},5795:e=>{"use strict";e.exports=window.ReactDOM}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var a=t[o]={exports:{}};return e[o](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;r.g.importScripts&&(e=r.g.location+"");var t=r.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");if(o.length)for(var n=o.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=o[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),r.p=window.wcpayAssets.url,(()=>{"use strict";var e={};r.r(e),r.d(e,{getAllDepositsOverviews:()=>ze,getAllDepositsOverviewsError:()=>qe,getDeposit:()=>je,getDepositQueryError:()=>Be,getDeposits:()=>$e,getDepositsCount:()=>Ye,getDepositsSummary:()=>Ve,getDepositsSummaryError:()=>Qe,getInstantDeposit:()=>We});var t={};r.r(t),r.d(t,{submitInstantDeposit:()=>nt,updateAllDepositsOverviews:()=>Ze,updateDeposit:()=>Ge,updateDeposits:()=>Je,updateDepositsCount:()=>Xe,updateDepositsSummary:()=>tt,updateErrorForAllDepositsOverviews:()=>Ke,updateErrorForDepositQuery:()=>et,updateErrorForDepositsSummary:()=>rt,updateInstantDeposit:()=>ot});var o={};r.r(o),r.d(o,{getAllDepositsOverviews:()=>st,getDeposit:()=>at,getDeposits:()=>dt,getDepositsSummary:()=>mt,getPayoutsCSVRequestURL:()=>ut,payoutsDownloadEndpoint:()=>ct});var n={};r.r(n),r.d(n,{getFraudOutcomeTransactions:()=>Tt,getFraudOutcomeTransactionsError:()=>Rt,getFraudOutcomeTransactionsSummary:()=>vt,getFraudOutcomeTransactionsSummaryError:()=>bt,getTransactions:()=>ht,getTransactionsError:()=>St,getTransactionsSummary:()=>ft,getTransactionsSummaryError:()=>gt});var a={};r.r(a),r.d(a,{updateErrorForFraudOutcomeTransactions:()=>Ct,updateErrorForFraudOutcomeTransactionsSummary:()=>Ft,updateErrorForTransactions:()=>At,updateErrorForTransactionsSummary:()=>Dt,updateFraudOutcomeTransactions:()=>Pt,updateFraudOutcomeTransactionsSummary:()=>Mt,updateTransactions:()=>It,updateTransactionsSummary:()=>Nt});var s={};r.r(s),r.d(s,{formatQueryFilters:()=>Ut,getFraudOutcomeTransactions:()=>qt,getFraudOutcomeTransactionsExport:()=>$t,getFraudOutcomeTransactionsSummary:()=>Lt,getTransactions:()=>xt,getTransactionsCSVRequestURL:()=>jt,getTransactionsSummary:()=>zt,transactionsDownloadEndpoint:()=>kt});var i={};r.r(i),r.d(i,{getCharge:()=>Bt,getChargeError:()=>Ht,getChargeFromOrder:()=>Vt,getChargeFromOrderError:()=>Qt});var c={};r.r(c),r.d(c,{updateCharge:()=>Wt,updateErrorForCharge:()=>Gt});var u={};r.r(u),r.d(u,{getCharge:()=>Zt,getChargeFromOrder:()=>Kt});var d={};r.r(d),r.d(d,{getTimeline:()=>Xt,getTimelineError:()=>er});var m={};r.r(m),r.d(m,{updateErrorForTimeline:()=>rr,updateTimeline:()=>tr});var p={};r.r(p),r.d(p,{getTimeline:()=>or});var l={};r.r(l),r.d(l,{getCachedDispute:()=>ur,getDispute:()=>ir,getDisputeError:()=>cr,getDisputes:()=>dr,getDisputesSummary:()=>mr});var _={};r.r(_),r.d(_,{refundCharge:()=>hr,updateErrorForPaymentIntent:()=>yr,updatePaymentIntent:()=>_r});var y={};r.r(y),r.d(y,{getPaymentIntent:()=>Sr});var h={};r.r(h),r.d(h,{acceptDispute:()=>Tr,updateDispute:()=>Er,updateDisputes:()=>gr,updateDisputesSummary:()=>wr,updateErrorForDispute:()=>fr});var S={};r.r(S),r.d(S,{disputesDownloadEndpoint:()=>Or,getDispute:()=>br,getDisputes:()=>Ir,getDisputesCSVRequestURL:()=>vr,getDisputesSummary:()=>Ar});var E={};r.r(E),r.d(E,{getAccountBusinessSupportEmail:()=>Hr,getAccountBusinessSupportPhone:()=>Vr,getAccountCommunicationsEmail:()=>Po,getAccountDomesticCurrency:()=>Qr,getAccountStatementDescriptor:()=>$r,getAccountStatementDescriptorKana:()=>Br,getAccountStatementDescriptorKanji:()=>Yr,getAdvancedFraudProtectionSettings:()=>vo,getAvailablePaymentMethodIds:()=>jr,getCompletedWaitingPeriod:()=>Jr,getCurrentProtectionLevel:()=>Oo,getDepositDelayDays:()=>Kr,getDepositRestrictions:()=>eo,getDepositScheduleInterval:()=>Wr,getDepositScheduleMonthlyAnchor:()=>Zr,getDepositScheduleWeeklyAnchor:()=>Gr,getDepositStatus:()=>Xr,getDuplicatedPaymentMethodIds:()=>Ur,getEnabledPaymentMethodIds:()=>kr,getExpressCheckoutCartMethods:()=>Mo,getExpressCheckoutCheckoutMethods:()=>Fo,getExpressCheckoutProductMethods:()=>Co,getIsCardPresentEligible:()=>ho,getIsDebugLogEnabled:()=>io,getIsDevModeEnabled:()=>no,getIsExpressCheckoutInPaymentMethodsEnabled:()=>so,getIsManualCaptureEnabled:()=>to,getIsMultiCurrencyEnabled:()=>co,getIsPaymentRequestEnabled:()=>ao,getIsSavedCardsEnabled:()=>_o,getIsStripeBillingEnabled:()=>Io,getIsStripeBillingMigrationInProgress:()=>Ao,getIsSubscriptionsPluginActive:()=>fo,getIsTestModeEnabled:()=>ro,getIsTestModeOnboarding:()=>oo,getIsWCPayEnabled:()=>xr,getIsWCPaySubscriptionsEligible:()=>Eo,getIsWCPaySubscriptionsEnabled:()=>So,getIsWooPayEnabled:()=>go,getIsWooPayGlobalThemeSupportEnabled:()=>wo,getPaymentMethodStatuses:()=>zr,getPaymentRequestButtonBorderRadius:()=>lo,getPaymentRequestButtonSize:()=>mo,getPaymentRequestButtonTheme:()=>po,getPaymentRequestButtonType:()=>uo,getSavingError:()=>yo,getSettings:()=>Fr,getShowWooPayIncompatibilityNotice:()=>bo,getStripeBillingMigratedCount:()=>Do,getStripeBillingSubscriptionCount:()=>No,getWooPayCustomMessage:()=>To,getWooPayStoreLogo:()=>Ro,isDirty:()=>Lr,isSavingSettings:()=>qr});var f={};r.r(f),r.d(f,{saveOption:()=>vn,saveSettings:()=>pn,submitStripeBillingSubscriptionMigration:()=>On,updateAccountBusinessSupportEmail:()=>sn,updateAccountBusinessSupportPhone:()=>cn,updateAccountCommunicationsEmail:()=>gn,updateAccountStatementDescriptor:()=>on,updateAccountStatementDescriptorKana:()=>an,updateAccountStatementDescriptorKanji:()=>nn,updateAdvancedFraudProtectionSettings:()=>En,updateDepositScheduleInterval:()=>un,updateDepositScheduleMonthlyAnchor:()=>mn,updateDepositScheduleWeeklyAnchor:()=>dn,updateEnabledPaymentMethodIds:()=>Wo,updateExpressCheckoutCartMethods:()=>Tn,updateExpressCheckoutCheckoutMethods:()=>Rn,updateExpressCheckoutProductMethods:()=>wn,updateIsCardPresentEligible:()=>zo,updateIsDebugLogEnabled:()=>en,updateIsExpressCheckoutInPaymentMethodsEnabled:()=>Qo,updateIsManualCaptureEnabled:()=>Jo,updateIsMultiCurrencyEnabled:()=>tn,updateIsPaymentRequestEnabled:()=>Vo,updateIsSavedCardsEnabled:()=>jo,updateIsSavingSettings:()=>Go,updateIsStripeBillingEnabled:()=>fn,updateIsTestModeEnabled:()=>Xo,updateIsWCPayEnabled:()=>Ho,updateIsWCPaySubscriptionsEnabled:()=>rn,updateIsWooPayEnabled:()=>ln,updateIsWooPayGlobalThemeSupportEnabled:()=>_n,updatePaymentRequestButtonBorderRadius:()=>Yo,updatePaymentRequestButtonSize:()=>Lo,updatePaymentRequestButtonTheme:()=>$o,updatePaymentRequestButtonType:()=>qo,updateProtectionLevel:()=>Sn,updateSelectedPaymentMethod:()=>Zo,updateSettings:()=>Bo,updateUnselectedPaymentMethod:()=>Ko,updateWooPayCustomMessage:()=>yn,updateWooPayStoreLogo:()=>hn});var g={};r.r(g),r.d(g,{getSettings:()=>bn});var w={};r.r(w),r.d(w,{getCardReaderStats:()=>Nn,getCardReaderStatsError:()=>Dn,getCardReaders:()=>Pn});var T={};r.r(T),r.d(T,{updateCardReaderStats:()=>Cn,updateCardReaders:()=>Mn,updateErrorForCardReaderStats:()=>Fn,updateErrorForCardReaders:()=>Un});var R={};r.r(R),r.d(R,{getCardReaderStats:()=>xn,getCardReaders:()=>kn});var O={};r.r(O),r.d(O,{getActiveLoanSummary:()=>$n,getActiveLoanSummaryError:()=>Yn,getLoans:()=>Bn,getLoansError:()=>Hn});var v={};r.r(v),r.d(v,{updateActiveLoanSummary:()=>Vn,updateErrorForActiveLoanSummary:()=>Qn,updateErrorForLoans:()=>Gn,updateLoans:()=>Wn});var b={};r.r(b),r.d(b,{getActiveLoanSummary:()=>Zn,getLoans:()=>Kn});var I={};r.r(I),r.d(I,{getDocuments:()=>ra,getDocumentsError:()=>oa,getDocumentsSummary:()=>aa,getDocumentsSummaryError:()=>sa});var A={};r.r(A),r.d(A,{updateDocuments:()=>ia,updateDocumentsSummary:()=>ua,updateErrorForDocuments:()=>ca,updateErrorForDocumentsSummary:()=>da});var N={};r.r(N),r.d(N,{formatQueryFilters:()=>ma,getDocuments:()=>pa,getDocumentsSummary:()=>la});var D={};r.r(D),r.d(D,{getPaymentIntent:()=>ya,getPaymentIntentError:()=>ha});var P={};r.r(P),r.d(P,{getAuthorization:()=>Ta,getAuthorizations:()=>wa,getAuthorizationsError:()=>Ra,getAuthorizationsSummary:()=>va,getAuthorizationsSummaryError:()=>ba,getIsRequesting:()=>Ia});var C={};r.r(C),r.d(C,{setIsRequestingAuthorization:()=>Ma,submitCancelAuthorization:()=>Ua,submitCaptureAuthorization:()=>Fa,updateAuthorization:()=>Pa,updateAuthorizations:()=>Na,updateAuthorizationsSummary:()=>Ca,updateErrorForAuthorizations:()=>Da,updateErrorForAuthorizationsSummary:()=>xa});var M={};r.r(M),r.d(M,{getAuthorization:()=>ja,getAuthorizations:()=>ka,getAuthorizationsSummary:()=>za});var F={};r.r(F),r.d(F,{getFile:()=>Ya,getFileError:()=>Ba});var U={};r.r(U),r.d(U,{updateErrorForFiles:()=>Va,updateFiles:()=>Ha});var x={};r.r(x),r.d(x,{getFile:()=>Qa});var k={};r.r(k),r.d(k,{getPmPromotions:()=>Za,getPmPromotionsError:()=>Ka});var j={};r.r(j),r.d(j,{activatePmPromotion:()=>ts,dismissPmPromotion:()=>rs,updateErrorForPmPromotions:()=>es,updatePmPromotions:()=>Xa});var z={};r.r(z),r.d(z,{getPmPromotions:()=>ns});var q=r(5338),L=r(1609);const $=window.wp.i18n,Y=e=>{var t;const r=null!==(t=wcpay_order_config)&&void 0!==t?t:wc.wcSettings.getSetting("woocommerce_payments_data");return r?.[e]},B=window.moment;var H=r.n(B);const V=window.wc.wcSettings,Q={bank_cannot_process:{display:(0,$.__)("Bank cannot process","woocommerce-payments")},check_returned:{display:(0,$.__)("Check returned","woocommerce-payments")},credit_not_processed:{display:(0,$.__)("Credit not processed","woocommerce-payments"),overview:[(0,$.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,$.__)("If your customer was not refunded appropriately, you will need to accept the dispute, or resolve the issue with your customer. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments")],summary:[(0,$.__)("The customer claims that the purchased product was returned or the transaction was otherwise canceled, but you have not yet provided a refund or credit.","woocommerce-payments")],required:[(0,$.__)("Demonstrate that you have refunded your customer through other means or that your customer is not entitled to a refund. You cannot issue a refund while a payment is being disputed. If you believe that your customer was entitled a refund that you did not provide, you can accept the dispute.","woocommerce-payments")],respond:[(0,$.__)("You should first get in touch with your customer. If you understand what their complaint is, there is a chance for you to explain the misunderstanding or to make it right. If youre able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,$.__)("If the cardholder agrees to withdraw the dispute, you should still submit evidence for the dispute using the forms on the next screen. In addition to the following evidence, your submission should include correspondence with the cardholder saying they would withdraw the dispute and a written statement from their card issuer confirming that the dispute has been withdrawn.","woocommerce-payments")],claim:(0,$.__)("The cardholder claims a credit was not processed.","woocommerce-payments")},customer_initiated:{display:(0,$.__)("Customer initiated","woocommerce-payments")},debit_not_authorized:{display:(0,$.__)("Debit not authorized","woocommerce-payments")},duplicate:{display:(0,$.__)("Duplicate","woocommerce-payments"),overview:[(0,$.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,$.__)("If there were duplicate payments, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments")],summary:[(0,$.__)("The customer claims they were charged multiple times for the same product or service.","woocommerce-payments")],required:[(0,$.__)("Demonstrate that each payment was for a separate product or service.","woocommerce-payments")],respond:[(0,$.__)("Determine if your customer was incorrectly charged multiple times.","woocommerce-payments"),(0,$.__)("If they were not, collect any and all information documenting that each payment was made separately, such as copies of receipts. If the receipts dont include the items purchased, be sure to include an itemized list. Each receipt should clearly indicate that the payments are for separate purchases of items or services. If youve been able to get in touch with the customer you should be sure to address any concerns they had in your evidence.","woocommerce-payments"),(0,$.__)("If there have been two or more separate payments, you should get in touch with your customer. If you understand what their complaint is, there is a chance for you to explain the misunderstanding or to make it right. If youre able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,$.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments")],claim:(0,$.__)("The cardholder claims this is a duplicate transaction.","woocommerce-payments")},fraudulent:{display:(0,$.__)("Transaction unauthorized","woocommerce-payments"),overview:[(0,$.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,$.__)("If you believe the payment was actually made using a stolen credit card, you will need to accept the dispute. The credit card networks place liability for accepting unauthorized transactions with you, the business.","woocommerce-payments")],summary:[(0,$.__)("This is the most common reason for a dispute, and happens when a cardholder claims that they didnt authorize the payment. This can happen if the card was lost or stolen and used to make an unauthorized transaction. It can also happen if the cardholder doesnt recognize the payment as it appears on the billing statement from their card issuer.","woocommerce-payments")],required:[(0,$.__)("Provide adequate payment and order details so that a legitimate customer recognizes it, or proves to the card issuer that their cardholder authorized the transaction.","woocommerce-payments")],respond:[(0,$.__)("Try to get in touch with your customer. Sometimes people forget about payments they make or dont recognize the way they appear on their card statement. If this is the case, ask them to contact their card issuer and let them know they no longer dispute the transaction.","woocommerce-payments"),(0,$.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,$.__)("It may be more efficient—and provide a better customer experience—to accept an accidental dispute and charge the customer again, if appropriate. Even when a dispute is withdrawn, it usually takes approximately 75 days to be finalized. Remember, it doesnt matter to the card networks whether you win or lose a dispute; what matters is how many disputes a business receives, regardless of how many disputes are won.","woocommerce-payments")],claim:(0,$.__)("The cardholder claims this is an unauthorized transaction.","woocommerce-payments")},general:{display:(0,$.__)("General","woocommerce-payments"),overview:[(0,$.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments")],summary:[(0,$.__)("This is an uncategorized dispute, so you should contact the customer for additional details to find out why the payment was disputed.","woocommerce-payments")]},incorrect_account_details:{display:(0,$.__)("Incorrect account details","woocommerce-payments")},insufficient_funds:{display:(0,$.__)("Insufficient funds","woocommerce-payments")},product_not_received:{display:(0,$.__)("Product not received","woocommerce-payments"),overview:[(0,$.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,$.__)("If you can not prove the customer received their product or service, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments")],summary:[(0,$.__)("The customer claims they did not receive the products or services purchased.","woocommerce-payments")],required:[(0,$.__)("Prove that the customer received a physical product or offline service, or made use of a digital product or online service. This must have occurred prior to the date the dispute was initiated.","woocommerce-payments")],respond:[(0,$.__)("First, get in touch with your customer. Understanding why they filed the dispute will be important for helping make sure your customer gets the product and will give you critical information to prevent this from happening to others.","woocommerce-payments"),(0,$.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments")],claim:(0,$.__)("The cardholder claims they did not receive the product.","woocommerce-payments")},product_unacceptable:{display:(0,$.__)("Product unacceptable","woocommerce-payments"),overview:[(0,$.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,$.__)("If you can not prove the customer received their product or service as described, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments")],summary:[(0,$.__)("The product or service was received but was defective, damaged, or not as described.","woocommerce-payments")],required:[(0,$.__)("Demonstrate that the product or service was delivered as described at the time of purchase.","woocommerce-payments")],respond:[(0,$.__)("If the product or service is as described, provide specific information (invoice, contract, etc.) to refute the cardholders claims. Quality disputes are where the customer does not agree with the condition of merchandise or service received (e.g., a car repair situation or quality of a hotel room). There may be instances where you will need to obtain a neutral third-party opinion to help corroborate your claim against the cardholder. Provide as much specific information and documentation as possible to refute the cardholders claims. It is recommended that you address each point that the cardholder has made.","woocommerce-payments"),(0,$.__)("If the customer has not yet returned the product or canceled the service, provide specific information to that effect. You should double-check your incoming shipping records to verify that you have not received a return before you respond. If you have processed a credit or reversal for this transaction, provide evidence of this which includes the amount and date processed.","woocommerce-payments"),(0,$.__)("For products that have been repaired or replaced, provide evidence that the cardholder agreed to a repair or replacement, it has been received by the customer, and the repair or replacement has not since been disputed.","woocommerce-payments"),(0,$.__)("If your customer made no attempt to return the product or cancel the service, or if you provided a replacement product or service, make sure to note that as well.","woocommerce-payments"),(0,$.__)("If the customer withdraws their dispute you should still submit evidence using the forms on the next screen. Be sure to provide a letter or email from the cardholder stating that they are no longer in dispute.","woocommerce-payments")],claim:(0,$.__)("The cardholder claims the product was unacceptable.","woocommerce-payments")},subscription_canceled:{display:(0,$.__)("Subscription canceled","woocommerce-payments"),overview:[(0,$.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,$.__)("If you can not prove the customers subscription was canceled, and or they did not follow your cancellation policy, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments")],summary:[(0,$.__)("The customer claims that you continued to charge them after a subscription was canceled.","woocommerce-payments")],required:[(0,$.__)("Prove that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments")],respond:[(0,$.__)("First, get in touch with your customer. If you understand what they believe happened, there is a chance for you to explain the misunderstanding or to make it right. ","woocommerce-payments"),(0,$.__)("Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence using the forms on the next screen. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,$.__)("Otherwise, use the forms on the next screen to submit evidence that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments")],claim:(0,$.__)("The cardholder claims a subscription was canceled.","woocommerce-payments")},unrecognized:{display:(0,$.__)("Unrecognized","woocommerce-payments"),overview:[(0,$.__)("If you believe the dispute is invalid, you can challenge it by submitting the appropriate evidence using the response forms on the next screen.","woocommerce-payments"),(0,$.__)("If you can not prove the customers subscription was canceled, and or they did not follow your cancellation policy, you should accept the dispute. You cannot issue a refund while a payment is being disputed. The credit card networks place liability for accepting disputed payments with you, the business.","woocommerce-payments")],summary:[(0,$.__)("The customer doesnt recognize the payment appearing on their card statement.","woocommerce-payments")],required:[(0,$.__)("Get your customer to withdraw the dispute by helping them identify the payment. Otherwise, challenge the dispute with appropriate evidence that proves the purchase was legitimate. ","woocommerce-payments")],respond:[(0,$.__)("First, try to get in touch with your customer. Sometimes people forget about payments they make or dont recognize the way they appear on their card statement. If this is the case, ask them to contact their card issuer and let them know they no longer dispute the transaction. Even if your customer agrees to withdraw the dispute, you must still submit appropriate evidence. Simply saying that your customer is going to withdraw the dispute is not sufficient evidence.","woocommerce-payments"),(0,$.__)("It may be more efficient—and provide a better customer experience—to accept an accidental dispute and charge the customer again, if appropriate. Even when a dispute is withdrawn, it usually takes approximately 75 days to be finalized. Remember, it doesnt matter to the card networks whether you win or lose a dispute; what matters is how many disputes a business receives, regardless of how many disputes are won.","woocommerce-payments")]},noncompliant:{display:(0,$.__)("Non-compliant","woocommerce-payments"),claim:(0,$.__)("Your customers bank claims this payment violates Visas rules.","woocommerce-payments"),summary:[(0,$.__)("This transaction is being reviewed under Visas network compliance rules.","woocommerce-payments")]}},W={warning_needs_response:(0,$.__)("Inquiry: Response needed","woocommerce-payments"),warning_under_review:(0,$.__)("Inquiry: Under review","woocommerce-payments"),warning_closed:(0,$.__)("Inquiry: Closed","woocommerce-payments"),needs_response:(0,$.__)("Response needed","woocommerce-payments"),under_review:(0,$.__)("Under review","woocommerce-payments"),charge_refunded:(0,$.__)("Charge refunded","woocommerce-payments"),won:(0,$.__)("Won","woocommerce-payments"),lost:(0,$.__)("Lost","woocommerce-payments")},G=(Object.entries(W).map((([e,t])=>({label:t,value:e}))).filter((function(e){return null!=e})),["needs_response","warning_needs_response"]),Z=["under_review","warning_under_review"],K=((0,$.__)("Dispute currency","woocommerce-payments"),(0,$.__)("All currencies","woocommerce-payments"),(0,$.__)("Show","woocommerce-payments"),(0,$.__)("Needs response","woocommerce-payments"),(0,$.__)("All disputes","woocommerce-payments"),(0,$.__)("Advanced filters","woocommerce-payments"),(0,V.getSetting)("wcVersion")),J=parseFloat(K),X=(J<7.8?(0,$.__)("Disputes match {{select /}} filters","woocommerce-payments"):(0,$.__)("Disputes match <select /> filters","woocommerce-payments"),(0,$.__)("Disputed on date","woocommerce-payments"),(0,$.__)("Remove dispute date filter","woocommerce-payments"),(0,$.__)("Select a dispute date filter match","woocommerce-payments"),J<7.8?(0,$.__)("{{title}}Date{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,$.__)("<title>Date</title> <rule /> <filter />","woocommerce-payments"),(0,$.__)("Select a dispute date","woocommerce-payments"),(0,$.__)("Before","woocommerce-payments"),(0,$.__)("After","woocommerce-payments"),(0,$.__)("Between","woocommerce-payments"),(0,$.__)("Status","woocommerce-payments"),(0,$.__)("Remove dispute status filter","woocommerce-payments"),(0,$.__)("Select a dispute status filter match","woocommerce-payments"),J<7.8?(0,$.__)("{{title}}Status{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,$.__)("<title>Status</title> <rule /> <filter />","woocommerce-payments"),(0,$.__)("Select a dispute status","woocommerce-payments"),(0,$._x)("Is","dispute status","woocommerce-payments"),(0,$._x)("Is not","dispute status","woocommerce-payments"),window.wp.domReady);var ee=r.n(X);const te=(e,t={})=>{if(window.wcpaySettings){Object.assign(t,{is_test_mode:wcpaySettings.testMode,jetpack_connected:wcpaySettings.isJetpackConnected,wcpay_version:wcpaySettings.version,woo_country_code:wcpaySettings.connect.country,hosting_provider:wcpaySettings.trackingInfo?.hosting_provider});for(const e in t)void 0===t[e]&&delete t[e]}ee()((()=>{var r;(null!==(r=wc?.tracks?.recordEvent)&&void 0!==r?r:wcTracks.recordEvent)(e,t)}))},re=((0,L.createContext)(window.wcpaySettings),(0,L.createContext)({isActive:!1,setActive:()=>null,isCompleted:!1,setCompleted:()=>null,taskId:""}),window.wc.currency);var oe=r.n(re);const ne=window.lodash,ae=((0,$.__)("Australian dollar","woocommerce-payments"),(0,$.__)("Canadian dollar","woocommerce-payments"),(0,$.__)("Swiss franc","woocommerce-payments"),(0,$.__)("Danish krone","woocommerce-payments"),(0,$.__)("Euro","woocommerce-payments"),(0,$.__)("Pound sterling","woocommerce-payments"),(0,$.__)("Norwegian krone","woocommerce-payments"),(0,$.__)("New Zealand dollar","woocommerce-payments"),(0,$.__)("Swedish krona","woocommerce-payments"),(0,$.__)("United States (US) dollar","woocommerce-payments"),e=>wcpaySettings.zeroDecimalCurrencies.includes(e.toLowerCase())),se=(e,t="USD",r=null,o=!1)=>{const n=ae(t);n||(e/=100);const a=e<0,s=a?-1*e:e,i=a?"-":"",c=o?(e=>{const t=e.toUpperCase(),{currencyData:r,connect:{country:o="US"}}=wcpaySettings;if(r[o]?.code===t)return oe()(r[o]);const n=(0,ne.find)(r,{code:t});if(n){const{defaultLocale:e={}}=n;return e.hasOwnProperty("decimalSeparator")&&e.hasOwnProperty("thousandSeparator")&&e.hasOwnProperty("symbolPosition")&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition),oe()(n)}return null})(t):((e,t=null)=>{const{currencyData:r,connect:{country:o="US"}}=wcpaySettings,n=(0,ne.find)(r,{code:e.toUpperCase()});if(n){if(null!==t&&t.toUpperCase()!==e.toUpperCase()||r[o]){const e=t?(0,ne.find)(r,{code:t.toUpperCase()}):r[o];e&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition)}return oe()(n)}return null})(t,r);if(null===c)return i+ce(s,t,n);try{return i+("function"==typeof c.formatAmount?ue(c.formatAmount(s)):ue(c.formatCurrency(s)))}catch(e){return i+ue(ce(s,t,n))}},ie=(e,t="USD",r=!1,o=null)=>{let n=se(e,t,o);return wcpaySettings.shouldUseExplicitPrice?(r&&(n=function(e){return e.replace(/[^0-9,.' ]/g,"").trim()}(n)),((e,t)=>(-1===e.toString().indexOf(t)&&(e=e+" "+t),e))(n,t.toUpperCase())):n};function ce(e,t,r){try{return e.toLocaleString(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",dummy:r})}catch(o){return(0,$.sprintf)(r?"%s %i":"%s %.2f",t.toUpperCase(),e)}}function ue(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}const de=e=>G.includes(e),me=e=>Z.includes(e),pe=e=>e.startsWith("warning");function le(e){return e.startsWith("{{/")?{type:"componentClose",value:e.replace(/\W/g,"")}:e.endsWith("/}}")?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.startsWith("{{")?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}function _e(e,t){let r,o,n=[];for(let a=0;a<e.length;a++){const s=e[a];if("string"!==s.type){if(void 0===t[s.value])throw new Error(`Invalid interpolation, missing component node: \`${s.value}\``);if("object"!=typeof t[s.value])throw new Error(`Invalid interpolation, component node must be a ReactElement or null: \`${s.value}\``);if("componentClose"===s.type)throw new Error(`Missing opening component token: \`${s.value}\``);if("componentOpen"===s.type){r=t[s.value],o=a;break}n.push(t[s.value])}else n.push(s.value)}if(r){const a=function(e,t){const r=t[e];let o=0;for(let n=e+1;n<t.length;n++){const e=t[n];if(e.value===r.value){if("componentOpen"===e.type){o++;continue}if("componentClose"===e.type){if(0===o)return n;o--}}}throw new Error("Missing closing component token `"+r.value+"`")}(o,e),s=_e(e.slice(o+1,a),t),i=(0,L.cloneElement)(r,{},s);if(n.push(i),a<e.length-1){const r=_e(e.slice(a+1),t);n=n.concat(r)}}return n=n.filter(Boolean),0===n.length?null:1===n.length?n[0]:(0,L.createElement)(L.Fragment,null,...n)}function ye(e){const{mixedString:t,components:r,throwErrors:o}=e;if(!r)return t;if("object"!=typeof r){if(o)throw new Error(`Interpolation Error: unable to process \`${t}\` because components is not an object`);return t}const n=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(le)}(t);try{return _e(n,r)}catch(e){if(o)throw new Error(`Interpolation Error: unable to process \`${t}\` because of error \`${e.message}\``);return t}}const he=window.wp.components;function Se(e){var t,r,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=Se(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const Ee=function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=Se(e))&&(o&&(o+=" "),o+=t);return o};var fe=r(5955),ge=r(9031),we=r(4275),Te=r(4848);const Re=function(e){const{icon:t,actions:r,children:o,buttonVariant:n,...a}=e;a.className=Ee("wcpay-inline-notice",`wcpay-inline-${a.status}-notice`,a.className);let s=t;if(!0===s)switch(a.status){case"success":s=(0,Te.jsx)(fe.A,{});break;case"error":case"warning":s=(0,Te.jsx)(ge.A,{});break;default:s=(0,Te.jsx)(we.A,{})}const i="wcpay-inline-notice__action",c=r?.map(((e,t)=>{var r,o;return"url"in e?(0,Te.jsx)("a",{className:i,href:e.url,children:e.label},t):(0,Te.jsx)(he.Button,{className:i,onClick:e.onClick,isBusy:null!==(r=e.isBusy)&&void 0!==r&&r,disabled:null!==(o=e.disabled)&&void 0!==o&&o,variant:n,children:e.label},t)}));return(0,Te.jsx)(he.Notice,{...a,children:(0,Te.jsxs)(he.Flex,{align:"center",justify:"flex-start",children:[s&&(0,Te.jsx)(he.FlexItem,{className:`wcpay-inline-notice__icon wcpay-inline-${a.status}-notice__icon`,children:(0,Te.jsx)(he.Icon,{icon:s,size:24})}),(0,Te.jsxs)(he.FlexItem,{className:`wcpay-inline-notice__content wcpay-inline-${a.status}-notice__content`,children:[o,c&&(0,Te.jsx)(he.Flex,{className:"wcpay-inline-notice__content__actions",align:"baseline",justify:"flex-start",gap:4,children:c})]})]})})},Oe=()=>(0,Te.jsx)(Re,{icon:!0,status:"warning",isDismissible:!1,children:ye({mixedString:(0,$.__)("WooPayments was in test mode when this order was placed. {{learnMoreLink/}}","woocommerce-payments"),components:{learnMoreLink:(0,Te.jsx)(he.ExternalLink,{href:"https://woocommerce.com/document/woopayments/testing-and-troubleshooting/testing/",children:(0,$.__)("Learn more about test mode","woocommerce-payments")})}})}),ve=window.wp.element,be=(window.wc.components,window.wp.url),Ie=window.wp.date,Ae=(window.wc.number,e=>(0,be.addQueryArgs)("admin.php",e)),Ne=(e,t=!1)=>{const r=t?H()(e).endOf("day").utc().toISOString():H()(e).startOf("day").utc().toISOString();return e&&(0,Ie.dateI18n)("Y-m-d H:i:s",r,!0)},De=window.wp.data,Pe=window.wp.dataControls,Ce="/wc/v3/payments",Me="wc/payments",Fe={SET_DEPOSIT:"SET_DEPOSIT",SET_DEPOSITS:"SET_DEPOSITS",SET_DEPOSITS_COUNT:"SET_DEPOSITS_COUNT",SET_ERROR_FOR_DEPOSIT_QUERY:"SET_ERROR_FOR_DEPOSIT_QUERY",SET_DEPOSITS_SUMMARY:"SET_DEPOSITS_SUMMARY",SET_ERROR_FOR_DEPOSITS_SUMMARY:"SET_ERROR_FOR_DEPOSITS_SUMMARY",SET_INSTANT_DEPOSIT:"SET_INSTANT_DEPOSIT",SET_ALL_DEPOSITS_OVERVIEWS:"SET_ALL_DEPOSITS_OVERVIEWS",SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:"SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS"},Ue=e=>JSON.stringify(e,Object.keys(e).sort()),xe={byId:{},queries:{},count:0,instant:{}},ke=e=>e&&e.deposits||{},je=(e,t)=>(ke(e).byId||{})[t],ze=e=>{const t=ke(e).overviews||{};if(!t.data)return{account:null,currencies:[]};const{deposit:r,balance:o,account:n}=t.data,a={lastPaid:r.last_paid,pending:o.pending,available:o.available,instant:o.instant},s={};for(const[e,t]of Object.entries(a))t?.forEach((t=>{const{currency:r}=t;s[r]||(s[r]={currency:r,lastPaid:void 0,pending:void 0,available:void 0,instant:void 0}),s[r][e]=t}));const i=Object.values(s);return{account:n,currencies:[...i.filter((e=>n.default_currency===e.currency)),...i.filter((e=>n.default_currency!==e.currency))]}},qe=e=>(ke(e).overviews||{}).error,Le=(e,t)=>{const r=Ue(t);return(ke(e).queries||{})[r]||{}},$e=(e,t)=>(Le(e,t).data||[]).map(je.bind(void 0,e)),Ye=e=>ke(e).count,Be=(e,t)=>Le(e,t).error||{},He=(e,t)=>{const r=Ue(t);return(ke(e).summary||{})[r]||{}},Ve=(e,t)=>He(e,t).data||{},Qe=(e,t)=>He(e,t).error||{},We=e=>(ke(e).instant||{}).data;function Ge(e){return{type:Fe.SET_DEPOSIT,data:e}}function Ze(e){return{type:Fe.SET_ALL_DEPOSITS_OVERVIEWS,data:e}}function Ke(e,t){return{type:Fe.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,error:t}}function Je(e,t){return{type:Fe.SET_DEPOSITS,query:e,data:t}}function Xe(e){return{type:Fe.SET_DEPOSITS_COUNT,data:e}}function et(e,t,r){return{type:Fe.SET_ERROR_FOR_DEPOSIT_QUERY,query:e,data:t,error:r}}function tt(e,t){return{type:Fe.SET_DEPOSITS_SUMMARY,query:e,data:t}}function rt(e,t,r){return{type:Fe.SET_ERROR_FOR_DEPOSITS_SUMMARY,query:e,data:t,error:r}}function ot(e){return{type:Fe.SET_INSTANT_DEPOSIT,data:e}}function*nt(e){try{yield(0,De.dispatch)(Me).startResolution("getInstantDeposit",[e]);const t=yield(0,Pe.apiFetch)({path:"/wc/v3/payments/deposits",method:"POST",data:{type:"instant",currency:e}});yield ot(t),yield(0,De.dispatch)(Me).invalidateResolutionForStoreSelector("getDeposits"),yield(0,De.dispatch)(Me).invalidateResolutionForStoreSelector("getAllDepositsOverviews"),yield(0,De.dispatch)("core/notices").createSuccessNotice((0,$.sprintf)((0,$.__)("Instant payout for %s in transit.","woocommerce-payments"),se(t.amount)),{actions:[{label:(0,$.__)("View details","woocommerce-payments"),url:Ae({page:"wc-admin",path:"/payments/payouts/details",id:t.id})}]})}catch{yield(0,De.dispatch)("core/notices").createErrorNotice((0,$.__)("Error creating instant payout.","woocommerce-payments"))}finally{yield(0,De.dispatch)(Me).finishResolution("getInstantDeposit",[e])}}function*at(e){if(/\W/.test(e))return;const t=(0,be.addQueryArgs)(`${Ce}/deposits/${e}`);try{const e=yield(0,Pe.apiFetch)({path:t});yield Ge(e)}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving payout.","woocommerce-payments"))}}function*st(){const e=(0,be.addQueryArgs)(`${Ce}/deposits/overview-all`);try{const t=yield(0,Pe.apiFetch)({path:e});yield Ze(t)}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving all payouts' overviews.","woocommerce-payments")),yield Ke()}}const it=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Ne(e.dateBefore,!0),date_after:Ne(e.dateAfter),date_between:e.dateBetween&&[Ne(e.dateBetween[0]),Ne(e.dateBetween[1],!0)],status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),ct=`${Ce}/deposits/download`;function ut(e){return(0,be.addQueryArgs)(ct,it(e))}function*dt(e){const t=(0,be.addQueryArgs)(`${Ce}/deposits`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...it(e)});try{const r=yield(0,Pe.apiFetch)({path:t})||{};yield Je(e,r.data),yield Xe(r.total_count);for(const e in r.data)yield De.controls.dispatch(Me,"finishResolution","getDeposit",[r.data[e].id])}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving payouts.","woocommerce-payments")),yield et(e,null,t)}}function*mt(e){const t=(0,be.addQueryArgs)(`${Ce}/deposits/summary`,it(e));try{const r=yield(0,Pe.apiFetch)({path:t});yield tt(e,r)}catch(t){yield rt(e,null,t)}}const pt={SET_TRANSACTIONS:"SET_TRANSACTIONS",SET_ERROR_FOR_TRANSACTIONS:"SET_ERROR_FOR_TRANSACTIONS",SET_TRANSACTIONS_SUMMARY:"SET_TRANSACTIONS_SUMMARY",SET_ERROR_FOR_TRANSACTIONS_SUMMARY:"SET_ERROR_FOR_TRANSACTIONS_SUMMARY",SET_FRAUD_OUTCOME_TRANSACTIONS:"SET_FRAUD_OUTCOME_TRANSACTIONS",SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:"SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS",SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:"SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY",SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:"SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY"},lt={summary:{},fraudProtection:{review:{summary:{}},block:{summary:{}}}},_t=e=>e&&e.transactions||{},yt=(e,t)=>{const r=Ue(t);return _t(e)[r]||{}},ht=(e,t)=>yt(e,t).data||[],St=(e,t)=>yt(e,t).error||{},Et=(e,t)=>{const r=Ue(t);return _t(e).summary[r]||{}},ft=(e,t)=>Et(e,t).data||{},gt=(e,t)=>Et(e,t).error||{},wt=(e,t,r)=>{const o=Ue(r);return _t(e).fraudProtection?.[t]?.[o]||{}},Tt=(e,t,r)=>wt(e,t,r).data||[],Rt=(e,t,r)=>wt(e,t,r).error||{},Ot=(e,t,r)=>{const o=Ue(r);return _t(e).fraudProtection?.[t]?.summary[o]||{}},vt=(e,t,r)=>Ot(e,t,r).data||{},bt=(e,t,r)=>Ot(e,t,r).error||{};function It(e,t){return{type:pt.SET_TRANSACTIONS,query:e,data:t}}function At(e,t,r){return{type:pt.SET_ERROR_FOR_TRANSACTIONS,query:e,data:t,error:r}}function Nt(e,t){return{type:pt.SET_TRANSACTIONS_SUMMARY,query:e,data:t}}function Dt(e,t,r){return{type:pt.SET_ERROR_FOR_TRANSACTIONS_SUMMARY,query:e,data:t,error:r}}function Pt(e,t,r){return{type:pt.SET_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:r}}function Ct(e,t,r){return{type:pt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:null,error:r}}function Mt(e,t,r){return{type:pt.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:r}}function Ft(e,t,r){return{type:pt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:null,error:r}}const Ut=e=>({user_email:e.userEmail,match:e.match,date_before:Ne(e.dateBefore,!0),date_after:Ne(e.dateAfter),date_between:e.dateBetween&&[Ne(e.dateBetween[0]),Ne(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot,type_is_in:e.typeIsIn,source_device_is:e.sourceDeviceIs,source_device_is_not:e.sourceDeviceIsNot,channel_is:e.channelIs,channel_is_not:e.channelIsNot,customer_country_is:e.customerCountryIs,customer_country_is_not:e.customerCountryIsNot,risk_level_is:e.riskLevelIs,risk_level_is_not:e.riskLevelIsNot,store_currency_is:e.storeCurrencyIs,loan_id_is:e.loanIdIs,deposit_id:e.depositId,customer_currency_is:e.customerCurrencyIs,customer_currency_is_not:e.customerCurrencyIsNot,source_is:e.sourceIs,source_is_not:e.sourceIsNot,search:e.search,user_timezone:H()(new Date).format("Z"),locale:e.locale});function*xt(e){const t=(0,be.addQueryArgs)(`${Ce}/transactions`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Ut(e)});try{const r=yield(0,Pe.apiFetch)({path:t});yield It(e,r.data||[])}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transactions.","woocommerce-payments")),yield At(e,null,t)}}const kt=`${Ce}/transactions/download`;function jt(e){return(0,be.addQueryArgs)(kt,Ut(e))}function*zt(e){const t=(0,be.addQueryArgs)(`${Ce}/transactions/summary`,Ut(e));try{const r=yield(0,Pe.apiFetch)({path:t});yield Nt(e,r)}catch(t){yield Dt(e,null,t)}}function*qt(e,t){const r=(0,be.addQueryArgs)(`${Ce}/transactions/fraud-outcomes`,{status:e,page:t.paged,sort:t.orderby,pagesize:t.perPage,direction:t.order,additional_status:t.additionalStatus,...Ut(t)});try{const o=yield(0,Pe.apiFetch)({path:r});yield Pt(e,t,o.data||[])}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield Pt(e,t,[]));yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transactions.","woocommerce-payments")),yield Ct(e,t,r)}}function*Lt(e,t){const r=(0,be.addQueryArgs)(`${Ce}/transactions/fraud-outcomes/summary`,{status:e,additional_status:t.additionalStatus}),o={count:0,total:0};try{const n=yield(0,Pe.apiFetch)({path:r});yield Mt(e,t,n||o)}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield Mt(e,t,o));yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving on review transactions.","woocommerce-payments")),yield Ft(e,t,r)}}function $t(e,t){return(0,be.addQueryArgs)(`${Ce}/transactions/fraud-outcomes/download`,{status:e,sort:t.orderby,direction:t.order,additional_status:t.additionalStatus,...Ut(t)})}const Yt={SET_CHARGE:"SET_CHARGE",SET_ERROR_FOR_CHARGE:"SET_ERROR_FOR_CHARGE"},Bt=(e,t)=>e.charges[t]&&e.charges[t].data?e.charges[t].data:{},Ht=(e,t)=>e.charges[t]&&e.charges[t].error?e.charges[t].error:{},Vt=(e,t)=>Bt(e,t),Qt=(e,t)=>Ht(e,t);function Wt(e,t){return{type:Yt.SET_CHARGE,id:e,data:t}}function Gt(e,t,r){return{type:Yt.SET_ERROR_FOR_CHARGE,id:e,data:t,error:r}}function*Zt(e){try{const t=yield(0,Pe.apiFetch)({path:`${Ce}/charges/${e}`});yield Wt(e,t)}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transaction.","woocommerce-payments")),yield Gt(e,null,t)}}function*Kt(e){try{const t=yield(0,Pe.apiFetch)({path:`${Ce}/charges/order/${e}`});yield Wt(e,t)}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transaction.","woocommerce-payments")),yield Gt(e,null,t)}}const Jt={SET_TIMELINE:"SET_TIMELINE",SET_ERROR_FOR_TIMELINE:"SET_ERROR_FOR_TIMELINE"},Xt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].data?e.timeline[t].data:{},er=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].error?e.timeline[t].error:{};function tr(e,t){return{id:e,type:Jt.SET_TIMELINE,data:t}}function rr(e,t){return{id:e,type:Jt.SET_ERROR_FOR_TIMELINE,error:t}}function*or(e){try{const t=yield(0,Pe.apiFetch)({path:`${Ce}/timeline/${e}`});yield tr(e,t.data)}catch(t){yield rr(e,t)}}const nr={SET_DISPUTE:"SET_DISPUTE",SET_ERROR_FOR_DISPUTE:"SET_ERROR_FOR_DISPUTE",SET_DISPUTES:"SET_DISPUTES",SET_DISPUTES_SUMMARY:"SET_DISPUTES_SUMMARY"},ar={byId:{},queries:{},summary:{},cached:{}},sr=e=>e&&e.disputes||{},ir=(e,t)=>(sr(e).byId||{})[t],cr=(e,t)=>{const r=sr(e).byId||{};return r[t]?.error},ur=(e,t)=>(sr(e).cached||{})[t],dr=(e,t)=>{const r=((e,t)=>{const r=Ue(t);return(sr(e).queries||{})[r]||{}})(e,t).data||[];return r.map(ur.bind(void 0,e))},mr=(e,t)=>((e,t)=>{const r=Ue(t);return(sr(e).summary||{})[r]||{}})(e,t).data||{};var pr=function(e){return e.SET_PAYMENT_INTENT="SET_PAYMENT_INTENT",e.SET_ERROR_FOR_PAYMENT_INTENT="SET_ERROR_FOR_PAYMENT_INTENT",e}(pr||{});const lr=pr;function _r(e,t){return{type:lr.SET_PAYMENT_INTENT,id:e,data:t}}function yr(e,t){return{type:lr.SET_ERROR_FOR_PAYMENT_INTENT,id:e,error:t}}function*hr(e,t){const r=e.payment_intent;try{yield(0,Pe.apiFetch)({path:"/wc/v3/payments/refund/",method:"post",data:{charge_id:e.id,amount:e.amount,reason:t,order_id:e?.order?.id}}),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getTimeline"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield De.controls.dispatch("core/notices","createSuccessNotice",(0,$.sprintf)((0,$.__)("Refunded payment #%s.","woocommerce-payments"),r))}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.sprintf)((0,$.__)("There has been an error refunding the payment #%s. Please try again later.","woocommerce-payments"),r))}}function*Sr(e){try{const t=yield(0,Pe.apiFetch)({path:`${Ce}/payment_intents/${e}`});yield _r(e,t)}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving transaction.","woocommerce-payments")),yield yr(e,t)}}function Er(e){return{type:nr.SET_DISPUTE,data:e}}function fr(e,t,r){return{type:nr.SET_ERROR_FOR_DISPUTE,id:e,data:t,error:r}}function gr(e,t){return{type:nr.SET_DISPUTES,query:e,data:t}}function wr(e,t){return{type:nr.SET_DISPUTES_SUMMARY,query:e,data:t}}function*Tr(e){const{id:t,payment_intent:r}=e;try{yield De.controls.dispatch(Me,"startResolution","getDispute",[t]);const e=yield(0,Pe.apiFetch)({path:`${Ce}/disputes/${t}/close`,method:"post"});yield Er(e),yield Sr(r),yield De.controls.dispatch(Me,"finishResolution","getDispute",[t]);const o=e.order?(0,$.sprintf)((0,$.__)("You have accepted the dispute for order #%s.","woocommerce-payments"),e.order.number):(0,$.__)("You have accepted the dispute.","woocommerce-payments");yield De.controls.dispatch("core/notices","createSuccessNotice",o)}catch(e){const r=(0,$.__)("There has been an error accepting the dispute. Please try again later.","woocommerce-payments");yield De.controls.dispatch("core/notices","createErrorNotice",r),yield De.controls.dispatch(Me,"finishResolution","getDispute",[t])}}const Rr=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Ne(e.dateBefore,!0),date_after:Ne(e.dateAfter),date_between:e.dateBetween&&[Ne(e.dateBetween[0]),Ne(e.dateBetween[1],!0)],search:"awaiting_response"===e.filter?G:e.search,status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),Or=`${Ce}/disputes/download`;function vr(e){return(0,be.addQueryArgs)(Or,Rr(e))}function*br(e){const t=(0,be.addQueryArgs)(`${Ce}/disputes/${e}`);try{const e=yield(0,Pe.apiFetch)({path:t});yield Er(e)}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving dispute.","woocommerce-payments")),yield fr(e,void 0,t)}}function*Ir(e){const t=(0,be.addQueryArgs)(`${Ce}/disputes`,{page:e.paged,pagesize:e.perPage,sort:(0,ne.snakeCase)(e.orderBy),direction:e.order,...Rr(e)});try{const r=yield(0,Pe.apiFetch)({path:t})||{};yield gr(e,r.data)}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving disputes.","woocommerce-payments"))}}function*Ar(e){const t=(0,be.addQueryArgs)(`${Ce}/disputes/summary`,{page:e.paged,pagesize:e.perPage,...Rr(e)});try{const r=yield(0,Pe.apiFetch)({path:t});yield wr(e,r)}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving the summary of disputes.","woocommerce-payments"))}}const Nr={SET_SETTINGS:"SET_SETTINGS",SET_SETTINGS_VALUES:"SET_SETTINGS_VALUES",SET_IS_SAVING_SETTINGS:"SET_IS_SAVING_SETTINGS",SET_SELECTED_PAYMENT_METHOD:"SET_SELECTED_PAYMENT_METHOD",SET_UNSELECTED_PAYMENT_METHOD:"SET_UNSELECTED_PAYMENT_METHOD"},Dr={isDirty:!1,isSaving:!1,savingError:null,data:{}},Pr={},Cr=[],Mr=e=>e&&e.settings||Pr,Fr=e=>Mr(e).data||Pr,Ur=e=>Fr(e).duplicated_payment_method_ids||Pr,xr=e=>Fr(e).is_wcpay_enabled||!1,kr=e=>Fr(e).enabled_payment_method_ids||Cr,jr=e=>Fr(e).available_payment_method_ids||Cr,zr=e=>Fr(e).payment_method_statuses||Pr,qr=e=>Mr(e).isSaving||!1,Lr=e=>Mr(e).isDirty||!1,$r=e=>Fr(e).account_statement_descriptor||"",Yr=e=>Fr(e).account_statement_descriptor_kanji||"",Br=e=>Fr(e).account_statement_descriptor_kana||"",Hr=e=>Fr(e).account_business_support_email||"",Vr=e=>Fr(e).account_business_support_phone||"",Qr=e=>Fr(e).account_domestic_currency||"",Wr=e=>Fr(e).deposit_schedule_interval||"",Gr=e=>Fr(e).deposit_schedule_weekly_anchor||"",Zr=e=>Fr(e).deposit_schedule_monthly_anchor||"",Kr=e=>Fr(e).deposit_delay_days||"7",Jr=e=>Fr(e).deposit_completed_waiting_period||!1,Xr=e=>Fr(e).deposit_status||"",eo=e=>Fr(e).deposit_restrictions||"",to=e=>Fr(e).is_manual_capture_enabled||!1,ro=e=>Fr(e).is_test_mode_enabled||!1,oo=e=>Fr(e).is_test_mode_onboarding||!1,no=e=>Fr(e).is_dev_mode_enabled||!1,ao=e=>Fr(e).is_payment_request_enabled||!1,so=e=>Fr(e).is_express_checkout_in_payment_methods_enabled||!1,io=e=>Fr(e).is_debug_log_enabled||!1,co=e=>Fr(e).is_multi_currency_enabled||!1,uo=e=>Fr(e).payment_request_button_type||"",mo=e=>Fr(e).payment_request_button_size||"",po=e=>Fr(e).payment_request_button_theme||"",lo=e=>{const t=Fr(e)?.payment_request_button_border_radius;return 0===t||"0"===t||t?t:"undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10)},_o=e=>Fr(e).is_saved_cards_enabled||!1,yo=e=>Mr(e).savingError,ho=e=>Fr(e).is_card_present_eligible||!1,So=e=>Fr(e).is_wcpay_subscriptions_enabled||!1,Eo=e=>Fr(e).is_wcpay_subscriptions_eligible||!1,fo=e=>Fr(e).is_subscriptions_plugin_active||!1,go=e=>Fr(e).is_woopay_enabled||!1,wo=e=>Fr(e).is_woopay_global_theme_support_enabled||!1,To=e=>Fr(e).woopay_custom_message||"",Ro=e=>Fr(e).woopay_store_logo||"",Oo=e=>Fr(e).current_protection_level||"basic",vo=e=>Fr(e).advanced_fraud_protection_settings||Cr,bo=e=>Fr(e).show_woopay_incompatibility_notice||!1,Io=e=>Fr(e).is_stripe_billing_enabled||!1,Ao=e=>Fr(e).is_migrating_stripe_billing||!1,No=e=>Fr(e).stripe_billing_subscription_count||0,Do=e=>Fr(e).stripe_billing_migrated_count||0,Po=e=>Fr(e).account_communications_email||"",Co=e=>Fr(e).express_checkout_product_methods||Cr,Mo=e=>Fr(e).express_checkout_cart_methods||Cr,Fo=e=>Fr(e).express_checkout_checkout_methods||Cr,Uo=window.wp.apiFetch;var xo=r.n(Uo);function ko(e){return{type:Nr.SET_SETTINGS_VALUES,payload:e}}function jo(e){return ko({is_saved_cards_enabled:e})}function zo(e){return ko({is_card_present_eligible:e})}function qo(e){return ko({payment_request_button_type:e})}function Lo(e){return ko({payment_request_button_size:e})}function $o(e){return ko({payment_request_button_theme:e})}function Yo(e){return ko({payment_request_button_border_radius:e})}function Bo(e){return{type:Nr.SET_SETTINGS,data:e}}function Ho(e){return ko({is_wcpay_enabled:e})}function Vo(e){return ko({is_payment_request_enabled:e})}function Qo(e){return ko({is_express_checkout_in_payment_methods_enabled:e})}function Wo(e){return ko({enabled_payment_method_ids:[...e]})}function Go(e,t){return{type:Nr.SET_IS_SAVING_SETTINGS,isSaving:e,error:t}}function Zo(e){return{type:Nr.SET_SELECTED_PAYMENT_METHOD,id:e}}function Ko(e){return{type:Nr.SET_UNSELECTED_PAYMENT_METHOD,id:e}}function Jo(e){return ko({is_manual_capture_enabled:e})}function Xo(e){return ko({is_test_mode_enabled:e})}function en(e){return ko({is_debug_log_enabled:e})}function tn(e){return ko({is_multi_currency_enabled:e})}function rn(e){return ko({is_wcpay_subscriptions_enabled:e})}function on(e){return ko({account_statement_descriptor:e})}function nn(e){return ko({account_statement_descriptor_kanji:e})}function an(e){return ko({account_statement_descriptor_kana:e})}function sn(e){return ko({account_business_support_email:e})}function cn(e){return ko({account_business_support_phone:e})}function un(e){return ko({deposit_schedule_interval:e})}function dn(e){return ko({deposit_schedule_weekly_anchor:e})}function mn(e){return ko({deposit_schedule_monthly_anchor:""===e?null:parseInt(e,10)})}function*pn(){let e=null;try{const e=(0,De.select)(Me).getSettings();yield Go(!0,null);const t=yield(0,Pe.apiFetch)({path:`${Ce}/settings`,method:"post",data:e});yield ko({payment_method_statuses:t.data.payment_method_statuses}),yield(0,De.dispatch)("core/notices").createSuccessNotice((0,$.__)("Settings saved.","woocommerce-payments"))}catch(t){e=t,yield(0,De.dispatch)("core/notices").createErrorNotice((0,$.__)("Error saving settings.","woocommerce-payments")),e.server_error&&(yield(0,De.dispatch)("core/notices").createErrorNotice(e.server_error))}finally{yield Go(!1,e)}return null===e}function ln(e){return ko({is_woopay_enabled:e})}function _n(e){return ko({is_woopay_global_theme_support_enabled:e})}function yn(e){return ko({woopay_custom_message:e})}function hn(e){return ko({woopay_store_logo:e})}function Sn(e){return ko({current_protection_level:e})}function En(e){return ko({advanced_fraud_protection_settings:e})}function fn(e){return ko({is_stripe_billing_enabled:e})}function gn(e){return ko({account_communications_email:e})}function wn(e){return ko({express_checkout_product_methods:[...e]})}function Tn(e){return ko({express_checkout_cart_methods:[...e]})}function Rn(e){return ko({express_checkout_checkout_methods:[...e]})}function*On(){try{yield(0,De.dispatch)(Me).startResolution("scheduleStripeBillingMigration"),yield(0,Pe.apiFetch)({path:`${Ce}/settings/schedule-stripe-billing-migration`,method:"post"})}catch(e){yield(0,De.dispatch)("core/notices").createErrorNotice((0,$.__)("Error starting the Stripe Billing migration.","woocommerce-payments"))}yield(0,De.dispatch)(Me).finishResolution("scheduleStripeBillingMigration")}function vn(e,t){return xo()({path:`${Ce}/settings/${e}`,method:"post",data:{value:t}}).catch((()=>{(0,De.dispatch)("core/notices").createErrorNotice((0,$.__)("Error saving option","woocommerce-payments"))}))}function*bn(){const e=`${Ce}/settings`;try{const t=yield(0,Pe.apiFetch)({path:e});yield Bo(t)}catch(e){yield(0,De.dispatch)("core/notices").createErrorNotice((0,$.__)("Error retrieving settings.","woocommerce-payments"))}}const In=e=>()=>{const{updateExpressCheckoutProductMethods:t,updateExpressCheckoutCartMethods:r,updateExpressCheckoutCheckoutMethods:o}=(0,De.useDispatch)(Me),n=(0,De.useSelect)((e=>e(Me).getExpressCheckoutProductMethods())),a=(0,De.useSelect)((e=>e(Me).getExpressCheckoutCartMethods())),s=(0,De.useSelect)((e=>e(Me).getExpressCheckoutCheckoutMethods())),i={product:n,cart:a,checkout:s},c={product:t,cart:r,checkout:o};return[[n.includes(e)&&"product",a.includes(e)&&"cart",s.includes(e)&&"checkout"].filter(Boolean),(t,r)=>{c[t](r?[...i[t],e]:i[t].filter((t=>t!==e)))}]},An=(In("payment_request"),In("woopay"),In("amazon_pay"),{SET_CARD_READER_STATS:"SET_CARD_READER_STATS",SET_ERROR_FOR_CARD_READER_STATS:"SET_ERROR_FOR_CARD_READER_STATS",SET_READERS:"SET_READERS",SET_ERROR_FOR_CARD_READERS:"SET_ERROR_FOR_CARD_READERS"}),Nn=(e,t)=>e.readers[t]&&e.readers[t].data?e.readers[t].data:{},Dn=(e,t)=>e.readers[t]&&e.readers[t].error?e.readers[t].error:{},Pn=e=>e.readers&&e.readers.list?e.readers.list:{};function Cn(e,t){return{type:An.SET_CARD_READER_STATS,id:e,data:t}}function Mn(e,t){return{type:An.SET_READERS,query:e,data:t}}function Fn(e,t,r){return{type:An.SET_CARD_ERROR_FOR_READER_STATS,id:e,data:t,error:r}}function Un(e,t){return{type:An.SET_CARD_ERROR_FOR_READERS,data:e,error:t}}function*xn(e,t){try{const r=yield(0,Pe.apiFetch)({path:`${Ce}/readers/charges/${t}`});yield Cn(e,r)}catch(t){yield Fn(e,null,t)}}function*kn(e){const t=(0,be.addQueryArgs)(`${Ce}/readers`,{limit:e.limit});try{const r=yield(0,Pe.apiFetch)({path:t})||{};yield Mn(e,r)}catch(e){yield Un(null,e)}}var jn=function(e){return e.SET_ACTIVE_LOAN_SUMMARY="SET_ACTIVE_LOAN_SUMMARY",e.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY="SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY",e.SET_LOANS="SET_LOANS",e.SET_ERROR_FOR_LOANS="SET_ERROR_FOR_LOANS",e}(jn||{});const zn=jn,qn={},Ln=e=>e&&e.capital||{},$n=e=>Ln(e).summary,Yn=e=>Ln(e).summaryError,Bn=e=>Ln(e).loans||[],Hn=e=>Ln(e).loansError;function Vn(e){return{type:zn.SET_ACTIVE_LOAN_SUMMARY,data:e}}function Qn(e){return{type:zn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY,error:e}}function Wn(e){return{type:zn.SET_LOANS,data:e.data}}function Gn(e){return{type:zn.SET_ERROR_FOR_LOANS,error:e}}function*Zn(){const e=`${Ce}/capital/active_loan_summary`;try{const t=yield(0,Pe.apiFetch)({path:e});yield Vn(t)}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Qn(e)}}function*Kn(){const e=`${Ce}/capital/loans`;try{const t=yield(0,Pe.apiFetch)({path:e});yield Wn(t)}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Gn(e)}}const Jn={SET_DOCUMENTS:"SET_DOCUMENTS",SET_ERROR_FOR_DOCUMENTS:"SET_ERROR_FOR_DOCUMENTS",SET_DOCUMENTS_SUMMARY:"SET_DOCUMENTS_SUMMARY",SET_ERROR_FOR_DOCUMENTS_SUMMARY:"SET_ERROR_FOR_DOCUMENTS_SUMMARY"},Xn={summary:{}},ea=e=>e&&e.documents||{},ta=(e,t)=>{const r=Ue(t);return ea(e)[r]||{}},ra=(e,t)=>ta(e,t).data||[],oa=(e,t)=>ta(e,t).error||{},na=(e,t)=>{const r=Ue(t);return ea(e).summary[r]||{}},aa=(e,t)=>na(e,t).data||{},sa=(e,t)=>na(e,t).error||{};function ia(e,t){return{type:Jn.SET_DOCUMENTS,query:e,data:t}}function ca(e,t,r){return{type:Jn.SET_ERROR_FOR_DOCUMENTS,query:e,data:t,error:r}}function ua(e,t){return{type:Jn.SET_DOCUMENTS_SUMMARY,query:e,data:t}}function da(e,t,r){return{type:Jn.SET_ERROR_FOR_DOCUMENTS_SUMMARY,query:e,data:t,error:r}}const ma=e=>({user_email:e.userEmail,match:e.match,date_before:Ne(e.dateBefore,!0),date_after:Ne(e.dateAfter),date_between:e.dateBetween&&[Ne(e.dateBetween[0]),Ne(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot});function*pa(e){const t=(0,be.addQueryArgs)(`${Ce}/documents`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...ma(e)});try{const r=yield(0,Pe.apiFetch)({path:t});yield ia(e,r.data||[])}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving documents.","woocommerce-payments")),yield ca(e,null,t)}}function*la(e){const t=(0,be.addQueryArgs)(`${Ce}/documents/summary`,ma(e));try{const r=yield(0,Pe.apiFetch)({path:t});yield ua(e,r)}catch(t){yield da(e,null,t)}}const _a={},ya=({paymentIntents:e},t)=>{const r=e?.[t];return r?.data||{}},ha=({paymentIntents:e},t)=>{const r=e?.[t];return r?.error||{}},Sa={SET_AUTHORIZATIONS:"SET_AUTHORIZATIONS",SET_AUTHORIZATION:"SET_AUTHORIZATION",SET_ERROR_FOR_AUTHORIZATIONS:"SET_ERROR_FOR_AUTHORIZATIONS",SET_AUTHORIZATIONS_SUMMARY:"SET_AUTHORIZATIONS_SUMMARY",SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:"SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY",SET_IS_REQUESTING_AUTHORIZATION:"SET_IS_REQUESTING_AUTHORIZATION"},Ea={summary:{},byId:{},isRequesting:!1},fa=e=>e&&e.authorizations||{},ga=(e,t)=>{const r=Ue(t);return fa(e)[r]||{}},wa=(e,t)=>ga(e,t).data||[],Ta=(e,t)=>(fa(e).byId||{})[t],Ra=(e,t)=>ga(e,t).error||{},Oa=(e,t)=>{const r=Ue(t);return fa(e).summary[r]||{}},va=(e,t)=>Oa(e,t).data||{},ba=(e,t)=>Oa(e,t).error||{},Ia=e=>fa(e).isRequesting,Aa=e=>{var t;const r={wcpay_missing_order:(0,$.__)("The order could not be found.","woocommerce-payments"),wcpay_refunded_order_uncapturable:(0,$.__)("Payment cannot be processed for partially or fully refunded orders.","woocommerce-payments"),wcpay_intent_order_mismatch:(0,$.__)("The payment cannot be processed due to a mismatch with order details.","woocommerce-payments"),wcpay_payment_uncapturable:(0,$.__)("This payment cannot be processed in its current state.","woocommerce-payments"),wcpay_capture_error:e=>"amount_too_small"===e.data?.error_type?(e=>{if(!e.data?.extra_details?.minimum_amount||!e.data?.extra_details?.minimum_amount_currency)return(0,$.__)("The payment amount is too small to be processed.","woocommerce-payments");const t=e.data.extra_details.minimum_amount_currency,r=se(e.data.extra_details.minimum_amount,t);return(0,$.sprintf)((0,$.__)("The minimum amount that can be processed is %1$s %2$s.","woocommerce-payments"),r,t.toUpperCase())})(e):(0,$.__)("The payment capture failed to complete.","woocommerce-payments"),wcpay_cancel_error:(0,$.__)("The payment cancellation failed to complete.","woocommerce-payments"),wcpay_server_error:(0,$.__)("An unexpected error occurred. Please try again later.","woocommerce-payments")}[null!==(t=e.code)&&void 0!==t?t:""];return"function"==typeof r?r(e):null!=r?r:(0,$.__)("Unable to process the payment. Please try again later.","woocommerce-payments")};function Na(e,t){return{type:Sa.SET_AUTHORIZATIONS,data:t,query:e}}function Da(e,t){return{type:Sa.SET_ERROR_FOR_AUTHORIZATIONS,query:e,error:t}}function Pa(e){return{type:Sa.SET_AUTHORIZATION,data:e}}function Ca(e,t){return{type:Sa.SET_AUTHORIZATIONS_SUMMARY,data:t,query:e}}function Ma(e){return{type:Sa.SET_IS_REQUESTING_AUTHORIZATION,data:e}}function*Fa(e,t){try{yield De.controls.dispatch(Me,"startResolution","getAuthorization",[e]),yield De.controls.dispatch(Me,"setIsRequestingAuthorization",!0);const r=yield(0,Pe.apiFetch)({path:`/wc/v3/payments/orders/${t}/capture_authorization`,method:"post",data:{payment_intent_id:e}}),o={payment_intent_id:r.id,captured:"succeeded"===r.status};yield Pa(o),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getAuthorizations"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getTimeline"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getTransactions"),yield De.controls.dispatch("core/notices","createSuccessNotice",(0,$.sprintf)((0,$.__)("Payment for order #%s captured successfully.","woocommerce-payments"),t))}catch(e){const r=(0,$.sprintf)((0,$.__)("There has been an error capturing the payment for order #%s.","woocommerce-payments"),t),o=Aa(e);yield De.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield De.controls.dispatch(Me,"finishResolution","getAuthorization",[e]),yield De.controls.dispatch(Me,"setIsRequestingAuthorization",!1)}}function*Ua(e,t){try{yield De.controls.dispatch(Me,"startResolution","getAuthorization",[e]),yield De.controls.dispatch(Me,"setIsRequestingAuthorization",!0);const r=yield(0,Pe.apiFetch)({path:`/wc/v3/payments/orders/${t}/cancel_authorization`,method:"post",data:{payment_intent_id:e}}),o={payment_intent_id:r.id,captured:"succeeded"===r.status};yield Pa(o),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getAuthorizations"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getTimeline"),yield De.controls.dispatch(Me,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield De.controls.dispatch("core/notices","createSuccessNotice",(0,$.sprintf)((0,$.__)("Payment for order #%s canceled successfully.","woocommerce-payments"),t))}catch(e){const r=(0,$.sprintf)((0,$.__)("There has been an error canceling the payment for order #%s.","woocommerce-payments"),t),o=Aa(e);yield De.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield De.controls.dispatch(Me,"finishResolution","getAuthorization",[e]),yield De.controls.dispatch(Me,"setIsRequestingAuthorization",!1)}}function xa(e,t){return{type:Sa.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY,query:e,error:t}}function*ka(e){let{paged:t=1,per_page:r=25,orderby:o="created",order:n="asc"}=e;"capture_by"===o&&(o="created");const a=(0,be.addQueryArgs)(`${Ce}/authorizations`,{page:t,pagesize:r,sort:o,direction:n});try{var s;const t=yield(0,Pe.apiFetch)({path:a});yield Na(e,null!==(s=t.data)&&void 0!==s?s:[])}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield Da(e,t)}}function*ja(e){try{if(e){const t=yield(0,Pe.apiFetch)({path:`${Ce}/authorizations/${e}`}),{is_captured:r,payment_intent_id:o,created:n}=t;yield Pa({payment_intent_id:o,captured:r,created:n})}}catch(e){"authorization_missing"!==e.code&&(yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving authorization.","woocommerce-payments")))}}function*za(e){const t=(0,be.addQueryArgs)(`${Ce}/authorizations/summary`,{pagesize:e.per_page,sort:e.orderby,direction:e.order,page:e.paged});try{const r=yield(0,Pe.apiFetch)({path:t});yield Ca(e,null!=r?r:[])}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield xa(e,t)}}var qa=function(e){return e.SET_FILE="SET_FILE",e.SET_ERROR_FOR_FILES="SET_ERROR_FOR_FILES",e}(qa||{});const La=qa,$a={},Ya=({files:e},t)=>{const r=e?.[t];return r?.data||{}},Ba=({files:e},t)=>{const r=e?.[t];return r?.error||{}};function Ha(e,t){return{type:La.SET_FILE,id:e,data:t}}function Va(e,t){return{type:La.SET_ERROR_FOR_FILES,id:e,error:t}}function*Qa(e){try{const t=yield(0,Pe.apiFetch)({path:`${Ce}/file/${e}/details`});yield Ha(e,t)}catch(t){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving file.","woocommerce-payments")),yield Va(e,t)}}let Wa=function(e){return e.SET_PM_PROMOTIONS="SET_PM_PROMOTIONS",e.SET_ERROR_FOR_PM_PROMOTIONS="SET_ERROR_FOR_PM_PROMOTIONS",e}({});const Ga={pmPromotions:void 0,pmPromotionsError:void 0},Za=e=>{var t;return null!==(t=e.pmPromotions?.pmPromotions)&&void 0!==t?t:[]},Ka=e=>e.pmPromotions?.pmPromotionsError;function Ja(e){return function(e){return"object"==typeof e&&null!==e&&"code"in e&&"string"==typeof e.code}(e)?e:{code:"unknown_error"}}function Xa(e){return{type:Wa.SET_PM_PROMOTIONS,data:e}}function es(e){return{type:Wa.SET_ERROR_FOR_PM_PROMOTIONS,error:e}}function*ts(e){const t=`${Ce}/pm-promotions/${e}/activate`;try{yield(0,Pe.apiFetch)({path:t,method:"POST"}),yield De.controls.dispatch("core/notices","createSuccessNotice",(0,$.__)("Promotion activated successfully!","woocommerce-payments")),yield De.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error activating promotion. Please try again.","woocommerce-payments")),yield De.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ja(e))}}function*rs(e){const t=`${Ce}/pm-promotions/${e}/dismiss`;try{yield(0,Pe.apiFetch)({path:t,method:"POST"}),yield De.controls.dispatch("core/notices","createSuccessNotice",(0,$.__)("Promotion dismissed.","woocommerce-payments")),yield De.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error dismissing promotion. Please try again.","woocommerce-payments")),yield De.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ja(e))}}function os(e){if("object"!=typeof e||null===e)return!1;const t=e;return"string"==typeof t.id&&"string"==typeof t.promo_id&&"string"==typeof t.payment_method&&"string"==typeof t.payment_method_title&&"string"==typeof t.type&&("spotlight"===t.type||"badge"===t.type)&&"string"==typeof t.title&&"string"==typeof t.description&&"string"==typeof t.cta_label&&"string"==typeof t.tc_url&&"string"==typeof t.tc_label}function*ns(){const e=`${Ce}/pm-promotions`;try{const t=yield(0,Pe.apiFetch)({path:e});if(r=t,!Array.isArray(r)||!r.every(os))throw new Error("Invalid promotions data received from API");yield De.controls.dispatch("wc/payments","updatePmPromotions",t)}catch(e){yield De.controls.dispatch("core/notices","createErrorNotice",(0,$.__)("Error retrieving promotions. Please try again later.","woocommerce-payments")),yield De.controls.dispatch("wc/payments","updateErrorForPmPromotions",(t=e,function(e){return"object"==typeof e&&null!==e&&"code"in e}(t)?t:{code:"unknown_error"}))}var t,r}function as(e,t={}){const{customFormat:r=null,includeTime:o=!1,separator:n=" / ",timezone:a}=t,s=H().utc(e).toISOString(),i=r||`${window.wcpaySettings.dateFormat}${o?`${n}${window.wcpaySettings.timeFormat}`:""}`;return(0,Ie.dateI18n)(i,s,a)}(0,De.registerStore)(Me,{reducer:(0,De.combineReducers)({deposits:(e=xe,{type:t,query:r={},data:o=[],error:n})=>{const a=Ue(r);switch(t){case Fe.SET_DEPOSIT:return{...e,byId:{...e.byId,[o.id]:o}};case Fe.SET_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,data:o}};case Fe.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,error:n}};case Fe.SET_DEPOSITS:return{...e,byId:{...e.byId,...(0,ne.keyBy)(o,"id")},queries:{...e.queries,[a]:{data:(0,ne.map)(o,"id")}}};case Fe.SET_DEPOSITS_COUNT:return{...e,count:o};case Fe.SET_ERROR_FOR_DEPOSIT_QUERY:return{...e,queries:{...e.queries,[a]:{error:n}}};case Fe.SET_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Fe.SET_ERROR_FOR_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}};case Fe.SET_INSTANT_DEPOSIT:return{...e,instant:{...e.instant,data:o}}}return e},transactions:(e=lt,{type:t,query:r={},data:o=[],error:n,status:a})=>{const s=Ue(r);switch(t){case pt.SET_TRANSACTIONS:return{...e,[s]:{data:o}};case pt.SET_ERROR_FOR_TRANSACTIONS:return{...e,[s]:{error:n}};case pt.SET_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}};case pt.SET_ERROR_FOR_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{error:n}}};case pt.SET_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{data:o}}}};case pt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[s]:{error:n}}}};case pt.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[s]:{data:o}}}}};case pt.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[s]:{error:n}}}}}}return e},charges:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case Yt.SET_CHARGE:e={...e,[r]:{...e[r],data:o}};break;case Yt.SET_ERROR_FOR_CHARGE:e={...e,[r]:{...e[r],error:n}}}return e},timeline:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case Jt.SET_TIMELINE:e={...e,[r]:{data:o}};break;case Jt.SET_ERROR_FOR_TIMELINE:e={...e,[r]:{...e[r],error:n}}}return e},disputes:(e=ar,{type:t,query:r={},data:o=[],id:n,error:a})=>{const s=Ue(r);switch(t){case nr.SET_DISPUTE:return{...e,byId:{...e.byId,[o.id]:o}};case nr.SET_ERROR_FOR_DISPUTE:e={...e,byId:{...e.byId,[n]:{error:a}}};break;case nr.SET_DISPUTES:return{...e,cached:{...e.cached,...(0,ne.keyBy)(o,"dispute_id")},queries:{...e.queries,[s]:{data:(0,ne.map)(o,"dispute_id")}}};case nr.SET_DISPUTES_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}}}return e},settings:(e=Dr,{type:t,...r})=>{switch(t){case Nr.SET_SETTINGS:return{...e,data:r.data,isDirty:!1};case Nr.SET_SETTINGS_VALUES:return{...e,savingError:null,isDirty:!0,data:{...e.data,...r.payload}};case Nr.SET_IS_SAVING_SETTINGS:return{...e,isDirty:!(!r.isSaving&&!r.error)&&e.isDirty,isSaving:r.isSaving,savingError:r.error};case Nr.SET_SELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.concat(r.id)}};case Nr.SET_UNSELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.filter((e=>e!==r.id))}}}return e},readers:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case An.SET_CARD_READER_STATS:e={...e,[r]:{...e[r],data:o}};break;case An.SET_ERROR_FOR_CARD_READER_STATS:e={...e,[r]:{...e[r],error:n}};break;case An.SET_READERS:e={...e,list:o}}return e},capital:(e=qn,t)=>{switch(t.type){case zn.SET_ACTIVE_LOAN_SUMMARY:return{...e,summary:t.data,summaryError:void 0};case zn.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY:return{...e,summary:void 0,summaryError:t.error};case zn.SET_LOANS:return{...e,loans:t.data,loansError:void 0};case zn.SET_ERROR_FOR_LOANS:return{...e,loans:void 0,loansError:t.error}}return e},documents:(e=Xn,{type:t,query:r={},data:o=[],error:n})=>{const a=Ue(r);switch(t){case Jn.SET_DOCUMENTS:return{...e,[a]:{data:o}};case Jn.SET_ERROR_FOR_DOCUMENTS:return{...e,[a]:{error:n}};case Jn.SET_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Jn.SET_ERROR_FOR_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}}}return e},paymentIntents:(e=_a,t)=>{const{type:r,id:o}=t;switch(r){case lr.SET_PAYMENT_INTENT:return{...e,[o]:{...e[o],data:t.data}};case lr.SET_ERROR_FOR_PAYMENT_INTENT:return{...e,[o]:{...e[o],error:t.error}};default:return e}},authorizations:(e=Ea,t)=>{switch(t.type){case Sa.SET_AUTHORIZATION:{const{data:r}=t;return{...e,byId:{...e.byId,[r.payment_intent_id]:{...e.byId[r.payment_intent_id],...r}}}}case Sa.SET_AUTHORIZATIONS:{const{data:r,query:o}=t;return{...e,[Ue(o)]:{data:r}}}case Sa.SET_ERROR_FOR_AUTHORIZATIONS:{const{error:r,query:o}=t;return{...e,[Ue(o)]:{error:r}}}case Sa.SET_AUTHORIZATIONS_SUMMARY:{const{data:r,query:o}=t;return{...e,summary:{...e.summary,[Ue(o)]:{data:r||{}}}}}case Sa.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:{const{query:r,error:o}=t;return{...e,summary:{...e.summary,[Ue(r)]:{error:o||""}}}}case Sa.SET_IS_REQUESTING_AUTHORIZATION:{const{data:r}=t;return{...e,isRequesting:r}}}return e},files:(e=$a,t)=>{const{type:r,id:o}=t;switch(r){case La.SET_FILE:return{...e,[o]:{...e[o],data:t.data}};case La.SET_ERROR_FOR_FILES:return{...e,[o]:{...e[o],error:t.error}};default:return e}},pmPromotions:(e=Ga,t)=>{switch(t.type){case Wa.SET_PM_PROMOTIONS:return{...e,pmPromotions:t.data,pmPromotionsError:void 0};case Wa.SET_ERROR_FOR_PM_PROMOTIONS:return{...e,pmPromotions:void 0,pmPromotionsError:t.error}}return e}}),actions:{...t,...a,...c,...m,...h,...f,...T,...v,...A,..._,...C,...U,...j},controls:Pe.controls,selectors:{...e,...n,...i,...d,...l,...E,...w,...O,...I,...D,...P,...F,...k},resolvers:{...o,...s,...u,...p,...S,...g,...R,...b,...N,...y,...M,...x,...z}});const ss=({isPreDisputeInquiry:e,disputeReason:t,formattedAmount:r,dueBy:o,countdownDays:n})=>{const a=e?(0,$.__)("Please resolve the inquiry on this order of %1$s labeled '%2$s' by %3$s.","woocommerce-payments"):(0,$.__)("Please resolve the dispute on this order of %1$s labeled '%2$s' by %3$s.","woocommerce-payments"),s=(0,$.sprintf)(a,r,Q[t].display,as(o.toISOString()));let i=(0,$.sprintf)((0,$._n)("(%s day left)","(%s days left)",n,"woocommerce-payments"),n);return n<1&&(i=(0,$.__)("(Last day today)","woocommerce-payments")),(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)("strong",{children:s})," ",i]})},is=({isPreDisputeInquiry:e,disputeReason:t,formattedAmount:r,dueBy:o})=>{const n=e?(0,$.__)("Please resolve the inquiry on this order of %1$s with reason '%2$s'.","woocommerce-payments"):(0,$.__)("This order has a payment dispute for %1$s for the reason '%2$s'. ","woocommerce-payments"),a=(0,$.sprintf)(n,r,Q[t].display),s=(0,$.sprintf)((0,$.__)("Please respond before %1$s.","woocommerce-payments"),as(o.toISOString()));return(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)("strong",{children:a})," ",s]})},cs=({disputeReason:e,formattedAmount:t,isPreDisputeInquiry:r,dueBy:o,countdownDays:n,disputeDetailsUrl:a})=>{(0,L.useEffect)((()=>{te("wcpay_order_dispute_notice_view",{is_inquiry:r,dispute_reason:e,due_by_days:n})}),[r,e,n]);const s=n<7,i=n<1?(0,$.__)("Respond today","woocommerce-payments"):(0,$.__)("Respond now","woocommerce-payments"),c=s?(0,Te.jsx)(ss,{isPreDisputeInquiry:r,disputeReason:e,formattedAmount:t,dueBy:o,countdownDays:n}):(0,Te.jsx)(is,{isPreDisputeInquiry:r,disputeReason:e,formattedAmount:t,dueBy:o});return(0,Te.jsx)(Re,{status:n<3?"error":"warning",isDismissible:!1,actions:[{label:i,variant:"secondary",onClick:()=>{te("wcpay_order_dispute_notice_action_click",{due_by_days:n}),window.location=a}}],children:c})},us=({message:e,disputeDetailsUrl:t})=>(0,Te.jsxs)(Re,{status:"warning",isDismissible:!1,children:[e,(0,ve.createInterpolateElement)((0,$.__)(" <a>View details</a>","woocommerce-payments"),{a:(0,Te.jsx)("a",{href:t})})]}),ds=({chargeId:e,onDisableOrderRefund:t})=>{const{data:r}=(e=>(0,De.useSelect)((t=>{const r=t(Me);return((e,t)=>{const{getCharge:r,isResolving:o,getChargeError:n,hasFinishedResolution:a}=t;return{data:r(e),error:n(e),isLoading:o("getCharge",[e])||!a("getCharge",[e])}})(e,r)}),[e]))(e),o=Ae({page:"wc-admin",path:`/payments/${"transactions"}/details`,id:e});(0,L.useEffect)((()=>{const{dispute:e}=r;var o;r?.dispute&&(o=e.status,pe(o)||"won"===o||t(e.status))}),[r,t]);const{dispute:n}=r;if(!r?.dispute)return null;if(me(n.status)&&!pe(n.status))return(0,Te.jsx)(us,{message:(0,$.__)("This order has an active payment dispute. Refunds and order editing are disabled.","woocommerce-payments"),disputeDetailsUrl:o});if("lost"===n.status)return(0,Te.jsx)(us,{message:(0,$.__)("Refunds and order editing have been disabled as a result of a lost dispute.","woocommerce-payments"),disputeDetailsUrl:o});if(!de(n.status))return null;if(!n.evidence_details?.due_by)return null;const a=H()().utc(),s=H().unix(n.evidence_details?.due_by).utc();return a.isBefore(s)?(0,Te.jsx)(cs,{chargeId:e,disputeReason:n.reason,formattedAmount:ie(n.amount,n.currency),isPreDisputeInquiry:pe(n.status),dueBy:s,countdownDays:Math.floor(s.diff(a,"days",!0)),disputeDetailsUrl:o}):null},ms=window.wp.primitives,ps=({children:e,actions:t,className:r,...o})=>(0,Te.jsxs)(he.Modal,{className:Ee("wcpay-confirmation-modal",r),...o,children:[e,(0,Te.jsx)(ms.HorizontalRule,{className:"wcpay-confirmation-modal__separator"}),(0,Te.jsx)("div",{className:"wcpay-confirmation-modal__footer",children:t})]}),ls=({orderStatus:e,refundAmount:t,formattedRefundAmount:r,refundedAmount:o})=>{const[n,a]=(0,ve.useState)(!0),s=()=>{a(!1)},i=()=>{const t=document.querySelector("#order_status");t.value=e,t.dispatchEvent(new Event("change"))};return(0,Te.jsx)(Te.Fragment,{children:n&&(0,Te.jsx)(ps,{title:(0,$.__)("Refund order in full","woocommerce-payments"),isDismissible:!1,className:"refund-confirmation-modal",actions:(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(he.Button,{variant:"secondary",onClick:()=>{i(),s()},__next40pxDefaultSize:!0,children:(0,$.__)("Cancel","woocommerce-payments")}),(0,Te.jsx)(he.Button,{variant:"primary",onClick:()=>{jQuery.ajax({type:"post",url:woocommerce_admin_meta_boxes.ajax_url,data:{action:"woocommerce_refund_line_items",order_id:woocommerce_admin_meta_boxes.post_id,security:woocommerce_admin_meta_boxes.order_item_nonce,refund_amount:t,refunded_amount:o,api_refund:!0},beforeSend:function(){jQuery(".refund-confirmation-modal").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},success:function(e){!0===e.success?window.location.reload():(i(),(0,De.dispatch)("core/notices").createErrorNotice(e.data.error))},complete:function(){jQuery(".refund-confirmation-modal").unblock(),s()}})},__next40pxDefaultSize:!0,children:(0,$.sprintf)((0,$.__)("Refund %s","woocommerce-payments"),r)})]}),children:(0,Te.jsx)("p",{children:(0,$.sprintf)((0,$.__)('Issue a full refund back to your customer\'s payment method using %s. This action can not be undone. To issue a partial refund, click "Cancel", and use the "Refund" button in the order details below.',"woocommerce-payments"),"WooPayments")})})})},_s=({title:e,confirmButtonText:t,cancelButtonText:r,confirmationMessage:o,onConfirm:n,onCancel:a})=>{const[s,i]=(0,ve.useState)(!0),c=()=>{i(!1)},u=(0,Te.jsxs)(Te.Fragment,{children:[(0,Te.jsx)(he.Button,{variant:"secondary",onClick:()=>{a(),c()},children:r}),(0,Te.jsx)(he.Button,{variant:"primary",onClick:()=>{n(),c()},children:t})]});return(0,Te.jsx)(Te.Fragment,{children:s&&(0,Te.jsx)(ps,{title:e,isDismissible:!1,className:"generic-confirmation-modal",actions:u,onRequestClose:()=>!1,children:(0,Te.jsx)("p",{children:o})})})},ys={CANCELLED:(0,$.__)("cancelled","woocommerce-payments"),COMPLETED:(0,$.__)("completed","woocommerce-payments"),FAILED:(0,$.__)("failed","woocommerce-payments"),ON_HOLD:(0,$.__)("on-hold","woocommerce-payments"),PENDING:(0,$.__)("pending","woocommerce-payments"),PROCESSING:(0,$.__)("processing","woocommerce-payments"),REFUNDED:(0,$.__)("refunded","woocommerce-payments"),TRASH:(0,$.__)("trash","woocommerce-payments")},hs="wc-cancelled",Ss="wc-completed",Es="wc-failed",fs="wc-on-hold",gs="wc-pending",ws="wc-processing",Ts="wc-refunded",Rs="wc-trash",Os={[hs]:ys.CANCELLED,[Ss]:ys.COMPLETED,[Es]:ys.FAILED,[fs]:ys.ON_HOLD,[gs]:ys.PENDING,[ws]:ys.PROCESSING,[Ts]:ys.REFUNDED,[Rs]:ys.TRASH};function vs(e){const t=document.createElement("div");t.id="wcpay-orderstatus-confirm-container",document.body.appendChild(t),(0,q.H)(t).render(e)}function bs(){console.log("No specific action defined for this status change.")}const Is={[hs]:function(e,t){if(e===hs)return;const r=Y("hasOpenAuthorization"),o=Y("canRefund"),n=Y("refundAmount");if(r&&function(e,t){const r=ye({mixedString:(0,$.__)("This order has been {{authorizedNotCaptured/}} yet. Changing the status to {{newOrderStatus/}} will also {{cancelAuthorization/}}. Do you want to continue?","woocommerce-payments"),components:{authorizedNotCaptured:(0,Te.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/#authorize-vs-capture",rel:"noopener noreferrer",children:(0,$.__)("authorized but payment has not been captured","woocommerce-payments")}),cancelAuthorization:(0,Te.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/#cancelling-authorizations",rel:"noopener noreferrer",children:(0,$.__)("cancel the payment","woocommerce-payments")}),newOrderStatus:(0,Te.jsx)("b",{children:Os[t]})}});vs((0,Te.jsx)(_s,{title:(0,$.__)("Cancel payment","woocommerce-payments"),confirmButtonText:(0,$.__)("Cancel order and payment","woocommerce-payments"),cancelButtonText:(0,$.__)("Cancel","woocommerce-payments"),confirmationMessage:r,onConfirm:()=>{const e=document.querySelector("#order_status")?.closest("form")||null;null!==e&&e.submit()},onCancel:()=>{const t=document.querySelector("#order_status");null!==t&&(t.value=e,t.dispatchEvent(new Event("change")))}}))}(e,t),!r&&o&&n>0){const t=ye({mixedString:(0,$.__)("Are you trying to issue a refund for this order? If so, please click {{doNothingBold/}} and see our documentation on {{howtoIssueRefunds/}}. If you want to mark this order as Cancelled without issuing a refund, click {{cancelOrderBold/}}.","woocommerce-payments"),components:{doNothingBold:(0,Te.jsx)("b",{children:(0,$.__)("Do Nothing","woocommerce-payments")}),cancelOrderBold:(0,Te.jsx)("b",{children:(0,$.__)("Cancel order","woocommerce-payments")}),howtoIssueRefunds:(0,Te.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/managing-money/#refunds",rel:"noopener noreferrer",children:(0,$.__)("how to issue refunds","woocommerce-payments")})}});vs((0,Te.jsx)(_s,{title:(0,$.__)("Cancel order","woocommerce-payments"),confirmButtonText:(0,$.__)("Cancel order","woocommerce-payments"),cancelButtonText:(0,$.__)("Do Nothing","woocommerce-payments"),confirmationMessage:t,onConfirm:()=>{const e=document.querySelector("#order_status")?.closest("form")||null;null!==e&&e.submit()},onCancel:()=>{const t=document.querySelector("#order_status");null!==t&&(t.value=e,t.dispatchEvent(new Event("change")))}}))}},[Ss]:function(e,t){e!==Ss&&Y("hasOpenAuthorization")&&function(e,t){const r=ye({mixedString:(0,$.__)("This order has been {{authorizedNotCaptured/}} yet. Changing the status to {{newOrderStatus/}} will also {{captureAuthorization/}}. Do you want to continue?","woocommerce-payments"),components:{authorizedNotCaptured:(0,Te.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/#authorize-vs-capture",rel:"noopener noreferrer",children:(0,$.__)("authorized but payment has not been captured","woocommerce-payments")}),captureAuthorization:(0,Te.jsx)("a",{target:"_blank",href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/#capturing-authorized-payments",rel:"noopener noreferrer",children:(0,$.__)("capture the payment","woocommerce-payments")}),newOrderStatus:(0,Te.jsx)("b",{children:Os[t]})}});vs((0,Te.jsx)(_s,{title:(0,$.__)("Capture payment","woocommerce-payments"),confirmButtonText:(0,$.__)("Complete order and capture payment","woocommerce-payments"),cancelButtonText:(0,$.__)("Cancel","woocommerce-payments"),confirmationMessage:r,onConfirm:()=>{const e=document.querySelector("#order_status")?.closest("form")||null;null!==e&&e.submit()},onCancel:()=>{const t=document.querySelector("#order_status");null!==t&&(t.value=e,t.dispatchEvent(new Event("change")))}}))}(e,t)},[Ts]:function(e){e!==Ts&&function(e,t,r){t?r<=0?(0,De.dispatch)("core/notices").createErrorNotice((0,$.__)("Invalid Refund Amount","woocommerce-payments")):vs((0,Te.jsx)(ls,{orderStatus:e,refundAmount:r,formattedRefundAmount:Y("formattedRefundAmount"),refundedAmount:Y("refundedAmount")})):(0,De.dispatch)("core/notices").createErrorNotice((0,$.__)("Order cannot be refunded","woocommerce-payments"))}(e,Y("canRefund"),Y("refundAmount"))}};function As(e){const t=document.querySelector("button.refund-items");if(!t)return;t.disabled=!0;let r="";de(e)?r=(0,$.__)("Refunds and order editing are disabled during disputes.","woocommerce-payments"):me(e)?r=(0,$.__)("Refunds and order editing are disabled during an active dispute.","woocommerce-payments"):"lost"===e&&(r=(0,$.__)("Refunds and order editing have been disabled as a result of a lost dispute.","woocommerce-payments")),jQuery(t).parent().find(".woocommerce-help-tip").attr({title:r,"aria-label":r}).tipTip()}jQuery((function(e){var t,r;const o=null!==(t=Y("disableManualRefunds"))&&void 0!==t&&t,n=null!==(r=Y("manualRefundsTip"))&&void 0!==r?r:"",a=Y("chargeId"),s=Y("testMode"),i=""!==Y("orderTestModeMatch");!function(){const e=document.querySelector("#wcpay-order-payment-details-container");e&&(0,q.H)(e).render((0,Te.jsxs)(Te.Fragment,{children:[s&&(0,Te.jsx)(Oe,{}),a&&i&&(0,Te.jsx)(ds,{chargeId:a,onDisableOrderRefund:As})]}))}(),e("#woocommerce-order-items").on("click","button.refund-items",(function(){const t=e(".do-manual-refund");o?t.hide():t.attr({title:n}).tipTip()})),e("select#order_status").on("change",(function(){let t=e("input#original_post_status").val()||e("input#original_order_status").val();var r;t&&!t.startsWith("wc-")&&(t="wc-"+t),(r=this.value,Is[r]||bs)(t,this.value)}))}))})()})();