Файловый менеджер - Редактировать - /home/harasnat/www/labour/wp-content/plugins/woocommerce-payments/dist/multi-currency-switcher-block.js
Назад
/*! For license information please see multi-currency-switcher-block.js.LICENSE.txt */ (()=>{var e={1020:(e,t,r)=>{"use strict";var o=r(1609),a=Symbol.for("react.element"),n=(Symbol.for("react.fragment"),Object.prototype.hasOwnProperty),s=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var o,c={},d=null,u=null;for(o in void 0!==r&&(d=""+r),void 0!==t.key&&(d=""+t.key),void 0!==t.ref&&(u=t.ref),t)n.call(t,o)&&!i.hasOwnProperty(o)&&(c[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===c[o]&&(c[o]=t[o]);return{$$typeof:a,type:e,key:d,ref:u,props:c,_owner:s.current}}t.jsx=c,t.jsxs=c},4848:(e,t,r)=>{"use strict";e.exports=r(1020)},1609:e=>{"use strict";e.exports=window.React}},t={};function r(o){var a=t[o];if(void 0!==a)return a.exports;var n=t[o]={exports:{}};return e[o](n,n.exports,r),n.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 a=o.length-1;a>-1&&(!e||!/^http(s?):/.test(e));)e=o[a--].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:()=>Z,getAllDepositsOverviewsError:()=>K,getDeposit:()=>W,getDepositQueryError:()=>te,getDeposits:()=>X,getDepositsCount:()=>ee,getDepositsSummary:()=>oe,getDepositsSummaryError:()=>ae,getInstantDeposit:()=>ne});var t={};r.r(t),r.d(t,{submitInstantDeposit:()=>De,updateAllDepositsOverviews:()=>fe,updateDeposit:()=>we,updateDeposits:()=>ve,updateDepositsCount:()=>be,updateDepositsSummary:()=>Ie,updateErrorForAllDepositsOverviews:()=>Oe,updateErrorForDepositQuery:()=>Ae,updateErrorForDepositsSummary:()=>Ne,updateInstantDeposit:()=>Ce});var o={};r.r(o),r.d(o,{getAllDepositsOverviews:()=>Ue,getDeposit:()=>Fe,getDeposits:()=>xe,getDepositsSummary:()=>je,getPayoutsCSVRequestURL:()=>Le,payoutsDownloadEndpoint:()=>Pe});var a={};r.r(a),r.d(a,{getFraudOutcomeTransactions:()=>We,getFraudOutcomeTransactionsError:()=>Ze,getFraudOutcomeTransactionsSummary:()=>Je,getFraudOutcomeTransactionsSummaryError:()=>Xe,getTransactions:()=>Be,getTransactionsError:()=>$e,getTransactionsSummary:()=>Ve,getTransactionsSummaryError:()=>Ge});var n={};r.r(n),r.d(n,{updateErrorForFraudOutcomeTransactions:()=>nt,updateErrorForFraudOutcomeTransactionsSummary:()=>it,updateErrorForTransactions:()=>tt,updateErrorForTransactionsSummary:()=>ot,updateFraudOutcomeTransactions:()=>at,updateFraudOutcomeTransactionsSummary:()=>st,updateTransactions:()=>et,updateTransactionsSummary:()=>rt});var s={};r.r(s),r.d(s,{formatQueryFilters:()=>ct,getFraudOutcomeTransactions:()=>lt,getFraudOutcomeTransactionsExport:()=>yt,getFraudOutcomeTransactionsSummary:()=>mt,getTransactions:()=>dt,getTransactionsCSVRequestURL:()=>_t,getTransactionsSummary:()=>pt,transactionsDownloadEndpoint:()=>ut});var i={};r.r(i),r.d(i,{getCharge:()=>St,getChargeError:()=>Et,getChargeFromOrder:()=>gt,getChargeFromOrderError:()=>Tt});var c={};r.r(c),r.d(c,{updateCharge:()=>Rt,updateErrorForCharge:()=>wt});var d={};r.r(d),r.d(d,{getCharge:()=>ft,getChargeFromOrder:()=>Ot});var u={};r.r(u),r.d(u,{getTimeline:()=>bt,getTimelineError:()=>At});var _={};r.r(_),r.d(_,{updateErrorForTimeline:()=>Nt,updateTimeline:()=>It});var p={};r.r(p),r.d(p,{getTimeline:()=>Ct});var l={};r.r(l),r.d(l,{getCachedDispute:()=>Lt,getDispute:()=>Mt,getDisputeError:()=>Pt,getDisputes:()=>xt,getDisputesSummary:()=>jt});var m={};r.r(m),r.d(m,{refundCharge:()=>Bt,updateErrorForPaymentIntent:()=>zt,updatePaymentIntent:()=>qt});var y={};r.r(y),r.d(y,{getPaymentIntent:()=>$t});var h={};r.r(h),r.d(h,{acceptDispute:()=>Wt,updateDispute:()=>Ht,updateDisputes:()=>Gt,updateDisputesSummary:()=>Qt,updateErrorForDispute:()=>Vt});var S={};r.r(S),r.d(S,{disputesDownloadEndpoint:()=>rr,getDispute:()=>ar,getDisputes:()=>nr,getDisputesCSVRequestURL:()=>or,getDisputesSummary:()=>sr});var E={};r.r(E),r.d(E,{getAccountBusinessSupportEmail:()=>fr,getAccountBusinessSupportPhone:()=>Or,getAccountDomesticCurrency:()=>vr,getAccountStatementDescriptor:()=>Tr,getAccountStatementDescriptorKana:()=>wr,getAccountStatementDescriptorKanji:()=>Rr,getAdvancedFraudProtectionSettings:()=>oo,getAvailablePaymentMethodIds:()=>hr,getCompletedWaitingPeriod:()=>Cr,getCurrentProtectionLevel:()=>ro,getDepositDelayDays:()=>Nr,getDepositRestrictions:()=>Fr,getDepositScheduleInterval:()=>br,getDepositScheduleMonthlyAnchor:()=>Ir,getDepositScheduleWeeklyAnchor:()=>Ar,getDepositStatus:()=>Dr,getDuplicatedPaymentMethodIds:()=>lr,getEnabledPaymentMethodIds:()=>yr,getIsCardPresentEligible:()=>Gr,getIsDebugLogEnabled:()=>jr,getIsDevModeEnabled:()=>Lr,getIsManualCaptureEnabled:()=>Ur,getIsMultiCurrencyEnabled:()=>Yr,getIsPaymentRequestEnabled:()=>xr,getIsSavedCardsEnabled:()=>Hr,getIsStripeBillingEnabled:()=>no,getIsStripeBillingMigrationInProgress:()=>so,getIsSubscriptionsPluginActive:()=>Zr,getIsTestModeEnabled:()=>Mr,getIsTestModeOnboarding:()=>Pr,getIsWCPayEnabled:()=>mr,getIsWCPaySubscriptionsEligible:()=>Wr,getIsWCPaySubscriptionsEnabled:()=>Qr,getIsWooPayEnabled:()=>Kr,getIsWooPayGlobalThemeSupportEnabled:()=>Jr,getPaymentMethodStatuses:()=>Sr,getPaymentRequestButtonBorderRadius:()=>$r,getPaymentRequestButtonSize:()=>zr,getPaymentRequestButtonTheme:()=>Br,getPaymentRequestButtonType:()=>qr,getPaymentRequestLocations:()=>kr,getSavingError:()=>Vr,getSettings:()=>pr,getShowWooPayIncompatibilityNotice:()=>ao,getStripeBillingMigratedCount:()=>co,getStripeBillingSubscriptionCount:()=>io,getWooPayCustomMessage:()=>Xr,getWooPayLocations:()=>to,getWooPayStoreLogo:()=>eo,isDirty:()=>gr,isSavingSettings:()=>Er});var g={};r.r(g),r.d(g,{saveOption:()=>Zo,saveSettings:()=>Yo,submitStripeBillingSubscriptionMigration:()=>Wo,updateAccountBusinessSupportEmail:()=>Mo,updateAccountBusinessSupportPhone:()=>Po,updateAccountStatementDescriptor:()=>Do,updateAccountStatementDescriptorKana:()=>Uo,updateAccountStatementDescriptorKanji:()=>Fo,updateAdvancedFraudProtectionSettings:()=>Go,updateDepositScheduleInterval:()=>Lo,updateDepositScheduleMonthlyAnchor:()=>jo,updateDepositScheduleWeeklyAnchor:()=>xo,updateEnabledPaymentMethodIds:()=>wo,updateIsCardPresentEligible:()=>mo,updateIsDebugLogEnabled:()=>Io,updateIsManualCaptureEnabled:()=>bo,updateIsMultiCurrencyEnabled:()=>No,updateIsPaymentRequestEnabled:()=>Ro,updateIsSavedCardsEnabled:()=>lo,updateIsSavingSettings:()=>fo,updateIsStripeBillingEnabled:()=>Qo,updateIsTestModeEnabled:()=>Ao,updateIsWCPayEnabled:()=>To,updateIsWCPaySubscriptionsEnabled:()=>Co,updateIsWooPayEnabled:()=>qo,updateIsWooPayGlobalThemeSupportEnabled:()=>zo,updatePaymentRequestButtonBorderRadius:()=>Eo,updatePaymentRequestButtonSize:()=>ho,updatePaymentRequestButtonTheme:()=>So,updatePaymentRequestButtonType:()=>yo,updatePaymentRequestLocations:()=>ko,updateProtectionLevel:()=>Vo,updateSelectedPaymentMethod:()=>Oo,updateSettings:()=>go,updateUnselectedPaymentMethod:()=>vo,updateWooPayCustomMessage:()=>Bo,updateWooPayLocations:()=>Ho,updateWooPayStoreLogo:()=>$o});var T={};r.r(T),r.d(T,{getSettings:()=>Ko});var R={};r.r(R),r.d(R,{getCardReaderStats:()=>Xo,getCardReaderStatsError:()=>ea,getCardReaders:()=>ta});var w={};r.r(w),r.d(w,{updateCardReaderStats:()=>ra,updateCardReaders:()=>oa,updateErrorForCardReaderStats:()=>aa,updateErrorForCardReaders:()=>na});var f={};r.r(f),r.d(f,{getCardReaderStats:()=>sa,getCardReaders:()=>ia});var O={};r.r(O),r.d(O,{getActiveLoanSummary:()=>pa,getActiveLoanSummaryError:()=>la,getLoans:()=>ma,getLoansError:()=>ya});var v={};r.r(v),r.d(v,{updateActiveLoanSummary:()=>ha,updateErrorForActiveLoanSummary:()=>Sa,updateErrorForLoans:()=>ga,updateLoans:()=>Ea});var b={};r.r(b),r.d(b,{getActiveLoanSummary:()=>Ta,getLoans:()=>Ra});var A={};r.r(A),r.d(A,{getDocuments:()=>ba,getDocumentsError:()=>Aa,getDocumentsSummary:()=>Na,getDocumentsSummaryError:()=>Ca});var I={};r.r(I),r.d(I,{updateDocuments:()=>Da,updateDocumentsSummary:()=>Ua,updateErrorForDocuments:()=>Fa,updateErrorForDocumentsSummary:()=>Ma});var N={};r.r(N),r.d(N,{formatQueryFilters:()=>Pa,getDocuments:()=>La,getDocumentsSummary:()=>xa});var C={};r.r(C),r.d(C,{getPaymentIntent:()=>Ya,getPaymentIntentError:()=>ka});var D={};r.r(D),r.d(D,{getAuthorization:()=>Va,getAuthorizations:()=>Ha,getAuthorizationsError:()=>Ga,getAuthorizationsSummary:()=>Wa,getAuthorizationsSummaryError:()=>Za,getIsRequesting:()=>Ka});var F={};r.r(F),r.d(F,{setIsRequestingAuthorization:()=>on,submitCancelAuthorization:()=>nn,submitCaptureAuthorization:()=>an,updateAuthorization:()=>tn,updateAuthorizations:()=>Xa,updateAuthorizationsSummary:()=>rn,updateErrorForAuthorizations:()=>en,updateErrorForAuthorizationsSummary:()=>sn});var U={};r.r(U),r.d(U,{getAuthorization:()=>dn,getAuthorizations:()=>cn,getAuthorizationsSummary:()=>un});var M={};r.r(M),r.d(M,{getFile:()=>mn,getFileError:()=>yn});var P={};r.r(P),r.d(P,{updateErrorForFiles:()=>Sn,updateFiles:()=>hn});var L={};r.r(L),r.d(L,{getFile:()=>En});var x={};r.r(x),r.d(x,{getAvailableCurrencies:()=>vn,getCurrencies:()=>On,getCurrencySettings:()=>In,getDefaultCurrency:()=>An,getEnabledCurrencies:()=>bn,getStoreSettings:()=>Nn});var j={};r.r(j),r.d(j,{saveOption:()=>Yn,submitCurrencySettings:()=>xn,submitEnabledCurrenciesUpdate:()=>Ln,submitStoreSettingsUpdate:()=>jn,updateAvailableCurrencies:()=>Dn,updateCurrencies:()=>Cn,updateCurrencySettings:()=>Mn,updateDefaultCurrency:()=>Un,updateEnabledCurrencies:()=>Fn,updateStoreSettings:()=>Pn});var Y={};r.r(Y),r.d(Y,{getCurrencies:()=>kn,getCurrencySettings:()=>qn,getStoreSettings:()=>zn});const k=window.wp.data,q=window.wp.dataControls,z="/wc/v3/payments",B="wc/payments",$=window.lodash,H={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"},V=e=>JSON.stringify(e,Object.keys(e).sort()),G={byId:{},queries:{},count:0,instant:{}},Q=e=>e&&e.deposits||{},W=(e,t)=>(Q(e).byId||{})[t],Z=e=>{const t=Q(e).overviews||{};if(!t.data)return{account:null,currencies:[]};const{deposit:r,balance:o,account:a}=t.data,n={lastPaid:r.last_paid,pending:o.pending,available:o.available,instant:o.instant},s={};for(const[e,t]of Object.entries(n))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:a,currencies:[...i.filter((e=>a.default_currency===e.currency)),...i.filter((e=>a.default_currency!==e.currency))]}},K=e=>(Q(e).overviews||{}).error,J=(e,t)=>{const r=V(t);return(Q(e).queries||{})[r]||{}},X=(e,t)=>(J(e,t).data||[]).map(W.bind(void 0,e)),ee=e=>Q(e).count,te=(e,t)=>J(e,t).error||{},re=(e,t)=>{const r=V(t);return(Q(e).summary||{})[r]||{}},oe=(e,t)=>re(e,t).data||{},ae=(e,t)=>re(e,t).error||{},ne=e=>(Q(e).instant||{}).data,se=window.wp.i18n,ie=window.wp.domReady;var ce=r.n(ie);const de=(e,t={})=>{var r;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:null===(r=wcpaySettings.trackingInfo)||void 0===r?void 0:r.hosting_provider});for(const e in t)void 0===t[e]&&delete t[e]}ce()((()=>{var r,o;(null!==(o=null===(r=null===wc||void 0===wc?void 0:wc.tracks)||void 0===r?void 0:r.recordEvent)&&void 0!==o?o:wcTracks.recordEvent)(e,t)}))};var ue=r(1609);(0,ue.createContext)(window.wcpaySettings),(0,ue.createContext)({isActive:!1,setActive:()=>null,isCompleted:!1,setCompleted:()=>null,taskId:""});const _e=window.wc.currency;var pe=r.n(_e);(0,se.__)("Australian dollar","woocommerce-payments"),(0,se.__)("Canadian dollar","woocommerce-payments"),(0,se.__)("Swiss franc","woocommerce-payments"),(0,se.__)("Danish krone","woocommerce-payments"),(0,se.__)("Euro","woocommerce-payments"),(0,se.__)("Pound sterling","woocommerce-payments"),(0,se.__)("Norwegian krone","woocommerce-payments"),(0,se.__)("New Zealand dollar","woocommerce-payments"),(0,se.__)("Swedish krona","woocommerce-payments"),(0,se.__)("United States (US) dollar","woocommerce-payments");const le=(e,t="USD",r=null,o=!1)=>{const a=(e=>wcpaySettings.zeroDecimalCurrencies.includes(e.toLowerCase()))(t);a||(e/=100);const n=e<0,s=n?-1*e:e,i=n?"-":"",c=o?(e=>{const t=e.toUpperCase(),{currencyData:r,connect:{country:o="US"}}=wcpaySettings;if(r[o]?.code===t)return pe()(r[o]);const a=(0,$.find)(r,{code:t});if(a){const{defaultLocale:e={}}=a;return e.hasOwnProperty("decimalSeparator")&&e.hasOwnProperty("thousandSeparator")&&e.hasOwnProperty("symbolPosition")&&(a.decimalSeparator=e.decimalSeparator,a.thousandSeparator=e.thousandSeparator,a.symbolPosition=e.symbolPosition),pe()(a)}return null})(t):((e,t=null)=>{const{currencyData:r,connect:{country:o="US"}}=wcpaySettings,a=(0,$.find)(r,{code:e.toUpperCase()});if(a){if(null!==t&&t.toUpperCase()!==e.toUpperCase()||r[o]){const e=t?(0,$.find)(r,{code:t.toUpperCase()}):r[o];e&&(a.decimalSeparator=e.decimalSeparator,a.thousandSeparator=e.thousandSeparator,a.symbolPosition=e.symbolPosition)}return pe()(a)}return null})(t,r);if(null===c)return i+me(s,t,a);try{return i+("function"==typeof c.formatAmount?ye(c.formatAmount(s)):ye(c.formatCurrency(s)))}catch(e){return i+ye(me(s,t,a))}};function me(e,t,r){try{return e.toLocaleString(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",dummy:r})}catch(o){return(0,se.sprintf)(r?"%s %i":"%s %.2f",t.toUpperCase(),e)}}function ye(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}const he=window.wp.url,Se=window.moment;var Ee=r.n(Se);const ge=window.wp.date,Te=(window.wc.number,e=>(0,he.addQueryArgs)("admin.php",e)),Re=(e,t=!1)=>{const r=t?Ee()(e).endOf("day").utc().toISOString():Ee()(e).startOf("day").utc().toISOString();return e&&(0,ge.dateI18n)("Y-m-d H:i:s",r,!0)};function we(e){return{type:H.SET_DEPOSIT,data:e}}function fe(e){return{type:H.SET_ALL_DEPOSITS_OVERVIEWS,data:e}}function Oe(e,t){return{type:H.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,error:t}}function ve(e,t){return{type:H.SET_DEPOSITS,query:e,data:t}}function be(e){return{type:H.SET_DEPOSITS_COUNT,data:e}}function Ae(e,t,r){return{type:H.SET_ERROR_FOR_DEPOSIT_QUERY,query:e,data:t,error:r}}function Ie(e,t){return{type:H.SET_DEPOSITS_SUMMARY,query:e,data:t}}function Ne(e,t,r){return{type:H.SET_ERROR_FOR_DEPOSITS_SUMMARY,query:e,data:t,error:r}}function Ce(e){return{type:H.SET_INSTANT_DEPOSIT,data:e}}function*De(e){try{yield(0,k.dispatch)(B).startResolution("getInstantDeposit",[e]);const t=yield(0,q.apiFetch)({path:"/wc/v3/payments/deposits",method:"POST",data:{type:"instant",currency:e}});yield Ce(t),yield(0,k.dispatch)(B).invalidateResolutionForStoreSelector("getDeposits"),yield(0,k.dispatch)(B).invalidateResolutionForStoreSelector("getAllDepositsOverviews"),yield(0,k.dispatch)("core/notices").createSuccessNotice((0,se.sprintf)((0,se.__)("Instant payout for %s in transit.","woocommerce-payments"),le(t.amount)),{actions:[{label:(0,se.__)("View details","woocommerce-payments"),url:Te({page:"wc-admin",path:"/payments/payouts/details",id:t.id})}]})}catch{yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error creating instant payout.","woocommerce-payments"))}finally{yield(0,k.dispatch)(B).finishResolution("getInstantDeposit",[e])}}function*Fe(e){if(/\W/.test(e))return;const t=(0,he.addQueryArgs)(`${z}/deposits/${e}`);try{const e=yield(0,q.apiFetch)({path:t});yield we(e)}catch(e){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving payout.","woocommerce-payments"))}}function*Ue(){const e=(0,he.addQueryArgs)(`${z}/deposits/overview-all`);try{const t=yield(0,q.apiFetch)({path:e});yield fe(t)}catch(e){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving all payouts' overviews.","woocommerce-payments")),yield Oe()}}const Me=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Re(e.dateBefore,!0),date_after:Re(e.dateAfter),date_between:e.dateBetween&&[Re(e.dateBetween[0]),Re(e.dateBetween[1],!0)],status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),Pe=`${z}/deposits/download`;function Le(e){return(0,he.addQueryArgs)(Pe,Me(e))}function*xe(e){const t=(0,he.addQueryArgs)(`${z}/deposits`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Me(e)});try{const r=yield(0,q.apiFetch)({path:t})||{};yield ve(e,r.data),yield be(r.total_count);for(const e in r.data)yield k.controls.dispatch(B,"finishResolution","getDeposit",[r.data[e].id])}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving payouts.","woocommerce-payments")),yield Ae(e,null,t)}}function*je(e){const t=(0,he.addQueryArgs)(`${z}/deposits/summary`,Me(e));try{const r=yield(0,q.apiFetch)({path:t});yield Ie(e,r)}catch(t){yield Ne(e,null,t)}}const Ye={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"},ke={summary:{},fraudProtection:{review:{summary:{}},block:{summary:{}}}},qe=e=>e&&e.transactions||{},ze=(e,t)=>{const r=V(t);return qe(e)[r]||{}},Be=(e,t)=>ze(e,t).data||[],$e=(e,t)=>ze(e,t).error||{},He=(e,t)=>{const r=V(t);return qe(e).summary[r]||{}},Ve=(e,t)=>He(e,t).data||{},Ge=(e,t)=>He(e,t).error||{},Qe=(e,t,r)=>{const o=V(r);return qe(e).fraudProtection?.[t]?.[o]||{}},We=(e,t,r)=>Qe(e,t,r).data||[],Ze=(e,t,r)=>Qe(e,t,r).error||{},Ke=(e,t,r)=>{const o=V(r);return qe(e).fraudProtection?.[t]?.summary[o]||{}},Je=(e,t,r)=>Ke(e,t,r).data||{},Xe=(e,t,r)=>Ke(e,t,r).error||{};function et(e,t){return{type:Ye.SET_TRANSACTIONS,query:e,data:t}}function tt(e,t,r){return{type:Ye.SET_ERROR_FOR_TRANSACTIONS,query:e,data:t,error:r}}function rt(e,t){return{type:Ye.SET_TRANSACTIONS_SUMMARY,query:e,data:t}}function ot(e,t,r){return{type:Ye.SET_ERROR_FOR_TRANSACTIONS_SUMMARY,query:e,data:t,error:r}}function at(e,t,r){return{type:Ye.SET_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:r}}function nt(e,t,r){return{type:Ye.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:null,error:r}}function st(e,t,r){return{type:Ye.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:r}}function it(e,t,r){return{type:Ye.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:null,error:r}}const ct=e=>({user_email:e.userEmail,match:e.match,date_before:Re(e.dateBefore,!0),date_after:Re(e.dateAfter),date_between:e.dateBetween&&[Re(e.dateBetween[0]),Re(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:Ee()(new Date).format("Z"),locale:e.locale});function*dt(e){const t=(0,he.addQueryArgs)(`${z}/transactions`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...ct(e)});try{const r=yield(0,q.apiFetch)({path:t});yield et(e,r.data||[])}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving transactions.","woocommerce-payments")),yield tt(e,null,t)}}const ut=`${z}/transactions/download`;function _t(e){return(0,he.addQueryArgs)(ut,ct(e))}function*pt(e){const t=(0,he.addQueryArgs)(`${z}/transactions/summary`,ct(e));try{const r=yield(0,q.apiFetch)({path:t});yield rt(e,r)}catch(t){yield ot(e,null,t)}}function*lt(e,t){const r=(0,he.addQueryArgs)(`${z}/transactions/fraud-outcomes`,{status:e,page:t.paged,sort:t.orderby,pagesize:t.perPage,direction:t.order,additional_status:t.additionalStatus,...ct(t)});try{const o=yield(0,q.apiFetch)({path:r});yield at(e,t,o.data||[])}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield at(e,t,[]));yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving transactions.","woocommerce-payments")),yield nt(e,t,r)}}function*mt(e,t){const r=(0,he.addQueryArgs)(`${z}/transactions/fraud-outcomes/summary`,{status:e,additional_status:t.additionalStatus}),o={count:0,total:0};try{const a=yield(0,q.apiFetch)({path:r});yield st(e,t,a||o)}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield st(e,t,o));yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving on review transactions.","woocommerce-payments")),yield it(e,t,r)}}function yt(e,t){return(0,he.addQueryArgs)(`${z}/transactions/fraud-outcomes/download`,{status:e,sort:t.orderby,direction:t.order,additional_status:t.additionalStatus,...ct(t)})}const ht={SET_CHARGE:"SET_CHARGE",SET_ERROR_FOR_CHARGE:"SET_ERROR_FOR_CHARGE"},St=(e,t)=>e.charges[t]&&e.charges[t].data?e.charges[t].data:{},Et=(e,t)=>e.charges[t]&&e.charges[t].error?e.charges[t].error:{},gt=(e,t)=>St(e,t),Tt=(e,t)=>Et(e,t);function Rt(e,t){return{type:ht.SET_CHARGE,id:e,data:t}}function wt(e,t,r){return{type:ht.SET_ERROR_FOR_CHARGE,id:e,data:t,error:r}}function*ft(e){try{const t=yield(0,q.apiFetch)({path:`${z}/charges/${e}`});yield Rt(e,t)}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving transaction.","woocommerce-payments")),yield wt(e,null,t)}}function*Ot(e){try{const t=yield(0,q.apiFetch)({path:`${z}/charges/order/${e}`});yield Rt(e,t)}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving transaction.","woocommerce-payments")),yield wt(e,null,t)}}const vt={SET_TIMELINE:"SET_TIMELINE",SET_ERROR_FOR_TIMELINE:"SET_ERROR_FOR_TIMELINE"},bt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].data?e.timeline[t].data:{},At=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].error?e.timeline[t].error:{};function It(e,t){return{id:e,type:vt.SET_TIMELINE,data:t}}function Nt(e,t){return{id:e,type:vt.SET_ERROR_FOR_TIMELINE,error:t}}function*Ct(e){try{const t=yield(0,q.apiFetch)({path:`${z}/timeline/${e}`});yield It(e,t.data)}catch(t){yield Nt(e,t)}}const Dt={SET_DISPUTE:"SET_DISPUTE",SET_ERROR_FOR_DISPUTE:"SET_ERROR_FOR_DISPUTE",SET_DISPUTES:"SET_DISPUTES",SET_DISPUTES_SUMMARY:"SET_DISPUTES_SUMMARY"},Ft={byId:{},queries:{},summary:{},cached:{}},Ut=e=>e&&e.disputes||{},Mt=(e,t)=>(Ut(e).byId||{})[t],Pt=(e,t)=>{const r=Ut(e).byId||{};return r[t]?.error},Lt=(e,t)=>(Ut(e).cached||{})[t],xt=(e,t)=>{const r=((e,t)=>{const r=V(t);return(Ut(e).queries||{})[r]||{}})(e,t).data||[];return r.map(Lt.bind(void 0,e))},jt=(e,t)=>((e,t)=>{const r=V(t);return(Ut(e).summary||{})[r]||{}})(e,t).data||{};var Yt;!function(e){e.SET_PAYMENT_INTENT="SET_PAYMENT_INTENT",e.SET_ERROR_FOR_PAYMENT_INTENT="SET_ERROR_FOR_PAYMENT_INTENT"}(Yt||(Yt={}));const kt=Yt;function qt(e,t){return{type:kt.SET_PAYMENT_INTENT,id:e,data:t}}function zt(e,t){return{type:kt.SET_ERROR_FOR_PAYMENT_INTENT,id:e,error:t}}function*Bt(e,t){var r;const o=e.payment_intent;try{yield(0,q.apiFetch)({path:"/wc/v3/payments/refund/",method:"post",data:{charge_id:e.id,amount:e.amount,reason:t,order_id:null===(r=null==e?void 0:e.order)||void 0===r?void 0:r.id}}),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getTimeline"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield k.controls.dispatch("core/notices","createSuccessNotice",(0,se.sprintf)((0,se.__)("Refunded payment #%s.","woocommerce-payments"),o))}catch(e){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.sprintf)((0,se.__)("There has been an error refunding the payment #%s. Please try again later.","woocommerce-payments"),o))}}function*$t(e){try{const t=yield(0,q.apiFetch)({path:`${z}/payment_intents/${e}`});yield qt(e,t)}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving transaction.","woocommerce-payments")),yield zt(e,t)}}function Ht(e){return{type:Dt.SET_DISPUTE,data:e}}function Vt(e,t,r){return{type:Dt.SET_ERROR_FOR_DISPUTE,id:e,data:t,error:r}}function Gt(e,t){return{type:Dt.SET_DISPUTES,query:e,data:t}}function Qt(e,t){return{type:Dt.SET_DISPUTES_SUMMARY,query:e,data:t}}function*Wt(e){const{id:t,payment_intent:r}=e;try{yield k.controls.dispatch(B,"startResolution","getDispute",[t]);const e=yield(0,q.apiFetch)({path:`${z}/disputes/${t}/close`,method:"post"});yield Ht(e),yield $t(r),yield k.controls.dispatch(B,"finishResolution","getDispute",[t]);const o=e.order?(0,se.sprintf)((0,se.__)("You have accepted the dispute for order #%s.","woocommerce-payments"),e.order.number):(0,se.__)("You have accepted the dispute.","woocommerce-payments");yield k.controls.dispatch("core/notices","createSuccessNotice",o)}catch(e){const r=(0,se.__)("There has been an error accepting the dispute. Please try again later.","woocommerce-payments");yield k.controls.dispatch("core/notices","createErrorNotice",r),yield k.controls.dispatch(B,"finishResolution","getDispute",[t])}}const Zt=window.wc.wcSettings,Kt=((0,se.__)("Bank cannot process","woocommerce-payments"),(0,se.__)("Check returned","woocommerce-payments"),(0,se.__)("Credit not processed","woocommerce-payments"),(0,se.__)("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,se.__)("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"),(0,se.__)("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"),(0,se.__)("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"),(0,se.__)("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 you’re able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,se.__)("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"),(0,se.__)("The cardholder claims a credit was not processed.","woocommerce-payments"),(0,se.__)("Customer initiated","woocommerce-payments"),(0,se.__)("Debit not authorized","woocommerce-payments"),(0,se.__)("Duplicate","woocommerce-payments"),(0,se.__)("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,se.__)("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"),(0,se.__)("The customer claims they were charged multiple times for the same product or service.","woocommerce-payments"),(0,se.__)("Demonstrate that each payment was for a separate product or service.","woocommerce-payments"),(0,se.__)("Determine if your customer was incorrectly charged multiple times.","woocommerce-payments"),(0,se.__)("If they were not, collect any and all information documenting that each payment was made separately, such as copies of receipts. If the receipts don’t 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 you’ve 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,se.__)("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 you’re able to resolve the issue with your customer, you can ask that they withdraw the dispute.","woocommerce-payments"),(0,se.__)("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,se.__)("The cardholder claims this is a duplicate transaction.","woocommerce-payments"),(0,se.__)("Transaction unauthorized","woocommerce-payments"),(0,se.__)("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,se.__)("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"),(0,se.__)("This is the most common reason for a dispute, and happens when a cardholder claims that they didn’t 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 doesn’t recognize the payment as it appears on the billing statement from their card issuer.","woocommerce-payments"),(0,se.__)("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"),(0,se.__)("Try to get in touch with your customer. Sometimes people forget about payments they make or don’t 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,se.__)("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,se.__)("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 doesn’t 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"),(0,se.__)("The cardholder claims this is an unauthorized transaction.","woocommerce-payments"),(0,se.__)("General","woocommerce-payments"),(0,se.__)("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,se.__)("This is an uncategorized dispute, so you should contact the customer for additional details to find out why the payment was disputed.","woocommerce-payments"),(0,se.__)("Incorrect account details","woocommerce-payments"),(0,se.__)("Insufficient funds","woocommerce-payments"),(0,se.__)("Product not received","woocommerce-payments"),(0,se.__)("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,se.__)("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"),(0,se.__)("The customer claims they did not receive the products or services purchased.","woocommerce-payments"),(0,se.__)("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"),(0,se.__)("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,se.__)("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,se.__)("The cardholder claims they did not receive the product.","woocommerce-payments"),(0,se.__)("Product unacceptable","woocommerce-payments"),(0,se.__)("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,se.__)("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"),(0,se.__)("The product or service was received but was defective, damaged, or not as described.","woocommerce-payments"),(0,se.__)("Demonstrate that the product or service was delivered as described at the time of purchase.","woocommerce-payments"),(0,se.__)("If the product or service is as described, provide specific information (invoice, contract, etc.) to refute the cardholder’s 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 cardholder’s claims. It is recommended that you address each point that the cardholder has made.","woocommerce-payments"),(0,se.__)("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,se.__)("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,se.__)("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,se.__)("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"),(0,se.__)("The cardholder claims the product was unacceptable.","woocommerce-payments"),(0,se.__)("Subscription canceled","woocommerce-payments"),(0,se.__)("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,se.__)("If you can not prove the customer’s 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"),(0,se.__)("The customer claims that you continued to charge them after a subscription was canceled.","woocommerce-payments"),(0,se.__)("Prove that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments"),(0,se.__)("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,se.__)("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,se.__)("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"),(0,se.__)("The cardholder claims a subscription was canceled.","woocommerce-payments"),(0,se.__)("Unrecognized","woocommerce-payments"),(0,se.__)("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,se.__)("If you can not prove the customer’s 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"),(0,se.__)("The customer doesn’t recognize the payment appearing on their card statement.","woocommerce-payments"),(0,se.__)("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"),(0,se.__)("First, try to get in touch with your customer. Sometimes people forget about payments they make or don’t 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,se.__)("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 doesn’t 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"),{warning_needs_response:(0,se.__)("Inquiry: Response needed","woocommerce-payments"),warning_under_review:(0,se.__)("Inquiry: Under review","woocommerce-payments"),warning_closed:(0,se.__)("Inquiry: Closed","woocommerce-payments"),needs_response:(0,se.__)("Response needed","woocommerce-payments"),under_review:(0,se.__)("Under review","woocommerce-payments"),charge_refunded:(0,se.__)("Charge refunded","woocommerce-payments"),won:(0,se.__)("Won","woocommerce-payments"),lost:(0,se.__)("Lost","woocommerce-payments")}),Jt=(Object.entries(Kt).map((([e,t])=>({label:t,value:e}))).filter((function(e){return null!=e})),["needs_response","warning_needs_response"]),Xt=((0,se.__)("Dispute currency","woocommerce-payments"),(0,se.__)("All currencies","woocommerce-payments"),(0,se.__)("Show","woocommerce-payments"),(0,se.__)("Needs response","woocommerce-payments"),(0,se.__)("All disputes","woocommerce-payments"),(0,se.__)("Advanced filters","woocommerce-payments"),(0,Zt.getSetting)("wcVersion")),er=parseFloat(Xt),tr=(er<7.8?(0,se.__)("Disputes match {{select /}} filters","woocommerce-payments"):(0,se.__)("Disputes match <select /> filters","woocommerce-payments"),(0,se.__)("Disputed on date","woocommerce-payments"),(0,se.__)("Remove dispute date filter","woocommerce-payments"),(0,se.__)("Select a dispute date filter match","woocommerce-payments"),er<7.8?(0,se.__)("{{title}}Date{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,se.__)("<title>Date</title> <rule /> <filter />","woocommerce-payments"),(0,se.__)("Select a dispute date","woocommerce-payments"),(0,se.__)("Before","woocommerce-payments"),(0,se.__)("After","woocommerce-payments"),(0,se.__)("Between","woocommerce-payments"),(0,se.__)("Status","woocommerce-payments"),(0,se.__)("Remove dispute status filter","woocommerce-payments"),(0,se.__)("Select a dispute status filter match","woocommerce-payments"),er<7.8?(0,se.__)("{{title}}Status{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,se.__)("<title>Status</title> <rule /> <filter />","woocommerce-payments"),(0,se.__)("Select a dispute status","woocommerce-payments"),(0,se._x)("Is","dispute status","woocommerce-payments"),(0,se._x)("Is not","dispute status","woocommerce-payments"),e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Re(e.dateBefore,!0),date_after:Re(e.dateAfter),date_between:e.dateBetween&&[Re(e.dateBetween[0]),Re(e.dateBetween[1],!0)],search:"awaiting_response"===e.filter?Jt:e.search,status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale})),rr=`${z}/disputes/download`;function or(e){return(0,he.addQueryArgs)(rr,tr(e))}function*ar(e){const t=(0,he.addQueryArgs)(`${z}/disputes/${e}`);try{const e=yield(0,q.apiFetch)({path:t});yield Ht(e)}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving dispute.","woocommerce-payments")),yield Vt(e,void 0,t)}}function*nr(e){const t=(0,he.addQueryArgs)(`${z}/disputes`,{page:e.paged,pagesize:e.perPage,sort:(0,$.snakeCase)(e.orderBy),direction:e.order,...tr(e)});try{const r=yield(0,q.apiFetch)({path:t})||{};yield Gt(e,r.data)}catch(e){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving disputes.","woocommerce-payments"))}}function*sr(e){const t=(0,he.addQueryArgs)(`${z}/disputes/summary`,{page:e.paged,pagesize:e.perPage,...tr(e)});try{const r=yield(0,q.apiFetch)({path:t});yield Qt(e,r)}catch(e){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving the summary of disputes.","woocommerce-payments"))}}const ir={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"},cr={isDirty:!1,isSaving:!1,savingError:null,data:{}},dr={},ur=[],_r=e=>e&&e.settings||dr,pr=e=>_r(e).data||dr,lr=e=>pr(e).duplicated_payment_method_ids||dr,mr=e=>pr(e).is_wcpay_enabled||!1,yr=e=>pr(e).enabled_payment_method_ids||ur,hr=e=>pr(e).available_payment_method_ids||ur,Sr=e=>pr(e).payment_method_statuses||dr,Er=e=>_r(e).isSaving||!1,gr=e=>_r(e).isDirty||!1,Tr=e=>pr(e).account_statement_descriptor||"",Rr=e=>pr(e).account_statement_descriptor_kanji||"",wr=e=>pr(e).account_statement_descriptor_kana||"",fr=e=>pr(e).account_business_support_email||"",Or=e=>pr(e).account_business_support_phone||"",vr=e=>pr(e).account_domestic_currency||"",br=e=>pr(e).deposit_schedule_interval||"",Ar=e=>pr(e).deposit_schedule_weekly_anchor||"",Ir=e=>pr(e).deposit_schedule_monthly_anchor||"",Nr=e=>pr(e).deposit_delay_days||"7",Cr=e=>pr(e).deposit_completed_waiting_period||!1,Dr=e=>pr(e).deposit_status||"",Fr=e=>pr(e).deposit_restrictions||"",Ur=e=>pr(e).is_manual_capture_enabled||!1,Mr=e=>pr(e).is_test_mode_enabled||!1,Pr=e=>pr(e).is_test_mode_onboarding||!1,Lr=e=>pr(e).is_dev_mode_enabled||!1,xr=e=>pr(e).is_payment_request_enabled||!1,jr=e=>pr(e).is_debug_log_enabled||!1,Yr=e=>pr(e).is_multi_currency_enabled||!1,kr=e=>pr(e).payment_request_enabled_locations||ur,qr=e=>pr(e).payment_request_button_type||"",zr=e=>pr(e).payment_request_button_size||"",Br=e=>pr(e).payment_request_button_theme||"",$r=e=>{const t=pr(e)?.payment_request_button_border_radius;return 0===t||"0"===t||t?t:"undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10)},Hr=e=>pr(e).is_saved_cards_enabled||!1,Vr=e=>_r(e).savingError,Gr=e=>pr(e).is_card_present_eligible||!1,Qr=e=>pr(e).is_wcpay_subscriptions_enabled||!1,Wr=e=>pr(e).is_wcpay_subscriptions_eligible||!1,Zr=e=>pr(e).is_subscriptions_plugin_active||!1,Kr=e=>pr(e).is_woopay_enabled||!1,Jr=e=>pr(e).is_woopay_global_theme_support_enabled||!1,Xr=e=>pr(e).woopay_custom_message||"",eo=e=>pr(e).woopay_store_logo||"",to=e=>pr(e).woopay_enabled_locations||ur,ro=e=>pr(e).current_protection_level||"basic",oo=e=>pr(e).advanced_fraud_protection_settings||ur,ao=e=>pr(e).show_woopay_incompatibility_notice||!1,no=e=>pr(e).is_stripe_billing_enabled||!1,so=e=>pr(e).is_migrating_stripe_billing||!1,io=e=>pr(e).stripe_billing_subscription_count||0,co=e=>pr(e).stripe_billing_migrated_count||0,uo=window.wp.apiFetch;var _o=r.n(uo);function po(e){return{type:ir.SET_SETTINGS_VALUES,payload:e}}function lo(e){return po({is_saved_cards_enabled:e})}function mo(e){return po({is_card_present_eligible:e})}function yo(e){return po({payment_request_button_type:e})}function ho(e){return po({payment_request_button_size:e})}function So(e){return po({payment_request_button_theme:e})}function Eo(e){return po({payment_request_button_border_radius:e})}function go(e){return{type:ir.SET_SETTINGS,data:e}}function To(e){return po({is_wcpay_enabled:e})}function Ro(e){return po({is_payment_request_enabled:e})}function wo(e){return po({enabled_payment_method_ids:[...e]})}function fo(e,t){return{type:ir.SET_IS_SAVING_SETTINGS,isSaving:e,error:t}}function Oo(e){return{type:ir.SET_SELECTED_PAYMENT_METHOD,id:e}}function vo(e){return{type:ir.SET_UNSELECTED_PAYMENT_METHOD,id:e}}function bo(e){return po({is_manual_capture_enabled:e})}function Ao(e){return po({is_test_mode_enabled:e})}function Io(e){return po({is_debug_log_enabled:e})}function No(e){return po({is_multi_currency_enabled:e})}function Co(e){return po({is_wcpay_subscriptions_enabled:e})}function Do(e){return po({account_statement_descriptor:e})}function Fo(e){return po({account_statement_descriptor_kanji:e})}function Uo(e){return po({account_statement_descriptor_kana:e})}function Mo(e){return po({account_business_support_email:e})}function Po(e){return po({account_business_support_phone:e})}function Lo(e){return po({deposit_schedule_interval:e})}function xo(e){return po({deposit_schedule_weekly_anchor:e})}function jo(e){return po({deposit_schedule_monthly_anchor:""===e?null:parseInt(e,10)})}function*Yo(){let e=null;try{const e=(0,k.select)(B).getSettings();yield fo(!0,null);const t=yield(0,q.apiFetch)({path:`${z}/settings`,method:"post",data:e});yield po({payment_method_statuses:t.data.payment_method_statuses}),yield(0,k.dispatch)("core/notices").createSuccessNotice((0,se.__)("Settings saved.","woocommerce-payments"))}catch(t){e=t,yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error saving settings.","woocommerce-payments")),e.server_error&&(yield(0,k.dispatch)("core/notices").createErrorNotice(e.server_error))}finally{yield fo(!1,e)}return null===e}function ko(e){return po({payment_request_enabled_locations:[...e]})}function qo(e){return po({is_woopay_enabled:e})}function zo(e){return po({is_woopay_global_theme_support_enabled:e})}function Bo(e){return po({woopay_custom_message:e})}function $o(e){return po({woopay_store_logo:e})}function Ho(e){return po({woopay_enabled_locations:[...e]})}function Vo(e){return po({current_protection_level:e})}function Go(e){return po({advanced_fraud_protection_settings:e})}function Qo(e){return po({is_stripe_billing_enabled:e})}function*Wo(){try{yield(0,k.dispatch)(B).startResolution("scheduleStripeBillingMigration"),yield(0,q.apiFetch)({path:`${z}/settings/schedule-stripe-billing-migration`,method:"post"})}catch(e){yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error starting the Stripe Billing migration.","woocommerce-payments"))}yield(0,k.dispatch)(B).finishResolution("scheduleStripeBillingMigration")}function Zo(e,t){_o()({path:`${z}/settings/${e}`,method:"post",data:{value:t}}).catch((()=>{(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error saving option","woocommerce-payments"))}))}function*Ko(){const e=`${z}/settings`;try{const t=yield(0,q.apiFetch)({path:e});yield go(t)}catch(e){yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error retrieving settings.","woocommerce-payments"))}}const Jo={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"},Xo=(e,t)=>e.readers[t]&&e.readers[t].data?e.readers[t].data:{},ea=(e,t)=>e.readers[t]&&e.readers[t].error?e.readers[t].error:{},ta=e=>e.readers&&e.readers.list?e.readers.list:{};function ra(e,t){return{type:Jo.SET_CARD_READER_STATS,id:e,data:t}}function oa(e,t){return{type:Jo.SET_READERS,query:e,data:t}}function aa(e,t,r){return{type:Jo.SET_CARD_ERROR_FOR_READER_STATS,id:e,data:t,error:r}}function na(e,t){return{type:Jo.SET_CARD_ERROR_FOR_READERS,data:e,error:t}}function*sa(e,t){try{const r=yield(0,q.apiFetch)({path:`${z}/readers/charges/${t}`});yield ra(e,r)}catch(t){yield aa(e,null,t)}}function*ia(e){const t=(0,he.addQueryArgs)(`${z}/readers`,{limit:e.limit});try{const r=yield(0,q.apiFetch)({path:t})||{};yield oa(e,r)}catch(e){yield na(null,e)}}var ca;!function(e){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"}(ca||(ca={}));const da=ca,ua={},_a=e=>e&&e.capital||{},pa=e=>_a(e).summary,la=e=>_a(e).summaryError,ma=e=>_a(e).loans||[],ya=e=>_a(e).loansError;function ha(e){return{type:da.SET_ACTIVE_LOAN_SUMMARY,data:e}}function Sa(e){return{type:da.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY,error:e}}function Ea(e){return{type:da.SET_LOANS,data:e.data}}function ga(e){return{type:da.SET_ERROR_FOR_LOANS,error:e}}function*Ta(){const e=`${z}/capital/active_loan_summary`;try{const t=yield(0,q.apiFetch)({path:e});yield ha(t)}catch(e){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Sa(e)}}function*Ra(){const e=`${z}/capital/loans`;try{const t=yield(0,q.apiFetch)({path:e});yield Ea(t)}catch(e){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield ga(e)}}const wa={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"},fa={summary:{}},Oa=e=>e&&e.documents||{},va=(e,t)=>{const r=V(t);return Oa(e)[r]||{}},ba=(e,t)=>va(e,t).data||[],Aa=(e,t)=>va(e,t).error||{},Ia=(e,t)=>{const r=V(t);return Oa(e).summary[r]||{}},Na=(e,t)=>Ia(e,t).data||{},Ca=(e,t)=>Ia(e,t).error||{};function Da(e,t){return{type:wa.SET_DOCUMENTS,query:e,data:t}}function Fa(e,t,r){return{type:wa.SET_ERROR_FOR_DOCUMENTS,query:e,data:t,error:r}}function Ua(e,t){return{type:wa.SET_DOCUMENTS_SUMMARY,query:e,data:t}}function Ma(e,t,r){return{type:wa.SET_ERROR_FOR_DOCUMENTS_SUMMARY,query:e,data:t,error:r}}const Pa=e=>({user_email:e.userEmail,match:e.match,date_before:Re(e.dateBefore,!0),date_after:Re(e.dateAfter),date_between:e.dateBetween&&[Re(e.dateBetween[0]),Re(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot});function*La(e){const t=(0,he.addQueryArgs)(`${z}/documents`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Pa(e)});try{const r=yield(0,q.apiFetch)({path:t});yield Da(e,r.data||[])}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving documents.","woocommerce-payments")),yield Fa(e,null,t)}}function*xa(e){const t=(0,he.addQueryArgs)(`${z}/documents/summary`,Pa(e));try{const r=yield(0,q.apiFetch)({path:t});yield Ua(e,r)}catch(t){yield Ma(e,null,t)}}const ja={},Ya=({paymentIntents:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.data)||{}},ka=({paymentIntents:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.error)||{}},qa={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"},za={summary:{},byId:{},isRequesting:!1},Ba=e=>e&&e.authorizations||{},$a=(e,t)=>{const r=V(t);return Ba(e)[r]||{}},Ha=(e,t)=>$a(e,t).data||[],Va=(e,t)=>(Ba(e).byId||{})[t],Ga=(e,t)=>$a(e,t).error||{},Qa=(e,t)=>{const r=V(t);return Ba(e).summary[r]||{}},Wa=(e,t)=>Qa(e,t).data||{},Za=(e,t)=>Qa(e,t).error||{},Ka=e=>Ba(e).isRequesting,Ja=e=>{var t;const r={wcpay_missing_order:(0,se.__)("The order could not be found.","woocommerce-payments"),wcpay_refunded_order_uncapturable:(0,se.__)("Payment cannot be processed for partially or fully refunded orders.","woocommerce-payments"),wcpay_intent_order_mismatch:(0,se.__)("The payment cannot be processed due to a mismatch with order details.","woocommerce-payments"),wcpay_payment_uncapturable:(0,se.__)("This payment cannot be processed in its current state.","woocommerce-payments"),wcpay_capture_error:e=>{var t;return"amount_too_small"===(null===(t=e.data)||void 0===t?void 0:t.error_type)?(e=>{var t,r,o,a;if(!(null===(r=null===(t=e.data)||void 0===t?void 0:t.extra_details)||void 0===r?void 0:r.minimum_amount)||!(null===(a=null===(o=e.data)||void 0===o?void 0:o.extra_details)||void 0===a?void 0:a.minimum_amount_currency))return(0,se.__)("The payment amount is too small to be processed.","woocommerce-payments");const n=e.data.extra_details.minimum_amount_currency,s=le(e.data.extra_details.minimum_amount,n);return(0,se.sprintf)((0,se.__)("The minimum amount that can be processed is %1$s %2$s.","woocommerce-payments"),s,n.toUpperCase())})(e):(0,se.__)("The payment capture failed to complete.","woocommerce-payments")},wcpay_cancel_error:(0,se.__)("The payment cancellation failed to complete.","woocommerce-payments"),wcpay_server_error:(0,se.__)("An unexpected error occurred. Please try again later.","woocommerce-payments")},o=r[null!==(t=e.code)&&void 0!==t?t:""];return"function"==typeof o?o(e):null!=o?o:(0,se.__)("Unable to process the payment. Please try again later.","woocommerce-payments")};function Xa(e,t){return{type:qa.SET_AUTHORIZATIONS,data:t,query:e}}function en(e,t){return{type:qa.SET_ERROR_FOR_AUTHORIZATIONS,query:e,error:t}}function tn(e){return{type:qa.SET_AUTHORIZATION,data:e}}function rn(e,t){return{type:qa.SET_AUTHORIZATIONS_SUMMARY,data:t,query:e}}function on(e){return{type:qa.SET_IS_REQUESTING_AUTHORIZATION,data:e}}function*an(e,t){try{yield k.controls.dispatch(B,"startResolution","getAuthorization",[e]),yield k.controls.dispatch(B,"setIsRequestingAuthorization",!0);const r=yield(0,q.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 tn(o),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getAuthorizations"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getTimeline"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getTransactions"),yield k.controls.dispatch("core/notices","createSuccessNotice",(0,se.sprintf)((0,se.__)("Payment for order #%s captured successfully.","woocommerce-payments"),t))}catch(e){const r=(0,se.sprintf)((0,se.__)("There has been an error capturing the payment for order #%s.","woocommerce-payments"),t),o=Ja(e);yield k.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield k.controls.dispatch(B,"finishResolution","getAuthorization",[e]),yield k.controls.dispatch(B,"setIsRequestingAuthorization",!1)}}function*nn(e,t){try{yield k.controls.dispatch(B,"startResolution","getAuthorization",[e]),yield k.controls.dispatch(B,"setIsRequestingAuthorization",!0);const r=yield(0,q.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 tn(o),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getAuthorizations"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getAuthorizationsSummary"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactions"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getFraudOutcomeTransactionsSummary"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getTimeline"),yield k.controls.dispatch(B,"invalidateResolutionForStoreSelector","getPaymentIntent"),yield k.controls.dispatch("core/notices","createSuccessNotice",(0,se.sprintf)((0,se.__)("Payment for order #%s canceled successfully.","woocommerce-payments"),t))}catch(e){const r=(0,se.sprintf)((0,se.__)("There has been an error canceling the payment for order #%s.","woocommerce-payments"),t),o=Ja(e);yield k.controls.dispatch("core/notices","createErrorNotice",`${r} ${o}`)}finally{yield k.controls.dispatch(B,"finishResolution","getAuthorization",[e]),yield k.controls.dispatch(B,"setIsRequestingAuthorization",!1)}}function sn(e,t){return{type:qa.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY,query:e,error:t}}function*cn(e){var t;let{paged:r=1,per_page:o=25,orderby:a="created",order:n="asc"}=e;"capture_by"===a&&(a="created");const s=(0,he.addQueryArgs)(`${z}/authorizations`,{page:r,pagesize:o,sort:a,direction:n});try{const r=yield(0,q.apiFetch)({path:s});yield Xa(e,null!==(t=r.data)&&void 0!==t?t:[])}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield en(e,t)}}function*dn(e){try{if(e){const t=yield(0,q.apiFetch)({path:`${z}/authorizations/${e}`}),{is_captured:r,payment_intent_id:o,created:a}=t;yield tn({payment_intent_id:o,captured:r,created:a})}}catch(e){"authorization_missing"!==e.code&&(yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving authorization.","woocommerce-payments")))}}function*un(e){const t=(0,he.addQueryArgs)(`${z}/authorizations/summary`,{pagesize:e.per_page,sort:e.orderby,direction:e.order,page:e.paged});try{const r=yield(0,q.apiFetch)({path:t});yield rn(e,null!=r?r:[])}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield sn(e,t)}}var _n;!function(e){e.SET_FILE="SET_FILE",e.SET_ERROR_FOR_FILES="SET_ERROR_FOR_FILES"}(_n||(_n={}));const pn=_n,ln={},mn=({files:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.data)||{}},yn=({files:e},t)=>{const r=null==e?void 0:e[t];return(null==r?void 0:r.error)||{}};function hn(e,t){return{type:pn.SET_FILE,id:e,data:t}}function Sn(e,t){return{type:pn.SET_ERROR_FOR_FILES,id:e,error:t}}function*En(e){try{const t=yield(0,q.apiFetch)({path:`${z}/file/${e}/details`});yield hn(e,t)}catch(t){yield k.controls.dispatch("core/notices","createErrorNotice",(0,se.__)("Error retrieving file.","woocommerce-payments")),yield Sn(e,t)}}(0,k.registerStore)(B,{reducer:(0,k.combineReducers)({deposits:(e=G,{type:t,query:r={},data:o=[],error:a})=>{const n=V(r);switch(t){case H.SET_DEPOSIT:return{...e,byId:{...e.byId,[o.id]:o}};case H.SET_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,data:o}};case H.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,error:a}};case H.SET_DEPOSITS:return{...e,byId:{...e.byId,...(0,$.keyBy)(o,"id")},queries:{...e.queries,[n]:{data:(0,$.map)(o,"id")}}};case H.SET_DEPOSITS_COUNT:return{...e,count:o};case H.SET_ERROR_FOR_DEPOSIT_QUERY:return{...e,queries:{...e.queries,[n]:{error:a}}};case H.SET_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[n]:{data:o}}};case H.SET_ERROR_FOR_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[n]:{error:a}}};case H.SET_INSTANT_DEPOSIT:return{...e,instant:{...e.instant,data:o}}}return e},transactions:(e=ke,{type:t,query:r={},data:o=[],error:a,status:n})=>{const s=V(r);switch(t){case Ye.SET_TRANSACTIONS:return{...e,[s]:{data:o}};case Ye.SET_ERROR_FOR_TRANSACTIONS:return{...e,[s]:{error:a}};case Ye.SET_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}};case Ye.SET_ERROR_FOR_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[s]:{error:a}}};case Ye.SET_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[n]:{...e.fraudProtection?.[n]||{},[s]:{data:o}}}};case Ye.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[n]:{...e.fraudProtection?.[n]||{},[s]:{error:a}}}};case Ye.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[n]:{...e.fraudProtection?.[n]||{},summary:{...e.fraudProtection?.[n]?.summary||{},[s]:{data:o}}}}};case Ye.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[n]:{...e.fraudProtection?.[n]||{},summary:{...e.fraudProtection?.[n]?.summary||{},[s]:{error:a}}}}}}return e},charges:(e={},{type:t,id:r,data:o,error:a})=>{switch(t){case ht.SET_CHARGE:e={...e,[r]:{...e[r],data:o}};break;case ht.SET_ERROR_FOR_CHARGE:e={...e,[r]:{...e[r],error:a}}}return e},timeline:(e={},{type:t,id:r,data:o,error:a})=>{switch(t){case vt.SET_TIMELINE:e={...e,[r]:{data:o}};break;case vt.SET_ERROR_FOR_TIMELINE:e={...e,[r]:{...e[r],error:a}}}return e},disputes:(e=Ft,{type:t,query:r={},data:o=[],id:a,error:n})=>{const s=V(r);switch(t){case Dt.SET_DISPUTE:return{...e,byId:{...e.byId,[o.id]:o}};case Dt.SET_ERROR_FOR_DISPUTE:e={...e,byId:{...e.byId,[a]:{error:n}}};break;case Dt.SET_DISPUTES:return{...e,cached:{...e.cached,...(0,$.keyBy)(o,"dispute_id")},queries:{...e.queries,[s]:{data:(0,$.map)(o,"dispute_id")}}};case Dt.SET_DISPUTES_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:o}}}}return e},settings:(e=cr,{type:t,...r})=>{switch(t){case ir.SET_SETTINGS:return{...e,data:r.data,isDirty:!1};case ir.SET_SETTINGS_VALUES:return{...e,savingError:null,isDirty:!0,data:{...e.data,...r.payload}};case ir.SET_IS_SAVING_SETTINGS:return{...e,isDirty:!(!r.isSaving&&!r.error)&&e.isDirty,isSaving:r.isSaving,savingError:r.error};case ir.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 ir.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:a})=>{switch(t){case Jo.SET_CARD_READER_STATS:e={...e,[r]:{...e[r],data:o}};break;case Jo.SET_ERROR_FOR_CARD_READER_STATS:e={...e,[r]:{...e[r],error:a}};break;case Jo.SET_READERS:e={...e,list:o}}return e},capital:(e=ua,t)=>{switch(t.type){case da.SET_ACTIVE_LOAN_SUMMARY:return Object.assign(Object.assign({},e),{summary:t.data,summaryError:void 0});case da.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY:return Object.assign(Object.assign({},e),{summary:void 0,summaryError:t.error});case da.SET_LOANS:return Object.assign(Object.assign({},e),{loans:t.data,loansError:void 0});case da.SET_ERROR_FOR_LOANS:return Object.assign(Object.assign({},e),{loans:void 0,loansError:t.error})}return e},documents:(e=fa,{type:t,query:r={},data:o=[],error:a})=>{const n=V(r);switch(t){case wa.SET_DOCUMENTS:return{...e,[n]:{data:o}};case wa.SET_ERROR_FOR_DOCUMENTS:return{...e,[n]:{error:a}};case wa.SET_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[n]:{data:o}}};case wa.SET_ERROR_FOR_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[n]:{error:a}}}}return e},paymentIntents:(e=ja,t)=>{const{type:r,id:o}=t;switch(r){case kt.SET_PAYMENT_INTENT:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{data:t.data})});case kt.SET_ERROR_FOR_PAYMENT_INTENT:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{error:t.error})});default:return e}},authorizations:(e=za,t)=>{switch(t.type){case qa.SET_AUTHORIZATION:{const{data:r}=t;return Object.assign(Object.assign({},e),{byId:Object.assign(Object.assign({},e.byId),{[r.payment_intent_id]:Object.assign(Object.assign({},e.byId[r.payment_intent_id]),r)})})}case qa.SET_AUTHORIZATIONS:{const{data:r,query:o}=t;return Object.assign(Object.assign({},e),{[V(o)]:{data:r}})}case qa.SET_ERROR_FOR_AUTHORIZATIONS:{const{error:r,query:o}=t;return Object.assign(Object.assign({},e),{[V(o)]:{error:r}})}case qa.SET_AUTHORIZATIONS_SUMMARY:{const{data:r,query:o}=t;return Object.assign(Object.assign({},e),{summary:Object.assign(Object.assign({},e.summary),{[V(o)]:{data:r||{}}})})}case qa.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:{const{query:r,error:o}=t;return Object.assign(Object.assign({},e),{summary:Object.assign(Object.assign({},e.summary),{[V(r)]:{error:o||""}})})}case qa.SET_IS_REQUESTING_AUTHORIZATION:{const{data:r}=t;return Object.assign(Object.assign({},e),{isRequesting:r})}}return e},files:(e=ln,t)=>{const{type:r,id:o}=t;switch(r){case pn.SET_FILE:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{data:t.data})});case pn.SET_ERROR_FOR_FILES:return Object.assign(Object.assign({},e),{[o]:Object.assign(Object.assign({},e[o]),{error:t.error})});default:return e}}}),actions:{...t,...n,...c,..._,...h,...g,...w,...v,...I,...m,...F,...P},controls:q.controls,selectors:{...e,...a,...i,...u,...l,...E,...R,...O,...A,...C,...D,...M},resolvers:{...o,...s,...d,...p,...S,...T,...f,...b,...N,...y,...U,...L}});const gn="/wc/v3/payments",Tn="wc/payments/multi-currency",Rn={SET_CURRENCIES:"SET_CURRENCIES",SET_AVAILABLE_CURRENCIES:"SET_AVAILABLE_CURRENCIES",SET_ENABLED_CURRENCIES:"SET_ENABLED_CURRENCIES",SET_DEFAULT_CURRENCY:"SET_DEFAULT_CURRENCY",SET_CURRENCY_SETTINGS:"SET_CURRENCY_SETTINGS",SET_STORE_SETTINGS:"SET_STORE_SETTINGS"},wn={},fn=e=>e&&e||{},On=e=>fn(e).currencies||{},vn=e=>On(e).available||{},bn=e=>On(e).enabled||{},An=e=>On(e).default||{},In=e=>fn(e).currency_settings||{},Nn=e=>fn(e).settings||{};function Cn(e){return{type:Rn.SET_CURRENCIES,data:e}}function Dn(e){return{type:Rn.SET_AVAILABLE_CURRENCIES,data:e}}function Fn(e){return{type:Rn.SET_ENABLED_CURRENCIES,data:e}}function Un(e){return{type:Rn.SET_DEFAULT_CURRENCY,data:e}}function Mn(e,t){return{type:Rn.SET_CURRENCY_SETTINGS,data:{code:e,data:t}}}function Pn(e){return{type:Rn.SET_STORE_SETTINGS,data:e}}function*Ln(e){const t=Object.keys((0,k.select)(Tn).getEnabledCurrencies()),r=e.filter((e=>!t.includes(e))),o=t.filter((t=>!e.includes(t)));try{const t=yield(0,q.apiFetch)({path:`${gn}/multi-currency/update-enabled-currencies`,method:"POST",data:{enabled:e}});yield Cn(t),yield(0,k.dispatch)("core/notices").createSuccessNotice((0,se.__)("Enabled currencies updated.","woocommerce-payments")),de("wcpay_multi_currency_enabled_currencies_updated",{added_currencies:r,removed_currencies:o})}catch(e){yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error updating enabled currencies.","woocommerce-payments"))}}function*xn(e,t){try{const r=yield(0,q.apiFetch)({path:`${gn}/multi-currency/currencies/${e}`,method:"POST",data:t});yield Mn(e,r),yield(0,k.dispatch)("core/notices").createSuccessNotice((0,se.__)("Currency settings updated.","woocommerce-payments"))}catch(e){yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error updating currency settings.","woocommerce-payments"))}}function*jn(e,t,r=!1){try{const o=yield(0,q.apiFetch)({path:`${gn}/multi-currency/update-settings`,method:"POST",data:{wcpay_multi_currency_enable_auto_currency:e?"yes":"no",wcpay_multi_currency_enable_storefront_switcher:t?"yes":"no"}});if(yield Pn(o),r)return;yield(0,k.dispatch)("core/notices").createSuccessNotice((0,se.__)("Store settings saved.","woocommerce-payments"))}catch(e){yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error saving store settings.","woocommerce-payments"))}}function Yn(e,t){_o()({path:`${gn}/settings/${e}`,method:"post",data:{value:t}}).catch((()=>{(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error saving option","woocommerce-payments"))}))}function*kn(){const e=`${gn}/multi-currency/currencies`;try{const t=yield(0,q.apiFetch)({path:e});yield Cn(t)}catch(e){yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error retrieving currencies.","woocommerce-payments"))}}function*qn(e){const t=`${gn}/multi-currency/currencies/${e}`;try{const r=yield(0,q.apiFetch)({path:t});yield Mn(e,r)}catch(e){yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error retrieving single currency settings.","woocommerce-payments"))}}function*zn(){const e=`${gn}/multi-currency/get-settings`;try{const t=yield(0,q.apiFetch)({path:e});yield Pn(t)}catch(e){yield(0,k.dispatch)("core/notices").createErrorNotice((0,se.__)("Error retrieving store settings.","woocommerce-payments"))}}(0,k.registerStore)(Tn,{reducer:(e=wn,{type:t,data:r=[]})=>{switch(t){case Rn.SET_CURRENCIES:return{...e,currencies:r,available:r.available,enabled:r.enabled,default:r.default};case Rn.SET_AVAILABLE_CURRENCIES:return{...e,currencies:{...e,available:r.available},available:r.available};case Rn.SET_ENABLED_CURRENCIES:return{...e,currencies:{...e,enabled:r.enabled},enabled:r.enabled};case Rn.SET_DEFAULT_CURRENCY:return{...e,currencies:{...e,default:r.default},default:r.default};case Rn.SET_CURRENCY_SETTINGS:return{...e,currency_settings:{...e.currency_settings,[r.code]:r.data}};case Rn.SET_STORE_SETTINGS:return{...e,settings:{enable_auto_currency:r.wcpay_multi_currency_enable_auto_currency,enable_storefront_switcher:r.wcpay_multi_currency_enable_storefront_switcher,site_theme:r.site_theme,date_format:r.date_format,time_format:r.time_format,store_url:r.store_url}}}return e},actions:{...j},controls:q.controls,selectors:{...x},resolvers:{...Y}});const Bn=window.wp.components,$n=window.wp.blocks,Hn=window.wp.blockEditor;var Vn=r(4848);(0,$n.registerBlockType)("woocommerce-payments/multi-currency-switcher",{apiVersion:3,title:(0,se.__)("Currency Switcher Block","woocommerce-payments"),description:(0,se.__)("Let your customers switch between your enabled currencies","woocommerce-payments"),icon:(0,Vn.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",baseProfile:"tiny-ps",viewBox:"0 0 24 24",children:[(0,Vn.jsx)("path",{d:"M13.5 8.1h.86c.34 1.81 1.54 2.9 3.2 2.9 1.58 0 2.64-.89 2.94-2.29h-1.11c-.23.72-.86 1.21-1.82 1.21-1 0-1.77-.67-2.06-1.82h2.78v-.65H15.4L15.38 7l.02-.46h2.89v-.65h-2.78c.3-1.13 1.06-1.81 2.05-1.81.94 0 1.63.59 1.84 1.38h1.1A2.86 2.86 0 0017.56 3c-1.65 0-2.85 1.09-3.19 2.89h-.87v.65h.78l-.02.46.02.45h-.78v.65zm-9 8.57v.78h1.8c.07.24.12.49.12.73 0 .87-.79 1.64-1.9 1.84V21h6.98v-1.01H6.57v-.07c.7-.33 1.25-.95 1.25-1.79 0-.23-.04-.45-.1-.68h2.72v-.78H7.43a3.6 3.6 0 01-.35-1.33c0-.83.77-1.33 2.12-1.33.74 0 1.51.13 1.85.29v-1.01A5.9 5.9 0 009.06 13c-2.15 0-3.44.87-3.44 2.28 0 .48.18.94.37 1.39H4.5z",className:"prefix__shp0"}),(0,Vn.jsx)("path",{fillRule:"evenodd",d:"M7.63 10.22c-1.72-.09-3.08-.75-3.13-1.85h1.41c.13.54.64.93 1.72 1.01V7.37l-.26-.05c-1.73-.27-2.66-.8-2.66-1.73 0-1.04 1.22-1.72 2.92-1.8V3h.8v.79c1.69.09 2.91.78 2.96 1.82H9.98c-.08-.57-.69-.91-1.55-.99v1.93l.31.05c1.79.28 2.76.78 2.76 1.77 0 1.13-1.35 1.77-3.07 1.85V11h-.8v-.78zm0-3.8v-1.8c-.98.08-1.48.47-1.48.89 0 .42.4.73 1.48.91zm.8 1.07v1.9c1.15-.07 1.64-.44 1.64-.93 0-.48-.39-.76-1.64-.97z",className:"prefix__shp0"}),(0,Vn.jsx)("path",{d:"M17.63 21v-1.61h1.97v-.67h-1.97v-.87h1.97v-.67h-1.63L20.5 13h-1.4l-2.07 3.63h-.05L14.92 13H13.5l2.53 4.18H14.4v.67h1.97v.87H14.4v.67h1.97V21h1.26z",opacity:.8})]}),category:"widgets",attributes:{symbol:{type:"boolean",default:!0},flag:{type:"boolean",default:!1},fontSize:{type:"integer",default:14},fontLineHeight:{type:"float",default:1.5},fontColor:{type:"string",default:"#000000"},border:{type:"boolean",default:!0},borderRadius:{type:"integer",default:3},borderColor:{type:"string",default:"#000000"},backgroundColor:{type:"string",default:"transparent"}},edit:e=>{const{attributes:{symbol:t,flag:r,fontSize:o,fontLineHeight:a,fontColor:n,border:s,borderRadius:i,borderColor:c,backgroundColor:d},setAttributes:u}=e,{isLoading:_}=(0,k.useSelect)((e=>{const{getCurrencies:t,isResolving:r}=e(Tn);return{currencies:t(),isLoading:r("getCurrencies",[])}}),[]),{enabledCurrencies:p}=(()=>{const e=(0,k.useSelect)((e=>{const{getEnabledCurrencies:t}=e(Tn);return t()})),{submitEnabledCurrenciesUpdate:t}=(0,k.useDispatch)(Tn);return{enabledCurrencies:e,submitEnabledCurrenciesUpdate:t}})(),l=p?Object.keys(p):[],m={div:{lineHeight:a},select:{fontSize:o,color:n,backgroundColor:d,borderWidth:s?"1px":"0px",borderColor:c,borderRadius:i}},y=(0,Hn.useBlockProps)(),h=!window._wpemojiSettings||window._wpemojiSettings.supports?.flag;return(0,Vn.jsxs)("div",{...y,children:[(0,Vn.jsxs)(Hn.InspectorControls,{children:[(0,Vn.jsx)(Bn.PanelBody,{title:(0,se.__)("Multi-Currency settings","woocommerce-payments"),children:(0,Vn.jsx)(Bn.ExternalLink,{href:"/wp-admin/admin.php?page=wc-settings&tab=wcpay_multi_currency",children:(0,se.__)("Adjust and edit your Multi-Currency settings","woocommerce-payments")})}),(0,Vn.jsxs)(Bn.PanelBody,{title:(0,se.__)("Layout","woocommerce-payments"),children:[(0,Vn.jsx)(Bn.CheckboxControl,{label:(0,se.__)("Display flags","woocommerce-payments"),checked:r,onChange:e=>{u({flag:e})},__nextHasNoMarginBottom:!0}),(0,Vn.jsx)(Bn.CheckboxControl,{label:(0,se.__)("Display currency symbols","woocommerce-payments"),checked:t,onChange:e=>{u({symbol:e})},__nextHasNoMarginBottom:!0}),(0,Vn.jsx)(Bn.CheckboxControl,{label:(0,se.__)("Border","woocommerce-payments"),checked:s,onChange:e=>{u({border:void 0!==e&&e})},__nextHasNoMarginBottom:!0}),(0,Vn.jsx)(Bn.RangeControl,{label:(0,se.__)("Border radius","woocommerce-payments"),value:i,onChange:e=>{u({borderRadius:void 0===e?3:e})},min:1,max:20,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]}),(0,Vn.jsxs)(Bn.PanelBody,{title:(0,se.__)("Typography","woocommerce-payments"),children:[(0,Vn.jsx)(Bn.RangeControl,{label:(0,se.__)("Size","woocommerce-payments"),value:o,onChange:e=>{u({fontSize:void 0===e?11:e})},min:6,max:48,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,Vn.jsx)(Bn.RangeControl,{label:(0,se.__)("Line height","woocommerce-payments"),value:a,onChange:e=>{u({fontLineHeight:void 0===e?"normal":e})},min:1,max:3,step:.1,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]}),(0,Vn.jsxs)(Bn.PanelBody,{title:(0,se.__)("Color settings","woocommerce-payments"),children:[(0,Vn.jsx)(Hn.ColorPaletteControl,{onChange:e=>{u({fontColor:void 0===e?"#000000":e})},value:n,label:(0,se.__)("Text","woocommerce-payments")}),(0,Vn.jsx)(Hn.ColorPaletteControl,{onChange:e=>{u({backgroundColor:void 0===e?"transparent":e})},value:d,label:(0,se.__)("Background","woocommerce-payments")}),(0,Vn.jsx)(Hn.ColorPaletteControl,{onChange:e=>{u({borderColor:void 0===e?"#000000":e})},value:c,label:(0,se.__)("Border","woocommerce-payments")})]})]},"setting"),(0,Vn.jsx)("div",{className:"currency-switcher-holder",style:m.div,children:(0,Vn.jsxs)("select",{name:"currency",disabled:_,style:m.select,children:[_&&(0,Vn.jsx)("option",{children:(0,se.__)("Loading…","woocommerce-payments")}),!_&&p&&l.map((e=>(0,Vn.jsxs)("option",{value:p[e].code,children:[h&&r?p[e].flag+" ":"",t&&p[e].symbol!==p[e].code?p[e].symbol+" ":"",p[e].code]},p[e].id)))]})})]})},save:()=>null})})()})();
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0.01 |
proxy
|
phpinfo
|
Настройка