Files
krolewskie-miody.pl/wp-content/plugins/woocommerce-payments/dist/wc-payments-settings-spotlight.js
2026-04-28 15:13:50 +02:00

2 lines
102 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 wc-payments-settings-spotlight.js.LICENSE.txt */
(()=>{var e={2838:function(e){e.exports=function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,r){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,r)}function r(e,o,n){return r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,r,o){var n=[null];n.push.apply(n,r);var a=new(Function.bind.apply(e,n));return o&&t(a,o.prototype),a},r.apply(null,arguments)}function o(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var a=Object.hasOwnProperty,i=Object.setPrototypeOf,s=Object.isFrozen,c=Object.getPrototypeOf,u=Object.getOwnPropertyDescriptor,d=Object.freeze,l=Object.seal,p=Object.create,m="undefined"!=typeof Reflect&&Reflect,_=m.apply,y=m.construct;_||(_=function(e,t,r){return e.apply(t,r)}),d||(d=function(e){return e}),l||(l=function(e){return e}),y||(y=function(e,t){return r(e,o(t))});var h,f=I(Array.prototype.forEach),E=I(Array.prototype.pop),S=I(Array.prototype.push),g=I(String.prototype.toLowerCase),T=I(String.prototype.toString),w=I(String.prototype.match),R=I(String.prototype.replace),v=I(String.prototype.indexOf),O=I(String.prototype.trim),b=I(RegExp.prototype.test),A=(h=TypeError,function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return y(h,t)});function I(e){return function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),n=1;n<r;n++)o[n-1]=arguments[n];return _(e,t,o)}}function N(e,t,r){var o;r=null!==(o=r)&&void 0!==o?o:g,i&&i(e,null);for(var n=t.length;n--;){var a=t[n];if("string"==typeof a){var c=r(a);c!==a&&(s(t)||(t[n]=c),a=c)}e[a]=!0}return e}function D(e){var t,r=p(null);for(t in e)!0===_(a,e,[t])&&(r[t]=e[t]);return r}function M(e,t){for(;null!==e;){var r=u(e,t);if(r){if(r.get)return I(r.get);if("function"==typeof r.value)return I(r.value)}e=c(e)}return function(e){return console.warn("fallback value for",e),null}}var C=d(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),P=d(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),F=d(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),U=d(["animate","color-profile","cursor","discard","fedropshadow","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),x=d(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover"]),k=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),L=d(["#text"]),z=d(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),j=d(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),B=d(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),H=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Y=l(/\{\{[\w\W]*|[\w\W]*\}\}/gm),q=l(/<%[\w\W]*|[\w\W]*%>/gm),$=l(/\${[\w\W]*}/gm),W=l(/^data-[\-\w.\u00B7-\uFFFF]/),G=l(/^aria-[\-\w]+$/),V=l(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Q=l(/^(?:\w+script|data):/i),Z=l(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=l(/^html$/i),X=l(/^[a-z][.\w]*(-[.\w]+)+$/i),J=function(){return"undefined"==typeof window?null:window};return function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:J(),n=function(e){return t(e)};if(n.version="2.5.6",n.removed=[],!r||!r.document||9!==r.document.nodeType)return n.isSupported=!1,n;var a=r.document,i=r.document,s=r.DocumentFragment,c=r.HTMLTemplateElement,u=r.Node,l=r.Element,p=r.NodeFilter,m=r.NamedNodeMap,_=void 0===m?r.NamedNodeMap||r.MozNamedAttrMap:m,y=r.HTMLFormElement,h=r.DOMParser,I=r.trustedTypes,ee=l.prototype,te=M(ee,"cloneNode"),re=M(ee,"nextSibling"),oe=M(ee,"childNodes"),ne=M(ee,"parentNode");if("function"==typeof c){var ae=i.createElement("template");ae.content&&ae.content.ownerDocument&&(i=ae.content.ownerDocument)}var ie=function(t,r){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var o=null,n="data-tt-policy-suffix";r.currentScript&&r.currentScript.hasAttribute(n)&&(o=r.currentScript.getAttribute(n));var a="dompurify"+(o?"#"+o:"");try{return t.createPolicy(a,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+a+" could not be created."),null}}(I,a),se=ie?ie.createHTML(""):"",ce=i,ue=ce.implementation,de=ce.createNodeIterator,le=ce.createDocumentFragment,pe=ce.getElementsByTagName,me=a.importNode,_e={};try{_e=D(i).documentMode?i.documentMode:{}}catch(e){}var ye={};n.isSupported="function"==typeof ne&&ue&&void 0!==ue.createHTMLDocument&&9!==_e;var he,fe,Ee=Y,Se=q,ge=$,Te=W,we=G,Re=Q,ve=Z,Oe=X,be=V,Ae=null,Ie=N({},[].concat(o(C),o(P),o(F),o(x),o(L))),Ne=null,De=N({},[].concat(o(z),o(j),o(B),o(H))),Me=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,Pe=null,Fe=!0,Ue=!0,xe=!1,ke=!0,Le=!1,ze=!0,je=!1,Be=!1,He=!1,Ye=!1,qe=!1,$e=!1,We=!0,Ge=!1,Ve=!0,Qe=!1,Ze={},Ke=null,Xe=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),Je=null,et=N({},["audio","video","img","source","image","track"]),tt=null,rt=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ot="http://www.w3.org/1998/Math/MathML",nt="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",it=at,st=!1,ct=null,ut=N({},[ot,nt,at],T),dt=["application/xhtml+xml","text/html"],lt=null,pt=i.createElement("form"),mt=function(e){return e instanceof RegExp||e instanceof Function},_t=function(t){lt&&lt===t||(t&&"object"===e(t)||(t={}),t=D(t),he=he=-1===dt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,fe="application/xhtml+xml"===he?T:g,Ae="ALLOWED_TAGS"in t?N({},t.ALLOWED_TAGS,fe):Ie,Ne="ALLOWED_ATTR"in t?N({},t.ALLOWED_ATTR,fe):De,ct="ALLOWED_NAMESPACES"in t?N({},t.ALLOWED_NAMESPACES,T):ut,tt="ADD_URI_SAFE_ATTR"in t?N(D(rt),t.ADD_URI_SAFE_ATTR,fe):rt,Je="ADD_DATA_URI_TAGS"in t?N(D(et),t.ADD_DATA_URI_TAGS,fe):et,Ke="FORBID_CONTENTS"in t?N({},t.FORBID_CONTENTS,fe):Xe,Ce="FORBID_TAGS"in t?N({},t.FORBID_TAGS,fe):{},Pe="FORBID_ATTR"in t?N({},t.FORBID_ATTR,fe):{},Ze="USE_PROFILES"in t&&t.USE_PROFILES,Fe=!1!==t.ALLOW_ARIA_ATTR,Ue=!1!==t.ALLOW_DATA_ATTR,xe=t.ALLOW_UNKNOWN_PROTOCOLS||!1,ke=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Le=t.SAFE_FOR_TEMPLATES||!1,ze=!1!==t.SAFE_FOR_XML,je=t.WHOLE_DOCUMENT||!1,Ye=t.RETURN_DOM||!1,qe=t.RETURN_DOM_FRAGMENT||!1,$e=t.RETURN_TRUSTED_TYPE||!1,He=t.FORCE_BODY||!1,We=!1!==t.SANITIZE_DOM,Ge=t.SANITIZE_NAMED_PROPS||!1,Ve=!1!==t.KEEP_CONTENT,Qe=t.IN_PLACE||!1,be=t.ALLOWED_URI_REGEXP||be,it=t.NAMESPACE||at,Me=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&mt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Me.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&mt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Me.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Me.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Ue=!1),qe&&(Ye=!0),Ze&&(Ae=N({},o(L)),Ne=[],!0===Ze.html&&(N(Ae,C),N(Ne,z)),!0===Ze.svg&&(N(Ae,P),N(Ne,j),N(Ne,H)),!0===Ze.svgFilters&&(N(Ae,F),N(Ne,j),N(Ne,H)),!0===Ze.mathMl&&(N(Ae,x),N(Ne,B),N(Ne,H))),t.ADD_TAGS&&(Ae===Ie&&(Ae=D(Ae)),N(Ae,t.ADD_TAGS,fe)),t.ADD_ATTR&&(Ne===De&&(Ne=D(Ne)),N(Ne,t.ADD_ATTR,fe)),t.ADD_URI_SAFE_ATTR&&N(tt,t.ADD_URI_SAFE_ATTR,fe),t.FORBID_CONTENTS&&(Ke===Xe&&(Ke=D(Ke)),N(Ke,t.FORBID_CONTENTS,fe)),Ve&&(Ae["#text"]=!0),je&&N(Ae,["html","head","body"]),Ae.table&&(N(Ae,["tbody"]),delete Ce.tbody),d&&d(t),lt=t)},yt=N({},["mi","mo","mn","ms","mtext"]),ht=N({},["foreignobject","annotation-xml"]),ft=N({},["title","style","font","a","script"]),Et=N({},P);N(Et,F),N(Et,U);var St=N({},x);N(St,k);var gt=function(e){S(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=se}catch(t){e.remove()}}},Tt=function(e,t){try{S(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){S(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ne[e])if(Ye||qe)try{gt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},wt=function(e){var t,r;if(He)e="<remove></remove>"+e;else{var o=w(e,/^[\r\n\t ]+/);r=o&&o[0]}"application/xhtml+xml"===he&&it===at&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var n=ie?ie.createHTML(e):e;if(it===at)try{t=(new h).parseFromString(n,he)}catch(e){}if(!t||!t.documentElement){t=ue.createDocument(it,"template",null);try{t.documentElement.innerHTML=st?se:n}catch(e){}}var a=t.body||t.documentElement;return e&&r&&a.insertBefore(i.createTextNode(r),a.childNodes[0]||null),it===at?pe.call(t,je?"html":"body")[0]:je?t.documentElement:a},Rt=function(e){return de.call(e.ownerDocument||e,e,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null,!1)},vt=function(e){return e instanceof y&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof _)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},Ot=function(t){return"object"===e(u)?t instanceof u:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},bt=function(e,t,r){ye[e]&&f(ye[e],(function(e){e.call(n,t,r,lt)}))},At=function(e){var t;if(bt("beforeSanitizeElements",e,null),vt(e))return gt(e),!0;if(b(/[\u0080-\uFFFF]/,e.nodeName))return gt(e),!0;var r=fe(e.nodeName);if(bt("uponSanitizeElement",e,{tagName:r,allowedTags:Ae}),e.hasChildNodes()&&!Ot(e.firstElementChild)&&(!Ot(e.content)||!Ot(e.content.firstElementChild))&&b(/<[/\w]/g,e.innerHTML)&&b(/<[/\w]/g,e.textContent))return gt(e),!0;if("select"===r&&b(/<template/i,e.innerHTML))return gt(e),!0;if(7===e.nodeType)return gt(e),!0;if(ze&&8===e.nodeType&&b(/<[/\w]/g,e.data))return gt(e),!0;if(!Ae[r]||Ce[r]){if(!Ce[r]&&Nt(r)){if(Me.tagNameCheck instanceof RegExp&&b(Me.tagNameCheck,r))return!1;if(Me.tagNameCheck instanceof Function&&Me.tagNameCheck(r))return!1}if(Ve&&!Ke[r]){var o=ne(e)||e.parentNode,a=oe(e)||e.childNodes;if(a&&o)for(var i=a.length-1;i>=0;--i){var s=te(a[i],!0);s.__removalCount=(e.__removalCount||0)+1,o.insertBefore(s,re(e))}}return gt(e),!0}return e instanceof l&&!function(e){var t=ne(e);t&&t.tagName||(t={namespaceURI:it,tagName:"template"});var r=g(e.tagName),o=g(t.tagName);return!!ct[e.namespaceURI]&&(e.namespaceURI===nt?t.namespaceURI===at?"svg"===r:t.namespaceURI===ot?"svg"===r&&("annotation-xml"===o||yt[o]):Boolean(Et[r]):e.namespaceURI===ot?t.namespaceURI===at?"math"===r:t.namespaceURI===nt?"math"===r&&ht[o]:Boolean(St[r]):e.namespaceURI===at?!(t.namespaceURI===nt&&!ht[o])&&!(t.namespaceURI===ot&&!yt[o])&&!St[r]&&(ft[r]||!Et[r]):!("application/xhtml+xml"!==he||!ct[e.namespaceURI]))}(e)?(gt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!b(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,t=R(t,Ee," "),t=R(t,Se," "),t=R(t,ge," "),e.textContent!==t&&(S(n.removed,{element:e.cloneNode()}),e.textContent=t)),bt("afterSanitizeElements",e,null),!1):(gt(e),!0)},It=function(e,t,r){if(We&&("id"===t||"name"===t)&&(r in i||r in pt))return!1;if(Ue&&!Pe[t]&&b(Te,t));else if(Fe&&b(we,t));else if(!Ne[t]||Pe[t]){if(!(Nt(e)&&(Me.tagNameCheck instanceof RegExp&&b(Me.tagNameCheck,e)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(e))&&(Me.attributeNameCheck instanceof RegExp&&b(Me.attributeNameCheck,t)||Me.attributeNameCheck instanceof Function&&Me.attributeNameCheck(t))||"is"===t&&Me.allowCustomizedBuiltInElements&&(Me.tagNameCheck instanceof RegExp&&b(Me.tagNameCheck,r)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(r))))return!1}else if(tt[t]);else if(b(be,R(r,ve,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==v(r,"data:")||!Je[e])if(xe&&!b(Re,R(r,ve,"")));else if(r)return!1;return!0},Nt=function(e){return"annotation-xml"!==e&&w(e,Oe)},Dt=function(t){var r,o,a,i;bt("beforeSanitizeAttributes",t,null);var s=t.attributes;if(s){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne};for(i=s.length;i--;){var u=r=s[i],d=u.name,l=u.namespaceURI;if(o="value"===d?r.value:O(r.value),a=fe(d),c.attrName=a,c.attrValue=o,c.keepAttr=!0,c.forceKeepAttr=void 0,bt("uponSanitizeAttribute",t,c),o=c.attrValue,ze&&b(/((--!?|])>)|<\/(style|title)/i,o))Tt(d,t);else if(!c.forceKeepAttr&&(Tt(d,t),c.keepAttr))if(ke||!b(/\/>/i,o)){Le&&(o=R(o,Ee," "),o=R(o,Se," "),o=R(o,ge," "));var p=fe(t.nodeName);if(It(p,a,o)){if(!Ge||"id"!==a&&"name"!==a||(Tt(d,t),o="user-content-"+o),ie&&"object"===e(I)&&"function"==typeof I.getAttributeType)if(l);else switch(I.getAttributeType(p,a)){case"TrustedHTML":o=ie.createHTML(o);break;case"TrustedScriptURL":o=ie.createScriptURL(o)}try{l?t.setAttributeNS(l,d,o):t.setAttribute(d,o),vt(t)?gt(t):E(n.removed)}catch(e){}}}else Tt(d,t)}bt("afterSanitizeAttributes",t,null)}},Mt=function e(t){var r,o=Rt(t);for(bt("beforeSanitizeShadowDOM",t,null);r=o.nextNode();)bt("uponSanitizeShadowNode",r,null),At(r)||(r.content instanceof s&&e(r.content),Dt(r));bt("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(t){var o,i,c,d,l,p=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((st=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!Ot(t)){if("function"!=typeof t.toString)throw A("toString is not a function");if("string"!=typeof(t=t.toString()))throw A("dirty is not a string, aborting")}if(!n.isSupported){if("object"===e(r.toStaticHTML)||"function"==typeof r.toStaticHTML){if("string"==typeof t)return r.toStaticHTML(t);if(Ot(t))return r.toStaticHTML(t.outerHTML)}return t}if(Be||_t(p),n.removed=[],"string"==typeof t&&(Qe=!1),Qe){if(t.nodeName){var m=fe(t.nodeName);if(!Ae[m]||Ce[m])throw A("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof u)1===(i=(o=wt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i);else{if(!Ye&&!Le&&!je&&-1===t.indexOf("<"))return ie&&$e?ie.createHTML(t):t;if(!(o=wt(t)))return Ye?null:$e?se:""}o&&He&&gt(o.firstChild);for(var _=Rt(Qe?t:o);c=_.nextNode();)3===c.nodeType&&c===d||At(c)||(c.content instanceof s&&Mt(c.content),Dt(c),d=c);if(d=null,Qe)return t;if(Ye){if(qe)for(l=le.call(o.ownerDocument);o.firstChild;)l.appendChild(o.firstChild);else l=o;return(Ne.shadowroot||Ne.shadowrootmod)&&(l=me.call(a,l,!0)),l}var y=je?o.outerHTML:o.innerHTML;return je&&Ae["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&b(K,o.ownerDocument.doctype.name)&&(y="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+y),Le&&(y=R(y,Ee," "),y=R(y,Se," "),y=R(y,ge," ")),ie&&$e?ie.createHTML(y):y},n.setConfig=function(e){_t(e),Be=!0},n.clearConfig=function(){lt=null,Be=!1},n.isValidAttribute=function(e,t,r){lt||_t({});var o=fe(e),n=fe(t);return It(o,n,r)},n.addHook=function(e,t){"function"==typeof t&&(ye[e]=ye[e]||[],S(ye[e],t))},n.removeHook=function(e){if(ye[e])return E(ye[e])},n.removeHooks=function(e){ye[e]&&(ye[e]=[])},n.removeAllHooks=function(){ye={}},n}()}()},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"),i=Object.prototype.hasOwnProperty,s=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)i.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:s.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].call(a.exports,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:()=>Se,getAllDepositsOverviewsError:()=>ge,getDeposit:()=>Ee,getDepositQueryError:()=>ve,getDeposits:()=>we,getDepositsCount:()=>Re,getDepositsSummary:()=>be,getDepositsSummaryError:()=>Ae,getInstantDeposit:()=>Ie});var t={};r.r(t),r.d(t,{submitInstantDeposit:()=>Xe,updateAllDepositsOverviews:()=>qe,updateDeposit:()=>Ye,updateDeposits:()=>We,updateDepositsCount:()=>Ge,updateDepositsSummary:()=>Qe,updateErrorForAllDepositsOverviews:()=>$e,updateErrorForDepositQuery:()=>Ve,updateErrorForDepositsSummary:()=>Ze,updateInstantDeposit:()=>Ke});var o={};r.r(o),r.d(o,{getAllDepositsOverviews:()=>et,getDeposit:()=>Je,getDeposits:()=>nt,getDepositsSummary:()=>at,getPayoutsCSVRequestURL:()=>ot,payoutsDownloadEndpoint:()=>rt});var n={};r.r(n),r.d(n,{getFraudOutcomeTransactions:()=>ht,getFraudOutcomeTransactionsError:()=>ft,getFraudOutcomeTransactionsSummary:()=>St,getFraudOutcomeTransactionsSummaryError:()=>gt,getTransactions:()=>dt,getTransactionsError:()=>lt,getTransactionsSummary:()=>mt,getTransactionsSummaryError:()=>_t});var a={};r.r(a),r.d(a,{updateErrorForFraudOutcomeTransactions:()=>bt,updateErrorForFraudOutcomeTransactionsSummary:()=>It,updateErrorForTransactions:()=>wt,updateErrorForTransactionsSummary:()=>vt,updateFraudOutcomeTransactions:()=>Ot,updateFraudOutcomeTransactionsSummary:()=>At,updateTransactions:()=>Tt,updateTransactionsSummary:()=>Rt});var i={};r.r(i),r.d(i,{formatQueryFilters:()=>Nt,getFraudOutcomeTransactions:()=>Ft,getFraudOutcomeTransactionsExport:()=>xt,getFraudOutcomeTransactionsSummary:()=>Ut,getTransactions:()=>Dt,getTransactionsCSVRequestURL:()=>Ct,getTransactionsSummary:()=>Pt,transactionsDownloadEndpoint:()=>Mt});var s={};r.r(s),r.d(s,{getCharge:()=>Lt,getChargeError:()=>zt,getChargeFromOrder:()=>jt,getChargeFromOrderError:()=>Bt});var c={};r.r(c),r.d(c,{updateCharge:()=>Ht,updateErrorForCharge:()=>Yt});var u={};r.r(u),r.d(u,{getCharge:()=>qt,getChargeFromOrder:()=>$t});var d={};r.r(d),r.d(d,{getTimeline:()=>Gt,getTimelineError:()=>Vt});var l={};r.r(l),r.d(l,{updateErrorForTimeline:()=>Zt,updateTimeline:()=>Qt});var p={};r.r(p),r.d(p,{getTimeline:()=>Kt});var m={};r.r(m),r.d(m,{getCachedDispute:()=>or,getDispute:()=>tr,getDisputeError:()=>rr,getDisputes:()=>nr,getDisputesSummary:()=>ar});var _={};r.r(_),r.d(_,{refundCharge:()=>dr,updateErrorForPaymentIntent:()=>ur,updatePaymentIntent:()=>cr});var y={};r.r(y),r.d(y,{getPaymentIntent:()=>lr});var h={};r.r(h),r.d(h,{acceptDispute:()=>hr,updateDispute:()=>pr,updateDisputes:()=>_r,updateDisputesSummary:()=>yr,updateErrorForDispute:()=>mr});var f={};r.r(f),r.d(f,{disputesDownloadEndpoint:()=>Rr,getDispute:()=>Or,getDisputes:()=>br,getDisputesCSVRequestURL:()=>vr,getDisputesSummary:()=>Ar});var E={};r.r(E),r.d(E,{getAccountBusinessSupportEmail:()=>qr,getAccountBusinessSupportPhone:()=>$r,getAccountCommunicationsEmail:()=>Do,getAccountDomesticCurrency:()=>Wr,getAccountStatementDescriptor:()=>Br,getAccountStatementDescriptorKana:()=>Yr,getAccountStatementDescriptorKanji:()=>Hr,getAdvancedFraudProtectionSettings:()=>vo,getAvailablePaymentMethodIds:()=>kr,getCompletedWaitingPeriod:()=>Kr,getCurrentProtectionLevel:()=>Ro,getDepositDelayDays:()=>Zr,getDepositRestrictions:()=>Jr,getDepositScheduleInterval:()=>Gr,getDepositScheduleMonthlyAnchor:()=>Qr,getDepositScheduleWeeklyAnchor:()=>Vr,getDepositStatus:()=>Xr,getDuplicatedPaymentMethodIds:()=>Fr,getEnabledPaymentMethodIds:()=>xr,getExpressCheckoutCartMethods:()=>Co,getExpressCheckoutCheckoutMethods:()=>Po,getExpressCheckoutProductMethods:()=>Mo,getIsCardPresentEligible:()=>yo,getIsDebugLogEnabled:()=>io,getIsDevModeEnabled:()=>oo,getIsExpressCheckoutInPaymentMethodsEnabled:()=>ao,getIsManualCaptureEnabled:()=>eo,getIsMultiCurrencyEnabled:()=>so,getIsPaymentRequestEnabled:()=>no,getIsSavedCardsEnabled:()=>mo,getIsStripeBillingEnabled:()=>bo,getIsStripeBillingMigrationInProgress:()=>Ao,getIsSubscriptionsPluginActive:()=>Eo,getIsTestModeEnabled:()=>to,getIsTestModeOnboarding:()=>ro,getIsWCPayEnabled:()=>Ur,getIsWCPaySubscriptionsEligible:()=>fo,getIsWCPaySubscriptionsEnabled:()=>ho,getIsWooPayEnabled:()=>So,getIsWooPayGlobalThemeSupportEnabled:()=>go,getPaymentMethodStatuses:()=>Lr,getPaymentRequestButtonBorderRadius:()=>po,getPaymentRequestButtonSize:()=>uo,getPaymentRequestButtonTheme:()=>lo,getPaymentRequestButtonType:()=>co,getSavingError:()=>_o,getSettings:()=>Pr,getShowWooPayIncompatibilityNotice:()=>Oo,getStripeBillingMigratedCount:()=>No,getStripeBillingSubscriptionCount:()=>Io,getWooPayCustomMessage:()=>To,getWooPayStoreLogo:()=>wo,isDirty:()=>jr,isSavingSettings:()=>zr});var S={};r.r(S),r.d(S,{saveOption:()=>vn,saveSettings:()=>ln,submitStripeBillingSubscriptionMigration:()=>Rn,updateAccountBusinessSupportEmail:()=>an,updateAccountBusinessSupportPhone:()=>sn,updateAccountCommunicationsEmail:()=>Sn,updateAccountStatementDescriptor:()=>rn,updateAccountStatementDescriptorKana:()=>nn,updateAccountStatementDescriptorKanji:()=>on,updateAdvancedFraudProtectionSettings:()=>fn,updateDepositScheduleInterval:()=>cn,updateDepositScheduleMonthlyAnchor:()=>dn,updateDepositScheduleWeeklyAnchor:()=>un,updateEnabledPaymentMethodIds:()=>Go,updateExpressCheckoutCartMethods:()=>Tn,updateExpressCheckoutCheckoutMethods:()=>wn,updateExpressCheckoutProductMethods:()=>gn,updateIsCardPresentEligible:()=>Lo,updateIsDebugLogEnabled:()=>Jo,updateIsExpressCheckoutInPaymentMethodsEnabled:()=>Wo,updateIsManualCaptureEnabled:()=>Ko,updateIsMultiCurrencyEnabled:()=>en,updateIsPaymentRequestEnabled:()=>$o,updateIsSavedCardsEnabled:()=>ko,updateIsSavingSettings:()=>Vo,updateIsStripeBillingEnabled:()=>En,updateIsTestModeEnabled:()=>Xo,updateIsWCPayEnabled:()=>qo,updateIsWCPaySubscriptionsEnabled:()=>tn,updateIsWooPayEnabled:()=>pn,updateIsWooPayGlobalThemeSupportEnabled:()=>mn,updatePaymentRequestButtonBorderRadius:()=>Ho,updatePaymentRequestButtonSize:()=>jo,updatePaymentRequestButtonTheme:()=>Bo,updatePaymentRequestButtonType:()=>zo,updateProtectionLevel:()=>hn,updateSelectedPaymentMethod:()=>Qo,updateSettings:()=>Yo,updateUnselectedPaymentMethod:()=>Zo,updateWooPayCustomMessage:()=>_n,updateWooPayStoreLogo:()=>yn});var g={};r.r(g),r.d(g,{getSettings:()=>On});var T={};r.r(T),r.d(T,{getCardReaderStats:()=>In,getCardReaderStatsError:()=>Nn,getCardReaders:()=>Dn});var w={};r.r(w),r.d(w,{updateCardReaderStats:()=>Mn,updateCardReaders:()=>Cn,updateErrorForCardReaderStats:()=>Pn,updateErrorForCardReaders:()=>Fn});var R={};r.r(R),r.d(R,{getCardReaderStats:()=>Un,getCardReaders:()=>xn});var v={};r.r(v),r.d(v,{getActiveLoanSummary:()=>Bn,getActiveLoanSummaryError:()=>Hn,getLoans:()=>Yn,getLoansError:()=>qn});var O={};r.r(O),r.d(O,{updateActiveLoanSummary:()=>$n,updateErrorForActiveLoanSummary:()=>Wn,updateErrorForLoans:()=>Vn,updateLoans:()=>Gn});var b={};r.r(b),r.d(b,{getActiveLoanSummary:()=>Qn,getLoans:()=>Zn});var A={};r.r(A),r.d(A,{getDocuments:()=>ta,getDocumentsError:()=>ra,getDocumentsSummary:()=>na,getDocumentsSummaryError:()=>aa});var I={};r.r(I),r.d(I,{updateDocuments:()=>ia,updateDocumentsSummary:()=>ca,updateErrorForDocuments:()=>sa,updateErrorForDocumentsSummary:()=>ua});var N={};r.r(N),r.d(N,{formatQueryFilters:()=>da,getDocuments:()=>la,getDocumentsSummary:()=>pa});var D={};r.r(D),r.d(D,{getPaymentIntent:()=>_a,getPaymentIntentError:()=>ya});var M={};r.r(M),r.d(M,{getAuthorization:()=>Ta,getAuthorizations:()=>ga,getAuthorizationsError:()=>wa,getAuthorizationsSummary:()=>va,getAuthorizationsSummaryError:()=>Oa,getIsRequesting:()=>ba});var C={};r.r(C),r.d(C,{setIsRequestingAuthorization:()=>Ca,submitCancelAuthorization:()=>Fa,submitCaptureAuthorization:()=>Pa,updateAuthorization:()=>Da,updateAuthorizations:()=>Ia,updateAuthorizationsSummary:()=>Ma,updateErrorForAuthorizations:()=>Na,updateErrorForAuthorizationsSummary:()=>Ua});var P={};r.r(P),r.d(P,{getAuthorization:()=>ka,getAuthorizations:()=>xa,getAuthorizationsSummary:()=>La});var F={};r.r(F),r.d(F,{getFile:()=>Ha,getFileError:()=>Ya});var U={};r.r(U),r.d(U,{updateErrorForFiles:()=>$a,updateFiles:()=>qa});var x={};r.r(x),r.d(x,{getFile:()=>Wa});var k={};r.r(k),r.d(k,{getPmPromotions:()=>Qa,getPmPromotionsError:()=>Za});var L={};r.r(L),r.d(L,{activatePmPromotion:()=>ei,dismissPmPromotion:()=>ti,updateErrorForPmPromotions:()=>Ja,updatePmPromotions:()=>Xa});var z={};r.r(z),r.d(z,{getPmPromotions:()=>oi});var j=r(1609),B=r(5338);const H=window.wp.components,Y=window.wp.primitives;var q=r(4848);const $=(0,q.jsx)(Y.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,q.jsx)(Y.Path,{d:"M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z"})}),W=window.wp.i18n,G=window.wp.a11y,V=window.wp.element,Q=(0,V.forwardRef)((function({icon:e,size:t=24,...r},o){return(0,V.cloneElement)(e,{width:t,height:t,...r,ref:o})}));function Z(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=Z(e[t]))&&(o&&(o+=" "),o+=r)}else for(r in e)e[r]&&(o&&(o+=" "),o+=r);return o}const K=function(){for(var e,t,r=0,o="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=Z(e))&&(o&&(o+=" "),o+=t);return o},X=window.lodash;var J=r(5795);const ee=document.getElementById("wpbody-content")||document.body,te=(e,t)=>!(!t||t!==e.target&&!(e.target instanceof Node&&t.contains(e.target))),re=(0,j.memo)((({children:e,parentElement:t})=>{const r=(0,j.useRef)(null);return r.current||(r.current=document.createElement("div"),t.appendChild(r.current)),(0,j.useEffect)((()=>()=>{r.current&&(t.removeChild(r.current),r.current=null)}),[t]),(0,J.createPortal)(e,r.current)})),oe=({className:e,children:t,content:r,parentElement:o=ee,hideDelayMs:n=600,isVisible:a,onHide:i,maxWidth:s="250px"})=>{const c=(0,j.useRef)(null),u=(0,j.useRef)(null),d=((e,{hideDelayMs:t=600,triggerRef:r,tooltipRef:o,parentElement:n,onHide:a=X.noop})=>{const[i,s]=(0,j.useState)(e),c=(0,j.useRef)(!1),u=(0,j.useRef)(a);return(0,j.useEffect)((()=>{u.current=a}),[a]),(0,j.useEffect)((()=>{let r=null;if(c.current){if(e)return n.dispatchEvent(new Event("wcpay-tooltip-open")),void s(!0);if(i)return r=setTimeout((()=>{s(!1),u.current()}),t),()=>{r&&clearTimeout(r)}}else c.current=!0}),[s,t,e,i,n]),(0,j.useEffect)((()=>{if(!i)return;const e=()=>{s(!1),u.current()},t=e=>{te(e,r.current?.firstChild)||te(e,o.current)||(s(!1),u.current())};return document.addEventListener("click",t),n.addEventListener("wcpay-tooltip-open",e),()=>{document.removeEventListener("click",t),n.removeEventListener("wcpay-tooltip-open",e)}}),[e,i,r,o,n]),i})(!!a,{hideDelayMs:n,triggerRef:c,tooltipRef:u,parentElement:o,onHide:i});return(0,j.useEffect)((()=>{const e=()=>{if(!d)return;const e=u.current,t=c.current?.firstChild;if(!e||!t)return;if(!(t instanceof HTMLElement))return;e.style.maxWidth=s;const r=t.getBoundingClientRect(),o=e.getBoundingClientRect().height;e.style.top=r.top-o-8+"px";let n=t.offsetWidth/2+r.left-e.offsetWidth/2;const a=window.innerWidth-(r.left+e.offsetWidth);n<0?n=45:a<0&&(n-=85),e.style.left=`${n}px`,e.style.visibility="visible",e.style.opacity="1"};e();const t=(0,X.debounce)(e,150);return window.addEventListener("resize",t),document.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),document.removeEventListener("scroll",t)}}),[d,s]),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)("div",{className:"wcpay-tooltip__content-wrapper",ref:c,children:t}),d&&(0,q.jsx)(re,{parentElement:o,children:(0,q.jsx)("div",{ref:u,className:K("wcpay-tooltip__tooltip-wrapper",{"is-hiding":!a}),role:"tooltip",children:(0,q.jsx)("div",{className:K("wcpay-tooltip__tooltip",e),children:r})})})]})},ne=({isVisible:e,onHide:t=X.noop,children:r,buttonIcon:o,buttonLabel:n,buttonSize:a=16,...i})=>{const[s,c]=(0,j.useState)(!1),[u,d]=(0,j.useState)(!1),l=()=>{c(!0)},p=()=>{c(!1),t()};return(0,q.jsx)("button",{className:"wcpay-tooltip__content-wrapper",onMouseEnter:l,onMouseLeave:p,onFocus:l,onBlur:p,onClick:()=>{d((e=>!e)),u&&t()},type:"button",children:(0,q.jsx)(oe,{...i,onHide:()=>{c(!1),d(!1),t()},isVisible:e||s||u,children:o?(0,q.jsx)(H.Icon,{icon:o,size:a,"aria-label":n}):r})})},ae=({message:e,type:t="primary",className:r,tooltip:o,icon:n})=>{const a=K("chip",`chip-${t}`,n&&"chip-has-icon",r),i=(0,q.jsxs)(q.Fragment,{children:[n&&(0,q.jsx)(Q,{icon:n,size:16}),e]});return o?(0,q.jsx)(ne,{content:o,children:(0,q.jsx)("span",{className:a,children:i})}):(0,q.jsx)("span",{className:a,children:i})};var ie=r(2838);const se=e=>({__html:(0,ie.sanitize)(e,{ALLOWED_TAGS:["a","b","em","i","strong","p","br"],ALLOWED_ATTR:["target","href","rel","name","download"]})}),ce=["primary","success","light","warning","alert"],ue=({badge:e,badgeType:t,heading:r,description:o,footnote:n,image:a,icon:i,primaryButtonLabel:s,onPrimaryClick:c,secondaryButtonLabel:u,onSecondaryClick:d,onDismiss:l,onView:p,showImmediately:m=!1,showDelayMs:_=4e3,reverseButtons:y=!1})=>{const h=(f=t)&&ce.includes(f)?f:"success";var f;const[E,S]=(0,j.useState)(!1),[g,T]=(0,j.useState)(!1),w=(0,j.useRef)(null),R=(0,j.useRef)(null),v=(0,j.useRef)(null);(0,j.useEffect)((()=>{if(m)return S(!0),void T(!0);const e=setTimeout((()=>{S(!0),requestAnimationFrame((()=>{requestAnimationFrame((()=>{T(!0)}))}))}),_);return()=>clearTimeout(e)}),[m,_]),(0,j.useEffect)((()=>()=>{w.current&&clearTimeout(w.current)}),[]),(0,j.useEffect)((()=>{g&&((0,G.speak)((0,W.sprintf)((0,W.__)("Dialog opened: %s","woocommerce-payments"),r),"polite"),p&&p())}),[g]);const O=(0,j.useCallback)(((e=!0)=>{T(!1),w.current=setTimeout((()=>{S(!1),e&&l()}),300)}),[l]);if((0,j.useEffect)((()=>{if(!E||!R.current)return;const e=R.current,t=e.ownerDocument;v.current=t.activeElement,e.focus();const r=r=>{if("Escape"===r.key)return r.preventDefault(),void O();if("Tab"===r.key){const o=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=o[0],a=o[o.length-1],i=t.activeElement;r.shiftKey&&i===n?(r.preventDefault(),a?.focus()):r.shiftKey||i!==a||(r.preventDefault(),n?.focus())}};return t.addEventListener("keydown",r),()=>{t.removeEventListener("keydown",r),v.current?.focus()}}),[E,O]),!E)return null;const b=(0,q.jsx)(H.Button,{className:"wcpay-spotlight__primary-btn",variant:"secondary",onClick:()=>{c(),O(!1)},size:"compact",children:s}),A=u&&(0,q.jsx)(H.Button,{className:"wcpay-spotlight__secondary-btn",variant:"tertiary",onClick:d,size:"compact",children:u});return(0,q.jsx)("div",{className:"wcpay-spotlight "+(g?"wcpay-spotlight--visible":""),children:(0,q.jsx)("div",{ref:R,role:"dialog","aria-modal":"true","aria-labelledby":"spotlight-heading",tabIndex:-1,className:"wcpay-spotlight__container",children:(0,q.jsxs)(H.Card,{className:`wcpay-spotlight__card ${a?"has-image":""} ${i?"has-icon":""}`,elevation:2,children:[a&&(0,q.jsx)(H.CardMedia,{className:"wcpay-spotlight__image",children:"string"==typeof a?(0,q.jsx)("img",{src:a,alt:"","aria-hidden":"true",role:"presentation"}):a}),(0,q.jsx)(H.CardHeader,{isBorderless:!0,size:"small",className:"wcpay-spotlight__header",children:(0,q.jsxs)(H.Flex,{className:"wcpay-spotlight__controls",justify:"space-between",align:"center",children:[!a&&!i&&e&&(0,q.jsx)("div",{className:"wcpay-spotlight__badge",children:(0,q.jsx)(ae,{message:e,type:h})}),!a&&!i&&!e&&(0,q.jsx)("h2",{id:"spotlight-heading",className:"wcpay-spotlight__heading",children:r}),(a||i)&&(0,q.jsx)("span",{}),(0,q.jsx)(H.Button,{className:"wcpay-spotlight__close-btn",label:(0,W.__)("Close","woocommerce-payments"),icon:(0,q.jsx)(H.Icon,{icon:$,viewBox:"6 4 12 14"}),iconSize:16,onClick:()=>O()})]})}),(0,q.jsxs)(H.CardBody,{className:"wcpay-spotlight__body",size:"small",children:[i&&(0,q.jsx)("div",{className:"wcpay-spotlight__icon",children:i}),a&&e&&(0,q.jsx)("div",{className:"wcpay-spotlight__badge",children:(0,q.jsx)(ae,{message:e,type:h})}),(a||i||e)&&(0,q.jsx)("h2",{id:"spotlight-heading",className:"wcpay-spotlight__heading",children:r}),"string"==typeof o?(0,q.jsx)("div",{className:"wcpay-spotlight__description",dangerouslySetInnerHTML:se(o)}):(0,q.jsx)("div",{className:"wcpay-spotlight__description",children:o}),n&&("string"==typeof n?(0,q.jsx)("div",{className:"wcpay-spotlight__footnote",dangerouslySetInnerHTML:se(n)}):(0,q.jsx)("div",{className:"wcpay-spotlight__footnote",children:n}))]}),(0,q.jsx)(H.CardFooter,{isBorderless:!0,size:"small",className:"wcpay-spotlight__footer",children:(0,q.jsx)(H.Flex,{justify:"flex-start",gap:3,children:y?(0,q.jsxs)(q.Fragment,{children:[b,A]}):(0,q.jsxs)(q.Fragment,{children:[A,b]})})})]})})})},de=window.wp.data,le=window.wp.dataControls,pe="/wc/v3/payments",me="wc/payments",_e={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"},ye=e=>JSON.stringify(e,Object.keys(e).sort()),he={byId:{},queries:{},count:0,instant:{}},fe=e=>e&&e.deposits||{},Ee=(e,t)=>(fe(e).byId||{})[t],Se=e=>{const t=fe(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},i={};for(const[e,t]of Object.entries(a))t?.forEach((t=>{const{currency:r}=t;i[r]||(i[r]={currency:r,lastPaid:void 0,pending:void 0,available:void 0,instant:void 0}),i[r][e]=t}));const s=Object.values(i);return{account:n,currencies:[...s.filter((e=>n.default_currency===e.currency)),...s.filter((e=>n.default_currency!==e.currency))]}},ge=e=>(fe(e).overviews||{}).error,Te=(e,t)=>{const r=ye(t);return(fe(e).queries||{})[r]||{}},we=(e,t)=>(Te(e,t).data||[]).map(Ee.bind(void 0,e)),Re=e=>fe(e).count,ve=(e,t)=>Te(e,t).error||{},Oe=(e,t)=>{const r=ye(t);return(fe(e).summary||{})[r]||{}},be=(e,t)=>Oe(e,t).data||{},Ae=(e,t)=>Oe(e,t).error||{},Ie=e=>(fe(e).instant||{}).data,Ne=window.wp.domReady;var De=r.n(Ne);const Me=(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]}De()((()=>{var r;(null!==(r=wc?.tracks?.recordEvent)&&void 0!==r?r:wcTracks.recordEvent)(e,t)}))},Ce=((0,j.createContext)(window.wcpaySettings),(0,j.createContext)({isActive:!1,setActive:()=>null,isCompleted:!1,setCompleted:()=>null,taskId:""}),window.wc.currency);var Pe=r.n(Ce);(0,W.__)("Australian dollar","woocommerce-payments"),(0,W.__)("Canadian dollar","woocommerce-payments"),(0,W.__)("Swiss franc","woocommerce-payments"),(0,W.__)("Danish krone","woocommerce-payments"),(0,W.__)("Euro","woocommerce-payments"),(0,W.__)("Pound sterling","woocommerce-payments"),(0,W.__)("Norwegian krone","woocommerce-payments"),(0,W.__)("New Zealand dollar","woocommerce-payments"),(0,W.__)("Swedish krona","woocommerce-payments"),(0,W.__)("United States (US) dollar","woocommerce-payments");const Fe=(e,t="USD",r=null,o=!1)=>{const n=(e=>wcpaySettings.zeroDecimalCurrencies.includes(e.toLowerCase()))(t);n||(e/=100);const a=e<0,i=a?-1*e:e,s=a?"-":"",c=o?(e=>{const t=e.toUpperCase(),{currencyData:r,connect:{country:o="US"}}=wcpaySettings;if(r[o]?.code===t)return Pe()(r[o]);const n=(0,X.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),Pe()(n)}return null})(t):((e,t=null)=>{const{currencyData:r,connect:{country:o="US"}}=wcpaySettings,n=(0,X.find)(r,{code:e.toUpperCase()});if(n){if(null!==t&&t.toUpperCase()!==e.toUpperCase()||r[o]){const e=t?(0,X.find)(r,{code:t.toUpperCase()}):r[o];e&&(n.decimalSeparator=e.decimalSeparator,n.thousandSeparator=e.thousandSeparator,n.symbolPosition=e.symbolPosition)}return Pe()(n)}return null})(t,r);if(null===c)return s+Ue(i,t,n);try{return s+("function"==typeof c.formatAmount?xe(c.formatAmount(i)):xe(c.formatCurrency(i)))}catch(e){return s+xe(Ue(i,t,n))}};function Ue(e,t,r){try{return e.toLocaleString(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",dummy:r})}catch(o){return(0,W.sprintf)(r?"%s %i":"%s %.2f",t.toUpperCase(),e)}}function xe(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}const ke=window.wp.url,Le=window.moment;var ze=r.n(Le);const je=window.wp.date,Be=(window.wc.number,e=>(0,ke.addQueryArgs)("admin.php",e)),He=(e,t=!1)=>{const r=t?ze()(e).endOf("day").utc().toISOString():ze()(e).startOf("day").utc().toISOString();return e&&(0,je.dateI18n)("Y-m-d H:i:s",r,!0)};function Ye(e){return{type:_e.SET_DEPOSIT,data:e}}function qe(e){return{type:_e.SET_ALL_DEPOSITS_OVERVIEWS,data:e}}function $e(e,t){return{type:_e.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,error:t}}function We(e,t){return{type:_e.SET_DEPOSITS,query:e,data:t}}function Ge(e){return{type:_e.SET_DEPOSITS_COUNT,data:e}}function Ve(e,t,r){return{type:_e.SET_ERROR_FOR_DEPOSIT_QUERY,query:e,data:t,error:r}}function Qe(e,t){return{type:_e.SET_DEPOSITS_SUMMARY,query:e,data:t}}function Ze(e,t,r){return{type:_e.SET_ERROR_FOR_DEPOSITS_SUMMARY,query:e,data:t,error:r}}function Ke(e){return{type:_e.SET_INSTANT_DEPOSIT,data:e}}function*Xe(e){try{yield(0,de.dispatch)(me).startResolution("getInstantDeposit",[e]);const t=yield(0,le.apiFetch)({path:"/wc/v3/payments/deposits",method:"POST",data:{type:"instant",currency:e}});yield Ke(t),yield(0,de.dispatch)(me).invalidateResolutionForStoreSelector("getDeposits"),yield(0,de.dispatch)(me).invalidateResolutionForStoreSelector("getAllDepositsOverviews"),yield(0,de.dispatch)("core/notices").createSuccessNotice((0,W.sprintf)((0,W.__)("Instant payout for %s in transit.","woocommerce-payments"),Fe(t.amount)),{actions:[{label:(0,W.__)("View details","woocommerce-payments"),url:Be({page:"wc-admin",path:"/payments/payouts/details",id:t.id})}]})}catch{yield(0,de.dispatch)("core/notices").createErrorNotice((0,W.__)("Error creating instant payout.","woocommerce-payments"))}finally{yield(0,de.dispatch)(me).finishResolution("getInstantDeposit",[e])}}function*Je(e){if(/\W/.test(e))return;const t=(0,ke.addQueryArgs)(`${pe}/deposits/${e}`);try{const e=yield(0,le.apiFetch)({path:t});yield Ye(e)}catch(e){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving payout.","woocommerce-payments"))}}function*et(){const e=(0,ke.addQueryArgs)(`${pe}/deposits/overview-all`);try{const t=yield(0,le.apiFetch)({path:e});yield qe(t)}catch(e){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving all payouts' overviews.","woocommerce-payments")),yield $e()}}const tt=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:He(e.dateBefore,!0),date_after:He(e.dateAfter),date_between:e.dateBetween&&[He(e.dateBetween[0]),He(e.dateBetween[1],!0)],status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),rt=`${pe}/deposits/download`;function ot(e){return(0,ke.addQueryArgs)(rt,tt(e))}function*nt(e){const t=(0,ke.addQueryArgs)(`${pe}/deposits`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...tt(e)});try{const r=yield(0,le.apiFetch)({path:t})||{};yield We(e,r.data),yield Ge(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,W.__)("Error retrieving payouts.","woocommerce-payments")),yield Ve(e,null,t)}}function*at(e){const t=(0,ke.addQueryArgs)(`${pe}/deposits/summary`,tt(e));try{const r=yield(0,le.apiFetch)({path:t});yield Qe(e,r)}catch(t){yield Ze(e,null,t)}}const it={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"},st={summary:{},fraudProtection:{review:{summary:{}},block:{summary:{}}}},ct=e=>e&&e.transactions||{},ut=(e,t)=>{const r=ye(t);return ct(e)[r]||{}},dt=(e,t)=>ut(e,t).data||[],lt=(e,t)=>ut(e,t).error||{},pt=(e,t)=>{const r=ye(t);return ct(e).summary[r]||{}},mt=(e,t)=>pt(e,t).data||{},_t=(e,t)=>pt(e,t).error||{},yt=(e,t,r)=>{const o=ye(r);return ct(e).fraudProtection?.[t]?.[o]||{}},ht=(e,t,r)=>yt(e,t,r).data||[],ft=(e,t,r)=>yt(e,t,r).error||{},Et=(e,t,r)=>{const o=ye(r);return ct(e).fraudProtection?.[t]?.summary[o]||{}},St=(e,t,r)=>Et(e,t,r).data||{},gt=(e,t,r)=>Et(e,t,r).error||{};function Tt(e,t){return{type:it.SET_TRANSACTIONS,query:e,data:t}}function wt(e,t,r){return{type:it.SET_ERROR_FOR_TRANSACTIONS,query:e,data:t,error:r}}function Rt(e,t){return{type:it.SET_TRANSACTIONS_SUMMARY,query:e,data:t}}function vt(e,t,r){return{type:it.SET_ERROR_FOR_TRANSACTIONS_SUMMARY,query:e,data:t,error:r}}function Ot(e,t,r){return{type:it.SET_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:r}}function bt(e,t,r){return{type:it.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS,status:e,query:t,data:null,error:r}}function At(e,t,r){return{type:it.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:r}}function It(e,t,r){return{type:it.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY,status:e,query:t,data:null,error:r}}const Nt=e=>({user_email:e.userEmail,match:e.match,date_before:He(e.dateBefore,!0),date_after:He(e.dateAfter),date_between:e.dateBetween&&[He(e.dateBetween[0]),He(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:ze()(new Date).format("Z"),locale:e.locale});function*Dt(e){const t=(0,ke.addQueryArgs)(`${pe}/transactions`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Nt(e)});try{const r=yield(0,le.apiFetch)({path:t});yield Tt(e,r.data||[])}catch(t){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving transactions.","woocommerce-payments")),yield wt(e,null,t)}}const Mt=`${pe}/transactions/download`;function Ct(e){return(0,ke.addQueryArgs)(Mt,Nt(e))}function*Pt(e){const t=(0,ke.addQueryArgs)(`${pe}/transactions/summary`,Nt(e));try{const r=yield(0,le.apiFetch)({path:t});yield Rt(e,r)}catch(t){yield vt(e,null,t)}}function*Ft(e,t){const r=(0,ke.addQueryArgs)(`${pe}/transactions/fraud-outcomes`,{status:e,page:t.paged,sort:t.orderby,pagesize:t.perPage,direction:t.order,additional_status:t.additionalStatus,...Nt(t)});try{const o=yield(0,le.apiFetch)({path:r});yield Ot(e,t,o.data||[])}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield Ot(e,t,[]));yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving transactions.","woocommerce-payments")),yield bt(e,t,r)}}function*Ut(e,t){const r=(0,ke.addQueryArgs)(`${pe}/transactions/fraud-outcomes/summary`,{status:e,additional_status:t.additionalStatus}),o={count:0,total:0};try{const n=yield(0,le.apiFetch)({path:r});yield At(e,t,n||o)}catch(r){if("wcpay_fraud_outcome_not_found"===r.code)return void(yield At(e,t,o));yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving on review transactions.","woocommerce-payments")),yield It(e,t,r)}}function xt(e,t){return(0,ke.addQueryArgs)(`${pe}/transactions/fraud-outcomes/download`,{status:e,sort:t.orderby,direction:t.order,additional_status:t.additionalStatus,...Nt(t)})}const kt={SET_CHARGE:"SET_CHARGE",SET_ERROR_FOR_CHARGE:"SET_ERROR_FOR_CHARGE"},Lt=(e,t)=>e.charges[t]&&e.charges[t].data?e.charges[t].data:{},zt=(e,t)=>e.charges[t]&&e.charges[t].error?e.charges[t].error:{},jt=(e,t)=>Lt(e,t),Bt=(e,t)=>zt(e,t);function Ht(e,t){return{type:kt.SET_CHARGE,id:e,data:t}}function Yt(e,t,r){return{type:kt.SET_ERROR_FOR_CHARGE,id:e,data:t,error:r}}function*qt(e){try{const t=yield(0,le.apiFetch)({path:`${pe}/charges/${e}`});yield Ht(e,t)}catch(t){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving transaction.","woocommerce-payments")),yield Yt(e,null,t)}}function*$t(e){try{const t=yield(0,le.apiFetch)({path:`${pe}/charges/order/${e}`});yield Ht(e,t)}catch(t){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving transaction.","woocommerce-payments")),yield Yt(e,null,t)}}const Wt={SET_TIMELINE:"SET_TIMELINE",SET_ERROR_FOR_TIMELINE:"SET_ERROR_FOR_TIMELINE"},Gt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].data?e.timeline[t].data:{},Vt=(e,t)=>e.timeline&&e.timeline[t]&&e.timeline[t].error?e.timeline[t].error:{};function Qt(e,t){return{id:e,type:Wt.SET_TIMELINE,data:t}}function Zt(e,t){return{id:e,type:Wt.SET_ERROR_FOR_TIMELINE,error:t}}function*Kt(e){try{const t=yield(0,le.apiFetch)({path:`${pe}/timeline/${e}`});yield Qt(e,t.data)}catch(t){yield Zt(e,t)}}const Xt={SET_DISPUTE:"SET_DISPUTE",SET_ERROR_FOR_DISPUTE:"SET_ERROR_FOR_DISPUTE",SET_DISPUTES:"SET_DISPUTES",SET_DISPUTES_SUMMARY:"SET_DISPUTES_SUMMARY"},Jt={byId:{},queries:{},summary:{},cached:{}},er=e=>e&&e.disputes||{},tr=(e,t)=>(er(e).byId||{})[t],rr=(e,t)=>{const r=er(e).byId||{};return r[t]?.error},or=(e,t)=>(er(e).cached||{})[t],nr=(e,t)=>{const r=((e,t)=>{const r=ye(t);return(er(e).queries||{})[r]||{}})(e,t).data||[];return r.map(or.bind(void 0,e))},ar=(e,t)=>((e,t)=>{const r=ye(t);return(er(e).summary||{})[r]||{}})(e,t).data||{};var ir=function(e){return e.SET_PAYMENT_INTENT="SET_PAYMENT_INTENT",e.SET_ERROR_FOR_PAYMENT_INTENT="SET_ERROR_FOR_PAYMENT_INTENT",e}(ir||{});const sr=ir;function cr(e,t){return{type:sr.SET_PAYMENT_INTENT,id:e,data:t}}function ur(e,t){return{type:sr.SET_ERROR_FOR_PAYMENT_INTENT,id:e,error:t}}function*dr(e,t){const r=e.payment_intent;try{yield(0,le.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,W.sprintf)((0,W.__)("Refunded payment #%s.","woocommerce-payments"),r))}catch(e){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.sprintf)((0,W.__)("There has been an error refunding the payment #%s. Please try again later.","woocommerce-payments"),r))}}function*lr(e){try{const t=yield(0,le.apiFetch)({path:`${pe}/payment_intents/${e}`});yield cr(e,t)}catch(t){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving transaction.","woocommerce-payments")),yield ur(e,t)}}function pr(e){return{type:Xt.SET_DISPUTE,data:e}}function mr(e,t,r){return{type:Xt.SET_ERROR_FOR_DISPUTE,id:e,data:t,error:r}}function _r(e,t){return{type:Xt.SET_DISPUTES,query:e,data:t}}function yr(e,t){return{type:Xt.SET_DISPUTES_SUMMARY,query:e,data:t}}function*hr(e){const{id:t,payment_intent:r}=e;try{yield de.controls.dispatch(me,"startResolution","getDispute",[t]);const e=yield(0,le.apiFetch)({path:`${pe}/disputes/${t}/close`,method:"post"});yield pr(e),yield lr(r),yield de.controls.dispatch(me,"finishResolution","getDispute",[t]);const o=e.order?(0,W.sprintf)((0,W.__)("You have accepted the dispute for order #%s.","woocommerce-payments"),e.order.number):(0,W.__)("You have accepted the dispute.","woocommerce-payments");yield de.controls.dispatch("core/notices","createSuccessNotice",o)}catch(e){const r=(0,W.__)("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 fr=window.wc.wcSettings,Er=((0,W.__)("Bank cannot process","woocommerce-payments"),(0,W.__)("Check returned","woocommerce-payments"),(0,W.__)("Credit not processed","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("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,W.__)("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,W.__)("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,W.__)("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,W.__)("The cardholder claims a credit was not processed.","woocommerce-payments"),(0,W.__)("Customer initiated","woocommerce-payments"),(0,W.__)("Debit not authorized","woocommerce-payments"),(0,W.__)("Duplicate","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("The customer claims they were charged multiple times for the same product or service.","woocommerce-payments"),(0,W.__)("Demonstrate that each payment was for a separate product or service.","woocommerce-payments"),(0,W.__)("Determine if your customer was incorrectly charged multiple times.","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("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,W.__)("The cardholder claims this is a duplicate transaction.","woocommerce-payments"),(0,W.__)("Transaction unauthorized","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("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"),(0,W.__)("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,W.__)("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,W.__)("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,W.__)("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"),(0,W.__)("The cardholder claims this is an unauthorized transaction.","woocommerce-payments"),(0,W.__)("General","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("Incorrect account details","woocommerce-payments"),(0,W.__)("Insufficient funds","woocommerce-payments"),(0,W.__)("Product not received","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("The customer claims they did not receive the products or services purchased.","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("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,W.__)("The cardholder claims they did not receive the product.","woocommerce-payments"),(0,W.__)("Product unacceptable","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("The product or service was received but was defective, damaged, or not as described.","woocommerce-payments"),(0,W.__)("Demonstrate that the product or service was delivered as described at the time of purchase.","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("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,W.__)("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,W.__)("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,W.__)("The cardholder claims the product was unacceptable.","woocommerce-payments"),(0,W.__)("Subscription canceled","woocommerce-payments"),(0,W.__)("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,W.__)("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"),(0,W.__)("The customer claims that you continued to charge them after a subscription was canceled.","woocommerce-payments"),(0,W.__)("Prove that the subscription was still active and that the customer was aware of, and did not follow, your cancellation procedure.","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("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,W.__)("The cardholder claims a subscription was canceled.","woocommerce-payments"),(0,W.__)("Unrecognized","woocommerce-payments"),(0,W.__)("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,W.__)("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"),(0,W.__)("The customer doesnt recognize the payment appearing on their card statement.","woocommerce-payments"),(0,W.__)("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,W.__)("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,W.__)("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"),(0,W.__)("Non-compliant","woocommerce-payments"),(0,W.__)("Your customers bank claims this payment violates Visas rules.","woocommerce-payments"),(0,W.__)("This transaction is being reviewed under Visas network compliance rules.","woocommerce-payments"),{warning_needs_response:(0,W.__)("Inquiry: Response needed","woocommerce-payments"),warning_under_review:(0,W.__)("Inquiry: Under review","woocommerce-payments"),warning_closed:(0,W.__)("Inquiry: Closed","woocommerce-payments"),needs_response:(0,W.__)("Response needed","woocommerce-payments"),under_review:(0,W.__)("Under review","woocommerce-payments"),charge_refunded:(0,W.__)("Charge refunded","woocommerce-payments"),won:(0,W.__)("Won","woocommerce-payments"),lost:(0,W.__)("Lost","woocommerce-payments")}),Sr=(Object.entries(Er).map((([e,t])=>({label:t,value:e}))).filter((function(e){return null!=e})),["needs_response","warning_needs_response"]),gr=((0,W.__)("Dispute currency","woocommerce-payments"),(0,W.__)("All currencies","woocommerce-payments"),(0,W.__)("Show","woocommerce-payments"),(0,W.__)("Needs response","woocommerce-payments"),(0,W.__)("All disputes","woocommerce-payments"),(0,W.__)("Advanced filters","woocommerce-payments"),(0,fr.getSetting)("wcVersion")),Tr=parseFloat(gr),wr=(Tr<7.8?(0,W.__)("Disputes match {{select /}} filters","woocommerce-payments"):(0,W.__)("Disputes match <select /> filters","woocommerce-payments"),(0,W.__)("Disputed on date","woocommerce-payments"),(0,W.__)("Remove dispute date filter","woocommerce-payments"),(0,W.__)("Select a dispute date filter match","woocommerce-payments"),Tr<7.8?(0,W.__)("{{title}}Date{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,W.__)("<title>Date</title> <rule /> <filter />","woocommerce-payments"),(0,W.__)("Select a dispute date","woocommerce-payments"),(0,W.__)("Before","woocommerce-payments"),(0,W.__)("After","woocommerce-payments"),(0,W.__)("Between","woocommerce-payments"),(0,W.__)("Status","woocommerce-payments"),(0,W.__)("Remove dispute status filter","woocommerce-payments"),(0,W.__)("Select a dispute status filter match","woocommerce-payments"),Tr<7.8?(0,W.__)("{{title}}Status{{/title}} {{rule /}} {{filter /}}","woocommerce-payments"):(0,W.__)("<title>Status</title> <rule /> <filter />","woocommerce-payments"),(0,W.__)("Select a dispute status","woocommerce-payments"),(0,W._x)("Is","dispute status","woocommerce-payments"),(0,W._x)("Is not","dispute status","woocommerce-payments"),e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:He(e.dateBefore,!0),date_after:He(e.dateAfter),date_between:e.dateBetween&&[He(e.dateBetween[0]),He(e.dateBetween[1],!0)],search:"awaiting_response"===e.filter?Sr:e.search,status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale})),Rr=`${pe}/disputes/download`;function vr(e){return(0,ke.addQueryArgs)(Rr,wr(e))}function*Or(e){const t=(0,ke.addQueryArgs)(`${pe}/disputes/${e}`);try{const e=yield(0,le.apiFetch)({path:t});yield pr(e)}catch(t){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving dispute.","woocommerce-payments")),yield mr(e,void 0,t)}}function*br(e){const t=(0,ke.addQueryArgs)(`${pe}/disputes`,{page:e.paged,pagesize:e.perPage,sort:(0,X.snakeCase)(e.orderBy),direction:e.order,...wr(e)});try{const r=yield(0,le.apiFetch)({path:t})||{};yield _r(e,r.data)}catch(e){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving disputes.","woocommerce-payments"))}}function*Ar(e){const t=(0,ke.addQueryArgs)(`${pe}/disputes/summary`,{page:e.paged,pagesize:e.perPage,...wr(e)});try{const r=yield(0,le.apiFetch)({path:t});yield yr(e,r)}catch(e){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("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"},Nr={isDirty:!1,isSaving:!1,savingError:null,data:{}},Dr={},Mr=[],Cr=e=>e&&e.settings||Dr,Pr=e=>Cr(e).data||Dr,Fr=e=>Pr(e).duplicated_payment_method_ids||Dr,Ur=e=>Pr(e).is_wcpay_enabled||!1,xr=e=>Pr(e).enabled_payment_method_ids||Mr,kr=e=>Pr(e).available_payment_method_ids||Mr,Lr=e=>Pr(e).payment_method_statuses||Dr,zr=e=>Cr(e).isSaving||!1,jr=e=>Cr(e).isDirty||!1,Br=e=>Pr(e).account_statement_descriptor||"",Hr=e=>Pr(e).account_statement_descriptor_kanji||"",Yr=e=>Pr(e).account_statement_descriptor_kana||"",qr=e=>Pr(e).account_business_support_email||"",$r=e=>Pr(e).account_business_support_phone||"",Wr=e=>Pr(e).account_domestic_currency||"",Gr=e=>Pr(e).deposit_schedule_interval||"",Vr=e=>Pr(e).deposit_schedule_weekly_anchor||"",Qr=e=>Pr(e).deposit_schedule_monthly_anchor||"",Zr=e=>Pr(e).deposit_delay_days||"7",Kr=e=>Pr(e).deposit_completed_waiting_period||!1,Xr=e=>Pr(e).deposit_status||"",Jr=e=>Pr(e).deposit_restrictions||"",eo=e=>Pr(e).is_manual_capture_enabled||!1,to=e=>Pr(e).is_test_mode_enabled||!1,ro=e=>Pr(e).is_test_mode_onboarding||!1,oo=e=>Pr(e).is_dev_mode_enabled||!1,no=e=>Pr(e).is_payment_request_enabled||!1,ao=e=>Pr(e).is_express_checkout_in_payment_methods_enabled||!1,io=e=>Pr(e).is_debug_log_enabled||!1,so=e=>Pr(e).is_multi_currency_enabled||!1,co=e=>Pr(e).payment_request_button_type||"",uo=e=>Pr(e).payment_request_button_size||"",lo=e=>Pr(e).payment_request_button_theme||"",po=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)},mo=e=>Pr(e).is_saved_cards_enabled||!1,_o=e=>Cr(e).savingError,yo=e=>Pr(e).is_card_present_eligible||!1,ho=e=>Pr(e).is_wcpay_subscriptions_enabled||!1,fo=e=>Pr(e).is_wcpay_subscriptions_eligible||!1,Eo=e=>Pr(e).is_subscriptions_plugin_active||!1,So=e=>Pr(e).is_woopay_enabled||!1,go=e=>Pr(e).is_woopay_global_theme_support_enabled||!1,To=e=>Pr(e).woopay_custom_message||"",wo=e=>Pr(e).woopay_store_logo||"",Ro=e=>Pr(e).current_protection_level||"basic",vo=e=>Pr(e).advanced_fraud_protection_settings||Mr,Oo=e=>Pr(e).show_woopay_incompatibility_notice||!1,bo=e=>Pr(e).is_stripe_billing_enabled||!1,Ao=e=>Pr(e).is_migrating_stripe_billing||!1,Io=e=>Pr(e).stripe_billing_subscription_count||0,No=e=>Pr(e).stripe_billing_migrated_count||0,Do=e=>Pr(e).account_communications_email||"",Mo=e=>Pr(e).express_checkout_product_methods||Mr,Co=e=>Pr(e).express_checkout_cart_methods||Mr,Po=e=>Pr(e).express_checkout_checkout_methods||Mr,Fo=window.wp.apiFetch;var Uo=r.n(Fo);function xo(e){return{type:Ir.SET_SETTINGS_VALUES,payload:e}}function ko(e){return xo({is_saved_cards_enabled:e})}function Lo(e){return xo({is_card_present_eligible:e})}function zo(e){return xo({payment_request_button_type:e})}function jo(e){return xo({payment_request_button_size:e})}function Bo(e){return xo({payment_request_button_theme:e})}function Ho(e){return xo({payment_request_button_border_radius:e})}function Yo(e){return{type:Ir.SET_SETTINGS,data:e}}function qo(e){return xo({is_wcpay_enabled:e})}function $o(e){return xo({is_payment_request_enabled:e})}function Wo(e){return xo({is_express_checkout_in_payment_methods_enabled:e})}function Go(e){return xo({enabled_payment_method_ids:[...e]})}function Vo(e,t){return{type:Ir.SET_IS_SAVING_SETTINGS,isSaving:e,error:t}}function Qo(e){return{type:Ir.SET_SELECTED_PAYMENT_METHOD,id:e}}function Zo(e){return{type:Ir.SET_UNSELECTED_PAYMENT_METHOD,id:e}}function Ko(e){return xo({is_manual_capture_enabled:e})}function Xo(e){return xo({is_test_mode_enabled:e})}function Jo(e){return xo({is_debug_log_enabled:e})}function en(e){return xo({is_multi_currency_enabled:e})}function tn(e){return xo({is_wcpay_subscriptions_enabled:e})}function rn(e){return xo({account_statement_descriptor:e})}function on(e){return xo({account_statement_descriptor_kanji:e})}function nn(e){return xo({account_statement_descriptor_kana:e})}function an(e){return xo({account_business_support_email:e})}function sn(e){return xo({account_business_support_phone:e})}function cn(e){return xo({deposit_schedule_interval:e})}function un(e){return xo({deposit_schedule_weekly_anchor:e})}function dn(e){return xo({deposit_schedule_monthly_anchor:""===e?null:parseInt(e,10)})}function*ln(){let e=null;try{const e=(0,de.select)(me).getSettings();yield Vo(!0,null);const t=yield(0,le.apiFetch)({path:`${pe}/settings`,method:"post",data:e});yield xo({payment_method_statuses:t.data.payment_method_statuses}),yield(0,de.dispatch)("core/notices").createSuccessNotice((0,W.__)("Settings saved.","woocommerce-payments"))}catch(t){e=t,yield(0,de.dispatch)("core/notices").createErrorNotice((0,W.__)("Error saving settings.","woocommerce-payments")),e.server_error&&(yield(0,de.dispatch)("core/notices").createErrorNotice(e.server_error))}finally{yield Vo(!1,e)}return null===e}function pn(e){return xo({is_woopay_enabled:e})}function mn(e){return xo({is_woopay_global_theme_support_enabled:e})}function _n(e){return xo({woopay_custom_message:e})}function yn(e){return xo({woopay_store_logo:e})}function hn(e){return xo({current_protection_level:e})}function fn(e){return xo({advanced_fraud_protection_settings:e})}function En(e){return xo({is_stripe_billing_enabled:e})}function Sn(e){return xo({account_communications_email:e})}function gn(e){return xo({express_checkout_product_methods:[...e]})}function Tn(e){return xo({express_checkout_cart_methods:[...e]})}function wn(e){return xo({express_checkout_checkout_methods:[...e]})}function*Rn(){try{yield(0,de.dispatch)(me).startResolution("scheduleStripeBillingMigration"),yield(0,le.apiFetch)({path:`${pe}/settings/schedule-stripe-billing-migration`,method:"post"})}catch(e){yield(0,de.dispatch)("core/notices").createErrorNotice((0,W.__)("Error starting the Stripe Billing migration.","woocommerce-payments"))}yield(0,de.dispatch)(me).finishResolution("scheduleStripeBillingMigration")}function vn(e,t){return Uo()({path:`${pe}/settings/${e}`,method:"post",data:{value:t}}).catch((()=>{(0,de.dispatch)("core/notices").createErrorNotice((0,W.__)("Error saving option","woocommerce-payments"))}))}function*On(){const e=`${pe}/settings`;try{const t=yield(0,le.apiFetch)({path:e});yield Yo(t)}catch(e){yield(0,de.dispatch)("core/notices").createErrorNotice((0,W.__)("Error retrieving settings.","woocommerce-payments"))}}const bn=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())),i=(0,de.useSelect)((e=>e(me).getExpressCheckoutCheckoutMethods())),s={product:n,cart:a,checkout:i},c={product:t,cart:r,checkout:o};return[[n.includes(e)&&"product",a.includes(e)&&"cart",i.includes(e)&&"checkout"].filter(Boolean),(t,r)=>{c[t](r?[...s[t],e]:s[t].filter((t=>t!==e)))}]},An=(bn("payment_request"),bn("woopay"),bn("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"}),In=(e,t)=>e.readers[t]&&e.readers[t].data?e.readers[t].data:{},Nn=(e,t)=>e.readers[t]&&e.readers[t].error?e.readers[t].error:{},Dn=e=>e.readers&&e.readers.list?e.readers.list:{};function Mn(e,t){return{type:An.SET_CARD_READER_STATS,id:e,data:t}}function Cn(e,t){return{type:An.SET_READERS,query:e,data:t}}function Pn(e,t,r){return{type:An.SET_CARD_ERROR_FOR_READER_STATS,id:e,data:t,error:r}}function Fn(e,t){return{type:An.SET_CARD_ERROR_FOR_READERS,data:e,error:t}}function*Un(e,t){try{const r=yield(0,le.apiFetch)({path:`${pe}/readers/charges/${t}`});yield Mn(e,r)}catch(t){yield Pn(e,null,t)}}function*xn(e){const t=(0,ke.addQueryArgs)(`${pe}/readers`,{limit:e.limit});try{const r=yield(0,le.apiFetch)({path:t})||{};yield Cn(e,r)}catch(e){yield Fn(null,e)}}var kn=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}(kn||{});const Ln=kn,zn={},jn=e=>e&&e.capital||{},Bn=e=>jn(e).summary,Hn=e=>jn(e).summaryError,Yn=e=>jn(e).loans||[],qn=e=>jn(e).loansError;function $n(e){return{type:Ln.SET_ACTIVE_LOAN_SUMMARY,data:e}}function Wn(e){return{type:Ln.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY,error:e}}function Gn(e){return{type:Ln.SET_LOANS,data:e.data}}function Vn(e){return{type:Ln.SET_ERROR_FOR_LOANS,error:e}}function*Qn(){const e=`${pe}/capital/active_loan_summary`;try{const t=yield(0,le.apiFetch)({path:e});yield $n(t)}catch(e){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Wn(e)}}function*Zn(){const e=`${pe}/capital/loans`;try{const t=yield(0,le.apiFetch)({path:e});yield Gn(t)}catch(e){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving the active loan summary.","woocommerce-payments")),yield Vn(e)}}const Kn={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:{}},Jn=e=>e&&e.documents||{},ea=(e,t)=>{const r=ye(t);return Jn(e)[r]||{}},ta=(e,t)=>ea(e,t).data||[],ra=(e,t)=>ea(e,t).error||{},oa=(e,t)=>{const r=ye(t);return Jn(e).summary[r]||{}},na=(e,t)=>oa(e,t).data||{},aa=(e,t)=>oa(e,t).error||{};function ia(e,t){return{type:Kn.SET_DOCUMENTS,query:e,data:t}}function sa(e,t,r){return{type:Kn.SET_ERROR_FOR_DOCUMENTS,query:e,data:t,error:r}}function ca(e,t){return{type:Kn.SET_DOCUMENTS_SUMMARY,query:e,data:t}}function ua(e,t,r){return{type:Kn.SET_ERROR_FOR_DOCUMENTS_SUMMARY,query:e,data:t,error:r}}const da=e=>({user_email:e.userEmail,match:e.match,date_before:He(e.dateBefore,!0),date_after:He(e.dateAfter),date_between:e.dateBetween&&[He(e.dateBetween[0]),He(e.dateBetween[1],!0)],type_is:e.typeIs,type_is_not:e.typeIsNot});function*la(e){const t=(0,ke.addQueryArgs)(`${pe}/documents`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...da(e)});try{const r=yield(0,le.apiFetch)({path:t});yield ia(e,r.data||[])}catch(t){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving documents.","woocommerce-payments")),yield sa(e,null,t)}}function*pa(e){const t=(0,ke.addQueryArgs)(`${pe}/documents/summary`,da(e));try{const r=yield(0,le.apiFetch)({path:t});yield ca(e,r)}catch(t){yield ua(e,null,t)}}const ma={},_a=({paymentIntents:e},t)=>{const r=e?.[t];return r?.data||{}},ya=({paymentIntents:e},t)=>{const r=e?.[t];return r?.error||{}},ha={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"},fa={summary:{},byId:{},isRequesting:!1},Ea=e=>e&&e.authorizations||{},Sa=(e,t)=>{const r=ye(t);return Ea(e)[r]||{}},ga=(e,t)=>Sa(e,t).data||[],Ta=(e,t)=>(Ea(e).byId||{})[t],wa=(e,t)=>Sa(e,t).error||{},Ra=(e,t)=>{const r=ye(t);return Ea(e).summary[r]||{}},va=(e,t)=>Ra(e,t).data||{},Oa=(e,t)=>Ra(e,t).error||{},ba=e=>Ea(e).isRequesting,Aa=e=>{var t;const r={wcpay_missing_order:(0,W.__)("The order could not be found.","woocommerce-payments"),wcpay_refunded_order_uncapturable:(0,W.__)("Payment cannot be processed for partially or fully refunded orders.","woocommerce-payments"),wcpay_intent_order_mismatch:(0,W.__)("The payment cannot be processed due to a mismatch with order details.","woocommerce-payments"),wcpay_payment_uncapturable:(0,W.__)("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,W.__)("The payment amount is too small to be processed.","woocommerce-payments");const t=e.data.extra_details.minimum_amount_currency,r=Fe(e.data.extra_details.minimum_amount,t);return(0,W.sprintf)((0,W.__)("The minimum amount that can be processed is %1$s %2$s.","woocommerce-payments"),r,t.toUpperCase())})(e):(0,W.__)("The payment capture failed to complete.","woocommerce-payments"),wcpay_cancel_error:(0,W.__)("The payment cancellation failed to complete.","woocommerce-payments"),wcpay_server_error:(0,W.__)("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,W.__)("Unable to process the payment. Please try again later.","woocommerce-payments")};function Ia(e,t){return{type:ha.SET_AUTHORIZATIONS,data:t,query:e}}function Na(e,t){return{type:ha.SET_ERROR_FOR_AUTHORIZATIONS,query:e,error:t}}function Da(e){return{type:ha.SET_AUTHORIZATION,data:e}}function Ma(e,t){return{type:ha.SET_AUTHORIZATIONS_SUMMARY,data:t,query:e}}function Ca(e){return{type:ha.SET_IS_REQUESTING_AUTHORIZATION,data:e}}function*Pa(e,t){try{yield de.controls.dispatch(me,"startResolution","getAuthorization",[e]),yield de.controls.dispatch(me,"setIsRequestingAuthorization",!0);const r=yield(0,le.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 Da(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,W.sprintf)((0,W.__)("Payment for order #%s captured successfully.","woocommerce-payments"),t))}catch(e){const r=(0,W.sprintf)((0,W.__)("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*Fa(e,t){try{yield de.controls.dispatch(me,"startResolution","getAuthorization",[e]),yield de.controls.dispatch(me,"setIsRequestingAuthorization",!0);const r=yield(0,le.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 Da(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,W.sprintf)((0,W.__)("Payment for order #%s canceled successfully.","woocommerce-payments"),t))}catch(e){const r=(0,W.sprintf)((0,W.__)("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 Ua(e,t){return{type:ha.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY,query:e,error:t}}function*xa(e){let{paged:t=1,per_page:r=25,orderby:o="created",order:n="asc"}=e;"capture_by"===o&&(o="created");const a=(0,ke.addQueryArgs)(`${pe}/authorizations`,{page:t,pagesize:r,sort:o,direction:n});try{var i;const t=yield(0,le.apiFetch)({path:a});yield Ia(e,null!==(i=t.data)&&void 0!==i?i:[])}catch(t){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield Na(e,t)}}function*ka(e){try{if(e){const t=yield(0,le.apiFetch)({path:`${pe}/authorizations/${e}`}),{is_captured:r,payment_intent_id:o,created:n}=t;yield Da({payment_intent_id:o,captured:r,created:n})}}catch(e){"authorization_missing"!==e.code&&(yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving authorization.","woocommerce-payments")))}}function*La(e){const t=(0,ke.addQueryArgs)(`${pe}/authorizations/summary`,{pagesize:e.per_page,sort:e.orderby,direction:e.order,page:e.paged});try{const r=yield(0,le.apiFetch)({path:t});yield Ma(e,null!=r?r:[])}catch(t){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving uncaptured transactions.","woocommerce-payments")),yield Ua(e,t)}}var za=function(e){return e.SET_FILE="SET_FILE",e.SET_ERROR_FOR_FILES="SET_ERROR_FOR_FILES",e}(za||{});const ja=za,Ba={},Ha=({files:e},t)=>{const r=e?.[t];return r?.data||{}},Ya=({files:e},t)=>{const r=e?.[t];return r?.error||{}};function qa(e,t){return{type:ja.SET_FILE,id:e,data:t}}function $a(e,t){return{type:ja.SET_ERROR_FOR_FILES,id:e,error:t}}function*Wa(e){try{const t=yield(0,le.apiFetch)({path:`${pe}/file/${e}/details`});yield qa(e,t)}catch(t){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error retrieving file.","woocommerce-payments")),yield $a(e,t)}}let Ga=function(e){return e.SET_PM_PROMOTIONS="SET_PM_PROMOTIONS",e.SET_ERROR_FOR_PM_PROMOTIONS="SET_ERROR_FOR_PM_PROMOTIONS",e}({});const Va={pmPromotions:void 0,pmPromotionsError:void 0},Qa=e=>{var t;return null!==(t=e.pmPromotions?.pmPromotions)&&void 0!==t?t:[]},Za=e=>e.pmPromotions?.pmPromotionsError;function Ka(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:Ga.SET_PM_PROMOTIONS,data:e}}function Ja(e){return{type:Ga.SET_ERROR_FOR_PM_PROMOTIONS,error:e}}function*ei(e){const t=`${pe}/pm-promotions/${e}/activate`;try{yield(0,le.apiFetch)({path:t,method:"POST"}),yield de.controls.dispatch("core/notices","createSuccessNotice",(0,W.__)("Promotion activated successfully!","woocommerce-payments")),yield de.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error activating promotion. Please try again.","woocommerce-payments")),yield de.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ka(e))}}function*ti(e){const t=`${pe}/pm-promotions/${e}/dismiss`;try{yield(0,le.apiFetch)({path:t,method:"POST"}),yield de.controls.dispatch("core/notices","createSuccessNotice",(0,W.__)("Promotion dismissed.","woocommerce-payments")),yield de.controls.dispatch("wc/payments","invalidateResolution","getPmPromotions",[])}catch(e){yield de.controls.dispatch("core/notices","createErrorNotice",(0,W.__)("Error dismissing promotion. Please try again.","woocommerce-payments")),yield de.controls.dispatch("wc/payments","updateErrorForPmPromotions",Ka(e))}}function ri(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*oi(){const e=`${pe}/pm-promotions`;try{const t=yield(0,le.apiFetch)({path:e});if(r=t,!Array.isArray(r)||!r.every(ri))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,W.__)("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}(0,de.registerStore)(me,{reducer:(0,de.combineReducers)({deposits:(e=he,{type:t,query:r={},data:o=[],error:n})=>{const a=ye(r);switch(t){case _e.SET_DEPOSIT:return{...e,byId:{...e.byId,[o.id]:o}};case _e.SET_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,data:o}};case _e.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,error:n}};case _e.SET_DEPOSITS:return{...e,byId:{...e.byId,...(0,X.keyBy)(o,"id")},queries:{...e.queries,[a]:{data:(0,X.map)(o,"id")}}};case _e.SET_DEPOSITS_COUNT:return{...e,count:o};case _e.SET_ERROR_FOR_DEPOSIT_QUERY:return{...e,queries:{...e.queries,[a]:{error:n}}};case _e.SET_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case _e.SET_ERROR_FOR_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}};case _e.SET_INSTANT_DEPOSIT:return{...e,instant:{...e.instant,data:o}}}return e},transactions:(e=st,{type:t,query:r={},data:o=[],error:n,status:a})=>{const i=ye(r);switch(t){case it.SET_TRANSACTIONS:return{...e,[i]:{data:o}};case it.SET_ERROR_FOR_TRANSACTIONS:return{...e,[i]:{error:n}};case it.SET_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[i]:{data:o}}};case it.SET_ERROR_FOR_TRANSACTIONS_SUMMARY:return{...e,summary:{...e.summary,[i]:{error:n}}};case it.SET_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[i]:{data:o}}}};case it.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},[i]:{error:n}}}};case it.SET_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[i]:{data:o}}}}};case it.SET_ERROR_FOR_FRAUD_OUTCOME_TRANSACTIONS_SUMMARY:return{...e,fraudProtection:{...e.fraudProtection,[a]:{...e.fraudProtection?.[a]||{},summary:{...e.fraudProtection?.[a]?.summary||{},[i]:{error:n}}}}}}return e},charges:(e={},{type:t,id:r,data:o,error:n})=>{switch(t){case kt.SET_CHARGE:e={...e,[r]:{...e[r],data:o}};break;case kt.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 Wt.SET_TIMELINE:e={...e,[r]:{data:o}};break;case Wt.SET_ERROR_FOR_TIMELINE:e={...e,[r]:{...e[r],error:n}}}return e},disputes:(e=Jt,{type:t,query:r={},data:o=[],id:n,error:a})=>{const i=ye(r);switch(t){case Xt.SET_DISPUTE:return{...e,byId:{...e.byId,[o.id]:o}};case Xt.SET_ERROR_FOR_DISPUTE:e={...e,byId:{...e.byId,[n]:{error:a}}};break;case Xt.SET_DISPUTES:return{...e,cached:{...e.cached,...(0,X.keyBy)(o,"dispute_id")},queries:{...e.queries,[i]:{data:(0,X.map)(o,"dispute_id")}}};case Xt.SET_DISPUTES_SUMMARY:return{...e,summary:{...e.summary,[i]:{data:o}}}}return e},settings:(e=Nr,{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: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=zn,t)=>{switch(t.type){case Ln.SET_ACTIVE_LOAN_SUMMARY:return{...e,summary:t.data,summaryError:void 0};case Ln.SET_ERROR_FOR_ACTIVE_LOAN_SUMMARY:return{...e,summary:void 0,summaryError:t.error};case Ln.SET_LOANS:return{...e,loans:t.data,loansError:void 0};case Ln.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=ye(r);switch(t){case Kn.SET_DOCUMENTS:return{...e,[a]:{data:o}};case Kn.SET_ERROR_FOR_DOCUMENTS:return{...e,[a]:{error:n}};case Kn.SET_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{data:o}}};case Kn.SET_ERROR_FOR_DOCUMENTS_SUMMARY:return{...e,summary:{...e.summary,[a]:{error:n}}}}return e},paymentIntents:(e=ma,t)=>{const{type:r,id:o}=t;switch(r){case sr.SET_PAYMENT_INTENT:return{...e,[o]:{...e[o],data:t.data}};case sr.SET_ERROR_FOR_PAYMENT_INTENT:return{...e,[o]:{...e[o],error:t.error}};default:return e}},authorizations:(e=fa,t)=>{switch(t.type){case ha.SET_AUTHORIZATION:{const{data:r}=t;return{...e,byId:{...e.byId,[r.payment_intent_id]:{...e.byId[r.payment_intent_id],...r}}}}case ha.SET_AUTHORIZATIONS:{const{data:r,query:o}=t;return{...e,[ye(o)]:{data:r}}}case ha.SET_ERROR_FOR_AUTHORIZATIONS:{const{error:r,query:o}=t;return{...e,[ye(o)]:{error:r}}}case ha.SET_AUTHORIZATIONS_SUMMARY:{const{data:r,query:o}=t;return{...e,summary:{...e.summary,[ye(o)]:{data:r||{}}}}}case ha.SET_ERROR_FOR_AUTHORIZATIONS_SUMMARY:{const{query:r,error:o}=t;return{...e,summary:{...e.summary,[ye(r)]:{error:o||""}}}}case ha.SET_IS_REQUESTING_AUTHORIZATION:{const{data:r}=t;return{...e,isRequesting:r}}}return e},files:(e=Ba,t)=>{const{type:r,id:o}=t;switch(r){case ja.SET_FILE:return{...e,[o]:{...e[o],data:t.data}};case ja.SET_ERROR_FOR_FILES:return{...e,[o]:{...e[o],error:t.error}};default:return e}},pmPromotions:(e=Va,t)=>{switch(t.type){case Ga.SET_PM_PROMOTIONS:return{...e,pmPromotions:t.data,pmPromotionsError:void 0};case Ga.SET_ERROR_FOR_PM_PROMOTIONS:return{...e,pmPromotions:void 0,pmPromotionsError:t.error}}return e}}),actions:{...t,...a,...c,...l,...h,...S,...w,...O,...I,..._,...C,...U,...L},controls:le.controls,selectors:{...e,...n,...s,...d,...m,...E,...T,...v,...A,...D,...M,...F,...k},resolvers:{...o,...i,...u,...p,...f,...g,...R,...b,...N,...y,...P,...x,...z}});const ni=()=>{const e=window.location.pathname+window.location.search;return e.includes("path=%2Fpayments%2Foverview")?"wcpay-overview":e.includes("path=%2Fpayments%2Fsettings")?"wcpay-settings":e.includes("page=wc-settings")&&e.includes("tab=checkout")?"wc-settings-payments":"unknown"},ai=()=>{const{pmPromotions:e,isLoading:t}=(0,de.useSelect)((e=>{const{getPmPromotions:t,getPmPromotionsError:r,isResolving:o}=e(me);return{pmPromotions:t(),pmPromotionsError:r(),isLoading:o("getPmPromotions")}})),{activatePmPromotion:r,dismissPmPromotion:o}=(()=>{const{activatePmPromotion:e,dismissPmPromotion:t}=(0,de.useDispatch)(me);return{activatePmPromotion:e,dismissPmPromotion:t}})(),n=(0,j.useMemo)((()=>e?.find((e=>"spotlight"===e.type))),[e]),a=(0,j.useCallback)((()=>({promo_id:n?.promo_id,payment_method:n?.payment_method,display_context:"spotlight",source:ni(),path:window.location.pathname+window.location.search})),[n?.promo_id,n?.payment_method]),i=(0,j.useCallback)((()=>{Me("wcpay_payment_method_promotion_view",a())}),[a]),s=(0,j.useCallback)((()=>{n&&(Me("wcpay_payment_method_promotion_activate_click",a()),r(n.id))}),[a,r,n]),c=(0,j.useCallback)((()=>{if(n&&(Me("wcpay_payment_method_promotion_link_click",{...a(),link_type:"terms"}),n.tc_url))try{const e=new URL(n.tc_url);"https:"!==e.protocol&&"http:"!==e.protocol||window.open(n.tc_url,"_blank","noopener,noreferrer")}catch{}}),[a,n]),u=(0,j.useCallback)((()=>{n&&(Me("wcpay_payment_method_promotion_dismiss_click",a()),o(n.id))}),[a,o,n]);return t?null:e&&0!==e.length&&n?(0,q.jsx)(ue,{badge:n.badge_text,badgeType:n.badge_type,heading:n.title,description:n.description,footnote:n.footnote,image:n.image,primaryButtonLabel:n.cta_label,onPrimaryClick:s,secondaryButtonLabel:n.tc_label,onSecondaryClick:c,onDismiss:u,onView:i}):null},ii=()=>{const e=document.getElementById("wcpay-payments-settings-spotlight");e&&(0,B.H)(e).render((0,q.jsx)(ai,{}))};"interactive"===document.readyState||"complete"===document.readyState?ii():window.addEventListener("DOMContentLoaded",ii)})()})();