JezK
Edit File: settings.js
/*! For license information please see settings.js.LICENSE.txt */ (()=>{var e,t,o={4392(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,o){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,o)}function o(e,n,r){return o=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,o,n){var r=[null];r.push.apply(r,o);var s=new(Function.bind.apply(e,r));return n&&t(s,n.prototype),s},o.apply(null,arguments)}function n(e){return function(e){if(Array.isArray(e))return r(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 r(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?r(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 r(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var s=Object.hasOwnProperty,a=Object.setPrototypeOf,i=Object.isFrozen,c=Object.getPrototypeOf,l=Object.getOwnPropertyDescriptor,d=Object.freeze,u=Object.seal,m=Object.create,p="undefined"!=typeof Reflect&&Reflect,h=p.apply,y=p.construct;h||(h=function(e,t,o){return e.apply(t,o)}),d||(d=function(e){return e}),u||(u=function(e){return e}),y||(y=function(e,t){return o(e,n(t))});var _,f=P(Array.prototype.forEach),g=P(Array.prototype.pop),b=P(Array.prototype.push),w=P(String.prototype.toLowerCase),x=P(String.prototype.toString),v=P(String.prototype.match),S=P(String.prototype.replace),k=P(String.prototype.indexOf),j=P(String.prototype.trim),C=P(RegExp.prototype.test),E=(_=TypeError,function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return y(_,t)});function P(e){return function(t){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];return h(e,t,n)}}function N(e,t,o){var n;o=null!==(n=o)&&void 0!==n?n:w,a&&a(e,null);for(var r=t.length;r--;){var s=t[r];if("string"==typeof s){var c=o(s);c!==s&&(i(t)||(t[r]=c),s=c)}e[s]=!0}return e}function T(e){var t,o=m(null);for(t in e)!0===h(s,e,[t])&&(o[t]=e[t]);return o}function M(e,t){for(;null!==e;){var o=l(e,t);if(o){if(o.get)return P(o.get);if("function"==typeof o.value)return P(o.value)}e=c(e)}return function(e){return console.warn("fallback value for",e),null}}var L=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"]),A=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"]),D=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"]),O=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"]),I=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"]),R=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),F=d(["#text"]),B=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"]),z=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"]),W=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"]),q=u(/\{\{[\w\W]*|[\w\W]*\}\}/gm),U=u(/<%[\w\W]*|[\w\W]*%>/gm),$=u(/\${[\w\W]*}/gm),V=u(/^data-[\-\w.\u00B7-\uFFFF]/),G=u(/^aria-[\-\w]+$/),Y=u(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Z=u(/^(?:\w+script|data):/i),J=u(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),K=u(/^html$/i),Q=u(/^[a-z][.\w]*(-[.\w]+)+$/i),X=function(){return"undefined"==typeof window?null:window};return function t(){var o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:X(),r=function(e){return t(e)};if(r.version="2.5.6",r.removed=[],!o||!o.document||9!==o.document.nodeType)return r.isSupported=!1,r;var s=o.document,a=o.document,i=o.DocumentFragment,c=o.HTMLTemplateElement,l=o.Node,u=o.Element,m=o.NodeFilter,p=o.NamedNodeMap,h=void 0===p?o.NamedNodeMap||o.MozNamedAttrMap:p,y=o.HTMLFormElement,_=o.DOMParser,P=o.trustedTypes,ee=u.prototype,te=M(ee,"cloneNode"),oe=M(ee,"nextSibling"),ne=M(ee,"childNodes"),re=M(ee,"parentNode");if("function"==typeof c){var se=a.createElement("template");se.content&&se.content.ownerDocument&&(a=se.content.ownerDocument)}var ae=function(t,o){if("object"!==e(t)||"function"!=typeof t.createPolicy)return null;var n=null,r="data-tt-policy-suffix";o.currentScript&&o.currentScript.hasAttribute(r)&&(n=o.currentScript.getAttribute(r));var s="dompurify"+(n?"#"+n:"");try{return t.createPolicy(s,{createHTML:function(e){return e},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+s+" could not be created."),null}}(P,s),ie=ae?ae.createHTML(""):"",ce=a,le=ce.implementation,de=ce.createNodeIterator,ue=ce.createDocumentFragment,me=ce.getElementsByTagName,pe=s.importNode,he={};try{he=T(a).documentMode?a.documentMode:{}}catch(e){}var ye={};r.isSupported="function"==typeof re&&le&&void 0!==le.createHTMLDocument&&9!==he;var _e,fe,ge=q,be=U,we=$,xe=V,ve=G,Se=Z,ke=J,je=Q,Ce=Y,Ee=null,Pe=N({},[].concat(n(L),n(A),n(D),n(I),n(F))),Ne=null,Te=N({},[].concat(n(B),n(z),n(W),n(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}})),Le=null,Ae=null,De=!0,Oe=!0,Ie=!1,Re=!0,Fe=!1,Be=!0,ze=!1,We=!1,He=!1,qe=!1,Ue=!1,$e=!1,Ve=!0,Ge=!1,Ye=!0,Ze=!1,Je={},Ke=null,Qe=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"]),Xe=null,et=N({},["audio","video","img","source","image","track"]),tt=null,ot=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nt="http://www.w3.org/1998/Math/MathML",rt="http://www.w3.org/2000/svg",st="http://www.w3.org/1999/xhtml",at=st,it=!1,ct=null,lt=N({},[nt,rt,st],x),dt=["application/xhtml+xml","text/html"],ut=null,mt=a.createElement("form"),pt=function(e){return e instanceof RegExp||e instanceof Function},ht=function(t){ut&&ut===t||(t&&"object"===e(t)||(t={}),t=T(t),_e=_e=-1===dt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,fe="application/xhtml+xml"===_e?x:w,Ee="ALLOWED_TAGS"in t?N({},t.ALLOWED_TAGS,fe):Pe,Ne="ALLOWED_ATTR"in t?N({},t.ALLOWED_ATTR,fe):Te,ct="ALLOWED_NAMESPACES"in t?N({},t.ALLOWED_NAMESPACES,x):lt,tt="ADD_URI_SAFE_ATTR"in t?N(T(ot),t.ADD_URI_SAFE_ATTR,fe):ot,Xe="ADD_DATA_URI_TAGS"in t?N(T(et),t.ADD_DATA_URI_TAGS,fe):et,Ke="FORBID_CONTENTS"in t?N({},t.FORBID_CONTENTS,fe):Qe,Le="FORBID_TAGS"in t?N({},t.FORBID_TAGS,fe):{},Ae="FORBID_ATTR"in t?N({},t.FORBID_ATTR,fe):{},Je="USE_PROFILES"in t&&t.USE_PROFILES,De=!1!==t.ALLOW_ARIA_ATTR,Oe=!1!==t.ALLOW_DATA_ATTR,Ie=t.ALLOW_UNKNOWN_PROTOCOLS||!1,Re=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,Fe=t.SAFE_FOR_TEMPLATES||!1,Be=!1!==t.SAFE_FOR_XML,ze=t.WHOLE_DOCUMENT||!1,qe=t.RETURN_DOM||!1,Ue=t.RETURN_DOM_FRAGMENT||!1,$e=t.RETURN_TRUSTED_TYPE||!1,He=t.FORCE_BODY||!1,Ve=!1!==t.SANITIZE_DOM,Ge=t.SANITIZE_NAMED_PROPS||!1,Ye=!1!==t.KEEP_CONTENT,Ze=t.IN_PLACE||!1,Ce=t.ALLOWED_URI_REGEXP||Ce,at=t.NAMESPACE||st,Me=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&pt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Me.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&pt(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),Fe&&(Oe=!1),Ue&&(qe=!0),Je&&(Ee=N({},n(F)),Ne=[],!0===Je.html&&(N(Ee,L),N(Ne,B)),!0===Je.svg&&(N(Ee,A),N(Ne,z),N(Ne,H)),!0===Je.svgFilters&&(N(Ee,D),N(Ne,z),N(Ne,H)),!0===Je.mathMl&&(N(Ee,I),N(Ne,W),N(Ne,H))),t.ADD_TAGS&&(Ee===Pe&&(Ee=T(Ee)),N(Ee,t.ADD_TAGS,fe)),t.ADD_ATTR&&(Ne===Te&&(Ne=T(Ne)),N(Ne,t.ADD_ATTR,fe)),t.ADD_URI_SAFE_ATTR&&N(tt,t.ADD_URI_SAFE_ATTR,fe),t.FORBID_CONTENTS&&(Ke===Qe&&(Ke=T(Ke)),N(Ke,t.FORBID_CONTENTS,fe)),Ye&&(Ee["#text"]=!0),ze&&N(Ee,["html","head","body"]),Ee.table&&(N(Ee,["tbody"]),delete Le.tbody),d&&d(t),ut=t)},yt=N({},["mi","mo","mn","ms","mtext"]),_t=N({},["foreignobject","annotation-xml"]),ft=N({},["title","style","font","a","script"]),gt=N({},A);N(gt,D),N(gt,O);var bt=N({},I);N(bt,R);var wt=function(e){b(r.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=ie}catch(t){e.remove()}}},xt=function(e,t){try{b(r.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){b(r.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!Ne[e])if(qe||Ue)try{wt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},vt=function(e){var t,o;if(He)e="<remove></remove>"+e;else{var n=v(e,/^[\r\n\t ]+/);o=n&&n[0]}"application/xhtml+xml"===_e&&at===st&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var r=ae?ae.createHTML(e):e;if(at===st)try{t=(new _).parseFromString(r,_e)}catch(e){}if(!t||!t.documentElement){t=le.createDocument(at,"template",null);try{t.documentElement.innerHTML=it?ie:r}catch(e){}}var s=t.body||t.documentElement;return e&&o&&s.insertBefore(a.createTextNode(o),s.childNodes[0]||null),at===st?me.call(t,ze?"html":"body")[0]:ze?t.documentElement:s},St=function(e){return de.call(e.ownerDocument||e,e,m.SHOW_ELEMENT|m.SHOW_COMMENT|m.SHOW_TEXT|m.SHOW_PROCESSING_INSTRUCTION|m.SHOW_CDATA_SECTION,null,!1)},kt=function(e){return e instanceof y&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},jt=function(t){return"object"===e(l)?t instanceof l:t&&"object"===e(t)&&"number"==typeof t.nodeType&&"string"==typeof t.nodeName},Ct=function(e,t,o){ye[e]&&f(ye[e],function(e){e.call(r,t,o,ut)})},Et=function(e){var t;if(Ct("beforeSanitizeElements",e,null),kt(e))return wt(e),!0;if(C(/[\u0080-\uFFFF]/,e.nodeName))return wt(e),!0;var o=fe(e.nodeName);if(Ct("uponSanitizeElement",e,{tagName:o,allowedTags:Ee}),e.hasChildNodes()&&!jt(e.firstElementChild)&&(!jt(e.content)||!jt(e.content.firstElementChild))&&C(/<[/\w]/g,e.innerHTML)&&C(/<[/\w]/g,e.textContent))return wt(e),!0;if("select"===o&&C(/<template/i,e.innerHTML))return wt(e),!0;if(7===e.nodeType)return wt(e),!0;if(Be&&8===e.nodeType&&C(/<[/\w]/g,e.data))return wt(e),!0;if(!Ee[o]||Le[o]){if(!Le[o]&&Nt(o)){if(Me.tagNameCheck instanceof RegExp&&C(Me.tagNameCheck,o))return!1;if(Me.tagNameCheck instanceof Function&&Me.tagNameCheck(o))return!1}if(Ye&&!Ke[o]){var n=re(e)||e.parentNode,s=ne(e)||e.childNodes;if(s&&n)for(var a=s.length-1;a>=0;--a){var i=te(s[a],!0);i.__removalCount=(e.__removalCount||0)+1,n.insertBefore(i,oe(e))}}return wt(e),!0}return e instanceof u&&!function(e){var t=re(e);t&&t.tagName||(t={namespaceURI:at,tagName:"template"});var o=w(e.tagName),n=w(t.tagName);return!!ct[e.namespaceURI]&&(e.namespaceURI===rt?t.namespaceURI===st?"svg"===o:t.namespaceURI===nt?"svg"===o&&("annotation-xml"===n||yt[n]):Boolean(gt[o]):e.namespaceURI===nt?t.namespaceURI===st?"math"===o:t.namespaceURI===rt?"math"===o&&_t[n]:Boolean(bt[o]):e.namespaceURI===st?!(t.namespaceURI===rt&&!_t[n])&&!(t.namespaceURI===nt&&!yt[n])&&!bt[o]&&(ft[o]||!gt[o]):!("application/xhtml+xml"!==_e||!ct[e.namespaceURI]))}(e)?(wt(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!C(/<\/no(script|embed|frames)/i,e.innerHTML)?(Fe&&3===e.nodeType&&(t=e.textContent,t=S(t,ge," "),t=S(t,be," "),t=S(t,we," "),e.textContent!==t&&(b(r.removed,{element:e.cloneNode()}),e.textContent=t)),Ct("afterSanitizeElements",e,null),!1):(wt(e),!0)},Pt=function(e,t,o){if(Ve&&("id"===t||"name"===t)&&(o in a||o in mt))return!1;if(Oe&&!Ae[t]&&C(xe,t));else if(De&&C(ve,t));else if(!Ne[t]||Ae[t]){if(!(Nt(e)&&(Me.tagNameCheck instanceof RegExp&&C(Me.tagNameCheck,e)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(e))&&(Me.attributeNameCheck instanceof RegExp&&C(Me.attributeNameCheck,t)||Me.attributeNameCheck instanceof Function&&Me.attributeNameCheck(t))||"is"===t&&Me.allowCustomizedBuiltInElements&&(Me.tagNameCheck instanceof RegExp&&C(Me.tagNameCheck,o)||Me.tagNameCheck instanceof Function&&Me.tagNameCheck(o))))return!1}else if(tt[t]);else if(C(Ce,S(o,ke,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==k(o,"data:")||!Xe[e])if(Ie&&!C(Se,S(o,ke,"")));else if(o)return!1;return!0},Nt=function(e){return"annotation-xml"!==e&&v(e,je)},Tt=function(t){var o,n,s,a;Ct("beforeSanitizeAttributes",t,null);var i=t.attributes;if(i){var c={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ne};for(a=i.length;a--;){var l=o=i[a],d=l.name,u=l.namespaceURI;if(n="value"===d?o.value:j(o.value),s=fe(d),c.attrName=s,c.attrValue=n,c.keepAttr=!0,c.forceKeepAttr=void 0,Ct("uponSanitizeAttribute",t,c),n=c.attrValue,Be&&C(/((--!?|])>)|<\/(style|title)/i,n))xt(d,t);else if(!c.forceKeepAttr&&(xt(d,t),c.keepAttr))if(Re||!C(/\/>/i,n)){Fe&&(n=S(n,ge," "),n=S(n,be," "),n=S(n,we," "));var m=fe(t.nodeName);if(Pt(m,s,n)){if(!Ge||"id"!==s&&"name"!==s||(xt(d,t),n="user-content-"+n),ae&&"object"===e(P)&&"function"==typeof P.getAttributeType)if(u);else switch(P.getAttributeType(m,s)){case"TrustedHTML":n=ae.createHTML(n);break;case"TrustedScriptURL":n=ae.createScriptURL(n)}try{u?t.setAttributeNS(u,d,n):t.setAttribute(d,n),kt(t)?wt(t):g(r.removed)}catch(e){}}}else xt(d,t)}Ct("afterSanitizeAttributes",t,null)}},Mt=function e(t){var o,n=St(t);for(Ct("beforeSanitizeShadowDOM",t,null);o=n.nextNode();)Ct("uponSanitizeShadowNode",o,null),Et(o)||(o.content instanceof i&&e(o.content),Tt(o));Ct("afterSanitizeShadowDOM",t,null)};return r.sanitize=function(t){var n,a,c,d,u,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((it=!t)&&(t="\x3c!--\x3e"),"string"!=typeof t&&!jt(t)){if("function"!=typeof t.toString)throw E("toString is not a function");if("string"!=typeof(t=t.toString()))throw E("dirty is not a string, aborting")}if(!r.isSupported){if("object"===e(o.toStaticHTML)||"function"==typeof o.toStaticHTML){if("string"==typeof t)return o.toStaticHTML(t);if(jt(t))return o.toStaticHTML(t.outerHTML)}return t}if(We||ht(m),r.removed=[],"string"==typeof t&&(Ze=!1),Ze){if(t.nodeName){var p=fe(t.nodeName);if(!Ee[p]||Le[p])throw E("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof l)1===(a=(n=vt("\x3c!----\x3e")).ownerDocument.importNode(t,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?n=a:n.appendChild(a);else{if(!qe&&!Fe&&!ze&&-1===t.indexOf("<"))return ae&&$e?ae.createHTML(t):t;if(!(n=vt(t)))return qe?null:$e?ie:""}n&&He&&wt(n.firstChild);for(var h=St(Ze?t:n);c=h.nextNode();)3===c.nodeType&&c===d||Et(c)||(c.content instanceof i&&Mt(c.content),Tt(c),d=c);if(d=null,Ze)return t;if(qe){if(Ue)for(u=ue.call(n.ownerDocument);n.firstChild;)u.appendChild(n.firstChild);else u=n;return(Ne.shadowroot||Ne.shadowrootmod)&&(u=pe.call(s,u,!0)),u}var y=ze?n.outerHTML:n.innerHTML;return ze&&Ee["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&C(K,n.ownerDocument.doctype.name)&&(y="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+y),Fe&&(y=S(y,ge," "),y=S(y,be," "),y=S(y,we," ")),ae&&$e?ae.createHTML(y):y},r.setConfig=function(e){ht(e),We=!0},r.clearConfig=function(){ut=null,We=!1},r.isValidAttribute=function(e,t,o){ut||ht({});var n=fe(e),r=fe(t);return Pt(n,r,o)},r.addHook=function(e,t){"function"==typeof t&&(ye[e]=ye[e]||[],b(ye[e],t))},r.removeHook=function(e){if(ye[e])return g(ye[e])},r.removeHooks=function(e){ye[e]&&(ye[e]=[])},r.removeAllHooks=function(){ye={}},r}()}()},3902(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-add-outline",i,!!function(e){return 0==e%18}(o)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm5 9h-4V7h-2v4H7v2h4v4h2v-4h4v-2z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},2291(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-checkmark",i,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M9 19.414l-6.707-6.707 1.414-1.414L9 16.586 20.293 5.293l1.414 1.414z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},8971(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-cross-circle",i,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M19.1 4.9C15.2 1 8.8 1 4.9 4.9S1 15.2 4.9 19.1s10.2 3.9 14.1 0 4-10.3.1-14.2zm-4.3 11.3L12 13.4l-2.8 2.8-1.4-1.4 2.8-2.8-2.8-2.8 1.4-1.4 2.8 2.8 2.8-2.8 1.4 1.4-2.8 2.8 2.8 2.8-1.4 1.4z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},9572(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-cross-small",i,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M17.705 7.705l-1.41-1.41L12 10.59 7.705 6.295l-1.41 1.41L10.59 12l-4.295 4.295 1.41 1.41L12 13.41l4.295 4.295 1.41-1.41L13.41 12l4.295-4.295z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},8556(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-help-outline",i,!!function(e){return 0==e%18}(o)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm4 8a4 4 0 00-8 0h2c0-1.103.897-2 2-2s2 .897 2 2-.897 2-2 2a1 1 0 00-1 1v2h2v-1.141A3.991 3.991 0 0016 10zm-3 6h-2v2h2v-2z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},8851(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-help",i,!!function(e){return 0==e%18}(o)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 16h-2v-2h2v2zm0-4.141V15h-2v-2a1 1 0 011-1c1.103 0 2-.897 2-2s-.897-2-2-2-2 .897-2 2H8a4 4 0 018 0 3.991 3.991 0 01-3 3.859z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},9931(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-image",i,!1,!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M20 6v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h12a2 2 0 012 2zm-2 0H6v6.38l2.19-2.19 5.23 5.23 1-1a1.59 1.59 0 012.11.11L18 16V6zm-5 3.5a1.5 1.5 0 113 0 1.5 1.5 0 01-3 0z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},6947(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-info-outline",i,!!function(e){return 0==e%18}(o)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M13 9h-2V7h2v2zm0 2h-2v6h2v-6zm-1-7c-4.411 0-8 3.589-8 8s3.589 8 8 8 8-3.589 8-8-3.589-8-8-8m0-2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},8295(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-notice-outline",i,!!function(e){return 0==e%18}(o)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},9044(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-notice",i,!!function(e){return 0==e%18}(o)&&"needs-offset",!1,!1].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2l-.5-6h3l-.5 6z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},5264(e,t,o){"use strict";t.A=function(e){var t=e.size,o=void 0===t?24:t,n=e.onClick,i=(e.icon,e.className),c=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],0<=t.indexOf(o)||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(e,s),l=["gridicon","gridicons-trash",i,!1,!1,!!function(e){return 0==e%18}(o)&&"needs-offset-y"].filter(Boolean).join(" ");return r.default.createElement("svg",a({className:l,height:o,width:o,onClick:n},c,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"}),r.default.createElement("g",null,r.default.createElement("path",{d:"M6.187 8h11.625l-.695 11.125A2 2 0 0115.121 21H8.879a2 2 0 01-1.996-1.875L6.187 8zM19 5v2H5V5h3V4a2 2 0 012-2h4a2 2 0 012 2v1h3zm-9 0h4V4h-4v1z"})))};var n,r=(n=o(1609))&&n.__esModule?n:{default:n},s=["size","onClick","icon","className"];function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t,o=1;o<arguments.length;o++)for(var n in t=arguments[o])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},a.apply(this,arguments)}},6186(e,t,o){"use strict";var n=o(2985);function r(){}function s(){}s.resetWarningCache=r,e.exports=function(){function e(e,t,o,r,s,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:s,resetWarningCache:r};return o.PropTypes=o,o}},2736(e,t,o){e.exports=o(6186)()},2985(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},1609(e){"use strict";e.exports=window.React},790(e){"use strict";e.exports=window.ReactJSXRuntime},7723(e){"use strict";e.exports=window.wp.i18n}},n={};function r(e){var t=n[e];if(void 0!==t)return t.exports;var s=n[e]={exports:{}};return o[e].call(s.exports,s,s.exports,r),s.exports}r.m=o,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.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((t,o)=>(r.f[o](e,t),t),[])),r.u=e=>"chunks/"+(4701===e?"wcpay-phone-input":e)+".js?ver="+{4701:"f2f1d9501fe2d2329ad9",7189:"6e66f730143ed421da7b"}[e],r.miniCssF=e=>{},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="woocommerce-payments:",r.l=(o,n,s,a)=>{if(e[o])e[o].push(n);else{var i,c;if(void 0!==s)for(var l=document.getElementsByTagName("script"),d=0;d<l.length;d++){var u=l[d];if(u.getAttribute("src")==o||u.getAttribute("data-webpack")==t+s){i=u;break}}i||(c=!0,(i=document.createElement("script")).charset="utf-8",r.nc&&i.setAttribute("nonce",r.nc),i.setAttribute("data-webpack",t+s),i.src=o),e[o]=[n];var m=(t,n)=>{i.onerror=i.onload=null,clearTimeout(p);var r=e[o];if(delete e[o],i.parentNode&&i.parentNode.removeChild(i),r&&r.forEach(e=>e(n)),t)return t(n)},p=setTimeout(m.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=m.bind(null,i.onerror),i.onload=m.bind(null,i.onload),c&&document.head.appendChild(i)}},r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(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(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=e})(),(()=>{var e={6472:0};r.f.j=(t,o)=>{var n=r.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{var s=new Promise((o,r)=>n=e[t]=[o,r]);o.push(n[2]=s);var a=r.p+r.u(t),i=new Error;r.l(a,o=>{if(r.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var s=o&&("load"===o.type?"missing":o.type),a=o&&o.target&&o.target.src;i.message="Loading chunk "+t+" failed.\n("+s+": "+a+")",i.name="ChunkLoadError",i.type=s,i.request=a,n[1](i)}},"chunk-"+t,t)}};var t=(t,o)=>{var n,s,[a,i,c]=o,l=0;if(a.some(t=>0!==e[t])){for(n in i)r.o(i,n)&&(r.m[n]=i[n]);c&&c(r)}for(t&&t(o);l<a.length;l++)s=a[l],r.o(e,s)&&e[s]&&e[s][0](),e[s]=0},o=globalThis.webpackChunkwoocommerce_payments=globalThis.webpackChunkwoocommerce_payments||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})(),r.p=window.wcpayAssets.url,(()=>{"use strict";var e={};r.r(e),r.d(e,{getAccountBusinessSupportEmail:()=>V,getAccountBusinessSupportPhone:()=>G,getAccountCommunicationsEmail:()=>Me,getAccountDomesticCurrency:()=>Y,getAccountStatementDescriptor:()=>q,getAccountStatementDescriptorKana:()=>$,getAccountStatementDescriptorKanji:()=>U,getAdvancedFraudProtectionSettings:()=>je,getAvailablePaymentMethodIds:()=>B,getCompletedWaitingPeriod:()=>X,getCurrentProtectionLevel:()=>ke,getDepositDelayDays:()=>Q,getDepositRestrictions:()=>te,getDepositScheduleInterval:()=>Z,getDepositScheduleMonthlyAnchor:()=>K,getDepositScheduleWeeklyAnchor:()=>J,getDepositStatus:()=>ee,getDuplicatedPaymentMethodIds:()=>I,getEnabledPaymentMethodIds:()=>F,getExpressCheckoutCartMethods:()=>Ae,getExpressCheckoutCheckoutMethods:()=>De,getExpressCheckoutProductMethods:()=>Le,getIsCardPresentEligible:()=>_e,getIsDebugLogEnabled:()=>ce,getIsDevModeEnabled:()=>se,getIsExpressCheckoutInPaymentMethodsEnabled:()=>ie,getIsManualCaptureEnabled:()=>oe,getIsMultiCurrencyEnabled:()=>le,getIsPaymentRequestEnabled:()=>ae,getIsSavedCardsEnabled:()=>he,getIsStripeBillingEnabled:()=>Ee,getIsStripeBillingMigrationInProgress:()=>Pe,getIsSubscriptionsPluginActive:()=>be,getIsTestModeEnabled:()=>ne,getIsTestModeOnboarding:()=>re,getIsWCPayEnabled:()=>R,getIsWCPaySubscriptionsEligible:()=>ge,getIsWCPaySubscriptionsEnabled:()=>fe,getIsWooPayEnabled:()=>we,getIsWooPayGlobalThemeSupportEnabled:()=>xe,getPaymentMethodStatuses:()=>z,getPaymentRequestButtonBorderRadius:()=>pe,getPaymentRequestButtonSize:()=>ue,getPaymentRequestButtonTheme:()=>me,getPaymentRequestButtonType:()=>de,getSavingError:()=>ye,getSettings:()=>O,getShowWooPayIncompatibilityNotice:()=>Ce,getStripeBillingMigratedCount:()=>Te,getStripeBillingSubscriptionCount:()=>Ne,getWooPayCustomMessage:()=>ve,getWooPayStoreLogo:()=>Se,isDirty:()=>H,isSavingSettings:()=>W});var t={};r.r(t),r.d(t,{saveOption:()=>Nt,saveSettings:()=>_t,submitStripeBillingSubscriptionMigration:()=>Pt,updateAccountBusinessSupportEmail:()=>ut,updateAccountBusinessSupportPhone:()=>mt,updateAccountCommunicationsEmail:()=>kt,updateAccountStatementDescriptor:()=>ct,updateAccountStatementDescriptorKana:()=>dt,updateAccountStatementDescriptorKanji:()=>lt,updateAdvancedFraudProtectionSettings:()=>vt,updateDepositScheduleInterval:()=>pt,updateDepositScheduleMonthlyAnchor:()=>yt,updateDepositScheduleWeeklyAnchor:()=>ht,updateEnabledPaymentMethodIds:()=>Xe,updateExpressCheckoutCartMethods:()=>Ct,updateExpressCheckoutCheckoutMethods:()=>Et,updateExpressCheckoutProductMethods:()=>jt,updateIsCardPresentEligible:()=>Ue,updateIsDebugLogEnabled:()=>st,updateIsExpressCheckoutInPaymentMethodsEnabled:()=>Qe,updateIsManualCaptureEnabled:()=>nt,updateIsMultiCurrencyEnabled:()=>at,updateIsPaymentRequestEnabled:()=>Ke,updateIsSavedCardsEnabled:()=>qe,updateIsSavingSettings:()=>et,updateIsStripeBillingEnabled:()=>St,updateIsTestModeEnabled:()=>rt,updateIsWCPayEnabled:()=>Je,updateIsWCPaySubscriptionsEnabled:()=>it,updateIsWooPayEnabled:()=>ft,updateIsWooPayGlobalThemeSupportEnabled:()=>gt,updatePaymentRequestButtonBorderRadius:()=>Ye,updatePaymentRequestButtonSize:()=>Ve,updatePaymentRequestButtonTheme:()=>Ge,updatePaymentRequestButtonType:()=>$e,updateProtectionLevel:()=>xt,updateSelectedPaymentMethod:()=>tt,updateSettings:()=>Ze,updateUnselectedPaymentMethod:()=>ot,updateWooPayCustomMessage:()=>bt,updateWooPayStoreLogo:()=>wt});var o={};r.r(o),r.d(o,{getSettings:()=>Tt});var n={};r.r(n),r.d(n,{submitInstantDeposit:()=>Tr,updateAllDepositsOverviews:()=>vr,updateDeposit:()=>xr,updateDeposits:()=>kr,updateDepositsCount:()=>jr,updateDepositsSummary:()=>Er,updateErrorForAllDepositsOverviews:()=>Sr,updateErrorForDepositQuery:()=>Cr,updateErrorForDepositsSummary:()=>Pr,updateInstantDeposit:()=>Nr});var s={};r.r(s),r.d(s,{getAllDepositsOverviews:()=>Lr,getDeposit:()=>Mr,getDeposits:()=>Ir,getDepositsSummary:()=>Rr,getPayoutsCSVRequestURL:()=>Or,payoutsDownloadEndpoint:()=>Dr});var a={};r.r(a),r.d(a,{getAllDepositsOverviews:()=>zr,getAllDepositsOverviewsError:()=>Wr,getDeposit:()=>Br,getDepositQueryError:()=>$r,getDeposits:()=>qr,getDepositsCount:()=>Ur,getDepositsSummary:()=>Gr,getDepositsSummaryError:()=>Yr,getInstantDeposit:()=>Zr});var i={};r.r(i),r.d(i,{activatePmPromotion:()=>Hs,dismissPmPromotion:()=>qs,updateErrorForPmPromotions:()=>Ws,updatePmPromotions:()=>zs});var c={};r.r(c),r.d(c,{getPmPromotions:()=>$s});var l={};r.r(l),r.d(l,{getPmPromotions:()=>Vs,getPmPromotionsError:()=>Gs});var d=r(1609),u=r.n(d);const m=window.ReactDOM,p="https://cdn.sift.com/s.js",h=({beacon_key:e,session_id:t,user_id:o})=>{const n=window._sift=window._sift||[];if(n.push(["_setAccount",e]),n.push(["_setUserId",o]),n.push(["_setSessionId",t]),n.push(["_trackPageview"]),!document.querySelector(`[src="${p}"]`)){const e=document.createElement("script");e.src=p,e.async=!0,document.body.appendChild(e)}};(Object.getOwnPropertyDescriptor(h,"name")||{}).writable||Object.defineProperty(h,"name",{value:"default",configurable:!0});const y="https://js.stripe.com/v3",_=()=>{if(!document.querySelector(`[src^="${y}"]`)){const e=document.createElement("script");e.src=y,e.async=!0,document.body.appendChild(e)}};(Object.getOwnPropertyDescriptor(_,"name")||{}).writable||Object.defineProperty(_,"name",{value:"default",configurable:!0});const f={sift:h,stripe:_},g=e=>{for(const t in e){const o=f[t];o&&e[t]&&o(e[t])}};(Object.getOwnPropertyDescriptor(g,"name")||{}).writable||Object.defineProperty(g,"name",{value:"default",configurable:!0});const b=window.wp.components;var w=r(7723);const x=window.wc.navigation,v=window.wp.data,S={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"},k={isDirty:!1,isSaving:!1,savingError:null,data:{}},j="basic",C="advanced",E="standard",P="high",N=e=>"object"==typeof wcpayExpressCheckoutParams&&wcpayExpressCheckoutParams.hasOwnProperty(e)?wcpayExpressCheckoutParams[e]:null,T=()=>"undefined"==typeof wcpaySettings?4:parseInt(window?.wcpaySettings?.defaultExpressCheckoutBorderRadius||4,10),M=(e,t,o="wcpay_")=>e.toString().replace("%%endpoint%%",o+t),L={},A=[],D=e=>e&&e.settings||L,O=e=>D(e).data||L,I=e=>O(e).duplicated_payment_method_ids||L,R=e=>O(e).is_wcpay_enabled||!1,F=e=>O(e).enabled_payment_method_ids||A,B=e=>O(e).available_payment_method_ids||A,z=e=>O(e).payment_method_statuses||L,W=e=>D(e).isSaving||!1,H=e=>D(e).isDirty||!1,q=e=>O(e).account_statement_descriptor||"",U=e=>O(e).account_statement_descriptor_kanji||"",$=e=>O(e).account_statement_descriptor_kana||"",V=e=>O(e).account_business_support_email||"",G=e=>O(e).account_business_support_phone||"",Y=e=>O(e).account_domestic_currency||"",Z=e=>O(e).deposit_schedule_interval||"",J=e=>O(e).deposit_schedule_weekly_anchor||"",K=e=>O(e).deposit_schedule_monthly_anchor||"",Q=e=>O(e).deposit_delay_days||"7",X=e=>O(e).deposit_completed_waiting_period||!1,ee=e=>O(e).deposit_status||"",te=e=>O(e).deposit_restrictions||"",oe=e=>O(e).is_manual_capture_enabled||!1,ne=e=>O(e).is_test_mode_enabled||!1,re=e=>O(e).is_test_mode_onboarding||!1,se=e=>O(e).is_dev_mode_enabled||!1,ae=e=>O(e).is_payment_request_enabled||!1,ie=e=>O(e).is_express_checkout_in_payment_methods_enabled||!1,ce=e=>O(e).is_debug_log_enabled||!1,le=e=>O(e).is_multi_currency_enabled||!1,de=e=>O(e).payment_request_button_type||"",ue=e=>O(e).payment_request_button_size||"",me=e=>O(e).payment_request_button_theme||"",pe=e=>{const t=O(e)?.payment_request_button_border_radius;return 0===t||"0"===t||t?t:T()},he=e=>O(e).is_saved_cards_enabled||!1,ye=e=>D(e).savingError,_e=e=>O(e).is_card_present_eligible||!1,fe=e=>O(e).is_wcpay_subscriptions_enabled||!1,ge=e=>O(e).is_wcpay_subscriptions_eligible||!1,be=e=>O(e).is_subscriptions_plugin_active||!1,we=e=>O(e).is_woopay_enabled||!1,xe=e=>O(e).is_woopay_global_theme_support_enabled||!1,ve=e=>O(e).woopay_custom_message||"",Se=e=>O(e).woopay_store_logo||"",ke=e=>O(e).current_protection_level||j,je=e=>O(e).advanced_fraud_protection_settings||A,Ce=e=>O(e).show_woopay_incompatibility_notice||!1,Ee=e=>O(e).is_stripe_billing_enabled||!1,Pe=e=>O(e).is_migrating_stripe_billing||!1,Ne=e=>O(e).stripe_billing_subscription_count||0,Te=e=>O(e).stripe_billing_migrated_count||0,Me=e=>O(e).account_communications_email||"",Le=e=>O(e).express_checkout_product_methods||A,Ae=e=>O(e).express_checkout_cart_methods||A,De=e=>O(e).express_checkout_checkout_methods||A,Oe=window.wp.dataControls,Ie=window.wp.apiFetch;var Re=r.n(Ie);const Fe="/wc/v3/payments",Be="wc/payments/deposits",ze="wc/payments/settings",We="wc/payments/pmPromotions";function He(e){return{type:S.SET_SETTINGS_VALUES,payload:e}}function qe(e){return He({is_saved_cards_enabled:e})}function Ue(e){return He({is_card_present_eligible:e})}function $e(e){return He({payment_request_button_type:e})}function Ve(e){return He({payment_request_button_size:e})}function Ge(e){return He({payment_request_button_theme:e})}function Ye(e){return He({payment_request_button_border_radius:e})}function Ze(e){return{type:S.SET_SETTINGS,data:e}}function Je(e){return He({is_wcpay_enabled:e})}function Ke(e){return He({is_payment_request_enabled:e})}function Qe(e){return He({is_express_checkout_in_payment_methods_enabled:e})}function Xe(e){return He({enabled_payment_method_ids:[...e]})}function et(e,t){return{type:S.SET_IS_SAVING_SETTINGS,isSaving:e,error:t}}function tt(e){return{type:S.SET_SELECTED_PAYMENT_METHOD,id:e}}function ot(e){return{type:S.SET_UNSELECTED_PAYMENT_METHOD,id:e}}function nt(e){return He({is_manual_capture_enabled:e})}function rt(e){return He({is_test_mode_enabled:e})}function st(e){return He({is_debug_log_enabled:e})}function at(e){return He({is_multi_currency_enabled:e})}function it(e){return He({is_wcpay_subscriptions_enabled:e})}function ct(e){return He({account_statement_descriptor:e})}function lt(e){return He({account_statement_descriptor_kanji:e})}function dt(e){return He({account_statement_descriptor_kana:e})}function ut(e){return He({account_business_support_email:e})}function mt(e){return He({account_business_support_phone:e})}function pt(e){return He({deposit_schedule_interval:e})}function ht(e){return He({deposit_schedule_weekly_anchor:e})}function yt(e){return He({deposit_schedule_monthly_anchor:""===e?null:parseInt(e,10)})}function*_t(){let e=null;try{const e=(0,v.select)(ze).getSettings();yield et(!0,null);const t=yield(0,Oe.apiFetch)({path:`${Fe}/settings`,method:"post",data:e});yield Ze({...e,payment_method_statuses:t.data.payment_method_statuses}),yield(0,v.dispatch)("core/notices").createSuccessNotice((0,w.__)("Settings saved.","woocommerce-payments"))}catch(t){e=t,yield(0,v.dispatch)("core/notices").createErrorNotice((0,w.__)("Error saving settings.","woocommerce-payments")),e.server_error&&!e.data?.details&&(yield(0,v.dispatch)("core/notices").createErrorNotice(e.server_error))}finally{yield et(!1,e)}return null===e}function ft(e){return He({is_woopay_enabled:e})}function gt(e){return He({is_woopay_global_theme_support_enabled:e})}function bt(e){return He({woopay_custom_message:e})}function wt(e){return He({woopay_store_logo:e})}function xt(e){return He({current_protection_level:e})}function vt(e){return He({advanced_fraud_protection_settings:e})}function St(e){return He({is_stripe_billing_enabled:e})}function kt(e){return He({account_communications_email:e})}function jt(e){return He({express_checkout_product_methods:[...e]})}function Ct(e){return He({express_checkout_cart_methods:[...e]})}function Et(e){return He({express_checkout_checkout_methods:[...e]})}function*Pt(){try{yield(0,v.dispatch)(ze).startResolution("scheduleStripeBillingMigration"),yield(0,Oe.apiFetch)({path:`${Fe}/settings/schedule-stripe-billing-migration`,method:"post"})}catch(e){yield(0,v.dispatch)("core/notices").createErrorNotice((0,w.__)("Error starting the Stripe Billing migration.","woocommerce-payments"))}yield(0,v.dispatch)(ze).finishResolution("scheduleStripeBillingMigration")}function Nt(e,t){return Re()({path:`${Fe}/settings/${e}`,method:"post",data:{value:t}}).catch(()=>{(0,v.dispatch)("core/notices").createErrorNotice((0,w.__)("Error saving option","woocommerce-payments"))})}function*Tt(){const e=`${Fe}/settings`;try{const t=yield(0,Oe.apiFetch)({path:e});yield Ze(t)}catch(e){yield(0,v.dispatch)("core/notices").createErrorNotice((0,w.__)("Error retrieving settings.","woocommerce-payments"))}}const Mt=ze,Lt=(0,v.createReduxStore)(Mt,{reducer:(0,v.combineReducers)({settings:(e=k,{type:t,...o})=>{switch(t){case S.SET_SETTINGS:return{...e,data:o.data,isDirty:!1};case S.SET_SETTINGS_VALUES:return{...e,savingError:null,isDirty:!0,data:{...e.data,...o.payload}};case S.SET_IS_SAVING_SETTINGS:return{...e,isDirty:!(!o.isSaving&&!o.error)&&e.isDirty,isSaving:o.isSaving,savingError:o.error};case S.SET_SELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.concat(o.id)}};case S.SET_UNSELECTED_PAYMENT_METHOD:return{...e,isDirty:!0,data:{...e.data,enabled_payment_method_ids:e.data.enabled_payment_method_ids.filter(e=>e!==o.id)}}}return e}}),actions:t,selectors:e,resolvers:o,controls:Oe.controls});(0,v.register)(Lt);const At=()=>{const{updateEnabledPaymentMethodIds:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getEnabledPaymentMethodIds()),e]},Dt=()=>(0,v.useSelect)(e=>e(Mt).getIsTestModeOnboarding(),[]),Ot=()=>(0,v.useSelect)(e=>e(Mt).getIsDevModeEnabled(),[]),It=()=>{const{updateIsManualCaptureEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsManualCaptureEnabled()),e]},Rt=()=>(0,v.useSelect)(e=>e(Mt).getAvailablePaymentMethodIds()),Ft=()=>(0,v.useSelect)(e=>e(Mt).getPaymentMethodStatuses()),Bt=()=>(0,v.useSelect)(e=>e(Mt).getSettings()),zt=()=>{const{saveSettings:e}=(0,v.useDispatch)(Mt),t=(0,v.useSelect)(e=>e(Mt).isSavingSettings()),o=(0,v.useSelect)(e=>e(Mt).isDirty());return{isLoading:(0,v.useSelect)(e=>{e(Mt).getSettings();const t=e(Mt).isResolving("getSettings"),o=e(Mt).hasFinishedResolution("getSettings");return t||!o}),saveSettings:e,isSaving:t,isDirty:o}},Wt=()=>{const{updateIsPaymentRequestEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsPaymentRequestEnabled()),e]},Ht=()=>{const{updateIsExpressCheckoutInPaymentMethodsEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsExpressCheckoutInPaymentMethodsEnabled()),e]},qt=e=>()=>{const{updateExpressCheckoutProductMethods:t,updateExpressCheckoutCartMethods:o,updateExpressCheckoutCheckoutMethods:n}=(0,v.useDispatch)(Mt),r=(0,v.useSelect)(e=>e(Mt).getExpressCheckoutProductMethods()),s=(0,v.useSelect)(e=>e(Mt).getExpressCheckoutCartMethods()),a=(0,v.useSelect)(e=>e(Mt).getExpressCheckoutCheckoutMethods()),i={product:r,cart:s,checkout:a},c={product:t,cart:o,checkout:n};return[[r.includes(e)&&"product",s.includes(e)&&"cart",a.includes(e)&&"checkout"].filter(Boolean),(t,o)=>{c[t](o?[...i[t],e]:i[t].filter(t=>t!==e))}]},Ut=qt("payment_request"),$t=()=>{const{updatePaymentRequestButtonType:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getPaymentRequestButtonType()),e]},Vt=()=>{const{updatePaymentRequestButtonSize:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getPaymentRequestButtonSize()),e]},Gt=()=>{const{updatePaymentRequestButtonTheme:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getPaymentRequestButtonTheme()),e]},Yt=()=>{const{updatePaymentRequestButtonBorderRadius:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getPaymentRequestButtonBorderRadius()),e]},Zt=()=>(0,v.useSelect)(e=>e(Mt).getSavingError(),[]),Jt=()=>{const{updateIsWooPayEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsWooPayEnabled()),e]},Kt=qt("woopay"),Qt=()=>{const{updateEnabledPaymentMethodIds:e}=(0,v.useDispatch)(Mt),t=(0,v.useSelect)(e=>e(Mt).getEnabledPaymentMethodIds());return[t.includes("amazon_pay"),o=>{e(o?[...t,"amazon_pay"]:t.filter(e=>"amazon_pay"!==e))}]},Xt=qt("amazon_pay"),eo=()=>(0,v.useSelect)(e=>e(Mt).getShowWooPayIncompatibilityNotice()),to=()=>{const{updateIsStripeBillingEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsStripeBillingEnabled()),e]};var oo=r(790);const no=()=>{const e=Ot(),[t,o]=(()=>{const{updateIsDebugLogEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsDebugLogEnabled()),e]})();return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h4",{children:(0,w.__)("Debug mode","woocommerce-payments")}),(0,oo.jsx)(b.CheckboxControl,{label:e?(0,w.__)("Log error messages (defaulted on for test accounts)","woocommerce-payments"):(0,w.__)("Log error messages","woocommerce-payments"),help:(0,w.__)("When enabled, payment error logs will be saved to WooCommerce > Status > Logs.","woocommerce-payments"),disabled:e,checked:e||t,onChange:o,__nextHasNoMarginBottom:!0})]})};function ro(e){return e.startsWith("{{/")?{type:"componentClose",value:e.replace(/\W/g,"")}:e.endsWith("/}}")?{type:"componentSelfClosing",value:e.replace(/\W/g,"")}:e.startsWith("{{")?{type:"componentOpen",value:e.replace(/\W/g,"")}:{type:"string",value:e}}function so(e,t){let o,n,r=[];for(let s=0;s<e.length;s++){const a=e[s];if("string"!==a.type){if(void 0===t[a.value])throw new Error(`Invalid interpolation, missing component node: \`${a.value}\``);if("object"!=typeof t[a.value])throw new Error(`Invalid interpolation, component node must be a ReactElement or null: \`${a.value}\``);if("componentClose"===a.type)throw new Error(`Missing opening component token: \`${a.value}\``);if("componentOpen"===a.type){o=t[a.value],n=s;break}r.push(t[a.value])}else r.push(a.value)}if(o){const s=function(e,t){const o=t[e];let n=0;for(let r=e+1;r<t.length;r++){const e=t[r];if(e.value===o.value){if("componentOpen"===e.type){n++;continue}if("componentClose"===e.type){if(0===n)return r;n--}}}throw new Error("Missing closing component token `"+o.value+"`")}(n,e),a=so(e.slice(n+1,s),t),i=(0,d.cloneElement)(o,{},a);if(r.push(i),s<e.length-1){const o=so(e.slice(s+1),t);r=r.concat(o)}}return r=r.filter(Boolean),0===r.length?null:1===r.length?r[0]:(0,d.createElement)(d.Fragment,null,...r)}function ao(e){const{mixedString:t,components:o,throwErrors:n}=e;if(!o)return t;if("object"!=typeof o){if(n)throw new Error(`Interpolation Error: unable to process \`${t}\` because components is not an object`);return t}const r=function(e){return e.split(/(\{\{\/?\s*\w+\s*\/?\}\})/g).map(ro)}(t);try{return so(r,o)}catch(e){if(n)throw new Error(`Interpolation Error: unable to process \`${t}\` because of error \`${e.message}\``);return t}}const io=()=>{const[e,t]=(()=>{const{updateIsMultiCurrencyEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsMultiCurrencyEnabled()),e]})();return(0,oo.jsx)(b.CheckboxControl,{label:(0,w.__)("Enable Multi-Currency","woocommerce-payments"),help:ao({mixedString:(0,w.__)("Allow customers to shop and pay in multiple currencies. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),components:{learnMoreLink:(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/currencies/multi-currency-setup/"})}}),checked:e,onChange:e=>{t(e)},"data-testid":"multi-currency-toggle",__nextHasNoMarginBottom:!0})},co=()=>{const[e,t,o]=(()=>{const{updateIsWCPaySubscriptionsEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsWCPaySubscriptionsEnabled()),(0,v.useSelect)(e=>e(Mt).getIsWCPaySubscriptionsEligible()),e]})();return!wcpaySettings.isSubscriptionsActive&&t?(0,oo.jsx)(b.CheckboxControl,{label:(0,w.sprintf)((0,w.__)("Enable Subscriptions with %s","woocommerce-payments"),"WooPayments"),help:ao({mixedString:(0,w.__)("This feature is deprecated. Existing subscription renewals will continue to work, but creating or managing subscriptions is no longer available. Install {{learnMoreLink}}WooCommerce Subscriptions{{/learnMoreLink}} to continue managing subscriptions.","woocommerce-payments"),components:{learnMoreLink:(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/products/woocommerce-subscriptions/"})}}),checked:e,onChange:e=>{e||o(e)},disabled:!e,__nextHasNoMarginBottom:!0}):null};function lo(e){var t,o,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(o=lo(e[t]))&&(n&&(n+=" "),n+=o)}else for(o in e)e[o]&&(n&&(n+=" "),n+=o);return n}const uo=function(){for(var e,t,o=0,n="",r=arguments.length;o<r;o++)(e=arguments[o])&&(t=lo(e))&&(n&&(n+=" "),n+=t);return n},mo=({className:e,...t})=>(0,oo.jsx)(b.CardBody,{className:uo("wcpay-card-body",e),...t}),po=window.wp.element,ho=window.wp.primitives,yo=({children:e,actions:t,className:o,...n})=>(0,oo.jsxs)(b.Modal,{className:uo("wcpay-confirmation-modal",o),...n,children:[e,(0,oo.jsx)(ho.HorizontalRule,{className:"wcpay-confirmation-modal__separator"}),(0,oo.jsx)("div",{className:"wcpay-confirmation-modal__footer",children:t})]}),_o=(0,d.createContext)({isStripeBillingEnabled:!1,savedIsStripeBillingEnabled:!1,isMigrationOptionShown:!1,isMigrationInProgress:!1,hasSavedSettings:!1,subscriptionCount:0,migratedCount:0,startMigration:()=>null,isResolvingMigrateRequest:!1,hasResolvedMigrateRequest:!1,setIsMigrationInProgress:()=>null});var fo=r(2291),go=r(8295),bo=r(6947);const wo=function(e){const{icon:t,actions:o,children:n,buttonVariant:r,...s}=e;s.className=uo("wcpay-inline-notice",`wcpay-inline-${s.status}-notice`,s.className);let a=t;if(!0===a)switch(s.status){case"success":a=(0,oo.jsx)(fo.A,{});break;case"error":case"warning":a=(0,oo.jsx)(go.A,{});break;default:a=(0,oo.jsx)(bo.A,{})}const i="wcpay-inline-notice__action",c=o?.map((e,t)=>"url"in e?(0,oo.jsx)("a",{className:i,href:e.url,children:e.label},t):(0,oo.jsx)(b.Button,{className:i,onClick:e.onClick,isBusy:e.isBusy??!1,disabled:e.disabled??!1,variant:r,children:e.label},t));return(0,oo.jsx)(b.Notice,{...s,children:(0,oo.jsxs)(b.Flex,{align:"center",justify:"flex-start",children:[a&&(0,oo.jsx)(b.FlexItem,{className:`wcpay-inline-notice__icon wcpay-inline-${s.status}-notice__icon`,children:(0,oo.jsx)(b.Icon,{icon:a,size:24})}),(0,oo.jsxs)(b.FlexItem,{className:`wcpay-inline-notice__content wcpay-inline-${s.status}-notice__content`,children:[n,c&&(0,oo.jsx)(b.Flex,{className:"wcpay-inline-notice__content__actions",align:"baseline",justify:"flex-start",gap:4,children:c})]})]})})},xo=({stripeBillingSubscriptionCount:e})=>{const[t,o]=(0,d.useState)(!1),n=(0,d.useContext)(_o),[r,s]=(0,d.useState)(n.isMigrationInProgress);return(0,d.useEffect)(()=>{n.hasResolvedMigrateRequest&&s(!0)},[n.hasResolvedMigrateRequest]),(0,d.useEffect)(()=>{n.hasSavedSettings&&s(!n.savedIsStripeBillingEnabled)},[n.hasSavedSettings,n.savedIsStripeBillingEnabled]),r?t||0===n.subscriptionCount||n.isMigrationOptionShown?null:(0,oo.jsx)(wo,{status:"info",isDismissible:!0,onRemove:()=>o(!0),className:"woopayments-stripe-billing-notice",children:(0,w.sprintf)((0,w._n)("%d customer subscription is being migrated from Stripe off-site billing to billing powered by %s and %s.","%d customer subscriptions are being migrated from Stripe off-site billing to billing powered by %s and %s.",e,"woocommerce-payments"),e,"Woo Subscriptions","WooPayments")}):null},vo=({stripeBillingSubscriptionCount:e,startMigration:t,isLoading:o,hasResolved:n})=>{const r=(0,d.useContext)(_o),{setIsMigrationInProgress:s}=r,a="woopayments-migrate-stripe-billing-action";return(0,po.useEffect)(()=>{const e=document.querySelector(`.${a} .wcpay-inline-notice__action`);e&&(o?e.classList.add("is-busy"):e.classList.remove("is-busy"))},[o]),(0,po.useEffect)(()=>{n&&s(!0)},[n,s]),r.isMigrationOptionShown?(0,oo.jsx)(wo,{status:"warning",isDismissible:!1,className:`woopayments-stripe-billing-notice ${a}`,actions:[{label:(0,w.__)("Begin migration","woocommerce-payments"),onClick:t}],children:ao({mixedString:(0,w.sprintf)((0,w._n)("There is %d customer subscription using Stripe Billing for subscription renewals. We suggest migrating it to on-site billing powered by the %s plugin. {{learnMoreLink}}Learn more{{/learnMoreLink}}","There are %d customer subscriptions using Stripe Billing for payment processing. We suggest migrating them to on-site billing powered by the %s plugin. {{learnMoreLink}}Learn more{{/learnMoreLink}}",e,"woocommerce-payments"),e,"Woo Subscriptions"),components:{learnMoreLink:(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/subscriptions/stripe-billing/#migrating-subscribers"})}})}):null},So=({stripeBillingSubscriptionCount:e})=>{const t=(0,d.useContext)(_o),[o,n]=(0,d.useState)(t.isStripeBillingEnabled);return(0,d.useEffect)(()=>{t.hasSavedSettings&&n(t.savedIsStripeBillingEnabled)},[t.hasSavedSettings,t.savedIsStripeBillingEnabled]),o?t.isMigrationOptionShown||0===e||t.isStripeBillingEnabled?null:(0,oo.jsx)(wo,{status:"warning",isDismissible:!1,className:"woopayments-stripe-billing-notice",children:ao({mixedString:(0,w.sprintf)((0,w._n)("There is currently %d customer subscription using Stripe Billing for payment processing. This subscription will be automatically migrated to use the on-site billing engine built into %s once Stripe Billing is disabled. {{learnMoreLink}}Learn more{{/learnMoreLink}}","There are currently %d customer subscriptions using Stripe Billing for payment processing. These subscriptions will be automatically migrated to use the on-site billing engine built into %s once Stripe Billing is disabled. {{learnMoreLink}}Learn more{{/learnMoreLink}}",e,"woocommerce-payments"),e,"Woo Subscriptions"),components:{learnMoreLink:(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/subscriptions/stripe-billing/#disabling"})}})}):null},ko=({completedMigrationCount:e})=>{const[t,o]=(0,d.useState)(!1),n=(0,d.useContext)(_o),[r]=(0,d.useState)(!n.isStripeBillingEnabled&&!n.isMigrationInProgress);return!r||t||0===e?null:(0,oo.jsx)(wo,{status:"info",isDismissible:!0,onRemove:()=>o(!0),className:"woopayments-stripe-billing-notice",children:(0,w.sprintf)((0,w._n)("%d customer subscription was successfully migrated from Stripe off-site billing to on-site billing powered by %s and %s.","%d customer subscriptions were successfully migrated from Stripe off-site billing to on-site billing powered by %s and %s.",e,"woocommerce-payments"),e,"Woo Subscriptions","WooPayments")})},jo=()=>{const e=(0,d.useContext)(_o);return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(ko,{completedMigrationCount:e.migratedCount}),(0,oo.jsx)(vo,{stripeBillingSubscriptionCount:e.subscriptionCount,startMigration:()=>{e.startMigration()},isLoading:e.isResolvingMigrateRequest,hasResolved:e.hasResolvedMigrateRequest}),(0,oo.jsx)(So,{stripeBillingSubscriptionCount:e.subscriptionCount}),(0,oo.jsx)(xo,{stripeBillingSubscriptionCount:e.subscriptionCount})]})},Co=({onChange:e})=>{const t=(0,d.useContext)(_o);return(0,oo.jsx)(b.CheckboxControl,{checked:t.isStripeBillingEnabled,onChange:e,label:(0,w.__)("Enable Stripe Billing for future subscriptions","woocommerce-payments"),help:ao({mixedString:(0,w.sprintf)(t.isMigrationOptionShown&&0===t.migratedCount?(0,w.__)("Alternatively, you can enable this setting and future %s subscription purchases will also utilize Stripe Billing for payment processing. Note: This feature supports card payments only and may lack support for key subscription features. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"):(0,w.__)("By enabling this setting, future %s subscription purchases will utilize Stripe Billing for payment processing. Note: This feature supports card payments only and may lack support for key subscription features. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),"WooPayments"),components:{learnMoreLink:(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/subscriptions/stripe-billing/"})}}),"data-testid":"stripe-billing-toggle",__nextHasNoMarginBottom:!0})},Eo=()=>{const[e,t]=to(),[o]=It(),[n,r,s,a,i,c]=(()=>{const{submitStripeBillingSubscriptionMigration:e}=(0,v.useDispatch)(Mt);return(0,v.useSelect)(t=>{const{getStripeBillingSubscriptionCount:o}=t(Mt),{getIsStripeBillingMigrationInProgress:n}=t(Mt),{isResolving:r}=t(Mt),s=t(Mt).hasFinishedResolution("scheduleStripeBillingMigration"),{getStripeBillingMigratedCount:a}=t(Mt);return[n(),a(),o(),e,r("scheduleStripeBillingMigration"),s]},[])})(),{isLoading:l,isSaving:u}=zt(),[m,p]=(0,d.useState)(!1),[h,y]=(0,d.useState)(e),_=!u&&m;(0,d.useEffect)(()=>{u&&!l&&p(!0)},[l,u]),(0,d.useEffect)(()=>{_&&y(e)},[_,e]);const[f,g]=(0,d.useState)(!1),[x,S]=(0,d.useState)(!e);(0,d.useEffect)(()=>{h&&S(!1)},[h]);const k=n||f,j={isStripeBillingEnabled:e,savedIsStripeBillingEnabled:h,isMigrationOptionShown:!c&&!k&&s>0&&x&&!e,isMigrationInProgress:k,setIsMigrationInProgress:g,hasSavedSettings:_,subscriptionCount:s,migratedCount:r,startMigration:a,isResolvingMigrateRequest:i,hasResolvedMigrateRequest:c},[C,E]=(0,d.useState)(!1),P=()=>E(!1);return(0,oo.jsxs)(_o.Provider,{value:j,children:[(0,oo.jsx)("h4",{children:(0,w.__)("Subscriptions","woocommerce-payments")}),(0,oo.jsx)(jo,{}),(0,oo.jsx)(Co,{onChange:e=>{e&&o?E(!0):(t(e),p(!1))}}),C&&(0,oo.jsx)(yo,{title:(0,w.__)("Enable Stripe Billing","woocommerce-payments"),actions:(0,oo.jsx)(oo.Fragment,{children:(0,oo.jsx)(b.Button,{onClick:P,isPrimary:!0,children:(0,w.__)("OK","woocommerce-payments")})}),onRequestClose:P,children:(0,oo.jsx)("p",{children:(0,po.createInterpolateElement)((0,w.__)("Stripe Billing is not available with <b>manual capture enabled</b>. To use Stripe Billing, disable manual capture in your settings list.","woocommerce-payments"),{b:(0,oo.jsx)("strong",{})})})})]})},Po=()=>(0,oo.jsx)(oo.Fragment,{children:(0,oo.jsx)(b.Card,{children:(0,oo.jsxs)(mo,{className:"wcpay-card-body",children:[(0,oo.jsx)(io,{}),wcpaySettings.isSubscriptionsActive&&wcpaySettings.isStripeBillingEligible?(0,oo.jsx)(Eo,{}):(0,oo.jsx)(co,{}),(0,oo.jsx)(no,{})]})})}),No=window.wp.url,To=window.lodash,Mo=window.moment;var Lo=r.n(Mo);const Ao=window.wp.date;window.wc.number;const Do=e=>(0,No.addQueryArgs)("admin.php",e),Oo=e=>Do({page:"wc-settings",tab:"checkout",section:"woocommerce_payments",method:e}),Io=(e,t=!1)=>{const o=t?Lo()(e).endOf("day").utc().toISOString():Lo()(e).startOf("day").utc().toISOString();return e&&(0,Ao.dateI18n)("Y-m-d H:i:s",o,!0)},Ro=(0,d.createContext)(window.wcpaySettings),Fo=({message:e,learnMoreLinkHref:t})=>(0,oo.jsxs)(wo,{status:"warning",icon:!0,isDismissible:!1,children:[e," ",ao({mixedString:(0,w.__)("{{learnMoreLink}}Learn More{{/learnMoreLink}}","woocommerce-payments"),components:{learnMoreLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:t})}})]}),Bo=()=>(0,oo.jsx)(Fo,{message:(0,w.__)("One or more of your extensions are incompatible with WooPay.","woocommerce-payments"),learnMoreLinkHref:"https://woocommerce.com/document/woopay-merchant-documentation/#compatibility"}),zo=r.p+"../assets/images/payment-methods/jcb.svg?ver=cbb1bd44391fc950405c",Wo=r.p+"../assets/images/cards/visa.svg?ver=4092a4a60d0cc118521a",Ho=r.p+"../assets/images/cards/mastercard.svg?ver=6129dd1939ec8fae99f6",qo=r.p+"../assets/images/cards/amex.svg?ver=acda1145a36f911ce8bb",Uo=r.p+"../assets/images/payment-methods/woo.svg?ver=f8038db537160f3d85b8",$o=r.p+"../assets/images/payment-methods/woo-short.svg?ver=9536f8da3fd7b2f65555",Vo=r.p+"../assets/images/cards/diners.svg?ver=54cab5feb20ce75b53a4",Go=r.p+"../assets/images/cards/discover.svg?ver=01d6dfbfbc64f24bee7c",Yo=r.p+"../assets/images/cards/cb.svg?ver=7b1291fee8396b46e81f",Zo=r.p+"../assets/images/cards/unionpay.svg?ver=d45c6881498629ee226c",Jo=(e,t,o=!0)=>({className:n,...r})=>(0,oo.jsx)("img",{className:uo("payment-method__icon",o?"":"no-border",n),src:e,alt:t,...r}),Ko=(Jo(qo,(0,w.__)("American Express","woocommerce-payments")),Jo(Yo,(0,w.__)("Cartes Bancaires","woocommerce-payments")),Jo(Vo,(0,w.__)("Diners Club","woocommerce-payments")),Jo(Go,(0,w.__)("Discover","woocommerce-payments")),Jo(zo,(0,w.__)("JCB","woocommerce-payments"))),Qo=(Jo(Ho,(0,w.__)("Mastercard","woocommerce-payments")),Jo(Zo,(0,w.__)("UnionPay","woocommerce-payments")),Jo(Wo,(0,w.__)("Visa","woocommerce-payments")),Jo(Uo,(0,w.__)("WooPay","woocommerce-payments"),!1)),Xo=Jo($o,(0,w.__)("WooPay","woocommerce-payments"),!1),en=({label:e,checked:t,disabled:o,onChange:n,"data-testid":r})=>(0,oo.jsx)("div",{className:"payment-method-item__checkbox",children:(0,oo.jsx)(b.CheckboxControl,{label:e,checked:t,disabled:o,onChange:n,"data-testid":r,__nextHasNoMarginBottom:!0})});en.displayName="PaymentMethodItemCheckbox";const tn=en,on=({children:e})=>(0,oo.jsx)("div",{className:"payment-method-item__text-container",children:e});on.displayName="PaymentMethodItemBody";const nn=on,rn=({id:e,className:t,children:o})=>{const n=[],r=[];return u().Children.forEach(o,e=>{!u().isValidElement(e)||e.type!==tn&&e.type!==nn?r.push(e):n.push(e)}),(0,oo.jsxs)("li",{className:uo("payment-method-item",t),id:e,children:[(0,oo.jsx)("div",{className:"payment-method-item__row",children:n}),r]})};rn.displayName="PaymentMethodItem";const sn=rn,an=({Icon:e,label:t,children:o,className:n})=>(0,oo.jsxs)("div",{className:uo("payment-method-item__subgroup",n),children:[e&&(0,oo.jsx)("div",{className:"payment-method-item__icon",children:(0,oo.jsx)(e,{})}),(0,oo.jsx)("div",{className:"payment-method-item__label payment-method-item__label--mobile",children:t}),(0,oo.jsxs)("div",{className:"payment-method-item__label-container",children:[(0,oo.jsx)("div",{className:"payment-method-item__label payment-method-item__label--desktop",children:t}),o&&(0,oo.jsx)("div",{className:"payment-method-item__description",children:o})]})]});an.displayName="PaymentMethodItemSubgroup";const cn=an,ln=({children:e,className:t})=>(0,oo.jsx)("div",{className:uo("payment-method-item__action",t),children:e});ln.displayName="PaymentMethodItemAction";const dn=ln,un=Object.assign(sn,{Checkbox:tn,Body:nn,Subgroup:cn,Action:dn}),mn=()=>{const[e]=At(),[t,o]=Jt(),n=e.includes("link"),r=eo()&&!n,{featureFlags:{woopay:s}}=(0,po.useContext)(Ro);return s?(0,oo.jsxs)(un,{className:"express-checkout",id:"express-checkouts-woopay",children:[(0,oo.jsx)(un.Checkbox,{label:(0,w.__)("WooPay","woocommerce-payments"),checked:t,disabled:n,onChange:o,"data-testid":"woopay-toggle"}),(0,oo.jsxs)(un.Body,{children:[(0,oo.jsx)("div",{children:(0,oo.jsx)(un.Subgroup,{Icon:Qo,label:(0,w.__)("WooPay","woocommerce-payments"),children:t?(0,w.__)("Boost conversion and customer loyalty by offering a single click, secure way to pay.","woocommerce-payments"):ao({mixedString:(0,w.__)("Boost conversion and customer loyalty by offering a single click, secure way to pay. In order to use {{wooPayLink}}WooPay{{/wooPayLink}}, you must agree to our {{tosLink}}WooCommerce Terms of Service{{/tosLink}} and {{privacyLink}}Privacy Policy{{/privacyLink}}. {{trackingLink}}Click here{{/trackingLink}} to learn more about the data you will be sharing and opt-out options.","woocommerce-payments"),components:{wooPayLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://woocommerce.com/document/woopay-merchant-documentation/"}),tosLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://wordpress.com/tos/"}),privacyLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://automattic.com/privacy/"}),trackingLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://woocommerce.com/usage-tracking/"})}})})}),(0,oo.jsx)(un.Action,{children:(0,oo.jsx)(b.Button,{href:Oo("woopay"),isSecondary:!0,children:(0,w.__)("Customize","woocommerce-payments")})})]}),n&&(0,oo.jsx)(wo,{status:"warning",isDismissible:!1,children:(0,w.__)("To enable WooPay, you must first disable Link by Stripe.","woocommerce-payments")}),r&&(0,oo.jsx)(Bo,{})]}):null},pn=function({paymentMethod:e,gatewaysEnablingPaymentMethod:t,dismissedNotices:o,setDismissedDuplicateNotices:n}){const r=(0,d.useCallback)(()=>{const r={...o};Array.isArray(r[e])?r[e]=[...new Set([...r[e],...t])]:r[e]=t,n(r),Nt("wcpay_duplicate_payment_method_notices_dismissed",r),wcpaySettings.dismissedDuplicateNotices=r},[e,t,o,n]);return Array.isArray(o?.[e])&&t.every(t=>o[e].includes(t))?null:(0,oo.jsx)(wo,{status:"warning",icon:!1,isDismissible:!0,onRemove:r,children:ao({mixedString:(0,w.__)("This payment method is enabled by other extensions. {{reviewExtensions}}Review extensions{{/reviewExtensions}} to improve the shopper experience.","woocommerce-payments"),components:{reviewExtensions:(0,oo.jsx)("a",{href:Do({page:"wc-settings",tab:"checkout"}),children:"Review extensions"})}})})},hn=(0,d.createContext)({duplicates:{},dismissedDuplicateNotices:{},setDismissedDuplicateNotices:()=>null});if("undefined"==typeof wooPaymentsPaymentMethodDefinitions)throw new Error("wooPaymentsPaymentMethodDefinitions is undefined");const yn=Object.keys(wooPaymentsPaymentMethodDefinitions).reduce((e,t)=>(e[t]={...wooPaymentsPaymentMethodDefinitions[t],icon:({className:e})=>(0,oo.jsx)("img",{src:wooPaymentsPaymentMethodDefinitions[t].settings_icon_url,alt:wooPaymentsPaymentMethodDefinitions[t].label,className:uo("payment-method__icon",e)})},e),{jcb:{id:"jcb",label:(0,w.__)("JCB","woocommerce-payments"),description:(0,w.__)("Let your customers pay with JCB, the only international payment brand based in Japan.","woocommerce-payments"),icon:Ko,currencies:["JPY"],stripe_key:"jcb_payments",allows_manual_capture:!1,allows_pay_later:!1,accepts_only_domestic_payment:!1,settings_icon_url:""}}),_n=()=>{const e="apple_pay_google_pay",[t,o]=Wt(),{duplicates:n,dismissedDuplicateNotices:r,setDismissedDuplicateNotices:s}=(0,d.useContext)(hn),a=Object.keys(n).includes(e),{icon:i}=yn.apple_pay,{icon:c}=yn.google_pay;return(0,oo.jsxs)(un,{className:"express-checkout",id:"express-checkouts-apple-google-pay",children:[(0,oo.jsx)(un.Checkbox,{label:(0,w.__)("Apple Pay / Google Pay","woocommerce-payments"),checked:t,onChange:o}),(0,oo.jsxs)(un.Body,{children:[(0,oo.jsxs)("div",{children:[(0,oo.jsxs)(un.Subgroup,{Icon:i,label:yn.apple_pay.label,children:[yn.apple_pay.description,!t&&" ",!t&&ao({mixedString:(0,w.__)("By enabling this feature, you agree to {{stripeLink}}Stripe{{/stripeLink}} and{{appleLink}} Apple{{/appleLink}}'s terms of use.","woocommerce-payments"),components:{stripeLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://stripe.com/apple-pay/legal"}),appleLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://developer.apple.com/apple-pay/acceptable-use-guidelines-for-websites/"}),br:(0,oo.jsx)("br",{})}})]}),(0,oo.jsxs)(un.Subgroup,{Icon:c,label:yn.google_pay.label,children:[yn.google_pay.description,!t&&" ",!t&&ao({mixedString:(0,w.__)("By enabling this feature, you agree to {{stripeLink}}Stripe{{/stripeLink}}, and {{googleLink}}Google{{/googleLink}}'s terms of use.","woocommerce-payments"),components:{stripeLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://stripe.com/apple-pay/legal"}),googleLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://androidpay.developers.google.com/terms/sellertos"}),br:(0,oo.jsx)("br",{})}})]})]}),(0,oo.jsx)(un.Action,{children:(0,oo.jsx)(b.Button,{href:Oo("payment_request"),isSecondary:!0,children:(0,w.__)("Customize","woocommerce-payments")})})]}),a&&(0,oo.jsx)(pn,{paymentMethod:e,gatewaysEnablingPaymentMethod:n[e],dismissedNotices:r,setDismissedDuplicateNotices:s})]})},fn=()=>{const e=Rt(),[t]=Jt(),[o,n]=At(),r=o.includes("card")&&e.includes("link"),s=o.includes("link");if(!r)return null;const{icon:a}=yn.link;return(0,oo.jsxs)(un,{className:"express-checkout",id:"express-checkouts-link",children:[(0,oo.jsx)(un.Checkbox,{label:yn.link.label,disabled:t,checked:s,onChange:e=>{n(e?[...new Set([...o,"link"])]:[...o.filter(e=>"link"!==e)])}}),(0,oo.jsxs)(un.Body,{children:[(0,oo.jsx)("div",{children:(0,oo.jsxs)(un.Subgroup,{Icon:a,label:yn.link.label,children:[yn.link.description,!s&&" ",!s&&ao({mixedString:(0,w.__)("By enabling this feature, you agree to the {{stripeLinkTerms}}Link by Stripe terms{{/stripeLinkTerms}}, and {{privacyPolicy}}Privacy Policy{{/privacyPolicy}}.","woocommerce-payments"),components:{stripeLinkTerms:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://link.com/terms"}),privacyPolicy:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://link.com/privacy"})}})]})}),(0,oo.jsx)(un.Action,{children:(0,oo.jsx)(b.Button,{target:"_blank",rel:"noreferrer",href:"https://woocommerce.com/document/woopayments/payment-methods/link-by-stripe/",isSecondary:!0,children:(0,w.__)("Read more","woocommerce-payments")})})]}),t&&(0,oo.jsx)(wo,{status:"warning",isDismissible:!1,children:(0,w.__)("To enable Link by Stripe, you must first disable WooPay.","woocommerce-payments")})]})},gn="unrequested";var bn=function(e){return e.AFFIRM="affirm",e.AFTERPAY_CLEARPAY="afterpay_clearpay",e.ALIPAY="alipay",e.AMAZON_PAY="amazon_pay",e.APPLE_PAY="apple_pay",e.AU_BECS_DEBIT="au_becs_debit",e.BANCONTACT="bancontact",e.CARD="card",e.CARD_PRESENT="card_present",e.EPS="eps",e.GIROPAY="giropay",e.GOOGLE_PAY="google_pay",e.GRABPAY="grabpay",e.IDEAL="ideal",e.KLARNA="klarna",e.LINK="link",e.MULTIBANCO="multibanco",e.P24="p24",e.SEPA_DEBIT="sepa_debit",e.SOFORT="sofort",e.WECHAT_PAY="wechat_pay",e}(bn||{});(0,w.__)("ACH Credit Transfer","woocommerce-payments"),(0,w.__)("ACH Debit","woocommerce-payments"),(0,w.__)("ACSS Debit","woocommerce-payments"),(0,w.__)("Amazon Pay","woocommerce-payments"),(0,w.__)("American Express","woocommerce-payments"),(0,w.__)("Card Payment","woocommerce-payments"),(0,w.__)("In-Person Card Payment","woocommerce-payments"),(0,w.__)("Cartes Bancaires","woocommerce-payments"),(0,w.__)("Diners Club","woocommerce-payments"),(0,w.__)("Discover","woocommerce-payments"),(0,w.__)("eftpos","woocommerce-payments"),(0,w.__)("JCB","woocommerce-payments"),(0,w.__)("Mastercard","woocommerce-payments"),(0,w.__)("Stripe Account","woocommerce-payments"),(0,w.__)("Union Pay","woocommerce-payments"),(0,w.__)("Visa","woocommerce-payments");const wn=bn,xn=e=>{const t=Ft(),[o]=At(),[n]=It(),{stripe_key:r,currencies:s,label:a,allows_manual_capture:i}=yn[e],{status:c}=t[r]??{status:gn,requirements:[]};if("inactive"===c)return{isActionable:!1,chip:(0,w.__)("More information needed","woocommerce-payments"),notice:ao({mixedString:(0,w.__)("More information is needed to finish setting up this payment method. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),components:{learnMoreLink:(0,oo.jsx)(b.ExternalLink,{title:(0,w.__)("Learn more about enabling payment methods","woocommerce-payments"),href:(l=e,yn?.[l]?.allows_pay_later?"https://woocommerce.com/document/woopayments/payment-methods/buy-now-pay-later/#contact-support":"https://woocommerce.com/document/woopayments/payment-methods/local-payment-methods/#method-cant-be-enabled")})}})};var l,d,u,m;if("pending"===c){const t=[wn.ALIPAY,wn.WECHAT_PAY];return{isActionable:!1,chip:(0,w.__)("Approval pending","woocommerce-payments"),notice:t.includes(e)?ao({mixedString:(0,w.__)("Your store must be live and fully functional before this payment method can be offered. Approval typically takes 2–3 days. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),components:{learnMoreLink:(0,oo.jsx)(b.ExternalLink,{title:(0,w.__)("Learn more about approval delays","woocommerce-payments"),href:"https://woocommerce.com/document/woopayments/payment-methods/local-payment-methods/#approval-delays"})}}):(0,w.__)("This payment method is pending approval. It won't be available at checkout until it's approved.","woocommerce-payments")}}if("pending_verification"===c)return{isActionable:!1,chip:(0,w.__)("Pending verification","woocommerce-payments"),notice:ao({mixedString:(0,w.sprintf)((0,w.__)("%s won't be available at checkout yet. To finish setting it up, review the required steps in {{overviewLink}}Payments overview{{/overviewLink}}.","woocommerce-payments"),a),components:{overviewLink:(0,oo.jsx)("a",{href:Do({page:"wc-admin",path:"/payments/overview"})})}})};if("rejected"===c)return{isActionable:!1,chip:(0,w.__)("Rejected","woocommerce-payments"),chipType:"alert",notice:ao({mixedString:(0,w.sprintf)((0,w.__)("Your application to use %s has been rejected. Need help? {{contactSupportLink}}Contact support{{/contactSupportLink}}","woocommerce-payments"),a),components:{contactSupportLink:(0,oo.jsx)(b.ExternalLink,{title:(0,w.__)("Contact Support","woocommerce-payments"),href:"https://woocommerce.com/my-account/contact-support/"})}}),noticeType:"error"};if(n&&!i)return{isActionable:!1};if(!wcpaySettings.isMultiCurrencyEnabled&&e!==wn.CARD&&o.includes(e)){const e=wcpaySettings.storeCurrency;if(s.indexOf(e)<0)return{isActionable:!0,notice:(d=a,u=s,1===u.length?(0,w.sprintf)((0,w.__)("%1$s requires the %2$s currency. Add %2$s to your store to offer this payment method.","woocommerce-payments"),d,u[0]):(0,w.sprintf)((0,w.__)("%1$s requires at least one of the following currencies: %2$s. Add at least one of these currencies to your store to offer this payment method.","woocommerce-payments"),d,(m=u).length<=1?m[0]??"":2===m.length?(0,w.sprintf)((0,w.__)("%1$s or %2$s","woocommerce-payments"),m[0],m[1]):(0,w.sprintf)((0,w.__)("%1$s, or %2$s","woocommerce-payments"),m.slice(0,-1).join(", "),m[m.length-1])))}}return{isActionable:!0}},vn=()=>{const[e,t]=Qt(),{icon:o,label:n,description:r}=yn.amazon_pay,{isActionable:s,notice:a,noticeType:i="warning"}=xn("amazon_pay");return(0,oo.jsxs)(un,{className:"express-checkout",id:"express-checkouts-amazon-pay",children:[(0,oo.jsx)(un.Checkbox,{label:n,checked:e,disabled:!s,onChange:t}),(0,oo.jsxs)(un.Body,{children:[(0,oo.jsx)("div",{children:(0,oo.jsxs)(un.Subgroup,{Icon:o,label:n,children:[r+" ",ao({mixedString:(0,w.__)("By activating this feature, you accept {{stripeLink}}Stripe{{/stripeLink}} and {{amazonLink}}Amazon{{/amazonLink}}'s terms of use.","woocommerce-payments"),components:{stripeLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://stripe.com/legal/ssa"}),amazonLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://stripe.com/legal/amazon-pay"})}})]})}),(0,oo.jsx)(un.Action,{children:(0,oo.jsx)(b.Button,{href:Oo("amazon_pay"),isSecondary:!0,children:(0,w.__)("Customize","woocommerce-payments")})})]}),a&&(0,oo.jsx)(wo,{status:i,isDismissible:!1,children:a})]})},Sn=()=>{const{featureFlags:{amazonPay:e}}=(0,po.useContext)(Ro),t=Rt();return(0,oo.jsx)(b.Card,{className:"express-checkouts",children:(0,oo.jsx)(mo,{size:0,children:(0,oo.jsxs)("ul",{className:"express-checkouts-list",children:[(0,oo.jsx)(mn,{}),(0,oo.jsx)(_n,{}),(0,oo.jsx)(fn,{}),e&&t.includes("amazon_pay")&&(0,oo.jsx)(vn,{})]})})})},kn=()=>null,jn=({description:e=kn,children:t,className:o,id:n})=>(0,oo.jsxs)("div",{className:uo("settings-section",o),id:n,children:[(0,oo.jsx)("div",{className:"settings-section__details",children:(0,oo.jsx)(e,{})}),(0,oo.jsx)("div",{className:"settings-section__controls",children:t})]}),Cn=(0,po.forwardRef)(function({icon:e,size:t=24,...o},n){return(0,po.cloneElement)(e,{width:t,height:t,...o,ref:n})}),En=(0,oo.jsx)(ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oo.jsx)(ho.Path,{d:"M3.25 12a8.75 8.75 0 1117.5 0 8.75 8.75 0 01-17.5 0zM12 4.75a7.25 7.25 0 100 14.5 7.25 7.25 0 000-14.5zm-1.338 4.877c-.314.22-.412.452-.412.623 0 .171.098.403.412.623.312.218.783.377 1.338.377.825 0 1.605.233 2.198.648.59.414 1.052 1.057 1.052 1.852 0 .795-.461 1.438-1.052 1.852-.41.286-.907.486-1.448.582v.316a.75.75 0 01-1.5 0v-.316a3.64 3.64 0 01-1.448-.582c-.59-.414-1.052-1.057-1.052-1.852a.75.75 0 011.5 0c0 .171.098.403.412.623.312.218.783.377 1.338.377s1.026-.159 1.338-.377c.314-.22.412-.452.412-.623 0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377-.825 0-1.605-.233-2.198-.648-.59-.414-1.052-1.057-1.052-1.852 0-.795.461-1.438 1.052-1.852a3.64 3.64 0 011.448-.582V7.5a.75.75 0 011.5 0v.316c.54.096 1.039.296 1.448.582.59.414 1.052 1.057 1.052 1.852a.75.75 0 01-1.5 0c0-.171-.098-.403-.412-.623-.312-.218-.783-.377-1.338-.377s-1.026.159-1.338.377z"})}),Pn=(0,oo.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oo.jsx)("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z"})}),Nn=(0,oo.jsx)("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oo.jsx)("path",{d:"M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z",fillRule:"evenodd",clipRule:"evenodd"})}),Tn=window.wp.domReady;var Mn=r.n(Tn);const Ln=e=>"undefined"!=typeof wcpayConfig&&void 0!==wcpayConfig[e]?wcpayConfig[e]:An(e),An=e=>{let t=null;if("undefined"!=typeof wcpay_upe_config)t=wcpay_upe_config;else{if("object"!=typeof wc||void 0===wc.wcSettings)return null;t=wc.wcSettings.getSetting("woocommerce_payments_data")||{}}return t[e]||null},Dn=(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]}Mn()(()=>{(wc?.tracks?.recordEvent??wcTracks.recordEvent)(e,t)})},On=(e,t={})=>{if(!1===(Ln("isShopperTrackingEnabled")??N("is_shopper_tracking_enabled")))return;const o=Ln("platformTrackerNonce")??N("nonce")?.platform_tracker,n=Ln("ajaxUrl")??N("ajax_url"),r=new FormData;r.append("tracksNonce",o),r.append("action","platform_tracks"),r.append("tracksEventName",e),r.append("tracksEventProp",JSON.stringify(t)),fetch(n,{method:"post",body:r}).then(e=>e.json())},In=async()=>{let e=(()=>{const e=document.cookie.split(";");for(let t=0;t<e.length;t++){let o=e[t];for(;" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf("tk_ai="))return o.substring(6,o.length)}})();if(e){const t={_ut:"anon",_ui:e};return JSON.stringify(t)}const t=Ln("platformTrackerNonce")??N("nonce")?.platform_tracker,o=Ln("ajaxUrl")??N("ajax_url"),n=new FormData;n.append("tracksNonce",t),n.append("action","get_identity");try{const e=await fetch(o,{method:"post",body:n});if(!e.ok)return;const t=await e.json();return t.success&&t.data&&t.data._ui&&t.data._ut?JSON.stringify(t.data):void 0}catch(e){return}},Rn=({from:e,source:t,onClose:o})=>{const[n,r]=(0,d.useState)(!1);return(0,oo.jsxs)(b.Modal,{title:(0,w.__)("Activate payments on your store","woocommerce-payments"),className:"wcpay-setup-real-payments-modal",isDismissible:!0,onRequestClose:()=>{r(!1),Dn("wcpay_setup_live_payments_modal_exit",{from:e,source:t}),o()},children:[(0,oo.jsxs)("div",{className:"wcpay-setup-real-payments-modal__content",children:[(0,oo.jsx)("div",{className:"wcpay-setup-real-payments-modal__content__item",children:(0,oo.jsx)("p",{children:(0,w.__)("Before continuing, please make sure that you're aware of the following:","woocommerce-payments")})}),(0,oo.jsxs)("div",{className:"wcpay-setup-real-payments-modal__content__item-flex",children:[(0,oo.jsx)("div",{children:(0,oo.jsx)(Cn,{icon:Pn})}),(0,oo.jsx)("p",{className:"wcpay-setup-real-payments-modal__content__item-flex__description",children:(0,w.__)("Your test account will be deactivated, but your transactions can be found in your order history.","woocommerce-payments")})]}),(0,oo.jsxs)("div",{className:"wcpay-setup-real-payments-modal__content__item-flex",children:[(0,oo.jsx)("div",{children:(0,oo.jsx)(Cn,{icon:Nn})}),(0,oo.jsx)("p",{className:"wcpay-setup-real-payments-modal__content__item-flex__description",children:(0,w.sprintf)((0,w.__)("To use %s, you will need to verify your business details.","woocommerce-payments"),"WooPayments")})]}),(0,oo.jsxs)("div",{className:"wcpay-setup-real-payments-modal__content__item-flex",children:[(0,oo.jsx)("div",{children:(0,oo.jsx)(Cn,{icon:En})}),(0,oo.jsx)("p",{className:"wcpay-setup-real-payments-modal__content__item-flex__description",children:(0,w.__)("In order to receive payouts, you will need to provide your bank details.","woocommerce-payments")})]})]}),(0,oo.jsx)("div",{className:"wcpay-setup-real-payments-modal__footer",children:(0,oo.jsx)(b.Button,{variant:"primary",isBusy:n,disabled:n,onClick:()=>{r(!0),Dn("wcpay_onboarding_flow_setup_live_payments",{from:e,source:t}),window.location.href=Do({page:"wc-settings",tab:"checkout",path:"/woopayments/onboarding",source:t,from:"wcpay-setup-live-payments"})},__next40pxDefaultSize:!0,children:(0,w.__)("Activate payments","woocommerce-payments")})})]})},Fn=({onClose:e,onConfirm:t})=>(0,oo.jsxs)(yo,{title:(0,w.__)("Enable test mode","woocommerce-payments"),onRequestClose:e,actions:(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.Button,{onClick:e,variant:"secondary",children:(0,w.__)("Cancel","woocommerce-payments")}),(0,oo.jsx)(b.Button,{onClick:t,variant:"primary",children:(0,w.__)("Enable","woocommerce-payments")})]}),children:[(0,oo.jsx)("h3",{children:(0,w.__)("Are you sure you want to enable test mode?","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Test mode lets you try out payments, refunds, disputes and other such processes as you're working on your store without handling live payment information. All incoming orders will be simulated, and test mode will have to be disabled before you can accept real orders.","woocommerce-payments")}),(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/testing-and-troubleshooting/testing/",children:(0,w.__)("Learn more about test mode","woocommerce-payments")})]}),Bn=({Icon:e,label:t})=>e?(0,oo.jsxs)("span",{className:uo("woocommerce-payments__payment-method-icon"),children:[(0,oo.jsx)(e,{}),t&&(0,oo.jsx)("span",{className:"woocommerce-payments__payment-method-icon__label",children:t})]}):null;var zn=r(8971);const Wn=()=>null,Hn=({hasBorder:e,icon:t=Wn})=>(0,oo.jsx)("div",{className:"payment-delete-illustration__wrapper",children:(0,oo.jsxs)("div",{className:"payment-delete-illustration__illustrations",children:[(0,oo.jsx)(t,{className:uo("payment-delete-illustration__payment-icon",{"has-border":e})}),(0,oo.jsx)(zn.A,{className:"payment-delete-illustration__payment-cross-icon"})]})}),qn=r.p+"../assets/images/cards/woo-card.svg?ver=937562a736e3127af927",Un=({onClose:e,onConfirm:t})=>{const[o]=At(),[n]=Jt(),[r]=Wt(),[s]=Qt(),a=Boolean(o.find(e=>"link"===e)),{featureFlags:{amazonPay:i}}=(0,d.useContext)(Ro),c=Rt();return(0,oo.jsxs)(yo,{title:(0,w.sprintf)((0,w.__)("Disable %s","woocommerce-payments"),"WooPayments"),onRequestClose:e,actions:(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.Button,{onClick:t,variant:"primary",isDestructive:!0,__next40pxDefaultSize:!0,children:"Disable"}),(0,oo.jsx)(b.Button,{onClick:e,variant:"secondary",__next40pxDefaultSize:!0,children:"Cancel"})]}),children:[(0,oo.jsx)(Hn,{icon:e=>(0,oo.jsx)("img",{src:qn,alt:"WooCard",...e})}),(0,oo.jsx)("p",{children:ao({mixedString:(0,w.sprintf)((0,w.__)("%s is currently powering multiple popular payment methods on your store. Without it, they will no longer be available to your customers, which may influence sales.","woocommerce-payments"),"WooPayments"),components:{strong:(0,oo.jsx)("strong",{})}})}),(0,oo.jsx)("p",{children:(0,w.sprintf)((0,w.__)("Payment methods that need %s:","woocommerce-payments"),"WooPayments")}),(0,oo.jsxs)("ul",{className:"disable-confirmation-modal__payment-methods-list",children:[o.filter(e=>"link"!==e).map(e=>(0,oo.jsx)("li",{children:(0,oo.jsx)(Bn,{Icon:yn[e].icon,label:yn[e].label})},e)),r&&(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("li",{children:(0,oo.jsx)(Bn,{Icon:yn.google_pay.icon,label:yn.google_pay.label})}),(0,oo.jsx)("li",{children:(0,oo.jsx)(Bn,{Icon:yn.apple_pay.icon,label:yn.apple_pay.label})})]}),s&&i&&c.includes("amazon_pay")&&(0,oo.jsx)("li",{children:(0,oo.jsx)(Bn,{Icon:yn.amazon_pay.icon,label:yn.amazon_pay.label})}),a&&(0,oo.jsx)("li",{children:(0,oo.jsx)(Bn,{Icon:yn.link.icon,label:yn.link.label})}),n&&(0,oo.jsx)("li",{children:(0,oo.jsx)(Bn,{Icon:Xo,label:(0,w.__)("WooPay","woocommerce-payments")})})]}),(0,oo.jsx)("p",{className:"no-padding",children:ao({mixedString:(0,w.sprintf)((0,w.__)("{{strong}}Need help?{{/strong}} Learn more about {{wooCommercePaymentsLink}}%s{{/wooCommercePaymentsLink}} or {{contactSupportLink}}contact WooCommerce Support{{/contactSupportLink}}.","woocommerce-payments"),"WooPayments"),components:{strong:(0,oo.jsx)("strong",{}),wooCommercePaymentsLink:(0,oo.jsx)("a",{href:"https://woocommerce.com/document/woopayments/"}),contactSupportLink:(0,oo.jsx)("a",{href:"https://woocommerce.com/my-account/create-a-ticket/?select=5278104"})}})})]})},$n=()=>{const[e,t]=(()=>{const{updateIsWCPayEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsWCPayEnabled()),e]})(),[o,n]=((e=!1)=>{const[t,o]=(0,po.useState)(e);return[t,(0,po.useCallback)(()=>o(e=>!e),[o])]})(!1);return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.CheckboxControl,{checked:e,onChange:e=>{e?(t(!0),Dn("wcpay_gateway_toggle",{action:"enable",context:"wcpay-settings"})):n()},label:(0,w.sprintf)((0,w.__)("Enable %s","woocommerce-payments"),"WooPayments"),help:(0,w.sprintf)((0,w.__)("When enabled, payment methods powered by %s will appear on checkout.","woocommerce-payments"),"WooPayments"),__nextHasNoMarginBottom:!0}),o&&(0,oo.jsx)(Un,{onClose:n,onConfirm:()=>{t(!1),Dn("wcpay_gateway_toggle",{action:"disable",context:"wcpay-settings"}),n()}})]})},Vn=()=>{const[e,t]=(()=>{const{updateIsTestModeEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsTestModeEnabled()),e]})(),[o,n]=(0,d.useState)(!1),r=Dt(),s=Ot(),[a,i]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{const e=()=>{Dn("wcpay_settings_setup_live_payments_click",{source:"wcadmin-settings-page"}),n(!0)};return document.addEventListener("wcpay:activate_payments",e),()=>{document.removeEventListener("wcpay:activate_payments",e)}},[]),(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.Card,{children:(0,oo.jsxs)(mo,{className:"wcpay-card-body",children:[(0,oo.jsx)($n,{}),!r&&(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h4",{children:(0,w.__)("Test mode","woocommerce-payments")}),(0,oo.jsx)(b.CheckboxControl,{checked:s||e,disabled:s,onChange:e=>{e?i(!0):(Dn("wcpay_test_mode_disabled",{source:"wcadmin-settings-page"}),t(!1))},label:s?(0,w.__)("Enable test mode (enabled by development mode)","woocommerce-payments"):(0,w.__)("Enable test mode","woocommerce-payments"),help:ao(s?{mixedString:(0,w.__)("Test mode is active because your store is running in a development or staging environment. To disable it, switch to a production {{wpEnvLink}}WordPress environment{{/wpEnvLink}} or remove the WCPAY_DEV_MODE constant. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),components:{wpEnvLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://make.wordpress.org/core/2020/08/27/wordpress-environment-types/"}),learnMoreLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://woocommerce.com/document/woopayments/testing-and-troubleshooting/testing/"})}}:{mixedString:(0,w.__)("Use {{testCardHelpLink}}test card numbers{{/testCardHelpLink}} to simulate various transactions. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),components:{testCardHelpLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://woocommerce.com/document/woopayments/testing-and-troubleshooting/testing/#test-cards"}),learnMoreLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://woocommerce.com/document/woopayments/testing-and-troubleshooting/testing/"})}}),__nextHasNoMarginBottom:!0})]})]})}),o&&(0,oo.jsx)(Rn,{from:"WCPAY_SETTINGS",source:"wcadmin-settings-page",onClose:()=>{Dn("wcpay_setup_live_payments_modal_exit",{source:"wcadmin-settings-page"}),n(!1)}}),a&&(0,oo.jsx)(Fn,{onClose:()=>{Dn("wcpay_test_mode_modal_exit",{source:"wcadmin-settings-page"}),i(!1)},onConfirm:()=>{Dn("wcpay_test_mode_enabled",{source:"wcadmin-settings-page"}),t(!0),i(!1)}})]})},Gn=({children:e})=>(0,oo.jsx)("div",{className:"wcpay-settings-layout",children:e}),Yn=({isLoading:e,display:t,placeholder:o,value:n,children:r,...s})=>e?(0,oo.jsx)("span",{className:t?`is-loadable-placeholder is-${t}`:"is-loadable-placeholder","aria-busy":"true",...s,children:void 0===o?r||n:o}):(0,oo.jsx)(oo.Fragment,{children:r||n}),Zn=({numLines:e,...t})=>{const o=(0,oo.jsx)("p",{style:{lineHeight:e},children:"Block placeholder"});return(0,oo.jsx)(Yn,{...t,placeholder:o,display:"block","aria-hidden":!0})},Jn=Yn,Kn=r.p+"../assets/images/woopay.svg?ver=046e988278287c92a2f9",Qn=({onRequestClose:e})=>{const[t,o]=(0,d.useState)(!0);return(0,oo.jsx)(b.Modal,{title:(0,oo.jsx)("img",{src:Kn,alt:(0,w.__)("WooPay Logo","woocommerce-payments"),className:"woopay-disable-feedback-logo"}),isDismissible:!0,shouldCloseOnClickOutside:!1,shouldCloseOnEsc:!0,onRequestClose:e,className:"woopay-disable-feedback",children:(0,oo.jsx)(Jn,{isLoading:t,children:(0,oo.jsx)("iframe",{title:(0,w.__)("WooPay Disable Feedback","woocommerce-payments"),src:"https://woocommerce.survey.fm/woopay-disabled-merchants-feedback-triggered",className:"woopay-disable-feedback-iframe",onLoad:()=>{o(!1)}})})})},Xn=({disabled:e=!1})=>{const{saveSettings:t,isSaving:o,isLoading:n,isDirty:r}=zt(),s=Bt(),[a,i]=(0,d.useState)(null),[c,l]=(0,d.useState)(null),[u,m]=(0,d.useState)(!1);return null===a&&s&&void 0!==s.is_payment_request_enabled&&i(s.is_payment_request_enabled),null===c&&s&&void 0!==s.is_woopay_enabled&&l(s.is_woopay_enabled),(0,oo.jsxs)(jn,{className:"save-settings-section",children:[(0,oo.jsx)(b.Button,{isPrimary:!0,isBusy:o,disabled:o||n||e||!r,onClick:async()=>{if(!await t()){const e=(0,v.select)(Mt)?.getSavingError();return void(e=>{if(!e||"object"!=typeof e)return;const t=Object.keys(e)[0];if(!t)return;const o=document.getElementById(`${t.replace(/_/g,"-")}-input`);if(!o||"function"!=typeof o.scrollIntoView)return;const n=window.matchMedia("(prefers-reduced-motion: reduce)").matches;o.scrollIntoView({behavior:n?"auto":"smooth",block:"center"}),o.focus({preventScroll:!0})})(e?.data?.details)}if(a!==s.is_payment_request_enabled&&(Dn("wcpay_payment_request_settings_change",{enabled:s.is_payment_request_enabled?"yes":"no"}),i(s.is_payment_request_enabled)),c&&!s.is_woopay_enabled){const{woopayLastDisableDate:e}=wcpaySettings;if(e){const t=new Date(e),o=new Date,n=Math.abs(o-t);if(Math.ceil(n/864e5)<7)return}m(!0),i(!0),wcpaySettings.woopayLastDisableDate=new Date}},children:(0,w.__)("Save changes","woocommerce-payments")}),u?(0,oo.jsx)(Qn,{onRequestClose:()=>m(!1)}):null]})},er=()=>{const[e,t]=It(),[o]=to(),[n]=(()=>{const{updateIsCardPresentEligible:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsCardPresentEligible()),e]})(),[r,s]=(0,po.useState)(!1),a=()=>{s(!1)};return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.CheckboxControl,{checked:e,disabled:o,onChange:e=>{e?s(!0):t(e)},"data-testid":"capture-later-checkbox",label:(0,w.__)("Enable manual capture","woocommerce-payments"),help:(0,oo.jsxs)("span",{children:[ao({mixedString:(0,w.__)("Issue an authorization on checkout and capture later. {{learnMoreLink}}Learn more{{/learnMoreLink}}.","woocommerce-payments"),components:{learnMoreLink:(0,oo.jsx)("a",{href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/",target:"_blank",rel:"noreferrer"})}}),n?ao({mixedString:(0,w.__)(" The setting is not applied to {{a}}In-Person Payments{{/a}} (please note that In-Person Payments should be captured within 2 days of authorization).","woocommerce-payments"),components:{a:(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/in-person-payments/"})}}):""]}),__nextHasNoMarginBottom:!0}),o&&(0,oo.jsx)(wo,{status:"warning",isDismissible:!1,children:(0,w.__)("Manual capture is not available when Stripe Billing is active.","woocommerce-payments")}),r&&(0,oo.jsxs)(yo,{title:(0,w.__)("Enable manual capture","woocommerce-payments"),className:"manual-capture-confirmation-modal",actions:(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.Button,{onClick:a,isTertiary:!0,children:(0,w.__)("Cancel","woocommerce-payments")}),(0,oo.jsx)(b.Button,{onClick:()=>{t(!0),s(!1)},isPrimary:!0,children:(0,w.__)("Enable manual capture","woocommerce-payments")})]}),onRequestClose:a,children:[(0,oo.jsxs)("p",{children:[ao({mixedString:(0,w.__)("Payments {{strong}}must be captured on the order details screen within 7 days of authorization{{/strong}}, otherwise the authorization and order will be canceled.","woocommerce-payments"),components:{strong:(0,oo.jsx)("strong",{})}}),(0,oo.jsx)("br",{}),ao({mixedString:(0,w.__)("{{learnMoreLink}}Learn more about manual capture{{/learnMoreLink}}.","woocommerce-payments"),components:{learnMoreLink:(0,oo.jsx)("a",{href:"https://woocommerce.com/document/woopayments/settings-guide/authorize-and-capture/",target:"_blank",rel:"noreferrer"})}})]}),(0,oo.jsx)(wo,{status:"info",isDismissible:!1,children:(0,w.__)("Manual capture is available for card payments only. Payment methods that don't support it will be disabled.","woocommerce-payments")})]})]})},tr=(0,d.lazy)(()=>Promise.all([r.e(7189),r.e(4701)]).then(r.bind(r,3119))),or=({id:e,inputProps:t={},isBlocksCheckout:o})=>(0,oo.jsx)("div",{className:o?"wc-block-components-text-input":"",children:(0,oo.jsx)("div",{className:"iti",children:(0,oo.jsx)("input",{type:"tel",id:e,className:"phone-input input-text",placeholder:(0,w.__)("Mobile number","woocommerce-payments"),"aria-label":t.ariaLabel||(0,w.__)("Mobile phone number","woocommerce-payments"),name:t.name,disabled:!0})})}),nr=({value:e="",id:t,onValueChange:o=()=>{},onValidationChange:n=()=>{},onCountryDropdownClick:r,inputProps:s={},isBlocksCheckout:a,...i})=>((0,d.useEffect)(()=>{e&&n(e.replace(/\D/g,"").length>=6)},[e,n]),(0,oo.jsx)("div",{className:a?"wc-block-components-text-input":"",children:(0,oo.jsx)("input",{type:"tel",id:t,value:e,className:"phone-input input-text",placeholder:(0,w.__)("Mobile number","woocommerce-payments"),"aria-label":s.ariaLabel||(0,w.__)("Mobile phone number","woocommerce-payments"),name:s.name,onChange:e=>o(e.target.value),...i})}));class rr extends d.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}render(){return this.state.hasError?this.props.fallback:this.props.children}}const sr=e=>(0,oo.jsx)(rr,{fallback:(0,oo.jsx)(nr,{...e}),children:(0,oo.jsx)(d.Suspense,{fallback:(0,oo.jsx)(or,{...e}),children:(0,oo.jsx)(tr,{...e})})}),ar=({setInputValid:e})=>{const[t,o]=(()=>{const{updateAccountBusinessSupportPhone:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getAccountBusinessSupportPhone()),e]})();let n=Zt()?.data?.details?.account_business_support_phone?.message;const r=Dt(),s=r&&"+10000000000"===t,[a,i]=(0,d.useState)(!0);""!==t&&(s||a)||(n=(0,w.__)("A support phone number is required. Please enter a valid phone number.","woocommerce-payments")),(0,d.useEffect)(()=>{e&&e(!n)},[n,e]);const c=(0,w.__)("Support phone number (required)","woocommerce-payments");return(0,oo.jsxs)(oo.Fragment,{children:[n&&(0,oo.jsx)(wo,{status:"error",isDismissible:!1,children:(0,oo.jsx)("span",{children:n})}),(0,oo.jsx)(b.BaseControl,{className:"settings__account-business-support-phone-input no-top-margin",help:(0,oo.jsxs)(oo.Fragment,{children:[(0,w.__)("This number may appear on customer bank statements and in-person purchase receipts, but not in order emails. Use a number you're comfortable sharing publicly.","woocommerce-payments"),r&&(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("br",{}),(0,w.__)("(+1 0000000000 can be used for test accounts)","woocommerce-payments")]})]}),label:c,id:"account-business-support-phone-input",__nextHasNoMarginBottom:!0,children:(0,oo.jsx)(sr,{id:"account-business-support-phone-input",onValueChange:o,value:t,onValidationChange:i,inputProps:{ariaLabel:c}})})]})},ir=e=>e.length<=254&&/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9.-]+$/.test(e),cr=({setInputValid:e})=>{const[t,o]=(()=>{const{updateAccountBusinessSupportEmail:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getAccountBusinessSupportEmail()),e]})(),[n,r]=(0,d.useState)(!1);let s=Zt()?.data?.details?.account_business_support_email?.message;const a=(0,d.useRef)(t).current;""===t&&""!==a&&(s=(0,w.__)("Support email cannot be empty once it has been set before, please specify.","woocommerce-payments"));const i=""!==t&&!ir(t),c=n&&i?(0,w.__)("Please enter a valid email address.","woocommerce-payments"):null,l=s||c,u="support-email-error";return(0,d.useEffect)(()=>{e&&e(!s&&!i)},[s,e,i]),(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("div",{id:u,role:"status","data-testid":"support-email-error",children:l&&(0,oo.jsx)(b.Notice,{status:"error",isDismissible:!1,children:(0,oo.jsx)("span",{children:l})})}),(0,oo.jsx)(b.TextControl,{className:"settings__account-business-support-email-input",help:(0,w.__)("This may be visible on receipts, invoices, and automated emails from your store.","woocommerce-payments"),label:(0,w.__)("Support email","woocommerce-payments"),value:t,onChange:o,onBlur:()=>r(!0),id:"account-business-support-email-input","data-testid":"account-business-support-email-input",type:"email","aria-invalid":!!l||void 0,"aria-describedby":l?u:void 0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]})},lr=({setTransactionInputsValid:e})=>{const[t,o]=(()=>{const{updateIsSavedCardsEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsSavedCardsEnabled()),e]})(),[n,r]=(()=>{const{updateAccountStatementDescriptor:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getAccountStatementDescriptor()),e]})(),[s,a]=(()=>{const{updateAccountStatementDescriptorKanji:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getAccountStatementDescriptorKanji()),e]})(),[i,c]=(()=>{const{updateAccountStatementDescriptorKana:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getAccountStatementDescriptorKana()),e]})(),l=Zt()?.data?.details?.account_statement_descriptor?.message,[u,m]=(0,d.useState)(!0),[p,h]=(0,d.useState)(!0),y=(0,v.select)(Lt).getSettings();return(0,d.useEffect)(()=>{e&&e(u&&p)},[u,p,e]),(0,oo.jsx)(b.Card,{className:"transactions",children:(0,oo.jsxs)(mo,{className:"wcpay-card-body",children:[(0,oo.jsx)("h4",{children:(0,w.__)("Transaction preferences","woocommerce-payments")}),(0,oo.jsx)(b.CheckboxControl,{checked:t,onChange:o,label:(0,w.__)("Enable payments via saved cards","woocommerce-payments"),help:(0,w.__)("When enabled, users will be able to pay with a saved card during checkout. Card details are stored in our platform, not on your store.","woocommerce-payments"),__nextHasNoMarginBottom:!0}),(0,oo.jsx)(er,{}),(0,oo.jsx)("h4",{children:(0,w.__)("Customer statements","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Edit the way your store name appears on your customers' bank statements.","woocommerce-payments")}),(0,oo.jsxs)("div",{className:"transactions__customer-statements",children:[l&&(0,oo.jsx)(b.Notice,{status:"error",isDismissible:!1,children:(0,oo.jsx)("span",{dangerouslySetInnerHTML:{__html:l}})}),(0,oo.jsx)(b.TextControl,{className:"transactions__account-statement-input",help:"JP"===y.account_country&&(0,w.__)("Use only latin characters.","woocommerce-payments"),label:(0,w.__)("Customer bank statement","woocommerce-payments"),value:n,onChange:r,maxLength:22,id:"account-statement-descriptor-input","data-testid":"store-name-bank-statement",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,oo.jsx)("span",{className:"input-help-text","aria-hidden":"true",children:`${n.length} / 22`}),"JP"===y.account_country&&(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsxs)("div",{className:"transactions__customer-support",children:[(0,oo.jsx)(b.TextControl,{className:"transactions__account-statement-input",help:(0,w.__)("Use only kanji characters.","woocommerce-payments"),label:(0,w.__)("Customer bank statement (kanji)","woocommerce-payments"),value:s,onChange:a,maxLength:17,"data-testid":"store-name-bank-statement-kanji",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,oo.jsx)("span",{className:"input-help-text","aria-hidden":"true",children:`${s.length} / 17`})]}),(0,oo.jsxs)("div",{className:"transactions__customer-support",children:[(0,oo.jsx)(b.TextControl,{className:"transactions__account-statement-input",help:(0,w.__)("Use only kana characters.","woocommerce-payments"),label:(0,w.__)("Customer bank statement (kana)","woocommerce-payments"),value:i,onChange:c,maxLength:22,"data-testid":"store-name-bank-statement-kana",__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,oo.jsx)("span",{className:"input-help-text","aria-hidden":"true",children:`${i.length} / 22`})]})]})]}),(0,oo.jsx)("h4",{children:(0,w.__)("Customer support","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Provide contact information where customers can reach you for support.","woocommerce-payments")}),(0,oo.jsxs)("div",{className:"transactions__customer-support",children:[(0,oo.jsx)(cr,{setInputValid:m}),(0,oo.jsx)(ar,{setInputValid:h})]})]})})};function dr(e,t={}){const{customFormat:o=null,includeTime:n=!1,separator:r=" / ",timezone:s}=t,a=Lo().utc(e).toISOString(),i=o||`${window.wcpaySettings.dateFormat}${n?`${r}${window.wcpaySettings.timeFormat}`:""}`;return(0,Ao.dateI18n)(i,a,s)}const ur=({monthlyAnchor:e,capitalize:t=!0})=>{const o=Lo().locale().startsWith("en")?"en":Lo().locale();let n=Lo()().locale(o).date(e).format("Do");return 31===e&&(n=(0,w.__)("Last day of the month","woocommerce-payments")),t||(n=n.toLowerCase()),n},mr={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"},pr=e=>JSON.stringify(e,Object.keys(e).sort()),hr={byId:{},queries:{},count:0,instant:{}},yr=(0,d.createContext)({isActive:!1,setActive:()=>null,isCompleted:!1,setCompleted:()=>null,taskId:""}),_r=window.wc.currency;var fr=r.n(_r);(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 gr=(e,t="USD",o=null,n=!1)=>{const r=(e=>wcpaySettings.zeroDecimalCurrencies.includes(e.toLowerCase()))(t);r||(e/=100);const s=e<0,a=s?-1*e:e,i=s?"-":"",c=n?(e=>{const t=e.toUpperCase(),{currencyData:o,connect:{country:n="US"}}=wcpaySettings;if(o[n]?.code===t)return fr()(o[n]);const r=(0,To.find)(o,{code:t});if(r){const{defaultLocale:e={}}=r;return e.hasOwnProperty("decimalSeparator")&&e.hasOwnProperty("thousandSeparator")&&e.hasOwnProperty("symbolPosition")&&(r.decimalSeparator=e.decimalSeparator,r.thousandSeparator=e.thousandSeparator,r.symbolPosition=e.symbolPosition),fr()(r)}return null})(t):((e,t=null)=>{const{currencyData:o,connect:{country:n="US"}}=wcpaySettings,r=(0,To.find)(o,{code:e.toUpperCase()});if(r){if(null!==t&&t.toUpperCase()!==e.toUpperCase()||o[n]){const e=t?(0,To.find)(o,{code:t.toUpperCase()}):o[n];e&&(r.decimalSeparator=e.decimalSeparator,r.thousandSeparator=e.thousandSeparator,r.symbolPosition=e.symbolPosition)}return fr()(r)}return null})(t,o);if(null===c)return i+br(a,t,r);try{return i+("function"==typeof c.formatAmount?wr(c.formatAmount(a)):wr(c.formatCurrency(a)))}catch(e){return i+wr(br(a,t,r))}};function br(e,t,o){try{return e.toLocaleString(void 0,{style:"currency",currency:t,currencyDisplay:"narrowSymbol",dummy:o})}catch(n){return(0,w.sprintf)(o?"%s %i":"%s %.2f",t.toUpperCase(),e)}}function wr(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}function xr(e){return{type:mr.SET_DEPOSIT,data:e}}function vr(e){return{type:mr.SET_ALL_DEPOSITS_OVERVIEWS,data:e}}function Sr(e,t){return{type:mr.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS,error:t}}function kr(e,t){return{type:mr.SET_DEPOSITS,query:e,data:t}}function jr(e){return{type:mr.SET_DEPOSITS_COUNT,data:e}}function Cr(e,t,o){return{type:mr.SET_ERROR_FOR_DEPOSIT_QUERY,query:e,data:t,error:o}}function Er(e,t){return{type:mr.SET_DEPOSITS_SUMMARY,query:e,data:t}}function Pr(e,t,o){return{type:mr.SET_ERROR_FOR_DEPOSITS_SUMMARY,query:e,data:t,error:o}}function Nr(e){return{type:mr.SET_INSTANT_DEPOSIT,data:e}}function*Tr(e){try{yield(0,v.dispatch)(Be).startResolution("getInstantDeposit",[e]);const t=yield(0,Oe.apiFetch)({path:"/wc/v3/payments/deposits",method:"POST",data:{type:"instant",currency:e}});yield Nr(t),yield(0,v.dispatch)(Be).invalidateResolutionForStoreSelector("getDeposits"),yield(0,v.dispatch)(Be).invalidateResolutionForStoreSelector("getAllDepositsOverviews"),yield(0,v.dispatch)("core/notices").createSuccessNotice((0,w.sprintf)((0,w.__)("Instant payout for %s in transit.","woocommerce-payments"),gr(t.amount)),{actions:[{label:(0,w.__)("View details","woocommerce-payments"),url:Do({page:"wc-admin",path:"/payments/payouts/details",id:t.id})}]})}catch{yield(0,v.dispatch)("core/notices").createErrorNotice((0,w.__)("Error creating instant payout.","woocommerce-payments"))}finally{yield(0,v.dispatch)(Be).finishResolution("getInstantDeposit",[e])}}function*Mr(e){if(/\W/.test(e))return;const t=(0,No.addQueryArgs)(`${Fe}/deposits/${e}`);try{const e=yield(0,Oe.apiFetch)({path:t});yield xr(e)}catch(e){yield v.controls.dispatch("core/notices","createErrorNotice",(0,w.__)("Error retrieving payout.","woocommerce-payments"))}}function*Lr(){const e=(0,No.addQueryArgs)(`${Fe}/deposits/overview-all`);try{const t=yield(0,Oe.apiFetch)({path:e});yield vr(t)}catch(e){yield v.controls.dispatch("core/notices","createErrorNotice",(0,w.__)("Error retrieving all payouts' overviews.","woocommerce-payments")),yield Sr()}}const Ar=e=>({user_email:e.userEmail,match:e.match,store_currency_is:e.storeCurrencyIs,date_before:Io(e.dateBefore,!0),date_after:Io(e.dateAfter),date_between:e.dateBetween&&[Io(e.dateBetween[0]),Io(e.dateBetween[1],!0)],status_is:e.statusIs,status_is_not:e.statusIsNot,locale:e.locale}),Dr=`${Fe}/deposits/download`;function Or(e){return(0,No.addQueryArgs)(Dr,Ar(e))}function*Ir(e){const t=(0,No.addQueryArgs)(`${Fe}/deposits`,{page:e.paged,pagesize:e.perPage,sort:e.orderby,direction:e.order,...Ar(e)});try{const o=yield(0,Oe.apiFetch)({path:t})||{};yield kr(e,o.data),yield jr(o.total_count);for(const e in o.data)yield v.controls.dispatch(Be,"finishResolution","getDeposit",[o.data[e].id])}catch(t){yield v.controls.dispatch("core/notices","createErrorNotice",(0,w.__)("Error retrieving payouts.","woocommerce-payments")),yield Cr(e,null,t)}}function*Rr(e){const t=(0,No.addQueryArgs)(`${Fe}/deposits/summary`,Ar(e));try{const o=yield(0,Oe.apiFetch)({path:t});yield Er(e,o)}catch(t){yield Pr(e,null,t)}}const Fr=e=>e&&e.deposits||{},Br=(e,t)=>(Fr(e).byId||{})[t],zr=e=>{const t=Fr(e).overviews||{};if(!t.data)return{account:null,currencies:[]};const{deposit:o,balance:n,account:r}=t.data,s={lastPaid:o.last_paid,pending:n.pending,available:n.available,instant:n.instant},a={};for(const[e,t]of Object.entries(s))t?.forEach(t=>{const{currency:o}=t;a[o]||(a[o]={currency:o,lastPaid:void 0,pending:void 0,available:void 0,instant:void 0}),a[o][e]=t});const i=Object.values(a);return{account:r,currencies:[...i.filter(e=>r.default_currency===e.currency),...i.filter(e=>r.default_currency!==e.currency)]}},Wr=e=>(Fr(e).overviews||{}).error,Hr=(e,t)=>{const o=pr(t);return(Fr(e).queries||{})[o]||{}},qr=(e,t)=>(Hr(e,t).data||[]).map(Br.bind(void 0,e)),Ur=e=>Fr(e).count,$r=(e,t)=>Hr(e,t).error||{},Vr=(e,t)=>{const o=pr(t);return(Fr(e).summary||{})[o]||{}},Gr=(e,t)=>Vr(e,t).data||{},Yr=(e,t)=>Vr(e,t).error||{},Zr=e=>(Fr(e).instant||{}).data,Jr=Be,Kr=(0,v.createReduxStore)(Jr,{reducer:(0,v.combineReducers)({deposits:(e=hr,{type:t,query:o={},data:n=[],error:r})=>{const s=pr(o);switch(t){case mr.SET_DEPOSIT:return{...e,byId:{...e.byId,[n.id]:n}};case mr.SET_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,data:n}};case mr.SET_ERROR_FOR_ALL_DEPOSITS_OVERVIEWS:return{...e,overviews:{...e.overviews,error:r}};case mr.SET_DEPOSITS:return{...e,byId:{...e.byId,...(0,To.keyBy)(n,"id")},queries:{...e.queries,[s]:{data:(0,To.map)(n,"id")}}};case mr.SET_DEPOSITS_COUNT:return{...e,count:n};case mr.SET_ERROR_FOR_DEPOSIT_QUERY:return{...e,queries:{...e.queries,[s]:{error:r}}};case mr.SET_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[s]:{data:n}}};case mr.SET_ERROR_FOR_DEPOSITS_SUMMARY:return{...e,summary:{...e.summary,[s]:{error:r}}};case mr.SET_INSTANT_DEPOSIT:return{...e,instant:{...e.instant,data:n}}}return e}}),actions:n,selectors:a,resolvers:s,controls:Oe.controls});(0,v.register)(Kr);const Qr=window.wc.components,Xr=({updateAccountLink:e})=>{const t=e?(0,No.addQueryArgs)(e,{from:"WCPAY_PAYOUTS",source:"wcpay-payout-failure-notice"}):"";return""!==e?(0,oo.jsx)(wo,{status:"warning",icon:!0,className:"deposit-failure-notice",isDismissible:!1,children:ao({mixedString:(0,w.__)("Payouts are currently paused because a recent payout failed. Please {{updateLink}}update your bank account details{{/updateLink}}.","woocommerce-payments"),components:{updateLink:(0,oo.jsx)(b.ExternalLink,{onClick:()=>Dn("wcpay_account_details_link_clicked",{from:"WCPAY_PAYOUTS",source:"wcpay-payout-failure-notice"}),href:t})}})}):null},es=[{label:(0,w.__)("Monday","woocommerce-payments"),value:"monday"},{label:(0,w.__)("Tuesday","woocommerce-payments"),value:"tuesday"},{label:(0,w.__)("Wednesday","woocommerce-payments"),value:"wednesday"},{label:(0,w.__)("Thursday","woocommerce-payments"),value:"thursday"},{label:(0,w.__)("Friday","woocommerce-payments"),value:"friday"}],ts=[...Array.from({length:28},(e,t)=>t+1),31].map(e=>({value:e,label:ur({monthlyAnchor:e})})),os=()=>{const[e,t]=(()=>{const{updateDepositScheduleInterval:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getDepositScheduleInterval()),e]})(),[o,n]=(()=>{const{updateDepositScheduleWeeklyAnchor:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getDepositScheduleWeeklyAnchor()),e]})(),[r,s]=(()=>{const{updateDepositScheduleMonthlyAnchor:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getDepositScheduleMonthlyAnchor()),e]})(),a=(0,v.select)(Lt).getSettings();let i=[{value:"daily",label:(0,w.__)("Daily","woocommerce-payments")},{value:"weekly",label:(0,w.__)("Weekly","woocommerce-payments")},{value:"monthly",label:(0,w.__)("Monthly","woocommerce-payments")}];return"JP"===a.account_country&&(i=i.slice(1)),(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsxs)("div",{className:"schedule-controls",children:[(0,oo.jsx)(b.SelectControl,{label:(0,w.__)("Frequency","woocommerce-payments"),value:e,onChange:e=>{switch(e){case"weekly":n(o||"monday");break;case"monthly":s(r||"1")}t(e)},options:i,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),"monthly"===e&&(0,oo.jsx)(b.SelectControl,{label:(0,w.__)("Date","woocommerce-payments"),value:r,onChange:s,options:ts,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),"weekly"===e&&(0,oo.jsx)(b.SelectControl,{label:(0,w.__)("Day","woocommerce-payments"),value:o,onChange:n,options:es,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]}),(0,oo.jsxs)("p",{className:"help-text",children:["monthly"===e&&(0,w.__)("Payouts scheduled on a weekend will be sent on the next business day.","woocommerce-payments"),"weekly"===e&&(0,w.__)("Payouts that fall on a holiday will initiate on the next business day.","woocommerce-payments"),"daily"===e&&(0,w.__)("Payouts will occur every business day.","woocommerce-payments")]})]})},ns=()=>{const e=(0,v.useSelect)(e=>e(Mt).getDepositStatus(),[]),t=(0,v.useSelect)(e=>e(Mt).getDepositRestrictions()),o=(0,v.useSelect)(e=>e(Mt).getCompletedWaitingPeriod());return"enabled"!==e||"schedule_restricted"===t?(0,oo.jsx)(wo,{status:"warning",isDismissible:!1,icon:!0,children:ao({mixedString:(0,w.__)("Payout scheduling is currently unavailable for your store. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),components:{learnMoreLink:(0,oo.jsx)("a",{href:"https://woocommerce.com/document/woopayments/payouts/payout-schedule/",target:"_blank",rel:"noreferrer noopener"})}})}):!0!==o?(0,oo.jsx)(wo,{status:"warning",isDismissible:!1,icon:!0,children:ao({mixedString:(0,w.__)("Payout scheduling becomes available after the standard 7-day waiting period for new accounts is complete. {{learnMoreLink}}Learn more{{/learnMoreLink}}","woocommerce-payments"),components:{learnMoreLink:(0,oo.jsx)("a",{href:"https://woocommerce.com/document/woopayments/payouts/payout-schedule/",target:"_blank",rel:"noreferrer noopener"})}})}):(0,oo.jsx)(os,{})},rs=()=>{const{accountStatus:{accountLink:e}}=(0,d.useContext)(Ro),{overviews:t}=(0,v.useSelect)(e=>{const{getAllDepositsOverviews:t,getAllDepositsOverviewsError:o,isResolving:n,hasFinishedResolution:r}=e(Jr);return{overviews:t(),overviewError:o(),isLoading:!r("getAllDepositsOverviews")||n("getAllDepositsOverviews")}}),o=t.account?.default_external_accounts?.some(e=>"errored"===e.status)??!1;return(0,oo.jsx)(b.Card,{className:"deposits",children:(0,oo.jsxs)(mo,{className:"wcpay-card-body",children:[(0,oo.jsx)("h4",{children:(0,w.__)("Payout schedule","woocommerce-payments")}),(0,oo.jsx)(ns,{}),(0,oo.jsx)("h4",{children:(0,w.__)("Payout bank account","woocommerce-payments")}),o?(0,oo.jsx)(Xr,{updateAccountLink:e}):(0,oo.jsxs)("p",{children:[(0,w.__)("Manage and update your bank account information to receive payouts.","woocommerce-payments")," ",e&&(0,oo.jsx)(b.ExternalLink,{href:e,onClick:()=>{Dn("wcpay_settings_deposits_manage_in_stripe_click"),Dn("wcpay_account_details_link_clicked",{source:"settings-deposits"})},children:(0,w.__)("Manage in Stripe","woocommerce-payments")})]})]})})},ss=({children:e,numLines:t})=>{const{isLoading:o}=zt();return(0,oo.jsx)(Zn,{isLoading:o,numLines:t,children:e})};class as extends d.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onError&&this.props.onError(e,t)}render(){return this.state.error?(0,oo.jsxs)(wo,{icon:!0,status:"error",isDismissible:!1,children:[(0,w.__)("There was an error rendering this view. Please contact support for assistance if the problem persists.","woocommerce-payments"),(0,oo.jsx)("br",{}),this.state.error.toString()]}):this.props.children}}const is=document.getElementById("wpbody-content")||document.body,cs=(e,t)=>!(!t||t!==e.target&&!(e.target instanceof Node&&t.contains(e.target))),ls=(0,d.memo)(({children:e,parentElement:t})=>{const o=(0,d.useRef)(null);return o.current||(o.current=document.createElement("div"),t.appendChild(o.current)),(0,d.useEffect)(()=>()=>{o.current&&(t.removeChild(o.current),o.current=null)},[t]),(0,m.createPortal)(e,o.current)}),ds=({className:e,children:t,content:o,parentElement:n=is,hideDelayMs:r=600,isVisible:s,onHide:a,maxWidth:i="250px"})=>{const c=(0,d.useRef)(null),l=(0,d.useRef)(null),u=((e,{hideDelayMs:t=600,triggerRef:o,tooltipRef:n,parentElement:r,onHide:s=To.noop})=>{const[a,i]=(0,d.useState)(e),c=(0,d.useRef)(!1),l=(0,d.useRef)(s),u=(0,d.useRef)(e);return u.current!==e&&(u.current=e,e&&!a&&i(!0)),(0,d.useEffect)(()=>{l.current=s},[s]),(0,d.useEffect)(()=>{c.current?e&&r.dispatchEvent(new Event("wcpay-tooltip-open")):c.current=!0},[e,r]),(0,d.useEffect)(()=>{if(e||!a)return;const o=setTimeout(()=>{i(!1),l.current()},t);return()=>{clearTimeout(o)}},[e,a,t]),(0,d.useEffect)(()=>{if(!a)return;const e=()=>{i(!1),l.current()},t=e=>{cs(e,o.current?.firstChild)||cs(e,n.current)||(i(!1),l.current())};return document.addEventListener("click",t),r.addEventListener("wcpay-tooltip-open",e),()=>{document.removeEventListener("click",t),r.removeEventListener("wcpay-tooltip-open",e)}},[a,o,n,r]),a})(!!s,{hideDelayMs:r,triggerRef:c,tooltipRef:l,parentElement:n,onHide:a});return(0,d.useEffect)(()=>{const e=()=>{if(!u)return;const e=l.current,t=c.current?.firstChild;if(!e||!t)return;if(!(t instanceof HTMLElement))return;e.style.maxWidth=i;const o=window.innerWidth-16;e.offsetWidth>o&&(e.style.maxWidth=`${o}px`);const n=t.getBoundingClientRect(),r=e.getBoundingClientRect().height;e.style.top=n.top-r-8+"px";const s=t.offsetWidth/2+n.left,a=e.offsetWidth,d=window.innerWidth-a-8,m=Math.max(8,Math.min(s-a/2,d));e.style.left=`${m}px`,e.style.visibility="visible",e.style.opacity="1"};e();const t=(0,To.debounce)(e,150);return window.addEventListener("resize",t),document.addEventListener("scroll",t),()=>{window.removeEventListener("resize",t),document.removeEventListener("scroll",t)}},[u,i]),(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("div",{className:"wcpay-tooltip__content-wrapper",ref:c,children:t}),u&&(0,oo.jsx)(ls,{parentElement:n,children:(0,oo.jsx)("div",{ref:l,className:uo("wcpay-tooltip__tooltip-wrapper",{"is-hiding":!s}),role:"tooltip",children:(0,oo.jsx)("div",{className:uo("wcpay-tooltip__tooltip",e),children:o})})})]})},us=({isVisible:e,onHide:t=To.noop,children:o,buttonIcon:n,buttonLabel:r,buttonSize:s=16,...a})=>{const[i,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1),m=()=>{c(!0)},p=()=>{c(!1),t()};return(0,oo.jsx)("button",{className:"wcpay-tooltip__content-wrapper",onMouseEnter:m,onMouseLeave:p,onFocus:m,onBlur:p,onClick:()=>{u(e=>!e),l&&t()},type:"button",children:(0,oo.jsx)(ds,{...a,onHide:()=>{c(!1),u(!1),t()},isVisible:e||i||l,children:n?(0,oo.jsx)(b.Icon,{icon:n,size:s,"aria-label":r}):o})})},ms=({isVisible:e,onHide:t=To.noop,buttonIcon:o,buttonLabel:n,buttonSize:r=16,children:s,className:a,maxWidth:i,...c})=>{const[l,u]=(0,d.useState)(!1),m=(0,d.useRef)(null);return(0,oo.jsx)("button",{className:"wcpay-tooltip__content-wrapper wcpay-tooltip--click__content-wrapper",onClick:()=>{u(e=>!e),l&&t()},type:"button",ref:m,children:(0,oo.jsx)(ds,{...c,parentElement:m.current||void 0,onHide:()=>{u(!1),t()},maxWidth:i,isVisible:e||l,className:uo("wcpay-tooltip--click__tooltip",a),children:o?(0,oo.jsx)("div",{tabIndex:0,role:"button","aria-label":n,children:(0,oo.jsx)(b.Icon,{icon:o,size:r})}):s})})},ps=e=>Number((100*e).toFixed(3)),hs="https://woocommerce.com/document/woopayments/fees/",ys={AE:"united-arab-emirates",AU:"australia",AT:"austria",BE:"belgium",BG:"bulgaria",CA:"canada",CY:"cyprus",CZ:"czech-republic",FR:"france",LU:"luxembourg",DE:"germany",DK:"denmark",EE:"estonia",FI:"finland",GR:"greece",HK:"hong-kong",HR:"croatia",HU:"hungary",IE:"ireland",IT:"italy",JP:"japan",LT:"lithuania",LV:"latvia",MT:"malta",NL:"netherlands",NO:"norway",NZ:"new-zealand",PL:"poland",PT:"portugal",SG:"singapore",SI:"slovenia",SK:"slovakia",SE:"sweden",ES:"spain",CH:"switzerland",GB:"united-kingdom",US:"united-states",RO:"romania"},_s=(e,t=1)=>e.fixed_rate&&e.percentage_rate?(0,w.sprintf)("%1$f%% + %2$s",ps(e.percentage_rate*t),gr(e.fixed_rate*t,e.currency)):e.fixed_rate?(0,w.sprintf)("%1$s",gr(e.fixed_rate*t,e.currency)):e.percentage_rate?(0,w.sprintf)("%1$f%%",ps(e.percentage_rate*t)):"",fs=e=>{if(!e)return(0,oo.jsx)(oo.Fragment,{});const t=e.discount.length&&e.discount[0].discount?1-e.discount[0].discount:1,o={percentage_rate:e.base.percentage_rate*t+e.additional.percentage_rate*t+e.fx.percentage_rate,fixed_rate:e.base.fixed_rate*t+e.additional.fixed_rate*t+e.fx.fixed_rate,currency:e.base.currency},n=e=>e.fixed_rate>0||e.percentage_rate>0,r=wcpaySettings?.accountStatus?.country,s=r?(e=>Object.prototype.hasOwnProperty.call(ys,e)?ys[e]:void 0)(r):void 0,a=s?`${hs}#${s}`:hs;return(0,oo.jsxs)("div",{className:"wcpay-fees-tooltip",children:[(0,oo.jsxs)("div",{children:[(0,oo.jsx)("div",{children:(0,w.__)("Base fee","woocommerce-payments")}),(0,oo.jsx)("div",{children:_s(e.base,t)})]}),n(e.additional)?(0,oo.jsxs)("div",{children:[(0,oo.jsx)("div",{children:(0,w.__)("International payment method fee","woocommerce-payments")}),(0,oo.jsx)("div",{children:_s(e.additional,t)})]}):"",n(e.fx)?(0,oo.jsxs)("div",{children:[(0,oo.jsx)("div",{children:(0,w.__)("Currency conversion fee","woocommerce-payments")}),(0,oo.jsx)("div",{children:_s(e.fx)})]}):"",(0,oo.jsxs)("div",{children:[(0,oo.jsx)("div",{children:(0,w.__)("Total per transaction","woocommerce-payments")}),(0,oo.jsx)("div",{className:"wcpay-fees-tooltip__bold",children:_s(o)})]}),(0,oo.jsx)("div",{className:"wcpay-fees-tooltip__hint-text",children:(0,oo.jsx)("span",{children:ao({mixedString:s?(0,w.sprintf)((0,w.__)("{{linkToStripePage}}Learn more{{/linkToStripePage}} about %s Fees in your country","woocommerce-payments"),"WooPayments"):(0,w.sprintf)((0,w.__)("{{linkToStripePage}}Learn more{{/linkToStripePage}} about %s Fees","woocommerce-payments"),"WooPayments"),components:{linkToStripePage:(0,oo.jsx)(b.ExternalLink,{href:a})}})})})]})},gs=e=>e?((e,t={})=>{const o=e.base,n=(e=>e.discount.length?e.discount[0]:e.base)(e),r={fee:(0,w.__)("%1$f%% + %2$s per transaction","woocommerce-payments"),discount:(0,w.__)("(%f%% discount)","woocommerce-payments"),displayBaseFeeIfDifferent:!0,...t},s=(0,w.sprintf)(r.fee,ps(o.percentage_rate),gr(o.fixed_rate,o.currency));if(n.percentage_rate!==o.percentage_rate||n.fixed_rate!==o.fixed_rate||n.currency!==o.currency){const e=n;let t,a;e.discount?(t=o.percentage_rate*(1-e.discount),a=o.fixed_rate*(1-e.discount)):(t=n.percentage_rate,a=n.fixed_rate);let i=(0,w.sprintf)(r.fee,ps(t),gr(a,o.currency));r.displayBaseFeeIfDifferent&&(i=(0,w.sprintf)((0,w.__)("<s>%1$s</s> %2$s","woocommerce-payments"),s,i)),e.discount&&r.discount.length>0&&(i+=" "+(0,w.sprintf)(r.discount,ps(e.discount)));const c={s:(0,oo.jsx)("s",{})};return(0,po.createInterpolateElement)(i,c)}return s})(e,{fee:(0,w.__)("From %1$f%% + %2$s","woocommerce-payments"),discount:"",displayBaseFeeIfDifferent:!1}):(0,w.__)("missing fees","woocommerce-payments"),bs=e=>{if(!e.discount)return"";const t=ps(e.discount);return e.end_time?(0,w.sprintf)((0,w.__)("%1$s%% off fees through %2$s","woocommerce-payments"),t,dr(e.end_time)):(0,w.sprintf)((0,w.__)("%s%% off fees","woocommerce-payments"),t)},ws=e=>{if(!e.discount)return"";const t=ps(e.discount),o=e.volume_currency??e.currency;return e.volume_allowance&&e.end_time?(0,w.sprintf)((0,w.__)("You are saving %1$s%% on processing fees for the first %2$s of total payment volume or through %3$s.","woocommerce-payments"),t,gr(e.volume_allowance,o),dr(e.end_time)):e.volume_allowance?(0,w.sprintf)((0,w.__)("You are saving %1$s%% on processing fees for the first %2$s of total payment volume.","woocommerce-payments"),t,gr(e.volume_allowance,o)):e.end_time?(0,w.sprintf)((0,w.__)("You are saving %1$s%% on processing fees through %2$s.","woocommerce-payments"),t,dr(e.end_time)):(0,w.sprintf)((0,w.__)("You are saving %s%% on processing fees.","woocommerce-payments"),t)},xs=({message:e,type:t="primary",className:o,tooltip:n,icon:r})=>{const s=uo("chip",`chip-${t}`,r&&"chip-has-icon",o),a=(0,oo.jsxs)(oo.Fragment,{children:[r&&(0,oo.jsx)(Cn,{icon:r,size:16}),e]});return n?(0,oo.jsx)(us,{content:n,children:(0,oo.jsx)("span",{className:s,children:a})}):(0,oo.jsx)("span",{className:s,children:a})};var vs=r(4392),Ss=r.n(vs);const ks=e=>({__html:Ss().sanitize(e,{ALLOWED_TAGS:["a","b","em","i","strong","p","br"],ALLOWED_ATTR:["target","href","rel","name","download"]})}),js=({message:e,tooltip:t,type:o="success",tooltipLabel:n=(0,w.__)("More information","woocommerce-payments"),tcUrl:r,tcLabel:s})=>{const a=uo("chip",`chip-${o}`,"wcpay-promotional-badge"),i=r&&s?(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("span",{dangerouslySetInnerHTML:ks(t)})," ",(0,oo.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",children:s})]}):(0,oo.jsx)("span",{dangerouslySetInnerHTML:ks(t)});return(0,oo.jsxs)("span",{className:a,children:[e,(0,oo.jsx)(ms,{buttonIcon:(0,oo.jsx)(bo.A,{}),buttonLabel:n,content:i})]})},Cs=({type:e="",className:t="",children:o})=>{const n=uo("wcpay-pill"+(["primary","success","alert","danger","light"].includes(e)?"__"+e:""),t);return(0,oo.jsx)(Qr.Pill,{className:n,children:o})},Es=({id:e,className:t,children:o,anchor:n,open:r,onClose:s,dataTestId:a})=>{const i=(0,d.useRef)(null),[c,l]=(0,d.useState)(!1),m=(0,d.useCallback)(()=>{const e=i.current;if(!e||!n)return;const t=n.closest("label");if(!t)return;const o=t.getBoundingClientRect(),r=window.getComputedStyle(t),s=parseInt(r.paddingRight,10);e.style.position="fixed",e.style.right=window.innerWidth-(o.right-s)+"px",e.style.top=o.top-30+"px",e.style.left="auto",l(!0)},[n]);return(0,d.useLayoutEffect)(()=>{r&&n&&requestAnimationFrame(m)},[r,n,m]),(0,d.useEffect)(()=>{if(r&&n){const e=new MutationObserver(m);e.observe(n,{attributes:!0,childList:!0,subtree:!0}),window.addEventListener("resize",m),window.addEventListener("scroll",m);const t=e=>{!i.current||i.current.contains(e.target)||n.contains(e.target)||s?.()},o=e=>{"Escape"===e.key&&s?.()};return document.addEventListener("mousedown",t),document.addEventListener("keydown",o),()=>{e.disconnect(),window.removeEventListener("resize",m),window.removeEventListener("scroll",m),document.removeEventListener("mousedown",t),document.removeEventListener("keydown",o)}}},[r,n,m,s]),r?(0,oo.jsx)("div",{id:e,ref:i,className:`logo-popover ${t||""}`,style:{position:"fixed",zIndex:1e3,opacity:c?1:0,transition:"opacity 0.2s",gridTemplateColumns:`repeat(${u().Children.count(o)>5?5:u().Children.count(o)}, 38px)`,left:"auto"},role:"dialog","aria-label":(0,w.__)("Supported Credit Card Brands","woocommerce-payments"),"data-testid":a,children:o}):null},Ps=[{breakpoint:480,maxElements:5},{breakpoint:768,maxElements:7}],Ns=[],Ts=({maxElements:e=10,paymentMethods:t=Ns,breakpointConfigs:o=Ps})=>{const[n,r]=(0,d.useState)(e),[s,a]=(0,d.useState)(null),[i,c]=(0,d.useState)(!1),l=t.length>n,u=()=>c(!i),m=(0,d.useCallback)(e=>{null!==e&&a(e)},[]),p=(0,d.useRef)(null),h=(0,d.useCallback)(()=>{c(!1),p.current?.focus()},[]),y=document.querySelector('iframe[name="editor-canvas"]');return(0,d.useEffect)(()=>{const t=()=>{let t;t=y?y.clientWidth:window.innerWidth;const n=[...o].sort((e,t)=>e.breakpoint-t.breakpoint).find(e=>t<=e.breakpoint);r(n?n.maxElements:e)};if(t(),"undefined"!=typeof ResizeObserver){const e=new ResizeObserver(t);return y?e.observe(y):window.addEventListener("resize",t),()=>{e.disconnect(),window.removeEventListener("resize",t)}}return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[o,e,y]),(0,d.useEffect)(()=>{s&&(p.current=s)},[s]),(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("div",{className:"payment-methods--logos",children:(0,oo.jsxs)("div",{ref:m,...l&&{onClick:u,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),u())},role:"button",tabIndex:0,"aria-expanded":i,"aria-controls":"payment-methods-popover"},"data-testid":"payment-methods-logos",children:[t.slice(0,n).map(e=>(0,oo.jsx)("img",{alt:e.name,src:e.component,width:38,height:24},e.name)),l&&(0,oo.jsxs)("div",{className:"payment-methods--logos-count",children:["+ ",t.length-n]})]})}),l&&i&&(0,oo.jsx)(Es,{id:"payment-methods-popover",className:"payment-methods--logos-popover",anchor:s,open:i,onClose:h,dataTestId:"payment-methods-popover",children:t.slice(n).map(e=>(0,oo.jsx)("img",{alt:e.name,src:e.component,width:38,height:24},e.name))})]})},Ms=r.p+"../assets/images/payment-method-icons/visa.svg?ver=ea73ff7da957e7f061a5",Ls=r.p+"../assets/images/payment-method-icons/mastercard.svg?ver=4400aa23cc86d9f46f7b",As=r.p+"../assets/images/payment-method-icons/amex.svg?ver=ed5bba89666ab8190fdc",Ds=r.p+"../assets/images/payment-method-icons/discover.svg?ver=294a531122cb0d508a02",Os=r.p+"../assets/images/payment-method-icons/jcb.svg?ver=30285695e508b783e4f1",Is=r.p+"../assets/images/cards/cartes_bancaires.svg?ver=7b1291fee8396b46e81f";let Rs=function(e){return e.SET_PM_PROMOTIONS="SET_PM_PROMOTIONS",e.SET_ERROR_FOR_PM_PROMOTIONS="SET_ERROR_FOR_PM_PROMOTIONS",e}({});const Fs={pmPromotions:void 0,pmPromotionsError:void 0};function Bs(e){return function(e){return"object"==typeof e&&null!==e&&"code"in e&&"string"==typeof e.code}(e)?e:{code:"unknown_error"}}function zs(e){return{type:Rs.SET_PM_PROMOTIONS,data:e}}function Ws(e){return{type:Rs.SET_ERROR_FOR_PM_PROMOTIONS,error:e}}function*Hs(e){const t=`${Fe}/pm-promotions/${e}/activate`;try{yield(0,Oe.apiFetch)({path:t,method:"POST"}),yield v.controls.dispatch("core/notices","createSuccessNotice",(0,w.__)("Promotion activated successfully!","woocommerce-payments")),yield v.controls.dispatch(We,"invalidateResolution","getPmPromotions",[])}catch(e){yield v.controls.dispatch("core/notices","createErrorNotice",(0,w.__)("Error activating promotion. Please try again.","woocommerce-payments")),yield v.controls.dispatch(We,"updateErrorForPmPromotions",Bs(e))}}function*qs(e){const t=`${Fe}/pm-promotions/${e}/dismiss`;try{yield(0,Oe.apiFetch)({path:t,method:"POST"}),yield v.controls.dispatch("core/notices","createSuccessNotice",(0,w.__)("Promotion dismissed.","woocommerce-payments")),yield v.controls.dispatch(We,"invalidateResolution","getPmPromotions",[])}catch(e){yield v.controls.dispatch("core/notices","createErrorNotice",(0,w.__)("Error dismissing promotion. Please try again.","woocommerce-payments")),yield v.controls.dispatch(We,"updateErrorForPmPromotions",Bs(e))}}function Us(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*$s(){const e=`${Fe}/pm-promotions`;try{const t=yield(0,Oe.apiFetch)({path:e});if(o=t,!Array.isArray(o)||!o.every(Us))throw new Error("Invalid promotions data received from API");yield v.controls.dispatch(We,"updatePmPromotions",t)}catch(e){yield v.controls.dispatch("core/notices","createErrorNotice",(0,w.__)("Error retrieving promotions. Please try again later.","woocommerce-payments")),yield v.controls.dispatch(We,"updateErrorForPmPromotions",(t=e,function(e){return"object"==typeof e&&null!==e&&"code"in e}(t)?t:{code:"unknown_error"}))}var t,o}const Vs=e=>e.pmPromotions?.pmPromotions??[],Gs=e=>e.pmPromotions?.pmPromotionsError,Ys=We,Zs=(0,v.createReduxStore)(Ys,{reducer:(0,v.combineReducers)({pmPromotions:(e=Fs,t)=>{switch(t.type){case Rs.SET_PM_PROMOTIONS:return{...e,pmPromotions:t.data,pmPromotionsError:void 0};case Rs.SET_ERROR_FOR_PM_PROMOTIONS:return{...e,pmPromotions:void 0,pmPromotionsError:t.error}}return e}}),actions:i,selectors:l,resolvers:c,controls:Oe.controls});(0,v.register)(Zs);const Js=()=>(0,v.useSelect)(e=>{const{getPmPromotions:t,getPmPromotionsError:o,isResolving:n}=e(Ys);return{pmPromotions:t(),pmPromotionsError:o(),isLoading:n("getPmPromotions")}}),Ks=({id:e,label:t,accountFees:o,badgePromotion:n})=>{const{chip:r,chipType:s="warning"}=xn(e),a=o?.[e]?.discount?.[0],i=a?.discount,c=i||n,l=i?{message:bs(a),tooltip:ws(a),tooltipLabel:(0,w.__)("Discount details","woocommerce-payments")}:n?{message:n.title,tooltip:n.description,tooltipLabel:(0,w.__)("Promotion details","woocommerce-payments"),tcUrl:n.tc_url,tcLabel:n.tc_label,type:n.badge_type}:null;return(0,oo.jsxs)(oo.Fragment,{children:[t,wn.CARD===e&&(0,oo.jsx)("span",{className:"payment-method__required-label",children:"("+(0,w.__)("Required","woocommerce-payments")+")"}),r&&(0,oo.jsx)(xs,{message:r,type:s}),c&&l&&(0,oo.jsx)(js,{message:l.message,tooltip:l.tooltip,tooltipLabel:l.tooltipLabel,tcUrl:l.tcUrl,tcLabel:l.tcLabel,type:l.type})]})},Qs=[{name:"visa",component:Ms},{name:"mastercard",component:Ls},{name:"amex",component:As},{name:"discover",component:Ds},{name:"diners",component:Vo},{name:"jcb",component:Os},{name:"cartes_bancaires",component:Is},{name:"unionpay",component:Zo}],Xs=({id:e,label:t,Icon:o=()=>null,description:n,onCheckClick:r,onUncheckClick:s,className:a,locked:i})=>{const{isActionable:c,notice:l,noticeType:u="warning"}=xn(e),[m]=At(),{accountFees:p}=(0,d.useContext)(Ro),{pmPromotions:h=[]}=Js(),y=h?.find(t=>t.payment_method===e&&"badge"===t.type),{duplicates:_,dismissedDuplicateNotices:f,setDismissedDuplicateNotices:g}=(0,d.useContext)(hn),b=Object.keys(_).includes(e);return(0,oo.jsxs)(un,{className:uo("payment-method__list-item",a),children:[(0,oo.jsx)(un.Checkbox,{label:t,checked:m.includes(e),disabled:!c||i,onChange:t=>{if(!i)return t?r(e):s(e)}}),(0,oo.jsxs)(un.Body,{children:[(0,oo.jsxs)(un.Subgroup,{Icon:o,label:(0,oo.jsx)(Ks,{label:t,id:e,accountFees:p,badgePromotion:y}),children:[n,e===wn.CARD&&(0,oo.jsx)("div",{className:"payment-method__supported-cards",children:(0,oo.jsx)(Ts,{paymentMethods:Qs,maxElements:8,breakpointConfigs:[{breakpoint:480,maxElements:8},{breakpoint:768,maxElements:8}]})})]}),p&&p[e]&&(0,oo.jsx)(un.Action,{className:"payment-method__fees",children:(0,oo.jsx)(us,{maxWidth:"300px",content:fs(p[e]),children:(0,oo.jsx)(Cs,{"aria-label":(0,w.sprintf)((0,w.__)("Base transaction fees: %s","woocommerce-payments"),gs(p[e])),children:(0,oo.jsx)("span",{children:gs(p[e])})})})})]}),l&&(0,oo.jsx)(wo,{status:u,isDismissible:!1,children:l}),b&&!l&&(0,oo.jsx)(pn,{paymentMethod:e,gatewaysEnablingPaymentMethod:_[e],dismissedNotices:f,setDismissedDuplicateNotices:g})]})};var ea=r(8851);const ta=()=>null,oa=({hasBorder:e,icon:t=ta})=>(0,oo.jsx)("div",{className:"payment-confirm-illustration__wrapper",children:(0,oo.jsxs)("div",{className:"payment-confirm-illustration__illustrations",children:[(0,oo.jsx)(t,{className:uo("payment-confirm-illustration__payment-icon",{"has-border":e})}),(0,oo.jsx)(ea.A,{className:"payment-confirm-illustration__payment-question-mark-icon"})]})}),na={"individual.id_number":(0,w.__)("Personal Identification Number","woocommerce-payments"),"business_profile.url":(0,w.__)("Business Website","woocommerce-payments"),"company.tax_id":(0,w.__)("Business Number","woocommerce-payments")},ra=({paymentMethod:e,requirements:t,onClose:o,onConfirmClose:n})=>{const r=t.filter(e=>na.hasOwnProperty(e)),s=yn[e];return(0,oo.jsxs)(yo,{title:(0,w.sprintf)((0,w.__)("One more step to enable %s","woocommerce-payments"),s.label),shouldCloseOnClickOutside:!1,onRequestClose:o,className:"wcpay-payment-method-confirmation-modal",actions:(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.Button,{isSecondary:!0,onClick:o,children:(0,w.__)("Cancel","woocommerce-payments")}),(0,oo.jsx)(b.Button,{isPrimary:!0,onClick:n,children:(0,w.__)("Continue","woocommerce-payments")})]}),children:[(0,oo.jsx)(oa,{icon:s.icon,hasBorder:"card"!==s.id}),r.length>0?(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("p",{children:(0,w.sprintf)((0,w.__)("You need to provide more information to enable %s on your checkout:","woocommerce-payments"),s.label)}),(0,oo.jsx)("ul",{className:"payment-method-requirements-list",children:r.map((e,t)=>(0,oo.jsx)("li",{children:na[e]??e},"requirement"+t))})]}):(0,oo.jsx)("p",{children:(0,w.sprintf)((0,w.__)("You need to provide more information to enable %s on your checkout.","woocommerce-payments"),s.label)}),(0,oo.jsx)("p",{children:ao({mixedString:(0,w.__)("If you choose to continue, our payment partner Stripe will send an e-mail to {{merchantEmail /}} to collect the required information","woocommerce-payments"),components:{merchantEmail:(0,oo.jsx)("b",{children:wcpaySettings?.accountEmail??""})}})})]})},sa=({methodIds:e})=>{const[t]=At(),o=Ft(),n=e.map(e=>yn[e]),[r,s]=(0,d.useState)(null),[,a]=(()=>{const{updateSelectedPaymentMethod:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getEnabledPaymentMethodIds()),e]})(),i=e=>{a(e),s(null)},[,c]=(()=>{const{updateUnselectedPaymentMethod:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getEnabledPaymentMethodIds()),e]})();return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("ul",{className:"payment-methods-list payment-methods__available-methods",children:n.map(({id:e,label:n,icon:r,description:a})=>(0,oo.jsx)(Xs,{id:e,label:n,description:a,locked:wn.CARD===e&&t.includes(wn.CARD),Icon:r,onUncheckClick:()=>{(e=>{c(e)})(e)},onCheckClick:()=>{(e=>{const t=(e=>{const t=yn[e].stripe_key,n=o[t]??[];return n?{status:n.status,requirements:n.requirements}:{status:gn,requirements:[]}})(e);"unrequested"===t.status&&t.requirements.length>0?s({id:e,requirements:t.requirements}):i(e)})(e)}},e))}),r&&(0,oo.jsx)(ra,{onClose:()=>{s(null)},onConfirmClose:()=>{i(r.id)},requirements:r.requirements,paymentMethod:r.id})]})},aa=window.wp.a11y,ia=(0,oo.jsx)(ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oo.jsx)(ho.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})}),ca=(0,oo.jsx)(ho.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,oo.jsx)(ho.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z"})});var la=r(9044),da=r(9572);const ua={success:ia,error:la.A,warning:go.A,info:ca},ma=({icon:e,children:t,actions:o=[],className:n,status:r="info",isDismissible:s=!0,onRemove:a})=>{((e,t)=>{const o="string"==typeof t?t:(0,po.renderToString)(t),n="error"===e?"assertive":"polite";(0,po.useEffect)(()=>{o&&(0,aa.speak)(o,n)},[o,n])})(r,t);const i=!0===e?ua[r]:e,c=uo(n,"wcpay-banner-notice","is-"+r);return(0,oo.jsxs)("div",{className:c,children:[i&&(0,oo.jsx)(b.Icon,{icon:i,className:"wcpay-banner-notice__icon"}),(0,oo.jsxs)("div",{className:"wcpay-banner-notice__content",children:[t,o.length>0&&(0,oo.jsx)("div",{className:"wcpay-banner-notice__actions",children:o.map(({className:e,label:t,variant:o,onClick:n,url:r,urlTarget:s},a)=>{let i=o;return"primary"!==o&&(i=r?"link":"secondary"),(0,oo.jsx)(b.Button,{href:r,variant:i,onClick:r?void 0:n,className:e,target:s,__next40pxDefaultSize:!0,children:t},a)})})]}),s&&(0,oo.jsx)(b.Button,{className:"wcpay-banner-notice__dismiss",icon:da.A,label:(0,w.__)("Dismiss this notice","woocommerce-payments"),onClick:()=>a?.(),showTooltip:!1,__next40pxDefaultSize:!0})]})},pa=()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Payments accepted on checkout","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Add and edit payments available to customers at checkout. Based on their device type, location, and purchase history, your customers will only see the most relevant payment methods.","woocommerce-payments")})]}),ha=()=>{const e=Rt(),[t]=It(),[o,n]=(0,d.useState)(!1),r=e.filter(e=>yn[e]&&!yn[e].allows_pay_later&&wn.AMAZON_PAY!==e&&wn.LINK!==e&&wn.APPLE_PAY!==e&&wn.GOOGLE_PAY!==e).reduce((e,t)=>t===wn.CARD?[t,...e]:[...e,t],[]);return(0,oo.jsx)(jn,{description:pa,id:"payment-methods",children:(0,oo.jsx)(ss,{numLines:60,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(b.Card,{className:"payment-methods",children:(0,oo.jsxs)(mo,{size:null,children:[(0,oo.jsx)("div",{className:"payment-methods__header",children:(0,oo.jsx)("h3",{className:"payment-methods__heading",children:(0,w.__)("Payment methods","woocommerce-payments")})}),t&&!o&&(0,oo.jsx)(ma,{status:"warning",isDismissible:!0,icon:!0,className:"manual-capture-notice",onRemove:()=>n(!0),children:(0,w.__)("Manual capture is enabled, so any payment methods that don't support it have been automatically disabled.","woocommerce-payments")}),(0,oo.jsx)(sa,{methodIds:r})]})})})})})},ya=()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Buy now, pay later","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Boost sales by offering customers additional buying power and flexible payment options.","woocommerce-payments")}),(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/payment-methods/buy-now-pay-later/",children:(0,w.__)("Learn more","woocommerce-payments")})]}),_a=()=>{const e=Rt().filter(e=>yn[e]&&yn[e].allows_pay_later);return 0===e.length?null:(0,oo.jsx)(jn,{description:ya,id:"buy-now-pay-later-methods",children:(0,oo.jsx)(ss,{numLines:30,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(b.Card,{className:"payment-methods",children:(0,oo.jsx)(mo,{size:null,children:(0,oo.jsx)(sa,{methodIds:e})})})})})})},fa=({isBusy:e,className:t,children:o})=>(0,oo.jsxs)("div",{className:uo("wcpay-form-busy-state",t,{"is-busy":e}),"aria-busy":e,children:[(0,oo.jsx)("div",{className:"wcpay-form-busy-state__status screen-reader-text",role:"status","aria-live":"polite",children:e?(0,w.__)("Saving…","woocommerce-payments"):""}),o]}),ga=({onValidationChange:e})=>{const[t,o]=(()=>{const{updateAccountCommunicationsEmail:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getAccountCommunicationsEmail()),e]})(),{isLoading:n}=zt(),[r,s]=(0,d.useState)(!1),[a,i]=(0,d.useState)(""),[c,l]=(0,d.useState)(!1),u=(0,d.useRef)(null);n||null!==u.current||(u.current=t??"");const m=null!==u.current&&t!==u.current,p=Zt(),h=p?.data?.details?.account_communications_email?.message,y=r&&""!==t&&!ir(t)?(0,w.__)("Please enter a valid email address.","woocommerce-payments"):null,_=h||y,f="notifications-email-error",g=!m||t===a,x=m&&c&&!g?(0,w.__)("Email addresses do not match. Please re-enter your email address.","woocommerce-payments"):null,S=g&&(""===t||ir(t));return(0,d.useEffect)(()=>{e?.(S)},[S,e]),(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h4",{children:(0,w.__)("Notifications email","woocommerce-payments")}),(0,oo.jsx)("p",{className:"settings__notifications-email-description",children:(0,w.__)("Provide an email address where you would like to receive communications about your WooPayments account.","woocommerce-payments")}),(0,oo.jsx)(b.Notice,{className:"settings__notifications-email-warning",status:"warning",isDismissible:!1,children:(0,oo.jsx)("span",{children:(0,w.__)("Anyone with access to this email address will be treated as the account owner. Please verify the address carefully.","woocommerce-payments")})}),(0,oo.jsx)("div",{id:f,role:"status","data-testid":"notifications-email-error",children:_&&(0,oo.jsx)(b.Notice,{status:"error",isDismissible:!1,children:(0,oo.jsx)("span",{children:_})})}),(0,oo.jsx)(b.TextControl,{className:"settings__notifications-email-input",label:(0,w.__)("Email address","woocommerce-payments"),value:t,onChange:o,onBlur:()=>s(!0),id:"account-communications-email-input","data-testid":"notifications-email-input",type:"email",required:!0,"aria-invalid":!!_||void 0,"aria-describedby":_?f:void 0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,oo.jsx)("div",{id:"notifications-email-mismatch-error",role:"status","data-testid":"notifications-email-mismatch-error",children:x&&(0,oo.jsx)(b.Notice,{status:"error",isDismissible:!1,children:(0,oo.jsx)("span",{children:x})})}),m&&(0,oo.jsx)(oo.Fragment,{children:(0,oo.jsx)(b.TextControl,{className:"settings__notifications-email-confirm-input",label:(0,w.__)("Confirm email address","woocommerce-payments"),value:a,onChange:i,onBlur:()=>l(!0),"data-testid":"notifications-email-confirm-input",type:"email",required:!0,"aria-invalid":!!x||void 0,"aria-describedby":x?"notifications-email-mismatch-error":void 0,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})})]})},ba=()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Account notifications","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Receive important notifications about your WooPayments account.","woocommerce-payments")}),(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/settings-guide/#account-notifications",children:(0,w.__)("Learn more","woocommerce-payments")})]}),wa=({setNotificationEmailValid:e})=>(0,oo.jsx)(b.Card,{className:"notification-settings",children:(0,oo.jsx)(mo,{className:"wcpay-card-body",children:(0,oo.jsx)(ga,{onValidationChange:e})})});var xa=r(8556);const va=function(e){switch(e){case P:return(0,w.__)("Offers the highest level of filtering for stores, but may catch some legitimate transactions.","woocommerce-payments");case C:return(0,w.__)("Allows you to fine-tune the level of filtering according to your business needs.","woocommerce-payments");case E:return(0,w.__)("Provides a standard level of filtering that's suitable for most businesses.","woocommerce-payments");case j:return(0,w.__)("Provides the base level of platform protection.","woocommerce-payments");default:return""}},Sa=({level:e})=>(0,oo.jsx)("p",{className:"fraud-protection__text--help-text",children:va(e)}),ka=e=>(0,oo.jsx)(ho.SVG,{width:"24",height:"24",viewBox:"0 0 24 24",...e,children:(0,oo.jsx)(ho.Path,{d:["M12 15.8c-3.7 0-6.8-3-6.8-6.8s3-6.8 6.8-6.8c3.7 0 6.8 3 6.8 6.8s-3.1 6.8-6.8 6.8zm0-12C9.1 3.8 ","6.8 6.1 6.8 9s2.4 5.2 5.2 5.2c2.9 0 5.2-2.4 5.2-5.2S14.9 3.8 12 3.8zM8 17.5h8V19H8zM10 20.5h4V22h-4z"].join(" ")})}),ja=({level:e})=>{const t={[j]:(0,w.__)("Provides basic anti-fraud protection only.","woocommerce-payments"),[E]:(0,w.__)("Provides a standard level of filtering that's suitable for most business.","woocommerce-payments"),[P]:(0,w.__)("Offers the highest level of filtering for stores, but may catch some legitimate transactions.","woocommerce-payments")};return(0,oo.jsx)(b.Notice,{className:"component-notice--is-info",status:"info",isDismissible:!1,children:(0,oo.jsxs)("div",{className:"component-notice__content--flex",children:[(0,oo.jsx)(ka,{className:"component-notice__icon"}),(0,oo.jsx)("p",{children:t[e]})]})})},Ca=({level:e,setBasicModalOpen:t})=>{const{declineOnAVSFailure:o,declineOnCVCFailure:n}=wcpaySettings?.accountStatus?.fraudProtection??{declineOnAVSFailure:!0,declineOnCVCFailure:!0},r=o||n;return(0,oo.jsx)(b.Modal,{title:(0,w.__)("Basic filter level","woocommerce-payments"),isDismissible:!0,shouldCloseOnClickOutside:!0,shouldCloseOnEsc:!0,onRequestClose:()=>t(!1),className:"fraud-protection-level-modal",children:(0,oo.jsxs)("div",{className:"components-modal__body--fraud-protection",children:[(0,oo.jsx)(ja,{level:e}),r&&(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("p",{children:ao({mixedString:(0,w.__)("Payments will be {{blocked}}blocked{{/blocked}} if:","woocommerce-payments"),components:{blocked:(0,oo.jsx)("span",{className:"component-modal__text--blocked"})}})}),(0,oo.jsxs)("ul",{children:[o&&(0,oo.jsx)("li",{children:(0,w.__)("The billing address does not match what is on file with the card issuer.","woocommerce-payments")}),n&&(0,oo.jsx)("li",{children:(0,w.__)("The card's issuing bank cannot verify the CVV.","woocommerce-payments")})]})]}),(0,oo.jsx)(b.Button,{className:"component-modal__button--confirm",onClick:()=>t(!1),variant:"secondary",children:(0,w.__)("Got it","woocommerce-payments")})]})})},Ea=()=>{const[e,t]=(0,po.useState)(!1),o=(0,d.useRef)(null),n=(0,d.useRef)(null),[r,s]=(()=>{const{updateProtectionLevel:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getCurrentProtectionLevel()),e]})(),[a]=(()=>{const{updateAdvancedFraudProtectionSettings:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getAdvancedFraudProtectionSettings()),e]})(),{isDirty:i}=zt(),c=Bt();(0,d.useEffect)(()=>{null===o.current&&(o.current=r),null===n.current&&c&&(n.current={...c})},[r,c]);const l=Array.isArray(a)&&a.length>0,u=e=>()=>{Dn("wcpay_fraud_protection_risk_level_preset_enabled",{preset:e}),s(e)};return(0,oo.jsxs)(oo.Fragment,{children:["error"===a&&(0,oo.jsx)(wo,{icon:!0,status:"error",isDismissible:!1,children:(0,w.__)("There was an error retrieving your fraud protection settings. Please refresh the page to try again.","woocommerce-payments")}),(0,oo.jsx)("fieldset",{disabled:"error"===a,id:"fraud-protection-card-options",children:(0,oo.jsxs)("ul",{children:[(0,oo.jsxs)("li",{children:[(0,oo.jsxs)("div",{className:"fraud-protection-radio-wrapper",children:[(0,oo.jsx)("input",{name:"fraud-protection-level-select",id:"fraud-protection__basic-level",value:j,type:"radio",className:"fraud-protection-radio-wrapper__item",checked:j===r,onChange:u(j)}),(0,oo.jsx)("label",{className:"fraud-protection-radio-wrapper__item",htmlFor:"fraud-protection__basic-level",children:(0,w.__)("Basic","woocommerce-payments")}),(0,oo.jsx)(xa.A,{size:18,title:(0,w.__)("Basic level help icon","woocommerce-payments"),className:"fraud-protection__help-icon",onClick:()=>{Dn("wcpay_fraud_protection_basic_modal_viewed"),t(!0)}}),e&&(0,oo.jsx)(Ca,{level:j,setBasicModalOpen:t})]}),(0,oo.jsx)(Sa,{level:j})]}),(0,oo.jsxs)("li",{className:"fraud-protection__advanced-level-container",children:[(0,oo.jsxs)("label",{htmlFor:"fraud-protection-level-select_advanced-level",children:[(0,oo.jsxs)("div",{className:"fraud-protection-radio-wrapper",children:[(0,oo.jsx)("input",{name:"fraud-protection-level-select",id:"fraud-protection-level-select_advanced-level",value:C,type:"radio",checked:C===r,onChange:u(C)}),(0,oo.jsx)("p",{className:"fraud-protection-radio-wrapper__item",children:(0,w.__)("Advanced","woocommerce-payments")})]}),(0,oo.jsx)(Sa,{level:C})]}),(0,oo.jsx)(b.Button,{href:Do({page:"wc-admin",path:"/payments/fraud-protection"}),isSecondary:!0,onClick:()=>{i&&o.current===j&&r===C&&(()=>{if(!n.current||!c)return!1;const e=new Set([...Object.keys(n.current),...Object.keys(c)]);for(const t of e){if("current_protection_level"===t)continue;const e=void 0!==n.current[t]?n.current[t]:null,o=void 0!==c[t]?c[t]:null;if(JSON.stringify(e)!==JSON.stringify(o))return!1}return!0})()&&(window.onbeforeunload=null)},disabled:C!==r,children:l?(0,w.__)("Edit","woocommerce-payments"):(0,w.__)("Configure","woocommerce-payments")})]})]})})]})},Pa=[{referenceElements:{desktop:"#fp-settings"},meta:{name:"enhanced-fraud-protection",heading:(0,w.__)("Enhanced fraud protection 🔒","woocommerce-payments"),descriptions:{desktop:(0,w.__)("You can choose a level of protection for screening incoming transactions. Screened transactions will be automatically blocked by your customized fraud filters.","woocommerce-payments")},primaryButton:{text:(0,w.__)("See what's new","woocommerce-payments")}}},{referenceElements:{desktop:"#fraud-protection-card-options"},meta:{name:"choose-your-filter-level",heading:(0,w.__)("Choose your filter level 🚦","woocommerce-payments"),descriptions:{desktop:(0,w.__)("Choose how you'd like to screen incoming transactions using our Basic or Advanced options.","woocommerce-payments")}}},{referenceElements:{desktop:"[for=fraud-protection-level-select_advanced-level]"},meta:{name:"take-more-control",heading:(0,w.__)("Take more control 🎚️","woocommerce-payments"),descriptions:{desktop:(0,w.__)("Choose Advanced settings for full control over each filter. You can enable and configure filters to block risky transactions.","woocommerce-payments")}}},{referenceElements:{desktop:"#toplevel_page_wc-admin-path--payments-overview",mobile:".tour-kit woocommerce-tour-kit"},meta:{name:"review-blocked-transactions",heading:(0,w.__)("Review blocked transactions 📥️","woocommerce-payments"),descriptions:{desktop:ao({mixedString:(0,w.__)("Payments that have been blocked by a risk filter will appear under the blocked tab in {{strong}}Payments > Transactions{{/strong}}. We'll let you know why each payment was blocked so you can determine if you need to adjust your risk filters.","woocommerce-payments"),components:{strong:(0,oo.jsx)("strong",{})}})},primaryButton:{text:(0,w.__)("Got it","woocommerce-payments")}}}],Na={effects:{arrowIndicator:!0,spotlight:{styles:{padding:8}},autoScroll:{behavior:"smooth",block:"nearest"}},popperModifiers:[{name:"offset",options:{offset:[0,20]}}]},Ta=()=>{const{isWelcomeTourDismissed:e}=wcpaySettings.fraudProtection,{isLoading:t}=zt(),[o,n]=(0,d.useState)(!1);return(0,d.useEffect)(()=>{const o=document.getElementById("fp-settings");if(e||t||!o)return;const r=new IntersectionObserver(([e])=>{e.isIntersecting&&(n(!0),r.disconnect())},{threshold:1});return r.observe(o),()=>r.disconnect()},[t,e]),o?(0,oo.jsx)(Qr.TourKit,{config:{steps:Pa,options:Na,closeHandler:(e,t,o)=>{Nt("wcpay_fraud_protection_welcome_tour_dismissed",!0),wcpaySettings.fraudProtection.isWelcomeTourDismissed=!0,n(!1),Dn("done-btn"===o?"wcpay_fraud_protection_tour_clicked_through":"wcpay_fraud_protection_tour_abandoned")}}}):null},Ma=()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.Card,{className:"fraud-protection",children:(0,oo.jsxs)(mo,{className:"wcpay-card-body",children:[(0,oo.jsx)("h4",{children:(0,w.__)("Set your payment risk level","woocommerce-payments")}),(0,oo.jsx)(Ea,{})]})}),(0,oo.jsx)(Ta,{})]}),La=(0,d.createContext)({activeTask:"",setActiveTask:()=>null,completedTasks:{},setCompletedTasks:()=>null}),Aa=({children:e,defaultActiveTask:t="",defaultCompletedTasks:o={}})=>{const[n,r]=(0,d.useState)(t),[s,a]=(0,d.useState)(o),i=(0,d.useMemo)(()=>({activeTask:n,setActiveTask:r,completedTasks:s,setCompletedTasks:a}),[n,r,s]);return(0,oo.jsx)(La.Provider,{value:i,children:e})},Da=({children:e,id:t=""})=>{const{activeTask:o,completedTasks:n,setActiveTask:r,setCompletedTasks:s}=(0,d.useContext)(La),a=(0,d.useMemo)(()=>({isActive:t===o,setActive:()=>r(t),setCompleted:(e=!0,o="")=>{s(o=>({...o,[t]:e})),o&&r(o)},taskId:t,isCompleted:Boolean(n[t])}),[r,s,o,n,t]);return(0,oo.jsx)(yr.Provider,{value:a,children:e})},Oa=({children:e})=>{const t=(0,d.useRef)(!0),o=(0,d.useRef)(null),{activeTask:n}=(0,d.useContext)(La);return(0,d.useLayoutEffect)(()=>{if(!0===t.current)return void(t.current=!1);if(!o.current)return;const e=o.current.querySelector(".wcpay-wizard-task.is-active .wcpay-wizard-task__headline");e&&e.focus()},[n]),(0,oo.jsx)("div",{ref:o,children:(0,oo.jsx)("ul",{children:e})})},Ia=({className:e,...t})=>{const{isActive:o}=(0,d.useContext)(yr);return(0,oo.jsx)("div",{className:uo("task-collapsible-body",e,{"is-active":o}),...t})},Ra=({children:e,title:t,index:o,className:n,visibleDescription:r})=>{const{isCompleted:s,isActive:a}=(0,d.useContext)(yr);return(0,oo.jsxs)("li",{className:uo("wcpay-wizard-task",n,{"is-completed":s,"is-active":a}),children:[(0,oo.jsx)("div",{className:"wcpay-wizard-task__top-border"}),(0,oo.jsxs)("div",{className:"wcpay-wizard-task__headline",tabIndex:-1,children:[(0,oo.jsxs)("div",{className:"wcpay-wizard-task__icon-wrapper",children:[(0,oo.jsx)("div",{className:"wcpay-wizard-task__icon-text",children:o}),(0,oo.jsx)(Cn,{icon:ia,className:"wcpay-wizard-task__icon-checkmark"})]}),(0,oo.jsx)("span",{className:"wcpay-wizard-task__title",children:t})]}),r&&!a&&(0,oo.jsx)("span",{className:uo("wcpay-wizard-task__visible-description-element","is-muted-color"),children:r}),(0,oo.jsx)("div",{className:"wcpay-wizard-task__body",children:e})]})},Fa=({onCompleted:e,vatNumber:t,placeholderCompanyName:o,placeholderCompanyAddress:n})=>{const{setCompleted:r}=(0,d.useContext)(yr),[s,a]=(0,d.useState)(null),[i,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(o),[m,p]=(0,d.useState)(n),h=(0,d.useRef)({name:o,address:n});h.current.name===o&&h.current.address===n||(h.current={name:o,address:n},u(o),p(n));const y=""===l.trim()||""===m.trim();return(0,oo.jsx)(Ra,{index:2,title:(0,w.__)("Confirm your business details","woocommerce-payments"),children:(0,oo.jsxs)(Ia,{children:[(0,oo.jsx)(b.TextControl,{className:"wcpay-company-data-task__text-control",label:(0,w.__)("Business name","woocommerce-payments"),value:l,onChange:u,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,oo.jsx)(b.TextareaControl,{className:"wcpay-company-data-task__textarea-control",label:(0,w.__)("Address","woocommerce-payments"),value:m,onChange:p,__nextHasNoMarginBottom:!0}),(0,oo.jsx)(b.Button,{variant:"primary",disabled:y||i,isBusy:i,onClick:async()=>{try{c(!0);const o={name:l,address:m};null!==t&&(o.vat_number=t);const n=await Re()({path:"/wc/v3/payments/vat",method:"POST",data:o});c(!1),r(!0,"vat-submitted"),e(n.vat_number,n.name,n.address)}catch(e){c(!1),a(e.message)}},__next40pxDefaultSize:!0,children:(0,w.__)("Confirm","woocommerce-payments")}),s&&(0,oo.jsx)(b.Notice,{status:"error",isDismissible:!1,className:"vat-number-error",children:s})]})})},Ba=()=>{switch(wcpaySettings.accountStatus.country){case"AU":return(0,w.__)("ABN","woocommerce-payments");case"JP":return(0,w.__)("Corporate Number","woocommerce-payments");case"NZ":return(0,w.__)("IRD Number","woocommerce-payments");case"SG":return(0,w.__)("UEN or GST Registration Number","woocommerce-payments");default:return(0,w.__)("VAT Number","woocommerce-payments")}},za=()=>{switch(wcpaySettings.accountStatus.country){case"AU":return(0,w.__)("By inputting your ABN number you confirm that you are going to account for the GST.","woocommerce-payments");case"JP":return(0,w.__)("","woocommerce-payments");case"NO":return(0,w.__)("By inputting your VAT number you confirm you are a Norway VAT registered business and that you are going to account for the VAT.","woocommerce-payments");case"NZ":return(0,w.__)("By inputting your IRD number you confirm that you are going to account for the GST.","woocommerce-payments");case"SG":return(0,w.__)("By providing your UEN or GST number you confirm you are a Singapore GST registered business and you are going to account for the GST.","woocommerce-payments");default:return(0,po.createInterpolateElement)((0,w.__)("Tax registration rules vary by region. <learnMoreLink>Learn more about tax documents</learnMoreLink>.","woocommerce-payments"),{learnMoreLink:(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/taxes/documents/"})})}},Wa=()=>{switch(wcpaySettings.accountStatus.country){case"AU":return(0,w.__)("11-digit number, for example 12 345 678 901.","woocommerce-payments");case"JP":return(0,w.__)("13-digit number, for example 1234567890123.","woocommerce-payments");case"NZ":return(0,w.__)("8-digit or 9-digit number, for example 99-999-999 or 999-999-999.","woocommerce-payments");case"SG":return(0,w.__)("Enter your UEN (e.g., 200312345A) or GST Registration Number (e.g., M91234567X).","woocommerce-payments");default:return(0,w.__)("8 to 12 digits with your country code prefix, for example DE 123456789.","woocommerce-payments")}},Ha=({onCompleted:e})=>{const{setCompleted:t}=(0,d.useContext)(yr),[o,n]=(0,d.useState)(null),[r,s]=(0,d.useState)(!1),[a,i]=(0,d.useState)(!1),[c,l]=(0,d.useState)(""),u=(()=>{switch(wcpaySettings.accountStatus.country){case"AU":case"JP":case"NZ":case"SG":return"";case"GR":return"EL ";case"CH":return"CHE ";default:return`${wcpaySettings.accountStatus.country} `}})(),m=a&&c.trimEnd()===u.trimEnd();return(0,oo.jsxs)(Ra,{index:1,title:(0,w.sprintf)((0,w.__)("Set your %1$s","woocommerce-payments"),Ba()),children:[(0,oo.jsx)("p",{className:"wcpay-wizard-task__description-element",children:(0,w.__)("The information you provide here will be used for all of your account's tax documents.","woocommerce-payments")}),(0,oo.jsxs)(Ia,{children:[(0,oo.jsx)(b.CheckboxControl,{className:"wcpay-vat-number-task__checkbox",checked:a,onChange:e=>{i(e),l(e?u:"")},label:(0,w.sprintf)((0,w.__)("I have a valid %1$s","woocommerce-payments"),Ba()),help:za(),__nextHasNoMarginBottom:!0}),a&&(0,oo.jsx)(b.TextControl,{className:"wcpay-vat-number-task__text-control",label:Ba(),help:Wa(),value:c,onChange:e=>{const t=u.trim();e.trim().startsWith(t)?l(e):l(t)},__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),o&&(0,oo.jsx)(b.Notice,{status:"error",isDismissible:!1,className:"vat-number-error",children:o}),(0,oo.jsx)(b.Button,{variant:"primary",disabled:m||r,isBusy:r,onClick:async()=>{const o=a?c.replace(u,""):null;let r="",i="";n("");try{if(null!==o){s(!0);const e=await Re()({path:`/wc/v3/payments/vat/${encodeURI(o)}`});s(!1),r=e.name??"",i=e.address??""}t(!0,"company-data"),e(o,r,i)}catch(e){s(!1),n((e=>{const t=Ba();switch(e.code){case"wcpay_invalid_tax_number":return(0,w.sprintf)((0,w.__)("The provided %s failed validation.","woocommerce-payments"),t);case"wcpay_unsupported_tax_docs_country":return(0,w.__)("Your account's country is not supported for tax ID validation.","woocommerce-payments");default:return e.message}})(e))}},__next40pxDefaultSize:!0,children:(0,w.__)("Continue","woocommerce-payments")})]})]})},qa=({onCompleted:e})=>{const[t,o]=(0,d.useState)(null),[n,r]=(0,d.useState)(""),[s,a]=(0,d.useState)("");return(0,oo.jsx)(Aa,{defaultActiveTask:"vat-number",children:(0,oo.jsxs)(Oa,{children:[(0,oo.jsx)(Da,{id:"vat-number",children:(0,oo.jsx)(Ha,{onCompleted:(e,t,n)=>{o(e),r(t),a(n)}})}),(0,oo.jsx)(Da,{id:"company-data",children:(0,oo.jsx)(Fa,{onCompleted:(t,o,n)=>{e(t,o,n)},vatNumber:t,placeholderCompanyName:n,placeholderCompanyAddress:s})})]})})},Ua=({isModalOpen:e,setModalOpen:t,onCompleted:o})=>e?(0,oo.jsx)(b.Modal,{title:(0,w.__)("Set your tax details","woocommerce-payments"),onRequestClose:()=>t(!1),children:(0,oo.jsx)(qa,{onCompleted:o})}):null,$a=(0,oo.jsx)(ho.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,oo.jsx)(ho.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"})}),Va=["primary","success","light","warning","alert"],Ga=({badge:e,badgeType:t,heading:o,description:n,footnote:r,image:s,icon:a,primaryButtonLabel:i,onPrimaryClick:c,secondaryButtonLabel:l,onSecondaryClick:u,onDismiss:m,onView:p,showImmediately:h=!1,showDelayMs:y=4e3,reverseButtons:_=!1})=>{const f=(g=t)&&Va.includes(g)?g:"success";var g;const[x,v]=(0,d.useState)(h),[S,k]=(0,d.useState)(h),j=(0,d.useRef)(null),C=(0,d.useRef)(null),E=(0,d.useRef)(null);(0,d.useEffect)(()=>{if(h)return;const e=setTimeout(()=>{v(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{k(!0)})})},y);return()=>clearTimeout(e)},[h,y]),(0,d.useEffect)(()=>()=>{j.current&&clearTimeout(j.current)},[]),(0,d.useEffect)(()=>{S&&((0,aa.speak)((0,w.sprintf)((0,w.__)("Dialog opened: %s","woocommerce-payments"),o),"polite"),p&&p())},[S]);const P=(0,d.useCallback)((e=!0)=>{k(!1),j.current=setTimeout(()=>{v(!1),e&&m()},300)},[m]);if((0,d.useEffect)(()=>{if(!x||!C.current)return;const e=C.current,t=e.ownerDocument;E.current=t.activeElement,e.focus();const o=o=>{if("Escape"===o.key)return o.preventDefault(),void P();if("Tab"===o.key){const n=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),r=n[0],s=n[n.length-1],a=t.activeElement;o.shiftKey&&a===r?(o.preventDefault(),s?.focus()):o.shiftKey||a!==s||(o.preventDefault(),r?.focus())}};return t.addEventListener("keydown",o),()=>{t.removeEventListener("keydown",o),E.current?.focus()}},[x,P]),!x)return null;const N=(0,oo.jsx)(b.Button,{className:"wcpay-spotlight__primary-btn",variant:"primary",onClick:()=>{c(),P(!1)},size:"compact",children:i}),T=l&&(0,oo.jsx)(b.Button,{className:"wcpay-spotlight__secondary-btn",variant:"tertiary",onClick:u,size:"compact",children:l});return(0,oo.jsx)("div",{className:"wcpay-spotlight "+(S?"wcpay-spotlight--visible":""),children:(0,oo.jsx)("div",{ref:C,role:"dialog","aria-modal":"true","aria-labelledby":"spotlight-heading",tabIndex:-1,className:"wcpay-spotlight__container",children:(0,oo.jsxs)(b.Card,{className:`wcpay-spotlight__card ${s?"has-image":""} ${a?"has-icon":""}`,elevation:2,children:[s&&(0,oo.jsx)(b.CardMedia,{className:"wcpay-spotlight__image",children:"string"==typeof s?(0,oo.jsx)("img",{src:s,alt:"","aria-hidden":"true",role:"presentation"}):s}),(0,oo.jsx)(b.CardHeader,{isBorderless:!0,size:"small",className:"wcpay-spotlight__header",children:(0,oo.jsxs)(b.Flex,{className:"wcpay-spotlight__controls",justify:"space-between",align:"center",children:[!s&&!a&&e&&(0,oo.jsx)("div",{className:"wcpay-spotlight__badge",children:(0,oo.jsx)(xs,{message:e,type:f})}),!s&&!a&&!e&&(0,oo.jsx)("h2",{id:"spotlight-heading",className:"wcpay-spotlight__heading",children:o}),(s||a)&&(0,oo.jsx)("span",{}),(0,oo.jsx)(b.Button,{className:"wcpay-spotlight__close-btn",label:(0,w.__)("Close","woocommerce-payments"),icon:(0,oo.jsx)(b.Icon,{icon:$a,viewBox:"6 4 12 14"}),iconSize:16,onClick:()=>P()})]})}),(0,oo.jsxs)(b.CardBody,{className:"wcpay-spotlight__body",size:"small",children:[a&&(0,oo.jsx)("div",{className:"wcpay-spotlight__icon",children:a}),s&&e&&(0,oo.jsx)("div",{className:"wcpay-spotlight__badge",children:(0,oo.jsx)(xs,{message:e,type:f})}),(s||a||e)&&(0,oo.jsx)("h2",{id:"spotlight-heading",className:"wcpay-spotlight__heading",children:o}),"string"==typeof n?(0,oo.jsx)("div",{className:"wcpay-spotlight__description",dangerouslySetInnerHTML:ks(n)}):(0,oo.jsx)("div",{className:"wcpay-spotlight__description",children:n}),r&&("string"==typeof r?(0,oo.jsx)("div",{className:"wcpay-spotlight__footnote",dangerouslySetInnerHTML:ks(r)}):(0,oo.jsx)("div",{className:"wcpay-spotlight__footnote",children:r}))]}),(0,oo.jsx)(b.CardFooter,{isBorderless:!0,size:"small",className:"wcpay-spotlight__footer",children:(0,oo.jsx)(b.Flex,{justify:"flex-start",gap:3,children:_?(0,oo.jsxs)(oo.Fragment,{children:[N,T]}):(0,oo.jsxs)(oo.Fragment,{children:[T,N]})})})]})})})},Ya=()=>{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"},Za=()=>{const{pmPromotions:e,isLoading:t}=Js(),{activatePmPromotion:o,dismissPmPromotion:n}=(()=>{const{activatePmPromotion:e,dismissPmPromotion:t}=(0,v.useDispatch)(Ys);return{activatePmPromotion:e,dismissPmPromotion:t}})(),r=(0,d.useMemo)(()=>e?.find(e=>"spotlight"===e.type),[e]),s=(0,d.useCallback)(()=>({promo_id:r?.promo_id,payment_method:r?.payment_method,display_context:"spotlight",source:Ya(),path:window.location.pathname+window.location.search}),[r?.promo_id,r?.payment_method]),a=(0,d.useCallback)(()=>{Dn("wcpay_payment_method_promotion_view",s())},[s]),i=(0,d.useCallback)(()=>{r&&(Dn("wcpay_payment_method_promotion_activate_click",s()),o(r.id))},[s,o,r]),c=(0,d.useCallback)(()=>{if(r&&(Dn("wcpay_payment_method_promotion_link_click",{...s(),link_type:"terms"}),r.tc_url))try{const e=new URL(r.tc_url);"https:"!==e.protocol&&"http:"!==e.protocol||window.open(r.tc_url,"_blank","noopener,noreferrer")}catch{}},[s,r]),l=(0,d.useCallback)(()=>{r&&(Dn("wcpay_payment_method_promotion_dismiss_click",s()),n(r.id))},[s,n,r]);return t?null:e&&0!==e.length&&r?(0,oo.jsx)(Ga,{badge:r.badge_text,badgeType:r.badge_type,heading:r.title,description:r.description,footnote:r.footnote,image:r.image,primaryButtonLabel:r.cta_label,onPrimaryClick:i,secondaryButtonLabel:r.tc_label,onSecondaryClick:c,onDismiss:l,onView:a}):null},Ja=()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Express checkouts","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Let your customers use their favorite express payment methods and digital wallets for faster, more secure checkouts across different parts of your store.","woocommerce-payments")}),(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/settings-guide/#express-checkouts",children:(0,w.__)("Learn more","woocommerce-payments")})]}),Ka=()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("General","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.sprintf)((0,w.__)("Enable or disable %s on your store.","woocommerce-payments"),"WooPayments")})]}),Qa=()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Transactions","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Update your store's configuration to ensure smooth transactions.","woocommerce-payments")}),(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/",children:(0,w.__)("View our documentation","woocommerce-payments")})]}),Xa=()=>{const e=(0,v.useSelect)(e=>e(Mt).getDepositDelayDays(),[]);return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Payouts","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.sprintf)((0,w.__)("Funds are available for payout %s business days after they’re received.","woocommerce-payments"),e)}),(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/payouts/payout-schedule/",children:(0,w.__)("Learn more about payout schedules","woocommerce-payments")})]})},ei=()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Fraud protection","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Help avoid unauthorized transactions and disputes by setting your fraud protection level.","woocommerce-payments")}),(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/fraud-and-disputes/fraud-protection/",children:(0,w.__)("Learn more about fraud protection","woocommerce-payments")})]}),ti=()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Advanced settings","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("More options for specific payment needs.","woocommerce-payments")}),(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopayments/settings-guide/#advanced-settings",children:(0,w.__)("View our documentation","woocommerce-payments")})]}),oi=()=>"true"===new URLSearchParams(window.location.search).get("woopayments-vat-details-modal"),ni=()=>oi()&&wcpaySettings.accountStatus.isDocumentsEnabled&&!wcpaySettings.accountStatus.hasSubmittedVatData,ri=()=>{const[e,t]=(0,d.useState)(!0),[o,n]=(0,d.useState)(!0),{isLoading:r,isDirty:s,isSaving:a}=zt();(0,d.useEffect)(()=>{s||(window.onbeforeunload=null)},[s]),(0,d.useLayoutEffect)(()=>{const{anchor:e}=(0,x.getQuery)(),{hash:t}=window.location,o=e||t;if(!r&&o){const e=document.querySelector(o);if(!e)return;const t=document.querySelector(".woocommerce-layout__header"),n=(t?t.clientHeight:60)+50,r=e.getBoundingClientRect().top+window.pageYOffset-n;window.scrollTo({top:r,behavior:"smooth"})}},[r]);const[i,c]=(0,d.useState)(wcpaySettings.dismissedDuplicateNotices||{}),[l,u]=(0,d.useState)(ni);(0,d.useEffect)(()=>{oi()&&(wcpaySettings.accountStatus.isDocumentsEnabled?wcpaySettings.accountStatus.hasSubmittedVatData&&(0,v.dispatch)("core/notices").createInfoNotice((0,w.__)("Tax details are already submitted.","woocommerce-payments")):(0,v.dispatch)("core/notices").createErrorNotice((0,w.__)("Tax details collection is not available for your account.","woocommerce-payments")))},[]);const m=()=>{u(!1),(0,x.updateQueryString)({"woopayments-vat-details-modal":void 0})};return(0,oo.jsx)(Gn,{children:(0,oo.jsxs)(fa,{isBusy:a,children:[(0,oo.jsx)(jn,{description:Ka,id:"general",children:(0,oo.jsx)(ss,{numLines:20,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(Vn,{})})})}),(0,oo.jsxs)(hn.Provider,{value:{duplicates:(0,v.useSelect)(e=>e(Mt).getDuplicatedPaymentMethodIds()),dismissedDuplicateNotices:i,setDismissedDuplicateNotices:c},children:[(0,oo.jsx)(ha,{}),(0,oo.jsx)(_a,{}),(0,oo.jsx)(jn,{id:"express-checkouts",description:Ja,children:(0,oo.jsx)(ss,{numLines:20,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(Sn,{})})})})]}),(0,oo.jsx)(jn,{description:Qa,id:"transactions",children:(0,oo.jsx)(ss,{numLines:20,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(lr,{setTransactionInputsValid:t})})})}),(0,oo.jsx)(jn,{description:Xa,id:"deposits",children:(0,oo.jsx)("div",{id:"payout-schedule",children:(0,oo.jsx)(ss,{numLines:20,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(rs,{})})})})}),(0,oo.jsx)(jn,{description:ba,id:"notification-settings",children:(0,oo.jsx)(ss,{numLines:20,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(wa,{setNotificationEmailValid:n})})})}),(0,oo.jsx)(jn,{description:ei,id:"fp-settings",children:(0,oo.jsx)(ss,{numLines:20,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(Ma,{})})})}),(0,oo.jsx)(jn,{description:ti,id:"advanced-settings",children:(0,oo.jsx)(ss,{numLines:20,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(Po,{})})})}),(0,oo.jsx)(Xn,{disabled:!e||!o}),(0,oo.jsx)(Ua,{isModalOpen:l,setModalOpen:m,onCompleted:()=>{(0,v.dispatch)("core/notices").createInfoNotice((0,w.__)("Tax details updated","woocommerce-payments")),m()}}),(0,oo.jsx)(as,{children:(0,oo.jsx)(Za,{})})]})})};var si=r(2736);function ai(e,t){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),o.push.apply(o,n)}return o}function ii(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?ai(Object(o),!0).forEach(function(t){li(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):ai(Object(o)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(o,t))})}return e}function ci(e){return ci="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},ci(e)}function li(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}function di(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var o=e&&("undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"]);if(null!=o){var n,r,s=[],a=!0,i=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(s.push(n.value),!t||s.length!==t);a=!0);}catch(e){i=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(i)throw r}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ui(e,t);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?ui(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ui(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var mi=function(e,t,o){var n=!!o,r=d.useRef(o);d.useEffect(function(){r.current=o},[o]),d.useEffect(function(){if(!n||!e)return function(){};var o=function(){r.current&&r.current.apply(r,arguments)};return e.on(t,o),function(){e.off(t,o)}},[n,t,e,r])},pi=function(e){var t=d.useRef(e);return d.useEffect(function(){t.current=e},[e]),t.current},hi=function(e){return null!==e&&"object"===ci(e)},yi="[object Object]",_i=function e(t,o){if(!hi(t)||!hi(o))return t===o;var n=Array.isArray(t);if(n!==Array.isArray(o))return!1;var r=Object.prototype.toString.call(t)===yi;if(r!==(Object.prototype.toString.call(o)===yi))return!1;if(!r&&!n)return t===o;var s=Object.keys(t),a=Object.keys(o);if(s.length!==a.length)return!1;for(var i={},c=0;c<s.length;c+=1)i[s[c]]=!0;for(var l=0;l<a.length;l+=1)i[a[l]]=!0;var d=Object.keys(i);if(d.length!==s.length)return!1;var u=t,m=o;return d.every(function(t){return e(u[t],m[t])})},fi=function(e,t,o){return hi(e)?Object.keys(e).reduce(function(n,r){var s=!hi(t)||!_i(e[r],t[r]);return o.includes(r)?(s&&console.warn("Unsupported prop change: options.".concat(r," is not a mutable property.")),n):s?ii(ii({},n||{}),{},li({},r,e[r])):n},null):null},gi="Invalid prop `stripe` supplied to `Elements`. We recommend using the `loadStripe` utility from `@stripe/stripe-js`. See https://stripe.com/docs/stripe-js/react#elements-props-stripe for details.",bi=function(e){var t,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gi;if(null===e||hi(t=e)&&"function"==typeof t.elements&&"function"==typeof t.createToken&&"function"==typeof t.createPaymentMethod&&"function"==typeof t.confirmCardPayment)return e;throw new Error(o)},wi=d.createContext(null);wi.displayName="ElementsContext";var xi=function(e){var t=e.stripe,o=e.options,n=e.children,r=d.useMemo(function(){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:gi;if(function(e){return hi(e)&&"function"==typeof e.then}(e))return{tag:"async",stripePromise:Promise.resolve(e).then(function(e){return bi(e,t)})};var o=bi(e,t);return null===o?{tag:"empty"}:{tag:"sync",stripe:o}}(t)},[t]),s=di(d.useState(function(){return{stripe:"sync"===r.tag?r.stripe:null,elements:"sync"===r.tag?r.stripe.elements(o):null}}),2),a=s[0],i=s[1];d.useEffect(function(){var e=!0,t=function(e){i(function(t){return t.stripe?t:{stripe:e,elements:e.elements(o)}})};return"async"!==r.tag||a.stripe?"sync"!==r.tag||a.stripe||t(r.stripe):r.stripePromise.then(function(o){o&&e&&t(o)}),function(){e=!1}},[r,a,o]);var c=pi(t);d.useEffect(function(){null!==c&&c!==t&&console.warn("Unsupported prop change on Elements: You cannot change the `stripe` prop after setting it.")},[c,t]);var l=pi(o);return d.useEffect(function(){if(a.elements){var e=fi(o,l,["clientSecret","fonts"]);e&&a.elements.update(e)}},[o,l,a.elements]),d.useEffect(function(){!function(e){e&&e._registerWrapper&&e.registerAppInfo&&(e._registerWrapper({name:"react-stripe-js",version:"6.3.0"}),e.registerAppInfo({name:"react-stripe-js",version:"6.3.0",url:"https://stripe.com/docs/stripe-js/react"}))}(a.stripe)},[a.stripe]),d.createElement(wi.Provider,{value:a},n)};xi.propTypes={stripe:si.any,options:si.object},si.func.isRequired;var vi=d.createContext(null);vi.displayName="CheckoutContext";var Si=function(e){var t=d.useContext(vi),o=d.useContext(wi);if(t){if(o)throw new Error("You cannot wrap the part of your app that ".concat(e," in both a checkout provider and <Elements> provider."));return t}return function(e,t){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(t," in an <Elements> provider."));return e}(o,e)},ki=["mode"],ji=function(e,t,o){var n,r="".concat((n=e).charAt(0).toUpperCase()+n.slice(1),"Element"),s=t?function(e){Si("mounts <".concat(r,">"));var t=e.id,o=e.className;return d.createElement("div",{id:t,className:o})}:function(t){var o,n=t.id,s=t.className,a=t.options,i=void 0===a?{}:a,c=t.onBlur,l=t.onFocus,u=t.onReady,m=t.onChange,p=t.onEscape,h=t.onClick,y=t.onLoadError,_=t.onLoaderStart,f=t.onNetworksChange,g=t.onConfirm,b=t.onCancel,w=t.onShippingAddressChange,x=t.onShippingRateChange,v=t.onSavedPaymentMethodRemove,S=t.onSavedPaymentMethodUpdate,k=Si("mounts <".concat(r,">")),j="elements"in k?k.elements:null,C="checkoutState"in k?k.checkoutState:null,E="success"===(null==C?void 0:C.type)||"loading"===(null==C?void 0:C.type)?C.sdk:null,P=di(d.useState(null),2),N=P[0],T=P[1],M=d.useRef(null),L=d.useRef(null);mi(N,"blur",c),mi(N,"focus",l),mi(N,"escape",p),mi(N,"click",h),mi(N,"loaderror",y),mi(N,"loaderstart",_),mi(N,"networkschange",f),mi(N,"confirm",g),mi(N,"cancel",b),mi(N,"shippingaddresschange",w),mi(N,"shippingratechange",x),mi(N,"savedpaymentmethodremove",v),mi(N,"savedpaymentmethodupdate",S),mi(N,"change",m),u&&(o="expressCheckout"===e?u:function(){u(N)}),mi(N,"ready",o),d.useLayoutEffect(function(){if(null===M.current&&null!==L.current&&(j||E)){var t=null;if(E){var o=E,n=E;switch(e){case"paymentForm":t=n.createForm(i);break;case"payment":t=o.createPaymentElement(i);break;case"address":if(!("mode"in i))throw new Error("You must supply options.mode. mode must be 'billing' or 'shipping'.");var s=i.mode,a=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},s=Object.keys(e);for(n=0;n<s.length;n++)o=s[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(n=0;n<s.length;n++)o=s[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(i,ki);if("shipping"===s)t=o.createShippingAddressElement(a);else{if("billing"!==s)throw new Error("Invalid options.mode. mode must be 'billing' or 'shipping'.");t=o.createBillingAddressElement(a)}break;case"expressCheckout":t=o.createExpressCheckoutElement(i);break;case"currencySelector":t=E.createCurrencySelectorElement();break;case"taxId":t=o.createTaxIdElement(i);break;case"contactDetails":t=o.createContactDetailsElement();break;default:throw new Error("<".concat(r,"> is not supported inside a checkout provider. Use an <Elements> provider instead."))}}else j&&(t=j.create(e,i));M.current=t,T(t),t&&t.mount(L.current)}},[j,E,i]);var A=pi(i);return d.useEffect(function(){if(M.current){var e=fi(i,A,["paymentRequest"]);e&&"update"in M.current&&M.current.update(e)}},[i,A]),d.useLayoutEffect(function(){return function(){if(M.current&&"function"==typeof M.current.destroy)try{M.current.destroy(),M.current=null}catch(e){}}},[]),d.createElement("div",{id:n,className:s,ref:L})};return s.propTypes={id:si.string,className:si.string,onChange:si.func,onBlur:si.func,onFocus:si.func,onReady:si.func,onEscape:si.func,onClick:si.func,onLoadError:si.func,onLoaderStart:si.func,onNetworksChange:si.func,onConfirm:si.func,onCancel:si.func,onShippingAddressChange:si.func,onShippingRateChange:si.func,onSavedPaymentMethodRemove:si.func,onSavedPaymentMethodUpdate:si.func,options:si.object},s.displayName=r,s.__elementType=e,s},Ci="undefined"==typeof window;d.createContext(null).displayName="EmbeddedCheckoutProviderContext",ji("auBankAccount",Ci),ji("card",Ci),ji("cardNumber",Ci),ji("cardExpiry",Ci),ji("cardCvc",Ci),ji("iban",Ci),ji("payment",Ci);var Ei=ji("expressCheckout",Ci);function Pi(e){return Pi="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},Pi(e)}ji("paymentRequestButton",Ci),ji("linkAuthentication",Ci),ji("contactDetails",Ci),ji("address",Ci),ji("shippingAddress",Ci),ji("paymentMethodMessaging",Ci),ji("taxId",Ci),ji("issuingCardNumberDisplay",Ci),ji("issuingCardCvcDisplay",Ci),ji("issuingCardExpiryDisplay",Ci),ji("issuingCardPinDisplay",Ci),ji("issuingCardCopyButton",Ci);var Ni,Ti="dahlia",Mi="https://js.stripe.com",Li="".concat(Mi,"/").concat(Ti,"/stripe.js"),Ai=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,Di=/^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/,Oi="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",Ii=function(e){return Ai.test(e)||Di.test(e)},Ri=function(e){var t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src="".concat(Li).concat(t);var n=document.head||document.body;if(!n)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return n.appendChild(o),o},Fi=null,Bi=null,zi=null,Wi=!1,Hi=function(){return Ni||(Ni=(e=null,null!==Fi?Fi:(Fi=new Promise(function(t,o){if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(Oi),window.Stripe)t(window.Stripe);else try{var n=function(){for(var e=document.querySelectorAll('script[src^="'.concat(Mi,'"]')),t=0;t<e.length;t++){var o=e[t];if(Ii(o.src))return o}return null}();if(n&&e)console.warn(Oi);else if(n){if(n&&null!==zi&&null!==Bi){var r;n.removeEventListener("load",zi),n.removeEventListener("error",Bi),null===(r=n.parentNode)||void 0===r||r.removeChild(n),n=Ri(e)}}else n=Ri(e);zi=function(e,t){return function(){window.Stripe?e(window.Stripe):t(new Error("Stripe.js not available"))}}(t,o),Bi=function(e){return function(t){e(new Error("Failed to load Stripe.js",{cause:t}))}}(o),n.addEventListener("load",zi),n.addEventListener("error",Bi)}catch(e){return void o(e)}else t(null)})).catch(function(e){return Fi=null,Promise.reject(e)})).catch(function(e){return Ni=null,Promise.reject(e)}));var e};Promise.resolve().then(function(){return Hi()}).catch(function(e){Wi||console.warn(e)});const qi=e=>(0,oo.jsx)("svg",{viewBox:"0 0 109 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,oo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M69.496 5.785v16.42h2.766v-6.179h4.37c1.104 0 2.059-.23 2.865-.689.807-.46 1.424-1.075 1.852-1.846.428-.788.642-1.65.642-2.585 0-.936-.214-1.79-.642-2.56a4.714 4.714 0 0 0-1.852-1.872c-.79-.46-1.745-.69-2.864-.69h-7.137Zm2.766 7.804h4c.56 0 1.054-.107 1.482-.32.445-.23.79-.55 1.037-.96.247-.41.37-.878.37-1.403 0-.526-.123-.993-.37-1.404a2.386 2.386 0 0 0-1.037-.935c-.428-.23-.922-.345-1.482-.345h-4v5.367Zm15.693 8.912c-1.02 0-1.934-.246-2.74-.739-.808-.508-1.441-1.23-1.902-2.166-.445-.936-.667-2.043-.667-3.323 0-1.264.222-2.364.667-3.3.46-.951 1.094-1.682 1.901-2.19.807-.51 1.72-.764 2.741-.764.823 0 1.597.206 2.321.616a4.761 4.761 0 0 1 1.556 1.352v-1.672h2.47v11.89h-2.47v-1.667a5.231 5.231 0 0 1-1.556 1.372 4.695 4.695 0 0 1-2.32.591Zm2.692-9.675c.53.311.924.673 1.185 1.084v4.757c-.26.423-.656.79-1.185 1.101-.642.361-1.3.542-1.976.542-1.053 0-1.893-.37-2.519-1.108-.609-.755-.913-1.731-.913-2.93 0-.787.132-1.485.395-2.092a3.327 3.327 0 0 1 1.21-1.428c.527-.345 1.136-.517 1.827-.517.675 0 1.334.197 1.976.59Zm6.422 11.817c.115.066.271.115.469.148.197.032.395.049.592.049.395 0 .725-.082.988-.246.264-.164.478-.435.642-.813l.625-1.442-4.897-12.024h2.642l3.556 9.035 3.556-9.035h2.667l-5.803 14.106c0 .017-.008.025-.024.025v.05c-.264.607-.585 1.099-.964 1.476a3.337 3.337 0 0 1-1.284.813c-.477.164-1.02.246-1.63.246a6.98 6.98 0 0 1-1.53-.172l.395-2.216ZM39.45 5.512c-4.856 0-8.575 3.614-8.575 8.502 0 4.888 3.743 8.478 8.575 8.478 4.832 0 8.527-3.614 8.551-8.478 0-4.888-3.719-8.502-8.551-8.502Zm0 11.76c-1.824 0-3.08-1.369-3.08-3.258 0-1.89 1.256-3.283 3.08-3.283s3.08 1.394 3.08 3.283-1.233 3.259-3.08 3.259Zm-30.463 5.22c1.919 0 3.458-.945 4.619-3.117l2.582-4.818v4.085c0 2.41 1.563 3.85 3.98 3.85 1.894 0 3.292-.827 4.642-3.117l5.946-10.013c1.302-2.196.378-3.85-2.488-3.85-1.54 0-2.534.496-3.434 2.173l-4.098 7.675V8.535c0-2.03-.971-3.022-2.772-3.022-1.42 0-2.558.614-3.434 2.314l-3.861 7.533V8.606c0-2.172-.9-3.093-3.08-3.093H3.136c-1.682 0-2.534.779-2.534 2.22 0 1.44.9 2.266 2.534 2.266H4.96v8.62c0 2.432 1.634 3.873 4.027 3.873Zm40.221-8.478c0-4.888 3.719-8.502 8.551-8.502 4.832 0 8.551 3.637 8.551 8.502 0 4.864-3.719 8.478-8.55 8.478-4.833 0-8.552-3.59-8.552-8.478Zm5.495 0c0 1.889 1.208 3.259 3.056 3.259 1.824 0 3.08-1.37 3.08-3.26 0-1.888-1.256-3.282-3.08-3.282s-3.056 1.394-3.056 3.283Z",fill:"#fff",...e})});(Object.getOwnPropertyDescriptor(qi,"name")||{}).writable||Object.defineProperty(qi,"name",{value:"default",configurable:!0});const Ui=e=>(0,oo.jsxs)("svg",{viewBox:"0 0 100 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,oo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M63.963 4.435v15.121h2.547v-5.69h4.025c1.016 0 1.895-.212 2.638-.635a4.384 4.384 0 0 0 1.705-1.7 4.906 4.906 0 0 0 .591-2.38c0-.862-.197-1.648-.59-2.358a4.341 4.341 0 0 0-1.706-1.723c-.728-.423-1.607-.635-2.638-.635h-6.572Zm2.547 7.187h3.684c.515 0 .97-.099 1.364-.295.41-.212.728-.506.955-.884.228-.378.341-.809.341-1.292 0-.484-.113-.915-.34-1.293a2.197 2.197 0 0 0-.956-.861c-.394-.212-.849-.318-1.364-.318H66.51v4.943Zm14.451 8.206c-.94 0-1.781-.226-2.524-.68-.743-.468-1.326-1.133-1.75-1.995-.41-.861-.615-1.881-.615-3.06 0-1.164.205-2.177.614-3.038.425-.877 1.008-1.55 1.751-2.018.743-.468 1.584-.703 2.524-.703.758 0 1.47.19 2.138.567a4.384 4.384 0 0 1 1.432 1.245v-1.54h2.274v10.95h-2.274V18.02c-.393.517-.87.938-1.432 1.264a4.323 4.323 0 0 1-2.138.544Zm2.479-8.91c.487.287.851.62 1.091 1v4.38c-.24.39-.604.727-1.091 1.014-.591.332-1.198.499-1.82.499-.97 0-1.743-.34-2.319-1.02-.56-.696-.841-1.595-.841-2.698 0-.726.121-1.368.364-1.927.257-.56.629-.998 1.114-1.315.485-.318 1.046-.476 1.683-.476.621 0 1.228.181 1.819.544Zm5.913 10.883c.107.06.25.106.433.136.181.03.363.045.545.045.364 0 .667-.075.91-.227.243-.15.44-.4.591-.748l.576-1.328-4.51-11.073h2.433l3.275 8.32 3.274-8.32h2.456l-5.344 12.99c0 .016-.007.023-.022.023v.046c-.243.559-.538 1.012-.887 1.36a3.079 3.079 0 0 1-1.183.748c-.44.151-.94.227-1.5.227a6.449 6.449 0 0 1-1.41-.159l.364-2.04Z",fill:"#000",...e}),(0,oo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.242 19.82c1.767 0 3.185-.87 4.254-2.871l2.377-4.436v3.762c0 2.218 1.44 3.545 3.665 3.545 1.745 0 3.032-.762 4.275-2.871l5.475-9.22c1.2-2.023.35-3.545-2.29-3.545-1.418 0-2.334.457-3.163 2l-3.774 7.068V6.968c0-1.87-.894-2.784-2.552-2.784-1.308 0-2.355.565-3.162 2.131L9.79 13.252v-6.22c0-2-.829-2.848-2.836-2.848h-4.1c-1.55 0-2.334.718-2.334 2.044 0 1.327.828 2.088 2.334 2.088h1.68v7.937c0 2.24 1.504 3.567 3.707 3.567ZM36.295 4.184c-4.472 0-7.897 3.327-7.897 7.829 0 4.501 3.447 7.807 7.897 7.807s7.852-3.328 7.874-7.807c0-4.502-3.425-7.829-7.874-7.829Zm0 10.83c-1.68 0-2.836-1.262-2.836-3.001 0-1.74 1.156-3.023 2.836-3.023s2.835 1.283 2.835 3.023c0 1.74-1.134 3-2.835 3Zm8.985-3.001c0-4.502 3.425-7.829 7.875-7.829s7.874 3.349 7.874 7.829c0 4.48-3.424 7.807-7.874 7.807-4.45 0-7.875-3.306-7.875-7.807Zm5.061 0c0 1.74 1.112 3 2.814 3 1.68 0 2.835-1.26 2.835-3S54.834 8.99 53.155 8.99c-1.68 0-2.814 1.283-2.814 3.023Z",fill:"#873EFF"})]});function $i(e,t="",o){for(const n in e){const r=e[n],s=t?t+"["+n+"]":n;"string"==typeof r||"number"==typeof r?o.append(s,r):"object"==typeof r&&$i(r,s,o)}return o}async function Vi(e,t,o){const n=$i(t,"",new FormData),r=await fetch(e,{method:"POST",body:n,...o});return await r.json()}(Object.getOwnPropertyDescriptor(Ui,"name")||{}).writable||Object.defineProperty(Ui,"name",{value:"default",configurable:!0});const Gi=(e,t)=>{"wcSettings"in window&&wcSettings.wcBlocksConfig&&"product"!==e?wp.data.dispatch("core/notices")?.createNotice("error",t,{context:`wc/${e}`}):fetch(Ln("ajaxUrl"),{method:"POST",body:new URLSearchParams({action:"woopay_express_checkout_button_show_error_notice",_ajax_nonce:Ln("woopayButtonNonce"),context:e,message:t})}).then(e=>e.json()).then(e=>{if(e.success){const t=document.querySelector(".woocommerce-notices-wrapper"),o=document.createElement("div");o.innerHTML=e.data.notice,t.insertBefore(o,null),t.scrollIntoView({behavior:"smooth",block:"center"})}})},Yi=e=>{const t=window.wcpayConfig.pay_for_order,o=window.wcpayConfig.order_id,n=window.wcpayConfig.key,r=window.wcpayConfig.billing_email;if(!t||!o||!n)return e;const s=new URL(e);return s.searchParams.append("pay_for_order",t),s.searchParams.append("order_id",o),s.searchParams.append("key",n),s.searchParams.append("billing_email",r),s.href},Zi=()=>{(()=>{const e=document.cookie.split(";").find(e=>e.includes("skip_woopay"));if(!e)return!1;const t=e?.split("=");return"skip_woopay"===t[0].trim()&&"1"===t[1].trim()})()&&(document.cookie="skip_woopay=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC;")},Ji=()=>!!Ln("isShortcodeCheckout");function Ki(e){return Ki="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},Ki(e)}var Qi=/^\s+/,Xi=/\s+$/;function ec(e,t){if(t=t||{},(e=e||"")instanceof ec)return e;if(!(this instanceof ec))return new ec(e,t);var o=function(e){var t={r:0,g:0,b:0},o=1,n=null,r=null,s=null,a=!1,i=!1;return"string"==typeof e&&(e=function(e){e=e.replace(Qi,"").replace(Xi,"").toLowerCase();var t,o=!1;if(fc[e])e=fc[e],o=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=Mc.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=Mc.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=Mc.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=Mc.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=Mc.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=Mc.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=Mc.hex8.exec(e))?{r:Sc(t[1]),g:Sc(t[2]),b:Sc(t[3]),a:Ec(t[4]),format:o?"name":"hex8"}:(t=Mc.hex6.exec(e))?{r:Sc(t[1]),g:Sc(t[2]),b:Sc(t[3]),format:o?"name":"hex"}:(t=Mc.hex4.exec(e))?{r:Sc(t[1]+""+t[1]),g:Sc(t[2]+""+t[2]),b:Sc(t[3]+""+t[3]),a:Ec(t[4]+""+t[4]),format:o?"name":"hex8"}:!!(t=Mc.hex3.exec(e))&&{r:Sc(t[1]+""+t[1]),g:Sc(t[2]+""+t[2]),b:Sc(t[3]+""+t[3]),format:o?"name":"hex"}}(e)),"object"==Ki(e)&&(Lc(e.r)&&Lc(e.g)&&Lc(e.b)?(t=function(e,t,o){return{r:255*xc(e,255),g:255*xc(t,255),b:255*xc(o,255)}}(e.r,e.g,e.b),a=!0,i="%"===String(e.r).substr(-1)?"prgb":"rgb"):Lc(e.h)&&Lc(e.s)&&Lc(e.v)?(n=jc(e.s),r=jc(e.v),t=function(e,t,o){e=6*xc(e,360),t=xc(t,100),o=xc(o,100);var n=Math.floor(e),r=e-n,s=o*(1-t),a=o*(1-r*t),i=o*(1-(1-r)*t),c=n%6;return{r:255*[o,a,s,s,i,o][c],g:255*[i,o,o,a,s,s][c],b:255*[s,s,i,o,o,a][c]}}(e.h,n,r),a=!0,i="hsv"):Lc(e.h)&&Lc(e.s)&&Lc(e.l)&&(n=jc(e.s),s=jc(e.l),t=function(e,t,o){var n,r,s;function a(e,t,o){return o<0&&(o+=1),o>1&&(o-=1),o<1/6?e+6*(t-e)*o:o<.5?t:o<2/3?e+(t-e)*(2/3-o)*6:e}if(e=xc(e,360),t=xc(t,100),o=xc(o,100),0===t)n=r=s=o;else{var i=o<.5?o*(1+t):o+t-o*t,c=2*o-i;n=a(c,i,e+1/3),r=a(c,i,e),s=a(c,i,e-1/3)}return{r:255*n,g:255*r,b:255*s}}(e.h,n,s),a=!0,i="hsl"),e.hasOwnProperty("a")&&(o=e.a)),o=bc(o),{ok:a,format:e.format||i,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:o}}(e);this._originalInput=e,this._r=o.r,this._g=o.g,this._b=o.b,this._a=o.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||o.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=o.ok}function tc(e,t,o){e=xc(e,255),t=xc(t,255),o=xc(o,255);var n,r,s=Math.max(e,t,o),a=Math.min(e,t,o),i=(s+a)/2;if(s==a)n=r=0;else{var c=s-a;switch(r=i>.5?c/(2-s-a):c/(s+a),s){case e:n=(t-o)/c+(t<o?6:0);break;case t:n=(o-e)/c+2;break;case o:n=(e-t)/c+4}n/=6}return{h:n,s:r,l:i}}function oc(e,t,o){e=xc(e,255),t=xc(t,255),o=xc(o,255);var n,r,s=Math.max(e,t,o),a=Math.min(e,t,o),i=s,c=s-a;if(r=0===s?0:c/s,s==a)n=0;else{switch(s){case e:n=(t-o)/c+(t<o?6:0);break;case t:n=(o-e)/c+2;break;case o:n=(e-t)/c+4}n/=6}return{h:n,s:r,v:i}}function nc(e,t,o,n){var r=[kc(Math.round(e).toString(16)),kc(Math.round(t).toString(16)),kc(Math.round(o).toString(16))];return n&&r[0].charAt(0)==r[0].charAt(1)&&r[1].charAt(0)==r[1].charAt(1)&&r[2].charAt(0)==r[2].charAt(1)?r[0].charAt(0)+r[1].charAt(0)+r[2].charAt(0):r.join("")}function rc(e,t,o,n){return[kc(Cc(n)),kc(Math.round(e).toString(16)),kc(Math.round(t).toString(16)),kc(Math.round(o).toString(16))].join("")}function sc(e,t){t=0===t?0:t||10;var o=ec(e).toHsl();return o.s-=t/100,o.s=vc(o.s),ec(o)}function ac(e,t){t=0===t?0:t||10;var o=ec(e).toHsl();return o.s+=t/100,o.s=vc(o.s),ec(o)}function ic(e){return ec(e).desaturate(100)}function cc(e,t){t=0===t?0:t||10;var o=ec(e).toHsl();return o.l+=t/100,o.l=vc(o.l),ec(o)}function lc(e,t){t=0===t?0:t||10;var o=ec(e).toRgb();return o.r=Math.max(0,Math.min(255,o.r-Math.round(-t/100*255))),o.g=Math.max(0,Math.min(255,o.g-Math.round(-t/100*255))),o.b=Math.max(0,Math.min(255,o.b-Math.round(-t/100*255))),ec(o)}function dc(e,t){t=0===t?0:t||10;var o=ec(e).toHsl();return o.l-=t/100,o.l=vc(o.l),ec(o)}function uc(e,t){var o=ec(e).toHsl(),n=(o.h+t)%360;return o.h=n<0?360+n:n,ec(o)}function mc(e){var t=ec(e).toHsl();return t.h=(t.h+180)%360,ec(t)}function pc(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var o=ec(e).toHsl(),n=[ec(e)],r=360/t,s=1;s<t;s++)n.push(ec({h:(o.h+s*r)%360,s:o.s,l:o.l}));return n}function hc(e){var t=ec(e).toHsl(),o=t.h;return[ec(e),ec({h:(o+72)%360,s:t.s,l:t.l}),ec({h:(o+216)%360,s:t.s,l:t.l})]}function yc(e,t,o){t=t||6,o=o||30;var n=ec(e).toHsl(),r=360/o,s=[ec(e)];for(n.h=(n.h-(r*t>>1)+720)%360;--t;)n.h=(n.h+r)%360,s.push(ec(n));return s}function _c(e,t){t=t||6;for(var o=ec(e).toHsv(),n=o.h,r=o.s,s=o.v,a=[],i=1/t;t--;)a.push(ec({h:n,s:r,v:s})),s=(s+i)%1;return a}ec.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,o,n=this.toRgb();return e=n.r/255,t=n.g/255,o=n.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4))},setAlpha:function(e){return this._a=bc(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=oc(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=oc(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+o+"%, "+n+"%)":"hsva("+t+", "+o+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=tc(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=tc(this._r,this._g,this._b),t=Math.round(360*e.h),o=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+o+"%, "+n+"%)":"hsla("+t+", "+o+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return nc(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,o,n,r){var s=[kc(Math.round(e).toString(16)),kc(Math.round(t).toString(16)),kc(Math.round(o).toString(16)),kc(Cc(n))];return r&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*xc(this._r,255))+"%",g:Math.round(100*xc(this._g,255))+"%",b:Math.round(100*xc(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*xc(this._r,255))+"%, "+Math.round(100*xc(this._g,255))+"%, "+Math.round(100*xc(this._b,255))+"%)":"rgba("+Math.round(100*xc(this._r,255))+"%, "+Math.round(100*xc(this._g,255))+"%, "+Math.round(100*xc(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(gc[nc(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+rc(this._r,this._g,this._b,this._a),o=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var r=ec(e);o="#"+rc(r._r,r._g,r._b,r._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+o+")"},toString:function(e){var t=!!e;e=e||this._format;var o=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(o=this.toRgbString()),"prgb"===e&&(o=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(o=this.toHexString()),"hex3"===e&&(o=this.toHexString(!0)),"hex4"===e&&(o=this.toHex8String(!0)),"hex8"===e&&(o=this.toHex8String()),"name"===e&&(o=this.toName()),"hsl"===e&&(o=this.toHslString()),"hsv"===e&&(o=this.toHsvString()),o||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return ec(this.toString())},_applyModification:function(e,t){var o=e.apply(null,[this].concat([].slice.call(t)));return this._r=o._r,this._g=o._g,this._b=o._b,this.setAlpha(o._a),this},lighten:function(){return this._applyModification(cc,arguments)},brighten:function(){return this._applyModification(lc,arguments)},darken:function(){return this._applyModification(dc,arguments)},desaturate:function(){return this._applyModification(sc,arguments)},saturate:function(){return this._applyModification(ac,arguments)},greyscale:function(){return this._applyModification(ic,arguments)},spin:function(){return this._applyModification(uc,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(yc,arguments)},complement:function(){return this._applyCombination(mc,arguments)},monochromatic:function(){return this._applyCombination(_c,arguments)},splitcomplement:function(){return this._applyCombination(hc,arguments)},triad:function(){return this._applyCombination(pc,[3])},tetrad:function(){return this._applyCombination(pc,[4])}},ec.fromRatio=function(e,t){if("object"==Ki(e)){var o={};for(var n in e)e.hasOwnProperty(n)&&(o[n]="a"===n?e[n]:jc(e[n]));e=o}return ec(e,t)},ec.equals=function(e,t){return!(!e||!t)&&ec(e).toRgbString()==ec(t).toRgbString()},ec.random=function(){return ec.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},ec.mix=function(e,t,o){o=0===o?0:o||50;var n=ec(e).toRgb(),r=ec(t).toRgb(),s=o/100;return ec({r:(r.r-n.r)*s+n.r,g:(r.g-n.g)*s+n.g,b:(r.b-n.b)*s+n.b,a:(r.a-n.a)*s+n.a})},ec.readability=function(e,t){var o=ec(e),n=ec(t);return(Math.max(o.getLuminance(),n.getLuminance())+.05)/(Math.min(o.getLuminance(),n.getLuminance())+.05)},ec.isReadable=function(e,t,o){var n,r,s,a,i,c=ec.readability(e,t);switch(r=!1,(s=o,"AA"!==(a=((s=s||{level:"AA",size:"small"}).level||"AA").toUpperCase())&&"AAA"!==a&&(a="AA"),"small"!==(i=(s.size||"small").toLowerCase())&&"large"!==i&&(i="small"),n={level:a,size:i}).level+n.size){case"AAsmall":case"AAAlarge":r=c>=4.5;break;case"AAlarge":r=c>=3;break;case"AAAsmall":r=c>=7}return r},ec.mostReadable=function(e,t,o){var n,r,s,a,i=null,c=0;r=(o=o||{}).includeFallbackColors,s=o.level,a=o.size;for(var l=0;l<t.length;l++)(n=ec.readability(e,t[l]))>c&&(c=n,i=ec(t[l]));return ec.isReadable(e,i,{level:s,size:a})||!r?i:(o.includeFallbackColors=!1,ec.mostReadable(e,["#fff","#000"],o))};var fc=ec.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},gc=ec.hexNames=function(e){var t={};for(var o in e)e.hasOwnProperty(o)&&(t[e[o]]=o);return t}(fc);function bc(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function xc(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var o=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),o&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function vc(e){return Math.min(1,Math.max(0,e))}function Sc(e){return parseInt(e,16)}function kc(e){return 1==e.length?"0"+e:""+e}function jc(e){return e<=1&&(e=100*e+"%"),e}function Cc(e){return Math.round(255*parseFloat(e)).toString(16)}function Ec(e){return Sc(e)/255}var Pc,Nc,Tc,Mc=(Nc="[\\s|\\(]+("+(Pc="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+Pc+")[,|\\s]+("+Pc+")\\s*\\)?",Tc="[\\s|\\(]+("+Pc+")[,|\\s]+("+Pc+")[,|\\s]+("+Pc+")[,|\\s]+("+Pc+")\\s*\\)?",{CSS_UNIT:new RegExp(Pc),rgb:new RegExp("rgb"+Nc),rgba:new RegExp("rgba"+Tc),hsl:new RegExp("hsl"+Nc),hsla:new RegExp("hsla"+Tc),hsv:new RegExp("hsv"+Nc),hsva:new RegExp("hsva"+Tc),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function Lc(e){return!!Mc.CSS_UNIT.exec(e)}const Ac=["color","padding","paddingTop","paddingRight","paddingBottom","paddingLeft"],Dc=["fontFamily","fontSize","lineHeight","letterSpacing","fontWeight","fontVariation","textDecoration","textShadow","textTransform","-webkit-font-smoothing","-moz-osx-font-smoothing","transition"],Oc=["backgroundColor","border","borderTop","borderRight","borderBottom","borderLeft","borderRadius","borderWidth","borderColor","borderStyle","borderTopWidth","borderTopColor","borderTopStyle","borderRightWidth","borderRightColor","borderRightStyle","borderBottomWidth","borderBottomColor","borderBottomStyle","borderLeftWidth","borderLeftColor","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","outline","outlineOffset","boxShadow"],Ic={".Label":[...Ac,...Dc],".Text":[...Ac,...Dc],".Input":[...Ac,...Dc,...Oc],".Error":[...Ac,...Dc,...Oc],".Tab":[...Ac,...Dc,...Oc],".TabIcon":[...Ac],".TabLabel":[...Ac,...Dc],".Block":[...Ac.slice(1),...Oc.slice(1)],".Container":[...Oc],".Header":[...Ac,...Oc,...Dc],".Footer":[...Ac,...Oc,...Dc]},Rc={".Label":Ic[".Label"],".Label--floating":[...Ic[".Label"],"transform"],".Input":[...Ic[".Input"],"outlineColor","outlineWidth","outlineStyle"],".Error":Ic[".Error"],".Tab":["backgroundColor","color","fontFamily"],".Tab--selected":["outlineColor","outlineWidth","outlineStyle","backgroundColor","color",...Oc],".TabIcon":Ic[".TabIcon"],".TabIcon--selected":["color"],".TabLabel":Ic[".TabLabel"],".Block":Ic[".Block"],".Container":Ic[".Container"],".Header":Ic[".Header"],".Footer":Ic[".Footer"],".Footer--link":Ic[".Text"],".Text":Ic[".Text"],".Text--redirect":Ic[".Text"]},Fc=(e,t=document)=>{let o=null,n=0;for(;!o&&n<e.length;){let r;try{r=t.querySelector(e[n])}catch(e){n++;continue}if(!r){n++;continue}const s=(t.defaultView||window).getComputedStyle(r).backgroundColor;s&&ec(s).getAlpha()>=.5&&(o=s),n++}return o||"#ffffff"},Bc=e=>{const t=ec(e),o=t.getAlpha();if(o<1){const e=t.toRgb();return ec({r:Math.round(e.r*o+255*(1-o)),g:Math.round(e.g*o+255*(1-o)),b:Math.round(e.b*o+255*(1-o))}).getBrightness()>125}return t.getBrightness()>125},zc={default:{hiddenContainer:"#wcpay-hidden-div",hiddenInput:"#wcpay-hidden-input",hiddenInvalidInput:"#wcpay-hidden-invalid-input",hiddenValidActiveLabel:"#wcpay-hidden-valid-active-label"},classicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:["#payment .payment_methods li .payment_box fieldset",".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},backgroundSelectors:["li.wc_payment_method .wc-payment-form","li.wc_payment_method .payment_box","#payment","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"]},blocksCheckout:{appendTarget:".wc-block-checkout__contact-fields",upeThemeInputSelector:".wc-block-components-text-input #email",upeThemeLabelSelector:".wc-block-components-text-input label",upeThemeTextSelectors:[".wc-block-components-checkout-step__description",".wc-block-components-text-input",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],rowElement:"div",validClasses:["wc-block-components-text-input","is-active"],invalidClasses:["wc-block-components-text-input","has-error"],alternateSelectors:{appendTarget:"#billing.wc-block-components-address-form",upeThemeInputSelector:"#billing-first_name",upeThemeLabelSelector:".wc-block-components-checkout-step__description"},backgroundSelectors:["#payment-method .wc-block-components-radio-control-accordion-option","#payment-method","form.wc-block-checkout__form",".wc-block-checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-components-checkout-place-order-button"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"]},bnplProductPage:{appendTarget:".product .cart .quantity",upeThemeInputSelector:".product .cart .quantity .qty",upeThemeLabelSelector:".product .cart .quantity label",upeThemeTextSelectors:[".product .cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main > .product > div.summary.entry-summary","#main > .product","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".single_add_to_cart_button"]},bnplClassicCart:{appendTarget:".cart .quantity",upeThemeInputSelector:".cart .quantity .qty",upeThemeLabelSelector:".cart .quantity label",upeThemeTextSelectors:[".cart .quantity"],rowElement:"div",validClasses:["input-text"],invalidClasses:["input-text","has-error"],backgroundSelectors:["#payment-method-message","#main .entry-content .cart_totals","#main .entry-content","#main","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".checkout-button"],containerSelectors:[".shop_table"]},bnplCartBlock:{appendTarget:".wc-block-cart .wc-block-components-quantity-selector",upeThemeInputSelector:".wc-block-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input",upeThemeLabelSelector:".wc-block-components-text-input",upeThemeTextSelectors:[".wc-block-components-text-input"],rowElement:"div",validClasses:["wc-block-components-text-input"],invalidClasses:["wc-block-components-text-input","has-error"],backgroundSelectors:[".wc-block-components-bnpl-wrapper",".wc-block-components-order-meta",".wc-block-components-totals-wrapper",".wp-block-woocommerce-cart-order-summary-block",".wp-block-woocommerce-cart-totals-block",".wp-block-woocommerce-cart .wc-block-cart",".wp-block-woocommerce-cart","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-cart__submit-button"],containerSelectors:[".wp-block-woocommerce-cart-line-items-block"]},wooPayClassicCheckout:{appendTarget:".woocommerce-billing-fields__field-wrapper",upeThemeInputSelector:"#billing_first_name",upeThemeLabelSelector:".woocommerce-checkout .form-row label",upeThemeTextSelectors:[".woocommerce-checkout .form-row"],rowElement:"p",validClasses:["form-row"],invalidClasses:["form-row","woocommerce-invalid","woocommerce-invalid-required-field"],alternateSelectors:{appendTarget:"form.checkout",upeThemeInputSelector:'form.checkout input[type="text"]',upeThemeLabelSelector:"form.checkout label",upeThemeTextSelectors:["form.checkout",".woocommerce"]},backgroundSelectors:["#customer_details","#order_review","form.checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:["#place_order"],linkSelectors:["form.checkout a",".woocommerce a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".woocommerce-checkout-review-order-table"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},wooPayBlocksCheckout:{appendTarget:".wc-block-checkout__contact-fields",upeThemeInputSelector:".wc-block-components-text-input #email",upeThemeLabelSelector:".wc-block-components-text-input label",upeThemeTextSelectors:[".wc-block-components-checkout-step__description",".wc-block-components-text-input",".wc-block-components-radio-control__label",".wc-block-checkout__terms"],rowElement:"div",validClasses:["wc-block-components-text-input","is-active"],invalidClasses:["wc-block-components-text-input","has-error"],alternateSelectors:{appendTarget:"#billing.wc-block-components-address-form",upeThemeInputSelector:"#billing-first_name",upeThemeLabelSelector:".wc-block-components-checkout-step__description"},backgroundSelectors:["#payment-method .wc-block-components-radio-control-accordion-option","#payment-method","form.wc-block-checkout__form",".wc-block-checkout","body"],headingSelectors:["h1","h2","h3","h4","h5","h6"],buttonSelectors:[".wc-block-components-checkout-place-order-button"],linkSelectors:[".wc-block-checkout a",".wc-block-components-main a","main a",".entry-content a",".site-content a","#content a","#primary a","a"],containerSelectors:[".wp-block-woocommerce-checkout-order-summary-block"],headerSelectors:["header > div:has(nav)","header > div:has(.site-logo)","header > div:has(.custom-logo)",".site-header","#masthead","header > div:last-of-type","header"],footerSelectors:[".site-footer","#colophon","footer > div","footer"],footerLink:[".site-footer a","footer a"]},updateSelectors:function(e,t){return e.hasOwnProperty("alternateSelectors")&&(Object.entries(e.alternateSelectors).forEach(o=>{const[n,r]=o,s=e[n];if(Array.isArray(s))s.some(e=>{try{return t.querySelector(e)}catch(e){return!1}})||(e[n]=r);else try{t.querySelector(e[n])||(e[n]=r)}catch(t){e[n]=r}}),delete e.alternateSelectors),e},getSelectors:function(e,t){let o=this.blocksCheckout;switch(e){case"blocks_checkout":o=this.blocksCheckout;break;case"shortcode_checkout":o=this.classicCheckout;break;case"bnpl_product_page":o=this.bnplProductPage;break;case"bnpl_classic_cart":o=this.bnplClassicCart;break;case"bnpl_cart_block":o=this.bnplCartBlock;break;case"woopay_shortcode_checkout":o=this.wooPayClassicCheckout;break;case"woopay_blocks_checkout":o=this.wooPayBlocksCheckout}return{...this.default,...this.updateSelectors(o,t)}}},Wc={getHiddenContainer:function(e,t){const o=t.createElement("div");return o.setAttribute("id",this.getIDFromSelector(e)),o.style.border=0,o.style.clip="rect(0 0 0 0)",o.style.height="1px",o.style.margin="-1px",o.style.overflow="hidden",o.style.padding="0",o.style.position="absolute",o.style.width="1px",o},createRow:function(e,t=[],o){const n=o.createElement(e);return t.length&&n.classList.add(...t),n},appendClone:function(e,t,o,n){const r=n.querySelector(t);if(r){const t=r.cloneNode(!0);t.id=this.getIDFromSelector(o),t.value="",e.appendChild(t)}},getIDFromSelector:function(e){return e.startsWith("#")||e.startsWith(".")?e.slice(1):e},init:function(e,t){const o=zc.getSelectors(e,t),n=t.querySelector(o.appendTarget),r=t.querySelector(o.upeThemeInputSelector);if(!n||!r)return;t.querySelector(o.hiddenContainer)&&this.cleanup(t);const s=this.getHiddenContainer(o.hiddenContainer,t);n.appendChild(s);const a=this.createRow(o.rowElement,o.validClasses,t);s.appendChild(a);const i=this.createRow(o.rowElement,o.invalidClasses,t);s.appendChild(i),this.appendClone(a,o.upeThemeInputSelector,o.hiddenInput,t),this.appendClone(a,o.upeThemeLabelSelector,o.hiddenValidActiveLabel,t),this.appendClone(i,o.upeThemeInputSelector,o.hiddenInvalidInput,t),this.appendClone(i,o.upeThemeLabelSelector,o.hiddenInvalidInput,t),t.querySelector(o.hiddenInput).style.transition="none"},cleanup:function(e){const t=e.querySelector(zc.default.hiddenContainer);t&&t.remove()}},Hc=(e,t,o=null,n)=>{const r=(Array.isArray(e)?e:[e]).map(e=>{try{return n.querySelector(e)}catch(e){return null}}).filter(Boolean);if(!r.length)return{};const s=n.defaultView||window,a=Rc[t],i=r[0],c=s.getComputedStyle(i),l={};if(a.forEach(e=>{const t=e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),o=c.getPropertyValue(t);if(o)if("color"!==e)if("lineHeight"!==e||"0"!==o&&"0px"!==o)l[e]=o;else for(let t=1;t<r.length;t++){const o=s.getComputedStyle(r[t]).getPropertyValue("line-height");if("0"!==o&&"0px"!==o){l[e]=o;break}}else l[e]=(e=>{const t=e.match(/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(0?(\.\d+)?|1?(\.0+)?)\s*\)$/);if(t){const o=t[4]||1;e=`rgb(${t.slice(1,4).map(e=>Math.round(e*o+255*(1-o))).join(", ")})`}return e})(o)}),".Input"===t||".Tab--selected"===t){const e=((e,t="solid",o)=>e&&o?[e,t,o].join(" "):"")(l.outlineWidth,l.outlineStyle,l.outlineColor);""!==e&&(l.outline=e),delete l.outlineWidth,delete l.outlineColor,delete l.outlineStyle}const d=c.getPropertyValue("text-indent");return"0px"!==d&&"0px"===l.paddingLeft&&"0px"===l.paddingRight&&(l.paddingLeft=d,l.paddingRight=d),".Block"===t&&(l.backgroundColor=o),l},qc=(e=document)=>{const t=[],o=e.styleSheets,n=["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","fonts.bunny.net","fonts.wp.com"];for(let e=0;e<o.length;e++){if(!o[e].href)continue;const r=new URL(o[e].href);-1!==n.indexOf(r.hostname)&&t.push({cssSrc:o[e].href})}return t},Uc={blocks_checkout:"woopay_blocks_checkout",shortcode_checkout:"woopay_shortcode_checkout"},$c=(e,t=!1,o=document)=>{const n=t?Uc[e]??e:e,r=zc.getSelectors(n,o);Wc.init(n,o);const s=Hc(r.hiddenInput,".Input",null,o),a=Hc(r.hiddenInvalidInput,".Input",null,o),i=Hc(r.upeThemeLabelSelector,".Label",null,o),c={fontSize:i.fontSize},l=Hc(r.upeThemeTextSelectors,".Text",null,o),d=Hc(r.upeThemeInputSelector,".Tab",null,o),u=Hc(r.hiddenInput,".Tab--selected",null,o),m=(e=>{const t=Object.assign({},e);if(!e.backgroundColor||!e.color)return e;const o=((e,t)=>{const o={backgroundColor:e,color:t},n=ec(e),r=ec(t);if(!n.isValid()||!r.isValid())return{backgroundColor:"",color:""};const s=n.getBrightness()>50?ec(n).darken(7):ec(n).lighten(7),a=ec.mostReadable(s,[r],{includeFallbackColors:!0});return o.backgroundColor=s.toRgbString(),o.color=a.toRgbString(),o})(e.backgroundColor,e.color);return t.backgroundColor=o.backgroundColor,t.color=o.color,t})(d),p={color:m.color},h={color:u.color},y=Fc(r.backgroundSelectors,o),_=Hc(r.upeThemeLabelSelector,".Block",y,o),f={colorBackground:y,colorText:l.color,fontFamily:l.fontFamily,fontSizeBase:l.fontSize},g=("blocks_checkout"===e||"woopay_blocks_checkout"===n)&&((e,t=document)=>{let o;try{o=t.querySelector(e)}catch(e){return!0}if(!o)return!0;const n=(t.defaultView||window).getComputedStyle(o).getPropertyValue("position");return!n||"absolute"===n||"fixed"===n})(r.hiddenValidActiveLabel,o);let b={variables:f,theme:Bc(y)?"stripe":"night",labels:g?"floating":"above",rules:JSON.parse(JSON.stringify({".Input":s,".Input--invalid":a,".Label":i,".Label--resting":c,".Block":_,".Tab":d,".Tab:hover":m,".Tab--selected":u,".TabIcon:hover":p,".TabIcon--selected":h,".Text":l,".Text--redirect":l}))};if(g&&(b=((e,t)=>{if(e.rules[".Label--floating"]=t,e.rules[".Label--floating"].transform&&"none"!==e.rules[".Label--floating"].transform){const t=e.rules[".Label--floating"].transform.match(/matrix\((.+)\)/);if(t&&t[1]){const o=t[1].split(", "),n=(parseFloat(o[0])+parseFloat(o[3]))/2,r=parseFloat(e.rules[".Label--floating"].lineHeight),s=Math.floor(r*n);e.rules[".Label--floating"].lineHeight=`${s}px`,e.rules[".Label--floating"].fontSize=`${s}px`}delete e.rules[".Label--floating"].transform}if(e.rules[".Input"].paddingTop&&(e.rules[".Input"].paddingTop=`calc(${e.rules[".Input"].paddingTop} - ${e.rules[".Label--floating"].lineHeight} - 4px - 1px)`),e.rules[".Input"].paddingBottom){const t=parseFloat(e.rules[".Input"].paddingBottom);e.rules[".Input"].paddingBottom=t-1+"px";const o=e.rules[".Label"].marginTop??"0";e.rules[".Label"].marginTop=`${Math.floor((t-1)/3)}px`,e.rules[".Label--floating"].marginTop=o}return e})(b,Hc(r.hiddenValidActiveLabel,".Label--floating",null,o))),t){const e=Hc(r.headerSelectors,".Header",null,o),t=Hc(r.footerSelectors,".Footer",null,o);(!e.backgroundColor||ec(e.backgroundColor).getAlpha()<.5)&&(e.backgroundColor=Fc([...r.headerSelectors??[],"body"],o)),(!t.backgroundColor||ec(t.backgroundColor).getAlpha()<.5)&&(t.backgroundColor=Fc([...r.footerSelectors??[],"body"],o)),b.rules={...b.rules,".Heading":Hc(r.headingSelectors,".Label",null,o),".Header":e,".Footer":t,".Footer-link":Hc(r.footerLink,".Footer--link",null,o),".Button":Hc(r.buttonSelectors,".Input",null,o),".Link":Hc(r.linkSelectors,".Label",null,o),".Container":Hc(r.containerSelectors,".Container",null,o)}}return Wc.cleanup(o),b},Vc=()=>document.querySelector(".wp-block-woocommerce-checkout")?"blocks_checkout":document.querySelector(".woocommerce-billing-fields")?"woopay_shortcode_checkout":document.querySelector(".wp-block-woocommerce-cart")?"bnpl_cart_block":document.querySelector(".woocommerce-cart-form")?"bnpl_classic_cart":document.querySelector(".single-product")?"bnpl_product_page":void 0,Gc=(e,t,o="appearance")=>{Object.entries(t).forEach(([t,n])=>{const r=`${o}[${t}]`;null!=n&&(n&&"object"==typeof n&&!Array.isArray(n)?Gc(e,n,r):e.append(r,n))})};let Yc=!1;function Zc(){const e=Vc();if(!(e=>["woopay_shortcode_checkout","woopay_blocks_checkout","blocks_checkout","bnpl_product_page","bnpl_classic_cart","bnpl_cart_block"].includes(e))(e)||!Ln("isWooPayGlobalThemeSupportEnabled"))return null;const t=Ln("woopayAppearance");if(t)return t;if(Ji()){const t=$c(e,!0);return(e=>{if(Yc||!e)return;Yc=!0;const t=Ln("wcAjaxUrl");if(!t)return;const o=M(t,"shopper_set_woopay_appearance"),n=qc(),r=new FormData;r.append("_ajax_nonce",Ln("woopaySessionNonce")),Gc(r,e),r.append("font_rules",JSON.stringify(n)),fetch(o,{method:"POST",body:r,credentials:"same-origin"}).catch(()=>{})})(t),t}return null}let Jc=!1;const Kc=async(e,t,o)=>{const n=await In();let r="";const s=document.body,a=document.createElement("div");a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.classList.add("woopay-otp-iframe-wrapper");const i=document.createElement("iframe");i.title=(0,w.__)("WooPay SMS code verification","woocommerce-payments"),i.classList.add("woopay-otp-iframe"),i.classList.add("intrinsic-ignore");const c=768;let l=!0;const d=()=>{(c<=window.innerWidth&&l||c>window.innerWidth&&!l)&&(l=!l,i.contentWindow.postMessage({action:"setHeader",value:l},Ln("woopayHost"))),document.body.style.overflow="hidden"},u=()=>{if(!i)return;if(c>window.innerWidth)return i.style.left="0",i.style.right="",void(i.style.top="0");const e=i.getBoundingClientRect();i.style.top=Math.floor(window.innerHeight/2-e.height/2)+"px",i.style.left=Math.floor(window.innerWidth/2-e.width/2)+"px"};i.addEventListener("load",()=>{l=!0;const e=Zc();Ln("isWoopayFirstPartyAuthEnabled")&&Vi(M(Ln("wcAjaxUrl"),"get_woopay_session"),{_ajax_nonce:Ln("woopaySessionNonce"),order_id:Ln("order_id"),key:Ln("key"),billing_email:Ln("billing_email"),appearance:e}).then(e=>{e?.data?.session&&i.contentWindow.postMessage({action:"setSessionData",value:e},Ln("woopayHost"))}),d(),window.addEventListener("resize",d),u(),window.addEventListener("resize",u),i.classList.add("open")}),a.insertBefore(i,null);const m=()=>{window.removeEventListener("resize",d),window.removeEventListener("resize",u),window.removeEventListener("pageshow",h),window.removeEventListener("message",p),document.removeEventListener("keyup",y),a.remove(),i.classList.remove("open"),document.body.style.overflow=""};function p(o){if(o.origin===new URL(Ln("woopayHost")).origin)switch(o.data.action){case"otp_email_submitted":r=o.data.userEmail;break;case"redirect_to_woopay_skip_session_init":o.data.redirectUrl&&(window.location=Yi(o.data.redirectUrl));break;case"redirect_to_platform_checkout":case"redirect_to_woopay":const n=((e,t,o)=>{if(Jc)return;Jc=!0;const n=Ln("wcAjaxUrl"),r=Ln("initWooPayNonce");let s=null,a=null;if(Ln("isWooPayGlobalThemeSupportEnabled"))if(Ji()){const e=Vc();s=$c(e,!0),a=qc()}else s=Ln("woopayAppearance"),a=Ln("woopayFontRules");return e(M(n,"init_woopay"),{_wpnonce:r,appearance:s,font_rules:a,email:t,user_session:o,order_id:Ln("order_id"),key:Ln("key"),billing_email:Ln("billing_email")}).finally(()=>{Jc=!1})})(e.request,r||o.data.userEmail,o.data.platformCheckoutUserSession);if(!n)break;n.then(e=>{if(document.querySelector(".woopay-otp-iframe"))if("success"===e.result)window.location=Yi(e.url);else{const e=(0,w.__)("WooPay is unavailable at this time. Sorry for the inconvenience.","woocommerce-payments");Gi(t,e),m()}});break;case"otp_validation_failed":break;case"close_modal":m();break;case"iframe_height":o.data.height>300&&(c<=window.innerWidth?(i.style.height=o.data.height+"px",i.style.top=Math.floor(window.innerHeight/2-o.data.height/2)+"px"):(i.style.height="",i.style.top=""))}}function h(e){e.persisted&&m()}function y(e){"Escape"===e.key&&m()&&e.stopPropagation()}a.addEventListener("click",m),((e="")=>{if(document.querySelector(".woopay-otp-iframe"))return;window.addEventListener("pageshow",h),window.addEventListener("message",p),document.addEventListener("keyup",y);const o=window.document.documentElement.clientWidth,l=window.document.documentElement.clientHeight,d=new URLSearchParams;var m;d.append("testMode",Ln("testMode")),d.append("needsHeader",c>window.innerWidth),d.append("wcpayVersion",Ln("wcpayVersionNumber")),e&&(m=e,new RegExp(/^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[0-9a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]){2,}\.?$/i).test(m))&&(r=e,d.append("email",e)),d.append("is_blocks",!!window.wcSettings?.wcBlocksConfig),d.append("is_express","true"),d.append("express_context",t),d.append("source_url",window.location.href),d.append("viewport",`${o}x${l}`),n&&d.append("tracksUserIdentity",n),i.src=`${Ln("woopayHost")}/otp/?${d.toString()}`,s.insertBefore(a,null),u(),i.focus()})(await(async e=>{if("true"===window.wcpayConfig?.pay_for_order)return window.wcpayCustomerData?.email;const t=await(o=e,o?new Promise(e=>{if(document.querySelector(o))return e(document.querySelector(o));const t=document.querySelector('[data-block-name="woocommerce/checkout"]');if(!t)return e(null);new MutationObserver((t,n)=>{document.querySelector(o)&&(e(document.querySelector(o)),n.disconnect())}).observe(t,{childList:!0,subtree:!0})}):null);var o;return t?.value})(o)||Ln("woopaySessionEmail"))},Qc=()=>{const e=document.querySelector(".quantity .qty");return e&&parseFloat(e.value)||1},Xc=()=>document.querySelector("form.cart")||document.querySelector("form.wp-block-add-to-cart-with-options"),el=e=>({addToCart:t=>e.expressCheckoutAddToCart(t),getProductData:()=>{const e=(()=>{const e=document.querySelector(".single_add_to_cart_button");if(e?.value)return e.value;const t=document.querySelector('form.cart input[name="product_id"]');if(t?.value)return t.value;const o=document.querySelector('.wp-block-add-to-cart-with-options input[name="add-to-cart"]');return o?.value})();if(!e)return!1;const t=document.querySelector(".bundle_form"),o=document.querySelector(".single_variation_wrap"),n=document.querySelector(".wp-block-add-to-cart-with-options")&&!t?(()=>{const e=document.querySelector('.wp-block-add-to-cart-with-options input[name="variation_id"]'),t=parseInt(e?.value,10);return t>0?t:null})():null;let r={product_id:e,quantity:Qc()};if(n)r.product_id=n;else if(o&&!t)r.product_id=parseInt(o.querySelector('input[name="product_id"]').value,10),r.attributes=document.querySelector(".variations_form")?(()=>{const e=document.querySelector(".variations_form")?.querySelectorAll(".variations select"),t={};return e&&e.forEach(e=>{const o=e.name,n=e.value||"";t[o]=n}),t})():[];else{const e=Xc();if(e){const t=new FormData(e);t.delete("add-to-cart");const o={};for(const e of t.entries())o[e[0]]=e[1];r={...r,...o}}}const s=Xc();return!(s&&(new FormData(s).forEach((e,t)=>{if(/^(addon-|wc_)/.test(t))if(/\[\]$/.test(t)){const o=t.substring(0,t.length-2);r[o]?r[o].push(e):r[o]=[e]}else r[t]=e}),!(e=>{const t=["wc_gc_giftcard_to","wc_gc_giftcard_from","wc_gc_giftcard_to_multiple"];for(const o of t)if(e.hasOwnProperty(o)&&!e[o])return alert((0,w.__)("Please fill out all required fields","woocommerce-payments")),!1;return e.hasOwnProperty("wc_gc_giftcard_to_multiple")&&!e.wc_gc_giftcard_to_multiple.split(",").every(e=>ir(e.trim()))?(alert((0,w.__)("Please type only valid emails","woocommerce-payments")),!1):!(e.hasOwnProperty("wc_gc_giftcard_to")&&!ir(e.wc_gc_giftcard_to)&&(alert((0,w.__)("Please type only valid emails","woocommerce-payments")),1))})(r)))&&r}});function tl(e){window.WooPayConnect||(window.WooPayConnect={}),window.WooPayConnect.iframeInjectedState=e}function ol(){return window?.WooPayConnect?.postMessageTimeout||5e3}const nl=()=>{const e=(0,d.useRef)(),[t,o]=(0,d.useState)("");return(0,d.useEffect)(()=>{(async()=>{const e=Ln("testMode"),t=Ln("woopayHost"),n=Ln("woopayMerchantId"),r=new URLSearchParams({testMode:e,source_url:window.location.href,blogId:n}),s=await In();s&&r.append("tracksUserIdentity",s),o(`${t}/connect/?${r.toString()}`)})()},[]),(0,d.useEffect)(()=>{if(!t||!e.current)return;const o=e.current,n=()=>{tl(2),window.dispatchEvent(new MessageEvent("message",{source:window,origin:Ln("woopayHost"),data:{action:"get_iframe_post_message_success",value:e=>o.contentWindow.postMessage(e,Ln("woopayHost"))}}))};return o.addEventListener("load",n),()=>{o.removeEventListener("load",n)}},[t]),t?(0,oo.jsx)("iframe",{ref:e,id:"woopay-connect-iframe",src:t,style:{height:0,width:0,border:"none",margin:0,padding:0,overflow:"hidden",display:"block",visibility:"hidden",position:"fixed",pointerEvents:"none",userSelect:"none"},title:(0,w.__)("WooPay Connect Direct Checkout","woocommerce-payments")}):null},rl=class{iframePostMessage=null;listeners={};constructor(){this.listeners={getIframePostMessageCallback:()=>{},getPostMessageTimeoutCallback:()=>{}},this.removeMessageListener=this.attachMessageListener(),this.injectWooPayConnectIframe()}attachMessageListener(){const e=e=>{const t=new URL(Ln("woopayHost")).origin;e.origin===t&&this.callbackFn(e.data)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}detachMessageListener(){"function"==typeof this.removeMessageListener&&this.removeMessageListener()}injectWooPayConnectIframe(){const e=window?.WooPayConnect?.iframeInjectedState||0;if(2===e){const e=document.querySelector("#woopay-connect-iframe");return void(e&&(this.iframePostMessage=Promise.resolve(t=>{e.contentWindow.postMessage(t,Ln("woopayHost"))})))}if(1===e)return void(this.iframePostMessage=new Promise(e=>{this.listeners.getIframePostMessageCallback=e}));tl(1);const t=document.createElement("div");t.style.visibility="hidden",t.style.position="fixed",t.style.height="0",t.style.width="0",t.style.bottom="0",t.style.right="0",t.id="woopay-connect-iframe-container",document.body.appendChild(t);const o=this;this.iframePostMessage=new Promise(e=>{o.listeners.getIframePostMessageCallback=e}),(0,m.createRoot)(t).render((0,oo.jsx)(nl,{}))}injectTemporaryWooPayConnectIframe(){let e;const t=new Promise(t=>{e=t}),o=document.createElement("iframe");return o.id="temp-woopay-connect-iframe",o.src=Ln("woopayHost")+"/connect/",o.height=0,o.width=0,o.border="none",o.margin=0,o.padding=0,o.overflow="hidden",o.display="block",o.visibility="hidden",o.position="fixed",o.pointerEvents="none",o.userSelect="none",o.addEventListener("load",()=>{e(e=>o.contentWindow.postMessage(e,Ln("woopayHost")))}),document.body.appendChild(o),{resolvePostMessagePromise:t,removeTemporaryIframe:()=>{document.body.removeChild(o)}}}async sendMessageAndListenWith(e,t){const o=new Promise((e,o)=>{let n=!1;const r=setTimeout(()=>{n=!0,o(new Error("WooPayConnectIframe did not respond within the allotted time."))},ol());this.listeners[t]=t=>{n||(r&&clearTimeout(r),e(t))}});if("function"!=typeof this.iframePostMessage?.then)throw new Error("iframePostMessage is not set");return(await this.iframePostMessage)(e),await o}async getPostMessageTimeout(){try{return await this.sendMessageAndListenWith({action:"getPostMessageTimeout"},"getPostMessageTimeoutCallback")}catch(e){return null}}callbackFn(e){switch(e.action){case"get_iframe_post_message_success":this.listeners.getIframePostMessageCallback(e.value);break;case"get_post_message_timeout_success":this.listeners.getPostMessageTimeoutCallback(e.value)}}},sl=class extends rl{constructor(){super(),this.listeners={...this.listeners,setRedirectSessionDataCallback:()=>{},setTempThirdPartyCookieCallback:()=>{},getIsWooPayReachableCallback:()=>{},getIsThirdPartyCookiesEnabledCallback:()=>{},setPreemptiveSessionDataCallback:()=>{}}}async isWooPayThirdPartyCookiesEnabled(){const{resolvePostMessagePromise:e,removeTemporaryIframe:t}=this.injectTemporaryWooPayConnectIframe(),o=new Promise((e,t)=>{let o=!1;const n=setTimeout(()=>{o=!0,t(new Error("WooPayConnectIframe did not respond within the allotted time."))},ol());this.listeners.setTempThirdPartyCookieCallback=t=>{o||(n&&clearTimeout(n),e(t))}});if("function"!=typeof e?.then)return!1;const n=await e;n({action:"setTempThirdPartyCookie"});try{if(!await o)return t(),!1}catch(e){return t(),!1}const r=new Promise((e,t)=>{let o=!1;const n=setTimeout(()=>{o=!0,t(new Error("WooPayConnectIframe did not respond within the allotted time."))},ol());this.listeners.getIsThirdPartyCookiesEnabledCallback=t=>{o||(n&&clearTimeout(n),e(t))}});n({action:"getIsThirdPartyCookiesEnabled"});try{return await r}catch(e){return!1}finally{t()}}async sendRedirectSessionDataToWooPay(e){try{return await super.sendMessageAndListenWith({action:"setRedirectSessionData",value:e},"setRedirectSessionDataCallback")}catch(e){return null}}async setPreemptiveSessionData(e){try{return await super.sendMessageAndListenWith({action:"setPreemptiveSessionData",value:e},"setPreemptiveSessionDataCallback")}catch(e){return null}}async isWooPayReachable(){try{return await this.sendMessageAndListenWith({action:"isWooPayReachable"},"getIsWooPayReachableCallback")}catch(e){return!1}}callbackFn(e){switch(super.callbackFn(e),e.action){case"set_redirect_session_data_success":this.listeners.setRedirectSessionDataCallback(e.value);break;case"set_redirect_session_data_error":this.listeners.setRedirectSessionDataCallback({is_error:!0});break;case"set_temp_third_party_cookie_success":this.listeners.setTempThirdPartyCookieCallback(e.value);break;case"get_is_third_party_cookies_enabled_success":this.listeners.getIsThirdPartyCookiesEnabledCallback(e.value);break;case"get_is_woopay_reachable_success":this.listeners.getIsWooPayReachableCallback(e.value);break;case"set_preemptive_session_data_success":this.listeners.setPreemptiveSessionDataCallback(e.value);break;case"set_preemptive_session_data_error":this.listeners.setPreemptiveSessionDataCallback({is_error:!0})}}},al=class{static sessionConnect;static init(){this.getSessionConnect()}static getSessionConnect(){return this.sessionConnect||(this.sessionConnect=new sl),this.sessionConnect}static async sendPreemptiveSessionDataToWooPay(e){return this.getSessionConnect().setPreemptiveSessionData(e)}static async getWooPaySessionFromMerchant(e){return Vi(M(Ln("wcAjaxUrl"),"get_woopay_session"),e)}},il=[{name:"visa",component:r.p+"../assets/images/woopay-icons/visa.svg?ver=f5bbd888ace13f417388"},{name:"mastercard",component:r.p+"../assets/images/woopay-icons/mastercard.svg?ver=8ab106cb89511adbee3f"},{name:"amex",component:r.p+"../assets/images/woopay-icons/amex.svg?ver=b3759ac719253585e1f5"},{name:"discover",component:r.p+"../assets/images/woopay-icons/discover.svg?ver=ee7a3994c1ff74d84cd1"},{name:"jcb",component:r.p+"../assets/images/woopay-icons/jcb.svg?ver=6fe07259ab8049d5e4f6"},{name:"unionpay",component:r.p+"../assets/images/woopay-icons/unionpay.svg?ver=4ab40d7a676538ea7614"},{name:"diners",component:r.p+"../assets/images/woopay-icons/diners.svg?ver=5399061f43c9e99c93f3"}],cl="woopay_preferred_card",ll=/^\d{4}$/,dl={american_express:"amex",diners_club:"diners",union_pay:"unionpay"},ul=e=>{if(!e||"object"!=typeof e)return!1;const t=e;return"string"==typeof t.brand&&t.brand.length>0&&"string"==typeof t.last4&&ll.test(t.last4)},ml=()=>{try{const e=localStorage.getItem(cl);if(!e)return null;const t=JSON.parse(e);return ul(t)?t:null}catch{return null}},pl={visa:(0,w.__)("Visa","woocommerce-payments"),mastercard:(0,w.__)("Mastercard","woocommerce-payments"),amex:(0,w.__)("American Express","woocommerce-payments"),discover:(0,w.__)("Discover","woocommerce-payments"),jcb:(0,w.__)("JCB","woocommerce-payments"),unionpay:(0,w.__)("UnionPay","woocommerce-payments"),diners:(0,w.__)("Diners Club","woocommerce-payments"),cartes_bancaires:(0,w.__)("Cartes Bancaires","woocommerce-payments")},hl={default:(0,w.__)("WooPay","woocommerce-payments"),buy:(0,w.__)("Buy with WooPay","woocommerce-payments"),donate:(0,w.__)("Donate with WooPay","woocommerce-payments"),book:(0,w.__)("Book with WooPay","woocommerce-payments")},yl=({listenForCartChanges:e,isPreview:t=!1,buttonSettings:o,api:n,isProductPage:r=!1,emailSelector:s="#email",buttonAttributes:a,preferredCard:i=null})=>{const c=(0,d.useRef)(null),l=(0,d.useRef)(null),u=(0,d.useRef)(!1);let{height:m,type:p,theme:h,context:y,radius:_}=o;const[f,g]=(0,d.useState)(!1),[b,x]=(0,d.useState)(null),v=new Map;v.set("40","small"),v.set("48","medium"),v.set("55","large"),void 0!==a&&(m=a.height||m,_=a.borderRadius??_);const S=v.get(m?.toString())||"medium",k=hl[p||"default"]??hl.default,j="dark"===h?qi:Ui,C=Ln("isWoopayFirstPartyAuthEnabled"),E=Ln("woopayHost")+"/woopay/",{addToCart:P,getProductData:N}=el(n),T=(0,d.useRef)(N),M=(0,d.useRef)(P);(0,d.useEffect)(()=>{l.current&&x(l.current.getBoundingClientRect().width)},[]),(0,d.useEffect)(()=>{t||On("woopay_button_load",{source:y})},[t,y]);const L=(0,d.useCallback)(()=>{if(!r)return!0;const e=document.querySelector(".single_add_to_cart_button")||document.querySelector('.wp-block-add-to-cart-with-options button[type="submit"]');return!e||!e.disabled&&!e.classList.contains("disabled")||(e.classList.contains("wc-variation-is-unavailable")?window.alert(window?.wc_add_to_cart_variation_params?.i18n_unavailable_text||(0,w.__)("Sorry, this product is unavailable. Please choose a different combination.","woocommerce-payments")):window.alert((0,w.__)("Please select your product options before proceeding.","woocommerce-payments")),!1)},[r]),A=(0,d.useCallback)(e=>{if(e?.preventDefault(),!t&&(On("woopay_button_click",{source:y}),Zi(),L()))if(r){const e=T.current();if(!e)return;M.current(e).then(e=>{e.error?e.submit&&Xc()?.submit():Kc(n,y,s)})}else Kc(n,y,s)},[n,y,s,t,r,L]),D=(0,d.useCallback)(o=>{if(o.preventDefault(),t||u.current)return;if(On("woopay_button_click",{source:y}),Zi(),!L())return;u.current=!0,g(!0);const n=Zc();if(r){const t=T.current();if(!t)return;"function"==typeof e?.stop&&e.stop(),M.current(t).then(()=>{"function"==typeof e?.start&&e.start(),al.getWooPaySessionFromMerchant({_ajax_nonce:Ln("woopaySessionNonce"),appearance:n}).then(async e=>{if(!e?.blog_id||!e?.data?.session)throw c.current=A,new Error(e?.data);{const t=await al.sendPreemptiveSessionDataToWooPay(e);if(t?.is_error)return A(null),c.current=A,u.current=!1,void g(!1);window.location.href=Yi(t.redirect_url)}}).catch(()=>{const e=(0,w.__)("Something went wrong. Please try again.","woocommerce-payments");Gi(y,e),u.current=!1,g(!1)})})}else al.getWooPaySessionFromMerchant({_ajax_nonce:Ln("woopaySessionNonce"),order_id:Ln("order_id"),key:Ln("key"),billing_email:Ln("billing_email"),appearance:n}).then(async e=>{if(!e?.blog_id||!e?.data?.session)throw c.current=A,new Error(e?.data);{const t=await al.sendPreemptiveSessionDataToWooPay(e);if(t?.is_error)return A(null),c.current=A,u.current=!1,void g(!1);window.location.href=Yi(t.redirect_url)}})?.catch(()=>{const e=(0,w.__)("Something went wrong. Please try again.","woocommerce-payments");Gi(y,e),u.current=!1,g(!1)})},[L,y,t,r,e,A]);(0,d.useEffect)(()=>{Ln("isWoopayFirstPartyAuthEnabled")?(c.current=D,al.init()):c.current=A},[D,A]),(0,d.useEffect)(()=>{const e=e=>{e?.persisted&&(u.current=!1,g(!1))};return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[]);let O=null;null!==b&&(O=b>140?"wide":"narrow");const I=ul(i)?(R=i.brand,dl[R]||R):null;var R;const F=I&&b>=220?il.find(e=>e.name===I):null,B=pl[I]||I,z=F?(0,w.sprintf)((0,w.__)("WooPay with %1$s ending in %2$s","woocommerce-payments"),B,i.last4):k,W={ref:l,"aria-label":z,onClick:e=>c.current(e),className:uo("woopay-express-button",{"is-loading":f}),"data-type":p,"data-size":S,"data-theme":h,"data-width-type":O,style:{height:`${m}px`,borderRadius:`${_}px`}},H=f?(0,oo.jsx)("span",{className:"wc-block-components-spinner"}):F&&i?(0,oo.jsxs)("div",{className:"button-content",children:[(0,oo.jsx)(j,{}),(0,oo.jsx)("span",{className:"woopay-button-separator","aria-hidden":"true"}),(0,oo.jsx)("img",{src:F.component,alt:pl[I]||I,className:"woopay-button-card-brand"}),(0,oo.jsx)("span",{className:"woopay-button-last4",children:i.last4})]}):(0,oo.jsx)("div",{className:"button-content",children:ao({mixedString:k.replace(hl.default,"{{wooPayLogo /}}"),components:{wooPayLogo:(0,oo.jsx)(j,{})}})});return(0,oo.jsx)("div",{id:"wcpay-woopay-button",children:C?(0,oo.jsx)("a",{...W,href:f?void 0:E,"aria-disabled":f||void 0,tabIndex:f?-1:void 0,children:H},`${p}-${h}-${S}`):(0,oo.jsx)("button",{...W,disabled:f,type:"button",children:H},`${p}-${h}-${S}`)})},_l=class extends rl{constructor(){super(),this.listeners={...this.listeners,getIsUserLoggedInCallback:()=>{},getEncryptedDataCallback:()=>{},getPreferredPaymentMethodCallback:()=>{}}}async isUserLoggedIn(){try{return await this.sendMessageAndListenWith({action:"getIsUserLoggedIn"},"getIsUserLoggedInCallback")}catch(e){return!1}}async getEncryptedData(){try{return await this.sendMessageAndListenWith({action:"getEncryptedData"},"getEncryptedDataCallback")}catch(e){return null}}async getPreferredPaymentMethod(){try{return await this.sendMessageAndListenWith({action:"getPreferredPaymentMethod"},"getPreferredPaymentMethodCallback")}catch(e){return null}}callbackFn(e){switch(super.callbackFn(e),e.action){case"get_is_user_logged_in_success":this.listeners.getIsUserLoggedInCallback(e.value);break;case"get_encrypted_data_success":this.listeners.getEncryptedDataCallback(e.value);break;case"get_preferred_payment_method_success":this.listeners.getPreferredPaymentMethodCallback(e.value)}}};let fl;const gl=({stripe:e,buttonType:t,theme:o,height:n,radius:r})=>{const[s,a]=(0,d.useState)(!0),i={mode:"payment",amount:1e3,currency:"usd",appearance:{variables:{borderRadius:`${r??T()}px`,spacingUnit:"6px"}}},c=(e,t)=>{switch(t){case"dark":default:return"black";case"light":return"white";case"light-outline":return"googlePay"===e?"white":"white-outline"}},l="default"===t?"plain":t,u={buttonHeight:Math.min(Math.max(n,40),55),buttonTheme:{googlePay:c("googlePay",o),applePay:c("applePay",o)},buttonType:{googlePay:l,applePay:l},paymentMethods:{amazonPay:"never",link:"never",paypal:"never",klarna:"never",googlePay:"always",applePay:"always"},layout:{overflow:"never"}};return s?(0,oo.jsx)("div",{style:{minHeight:`${n}px`,width:"100%"},children:(0,oo.jsx)(xi,{stripe:e,options:i,children:(0,oo.jsx)(Ei,{options:u,onClick:()=>{},onReady:({availablePaymentMethods:e})=>{a(!!e)}})})},`${t}-${o}`):(0,oo.jsx)(wo,{icon:!0,status:"error",isDismissible:!1,children:(0,w.__)("Failed to preview the Apple Pay or Google Pay button. Ensure your store uses HTTPS on a publicly available domain and you're viewing this page in a Safari or Chrome browser. Your device must be configured to use Apple Pay or Google Pay.","woocommerce-payments")})},bl={small:40,medium:48,large:55},wl=({size:e,buttonType:t,theme:o,radius:n})=>{const r=(()=>{const[e,t]=(0,d.useState)(ml);return(0,d.useEffect)(()=>{(fl||(fl=(async()=>{const e=new _l;try{const t=await e.getPreferredPaymentMethod();return ul(t)?t:null}finally{e.detachMessageListener()}})()),fl).then(e=>{(e=>{try{ul(e)?localStorage.setItem(cl,JSON.stringify({brand:e.brand,last4:e.last4})):localStorage.removeItem(cl)}catch{}})(e),t(t=>{return o=e,n=t,o?.brand===n?.brand&&o?.last4===n?.last4?t:e;var o,n})}).catch(()=>{})},[]),e})();return(0,oo.jsx)(yl,{isPreview:!0,buttonSettings:{type:t,text:"Buy",theme:o,height:`${bl[e]||bl.medium}px`,size:e},buttonAttributes:{height:bl[e]||bl.medium,borderRadius:n},preferredCard:r})},xl=({theme:e,children:t})=>(0,oo.jsx)(oo.Fragment,{children:(0,oo.jsx)("div",{className:"payment-method-settings__preview","data-theme":e,children:t})}),vl=()=>(0,oo.jsx)(wo,{icon:!0,status:"info",isDismissible:!1,children:(0,w.__)("To preview the express checkout buttons, ensure your store uses HTTPS on a publicly available domain, and you're viewing this page in a Safari or Chrome browser. Your device must be configured to use Apple Pay or Google Pay.","woocommerce-payments")}),Sl=()=>{const e=Si("calls useStripe()").stripe,[t]=$t(),[o]=Vt(),[n]=Gt(),[r]=Yt(),[s]=Jt(),[a]=Wt();if(!s&&!a)return(0,oo.jsx)(wo,{icon:!0,status:"info",isDismissible:!1,children:(0,w.__)("To preview the express checkout buttons, activate at least one express checkout.","woocommerce-payments")});const i=s?(0,oo.jsx)(wl,{size:o,buttonType:t,theme:n,radius:r}):null,c="https:"===window.location.protocol,l=a?c&&(0,oo.jsx)(gl,{stripe:e,buttonType:t,theme:n,height:bl[o]||bl.medium,radius:r})||(0,oo.jsx)(vl,{}):null;return i||l?(0,oo.jsxs)(xl,{theme:n,children:[i,l]}):(0,oo.jsx)(vl,{})},kl=({currentMethod:e})=>{const[t]=Jt(),[o]=Wt(),[n]=Qt(),{featureFlags:{woopay:r,amazonPay:s}}=(0,d.useContext)(Ro),a=Rt(),i=t&&r,c=n&&s&&a.includes("amazon_pay"),l=["woopay"!==e&&i&&(0,w.__)("WooPay","woocommerce-payments"),"google/apple"!==e&&o&&(0,w.__)("Apple Pay / Google Pay","woocommerce-payments"),"amazon_pay"!==e&&c&&(0,w.__)("Amazon Pay","woocommerce-payments")].filter(Boolean);if(0===l.length)return null;const u=(e=>{if(1===e.length)return(0,w.sprintf)((0,w.__)("%s button","woocommerce-payments"),e[0]);if(2===e.length)return(0,w.sprintf)((0,w.__)("%1$s and %2$s buttons","woocommerce-payments"),e[0],e[1]);const t=e[e.length-1],o=e.slice(0,-1).join(", ");return(0,w.sprintf)((0,w.__)("%1$s, and %2$s buttons","woocommerce-payments"),o,t)})(l);return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(wo,{status:"warning",icon:!0,isDismissible:!1,children:(0,w.sprintf)((0,w.__)("These settings will also apply to the %s on your store.","woocommerce-payments"),u)}),(0,oo.jsx)(wo,{status:"warning",icon:!0,isDismissible:!1,children:(0,w.__)("Some appearance settings may be overridden in the express payment section of the Cart & Checkout blocks.","woocommerce-payments")})]})},jl=e=>ao({mixedString:e,components:{helpText:(0,oo.jsx)("span",{className:"payment-method-settings__option-muted-text"})}}),Cl=[{label:jl((0,w.__)("Small {{helpText}}(40 px){{/helpText}}","woocommerce-payments")),value:"small"},{label:jl((0,w.__)("Medium {{helpText}}(48 px){{/helpText}}","woocommerce-payments")),value:"medium"},{label:jl((0,w.__)("Large {{helpText}}(55 px){{/helpText}}","woocommerce-payments")),value:"large"}],El=[{label:(0,w.__)("Only icon","woocommerce-payments"),value:"default"},{label:(0,w.__)("Buy with","woocommerce-payments"),value:"buy"},{label:(0,w.__)("Donate with","woocommerce-payments"),value:"donate"},{label:(0,w.__)("Book with","woocommerce-payments"),value:"book"}],Pl=[{label:(0,w.__)("Dark","woocommerce-payments"),value:"dark",description:(0,w.__)("Recommended for white or light-colored backgrounds with high contrast.","woocommerce-payments")},{label:(0,w.__)("Light","woocommerce-payments"),value:"light",description:(0,w.__)("Recommended for dark or colored backgrounds with high contrast.","woocommerce-payments")},{label:(0,w.__)("Outline","woocommerce-payments"),value:"light-outline",description:(0,w.__)("Recommended for white or light-colored backgrounds with insufficient contrast.","woocommerce-payments")}],Nl=({type:e})=>{const[t,o]=$t(),[n,r]=Vt(),[s,a]=Gt(),[i,c]=Yt(),l=(0,d.useMemo)(()=>{const e=N("stripe");return function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];Wi=!0;var n=Date.now();return Hi().then(function(e){return function(e,t,o){if(null===e)return null;var n=t[0];if("string"!=typeof n)throw new Error("Expected publishable key to be of type string, got type ".concat(Pi(n)," instead."));var r=n.match(/^pk_test/),s=function(e){return 3===e?"v3":e}(e.version),a=Ti;r&&s!==a&&console.warn("Stripe.js@".concat(s," was loaded on the page, but @stripe/stripe-js@").concat("9.4.0"," expected Stripe.js@").concat(a,". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));var i=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"9.4.0",startTime:t})}(i,o),i}(e,t,n)})}(e.publishableKey,{stripeAccount:e.accountId,locale:e.locale})},[]);return(0,oo.jsxs)(mo,{className:"wcpay-card-body",children:[(0,oo.jsx)(kl,{currentMethod:e}),(0,oo.jsx)(b.SelectControl,{className:"payment-method-settings__cta-selection",label:(0,w.__)("Call to action","woocommerce-payments"),help:(0,w.__)("Select a button label that fits best with the flow of purchase or payment experience on your store.","woocommerce-payments"),value:t,options:El,onChange:o,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0}),(0,oo.jsx)(b.RadioControl,{label:(0,w.__)("Button size","woocommerce-payments"),selected:n,options:Cl,onChange:r}),(0,oo.jsx)(b.RadioControl,{label:(0,w.__)("Theme","woocommerce-payments"),selected:s,options:Pl,onChange:a}),(0,oo.jsx)(b.BaseControl,{id:"wcpay-payment-request-settings-border-radius",label:(0,w.__)("Border radius","woocommerce-payments"),help:(0,w.__)("Controls the corner roundness of express payment buttons.","woocommerce-payments"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:(0,oo.jsxs)("div",{className:"payment-method-settings__border-radius",children:[(0,oo.jsx)(b.__experimentalNumberControl,{label:(0,w.__)("Border radius, number input","woocommerce-payments"),id:"wcpay-payment-request-settings-border-radius",hideLabelFromVision:!0,isPressEnterToChange:!0,value:i,max:30,min:0,spinControls:"none",onChange:e=>{c("string"==typeof e?parseInt(e,10):e)},suffix:(0,oo.jsx)("div",{className:"payment-method-settings__border-radius__number-control__suffix",children:"px"}),__next40pxDefaultSize:!0}),(0,oo.jsx)(b.RangeControl,{label:(0,w.__)("Border radius, slider","woocommerce-payments"),hideLabelFromVision:!0,className:"payment-method-settings__border-radius__slider",value:i,max:30,min:0,withInputField:!1,onChange:c,__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0})]})}),(0,oo.jsxs)(b.BaseControl,{label:(0,w.__)("Preview","woocommerce-payments"),__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:[(0,oo.jsx)("div",{className:"payment-method-settings__option-help-text",children:(0,w.__)("See the preview of enabled express payment buttons.","woocommerce-payments")}),(0,oo.jsx)(xi,{stripe:l,children:(0,oo.jsx)(Sl,{})})]})]})},Tl=({section:e})=>{const[t,o]=Wt(),[n,r]=Ht(),[s,a]=Ut(),i=e=>t=>{a(e,t)};return(0,oo.jsxs)(b.Card,{children:["enable"===e&&(0,oo.jsx)(mo,{className:"wcpay-card-body",children:(0,oo.jsxs)("div",{className:"wcpay-payment-request-settings__enable",children:[(0,oo.jsx)(b.CheckboxControl,{className:"wcpay-payment-request-settings__enable__checkbox",checked:t,onChange:o,label:(0,w.__)("Enable Apple Pay / Google Pay as express payment buttons","woocommerce-payments"),help:(0,w.__)("Show express payment buttons on store pages for faster purchases. Customers with Apple Pay or Google Pay enabled will be able to pay with their preferred wallet.","woocommerce-payments"),__nextHasNoMarginBottom:!0}),wcpaySettings.featureFlags.isDynamicCheckoutPlaceOrderButtonEnabled&&(0,oo.jsx)(b.CheckboxControl,{className:"wcpay-payment-request-settings__enable__checkbox",checked:n,onChange:r,label:(0,w.__)("Enable express checkout methods as options in the payment methods list","woocommerce-payments"),help:wcpaySettings.featureFlags.amazonPay?(0,w.__)("Apple Pay, Google Pay, and Amazon Pay will appear as options in the payment methods list instead of as separate express checkout buttons.","woocommerce-payments"):(0,w.__)("Apple Pay and Google Pay will appear as options in the payment methods list instead of as separate express checkout buttons.","woocommerce-payments"),__nextHasNoMarginBottom:!0}),(0,oo.jsx)(b.BaseControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:(0,oo.jsxs)("ul",{className:"payment-request-settings__location",children:[(0,oo.jsx)("li",{children:(0,oo.jsx)(b.CheckboxControl,{disabled:!t||n,checked:!n&&t&&s.includes("product"),onChange:i("product"),label:(0,w.__)("Show on product page","woocommerce-payments"),__nextHasNoMarginBottom:!0})}),(0,oo.jsx)("li",{children:(0,oo.jsx)(b.CheckboxControl,{disabled:!t||n,checked:!n&&t&&s.includes("cart"),onChange:i("cart"),label:(0,w.__)("Show on cart page","woocommerce-payments"),__nextHasNoMarginBottom:!0})}),(0,oo.jsx)("li",{children:(0,oo.jsx)(b.CheckboxControl,{disabled:!t||n,checked:!!n||t&&s.includes("checkout"),onChange:i("checkout"),label:(0,w.__)("Show on checkout page","woocommerce-payments"),__nextHasNoMarginBottom:!0})})]})})]})}),"general"===e&&(0,oo.jsx)(Nl,{type:"google/apple"})]})};var Ml=r(5264),Ll=r(9931),Al=r(3902);const Dl=({error:e})=>(0,oo.jsx)("span",{className:"upload-message is-destructive",children:e}),Ol=({fileName:e,showPreview:t})=>{const o=wcpaySettings.restUrl+Fe.substring(1)+"/file/"+e;return(0,oo.jsxs)(oo.Fragment,{children:[t&&e&&(0,oo.jsx)("img",{src:o,style:{maxWidth:100,marginTop:12},alt:e}),!t&&e&&(0,oo.jsx)("span",{className:"upload-message",children:e})]})},Il=({fieldKey:e,fileName:t,disabled:o,isDone:n,isLoading:r,accept:s,error:a,onFileChange:i,onFileRemove:c,showPreview:l,uploadButtonLabel:d,type:u="file"})=>{const m=a&&a.length>0||!1,p="image"===u?Ll.A:Al.A,h=n&&!m?fo.A:p;return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.DropZone,{onFilesDrop:t=>i(e,t[0])}),(0,oo.jsxs)("div",{className:"file-upload",children:[(0,oo.jsx)(b.FormFileUpload,{accept:s,onChange:t=>{i(e,(t.target.files||new FileList)[0])},render:({openFileDialog:t})=>(0,oo.jsx)(b.Button,{id:`form-file-upload-${e}`,className:n&&!m?"is-success":"",isSecondary:!0,isDestructive:m,isBusy:r,disabled:o||r,icon:(0,oo.jsx)(h,{size:18}),onClick:e=>((e,t)=>{const o=e.target.closest(".components-form-file-upload")?.querySelector('input[type="file"]');o&&(o.value=""),t()})(e,t),children:d||(0,w.__)("Upload file","woocommerce-payments")})}),m?(0,oo.jsx)(Dl,{error:a}):(0,oo.jsx)(Ol,{fileName:t,showPreview:l}),n&&!o?(0,oo.jsx)(b.Button,{className:"delete-uploaded-file-button","aria-label":(0,w.__)("Remove file","woocommerce-payments"),icon:(0,oo.jsx)(Ml.A,{size:18}),onClick:()=>c(e)}):null]})]})},Rl=({fieldKey:e,label:t,accept:o,disabled:n,help:r,purpose:s,fileID:a,updateFileID:i})=>{const[c,l]=(0,po.useState)(!1),[d,u]=(0,po.useState)(!1),{createErrorNotice:m}=(0,v.useDispatch)("core/notices"),p=()=>{i(""),l(!1),u(!1)},h=!c&&a&&a.length>0,y=d||"";return(0,oo.jsx)(b.BaseControl,{id:`form-file-upload-${e}`,help:r,label:t,__nextHasNoMarginBottom:!0,children:(0,oo.jsxs)("div",{className:uo("woopay-settings__update-store-logo",a&&"has-file"),children:[(0,oo.jsx)(Il,{fieldKey:e,fileName:a,isLoading:c,accept:o,disabled:n,isDone:!1,error:y,onFileChange:async(e,t)=>{if(!t)return;if((e=>{if(51e4<e)return m((0,w.__)("The file you have attached is exceeding the maximum limit.","woocommerce-payments")),!0})(t.size))return;l(!0),Dn("wcpay_merchant_settings_file_upload_started",{type:e});const o=new FormData;o.append("file",t),o.append("purpose",s);try{const t=await Re()({path:"/wc/v3/payments/file",method:"post",body:o});t&&i(t.id),l(!1),u(!1),Dn("wcpay_merchant_settings_file_upload_success",{type:e})}catch(e){Dn("wcpay_merchant_settings_upload_failed",{message:e.message}),i(""),l(!1),u(e.message||""),m(e.message)}},onFileRemove:p,showPreview:!0,type:"image",uploadButtonLabel:(0,w.__)("Upload custom logo","woocommerce-payments")}),(0,oo.jsx)("div",{style:{display:"flex",alignItems:"center"},children:h&&(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(b.Button,{onClick:e=>{const t=e.target.closest(".woopay-settings__update-store-logo")?.querySelector('input[type="file"]');t?.click()},isLink:!0,children:(0,w.__)("Replace","woocommerce-payments")}),(0,oo.jsx)(b.Button,{className:"delete-uploaded-file-button","aria-label":(0,w.__)("Remove file","woocommerce-payments"),icon:(0,oo.jsx)(Ml.A,{size:18}),onClick:p})]})})]})})},Fl=window.wp.htmlEntities,Bl=r.p+"../assets/images/woopay-preview-product.svg?ver=d50bddbe55ef53cf0869",zl=r.p+"../assets/images/woopay-preview-visa.svg?ver=cd3a91b1c3d2b89d076d",Wl=r.p+"../assets/images/woopay-preview-logo.svg?ver=8b84130df502eb08460d",Hl=r.p+"../assets/images/woopay-preview-payment-cards.svg?ver=3942335f41ce3925ea4d",ql=({height:e})=>(0,oo.jsx)("div",{className:"preview-layout__v-spacer",style:{height:e}}),Ul=({height:e,themedStyle:t,children:o})=>(0,oo.jsx)("div",{className:"preview-layout__container",style:{height:e,...t},children:o}),$l=({themedStyle:e})=>{const t=e?.color||"#2C3338";return(0,oo.jsxs)("div",{className:"preview-layout__back-button",children:[(0,oo.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,oo.jsx)("path",{d:"M14 6.50002L9 12L14 17.5",stroke:t,strokeWidth:"1.5"})}),(0,oo.jsx)("span",{className:"preview-layout__back-button-label",style:e,children:(0,w.__)("Return to cart","woocommerce-payments")})]})},Vl=({themedStyle:e,chevronStyle:t,children:o})=>(0,oo.jsxs)("div",{className:"preview-layout__store-header",style:e,children:[(0,oo.jsx)($l,{themedStyle:t}),(0,oo.jsx)("div",{className:"preview-layout__store-branding",children:o}),(0,oo.jsx)("div",{className:"preview-layout__store-header-spacer"})]}),Gl=({themedStyle:e,children:t})=>(0,oo.jsx)("div",{className:"preview-layout__body",style:e,children:t}),Yl=({height:e,children:t})=>(0,oo.jsx)("div",{className:"preview-layout__columns-container",style:{height:e},children:t}),Zl=({height:e,children:t})=>(0,oo.jsx)("div",{className:"preview-layout__left-column",style:{height:e},children:t}),Jl=({children:e})=>(0,oo.jsx)("div",{className:"preview-layout__contact-section",children:e}),Kl=({children:e})=>(0,oo.jsx)("div",{className:"preview-layout__contact-field",children:e}),Ql=({height:e,themedStyle:t,children:o})=>(0,oo.jsx)("div",{className:"preview-layout__right-column",style:{height:e,...t},children:o}),Xl=({children:e,height:t,themedStyle:o})=>(0,oo.jsx)("div",{className:"preview-layout__section-header",style:{height:t,...o},children:e}),ed=({children:e,themedStyle:t})=>(0,oo.jsx)("div",{className:"preview-layout__field-value",style:t,children:e}),td=()=>(0,oo.jsx)("span",{className:"preview-layout__chevron-down",children:"›"}),od=({name:e,price:t,unitPrice:o,quantity:n,imageSrc:r,themedStyle:s})=>(0,oo.jsxs)("div",{className:"preview-layout__order-item",style:s,children:[(0,oo.jsxs)("div",{className:"preview-layout__order-item-image",children:[(0,oo.jsx)("img",{src:r,alt:e,className:"preview-layout__order-item-img"}),(0,oo.jsx)("span",{className:"preview-layout__order-item-qty",children:n})]}),(0,oo.jsxs)("div",{className:"preview-layout__order-item-details",children:[(0,oo.jsx)("span",{className:"preview-layout__order-item-name",children:e}),o&&(0,oo.jsx)("span",{className:"preview-layout__order-item-unit-price",children:o})]}),(0,oo.jsx)("span",{className:"preview-layout__order-item-price",children:t})]}),nd=({label:e,value:t,themedStyle:o})=>(0,oo.jsxs)("div",{className:"preview-layout__order-row",style:o,children:[(0,oo.jsx)("span",{children:e}),(0,oo.jsx)("span",{children:t})]}),rd=()=>(0,oo.jsx)("img",{className:"preview-layout__footer-cards",src:Hl,alt:""}),sd=({themedStyle:e,guestTextStyle:t})=>(0,oo.jsx)("div",{className:"preview-layout__footer",style:e,children:(0,oo.jsxs)("div",{className:"preview-layout__footer-inner",children:[(0,oo.jsxs)("div",{className:"preview-layout__footer-links",children:[(0,oo.jsx)("span",{className:"preview-layout__footer-guest-text",style:t,children:"Checkout as guest"}),(0,oo.jsx)("span",{className:"preview-layout__footer-dot",children:"•"}),(0,oo.jsx)("span",{children:"Terms of use"}),(0,oo.jsx)("span",{className:"preview-layout__footer-dot",children:"•"}),(0,oo.jsx)("span",{children:"Privacy policy"}),(0,oo.jsx)("span",{className:"preview-layout__footer-dot",children:"•"}),(0,oo.jsx)("span",{children:"Help"})]}),(0,oo.jsx)(rd,{})]})}),ad=({children:e,maxHeight:t,themedStyle:o})=>(0,oo.jsx)("div",{className:"preview-layout__text-box",style:{maxHeight:t,...o},dangerouslySetInnerHTML:{__html:e}}),id=()=>(0,oo.jsx)("img",{className:"preview-layout__woopay-logo",src:Wl,alt:"WooPay"}),cd=({height:e})=>(0,oo.jsx)("div",{className:"preview-layout__checkout-button",style:{height:e},children:(0,w.__)("Place order","woocommerce-payments")}),ld=["fonts.googleapis.com","fonts.gstatic.com","use.typekit.net","fonts.bunny.net","fonts.wp.com"],dd=({storeName:e,storeLogo:t,customMessage:o,appearance:n,fontRules:r,...s})=>{const{style:a,...i}=s,c=(0,d.useMemo)(()=>(e=>{if(!e)return{};const t=e.variables||{},o=e.rules||{},n=o[".Header"]?.backgroundColor||void 0,r=(e=>{if(!e)return;let t=e;const o=/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(t);return o&&(t=`#${o[1]}${o[1]}${o[2]}${o[2]}${o[3]}${o[3]}`),/^#[0-9a-f]{6}$/i.test(t)?(e=>{const t=e.replace("#","");return(299*parseInt(t.substring(0,2),16)+587*parseInt(t.substring(2,4),16)+114*parseInt(t.substring(4,6),16))/1e3<128})(t)?(e=>{const t=e.replace("#",""),o=Math.max(0,Math.min(100,6))/100,n=Math.round(parseInt(t.substring(0,2),16)+(255-parseInt(t.substring(0,2),16))*o),r=Math.round(parseInt(t.substring(2,4),16)+(255-parseInt(t.substring(2,4),16))*o),s=Math.round(parseInt(t.substring(4,6),16)+(255-parseInt(t.substring(4,6),16))*o);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`})(t):(e=>{const t=e.replace("#",""),o=1-Math.max(0,Math.min(100,6))/100,n=Math.round(parseInt(t.substring(0,2),16)*o),r=Math.round(parseInt(t.substring(2,4),16)*o),s=Math.round(parseInt(t.substring(4,6),16)*o);return`#${n.toString(16).padStart(2,"0")}${r.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}`})(t):void 0})(t.colorBackground);return{root:{fontFamily:t.fontFamily||void 0},container:{backgroundColor:n},body:{backgroundColor:t.colorBackground||void 0},storeHeader:{backgroundColor:n},headerText:{color:o[".Header"]?.color||void 0,fontFamily:o[".Heading"]?.fontFamily||void 0},chevron:{color:o[".Header"]?.color||void 0},sectionHeader:{color:o[".Label"]?.color||void 0,fontFamily:o[".Heading"]?.fontFamily||void 0},textBox:{color:t.colorText||void 0},card:{borderColor:r},link:{color:o[".Link"]?.color||void 0},footer:{backgroundColor:o[".Footer"]?.backgroundColor||void 0,color:o[".Footer"]?.color||void 0},footerGuestText:{color:o[".Footer-link"]?.color||void 0}}})(n),[n]);(0,d.useEffect)(()=>{const e=[];return(r||[]).forEach((t,o)=>{if(!t.cssSrc)return;let n;try{const e=new URL(t.cssSrc);if("https:"!==e.protocol||!ld.includes(e.hostname))return;n=e.href}catch{return}const r=document.createElement("link");r.rel="stylesheet",r.href=n,r.id=`woopay-preview-font-${o}`,document.head.appendChild(r),e.push(r)}),()=>e.forEach(e=>e.remove())},[r]);const l=(0,d.useMemo)(()=>{let e=(o||"").trim();return e&&(e=e.replace(/<\/?([a-zA-Z]+)[^>]*>/g,function(e,t){return t=t.toLowerCase(),["a","em","strong","b","i"].includes(t)?"a"===t?e.startsWith("</")?"</span>":'<span class="preview-layout__shortcode-link">':e.startsWith("</")?`</${t}>`:`<${t}>`:""}),e=e.replace(/\[(terms|terms_of_service_link)\]/g,'<span class="preview-layout__shortcode-link">Terms of Service</span>'),e=e.replace(/\[(privacy_policy|privacy_policy_link)\]/g,'<span class="preview-layout__shortcode-link">Privacy Policy</span>')),e},[o]);let u;if(t){const e=wcpaySettings.restUrl+Fe.substring(1)+"/file/"+t;u=(0,oo.jsx)("img",{src:e,alt:"Store logo"})}else u=wcpaySettings?.siteLogoUrl?(0,oo.jsx)("img",{src:wcpaySettings?.siteLogoUrl,alt:"Store logo"}):(0,oo.jsx)("span",{className:"header-text",style:c.headerText,children:(0,Fl.decodeEntities)(e)});return(0,oo.jsxs)("div",{className:"preview-layout",style:{...a,...c.root},role:"img","aria-label":(0,w.__)("WooPay checkout preview","woocommerce-payments"),...i,children:[(0,oo.jsxs)(Ul,{themedStyle:c.container,children:[(0,oo.jsx)(Vl,{themedStyle:c.storeHeader,chevronStyle:c.chevron,children:u}),(0,oo.jsxs)(Gl,{themedStyle:c.body,children:[(0,oo.jsx)(ql,{height:"2rem"}),(0,oo.jsxs)(Yl,{children:[(0,oo.jsxs)(Zl,{children:[(0,oo.jsxs)(Jl,{children:[(0,oo.jsxs)(Kl,{children:[(0,oo.jsx)(id,{}),(0,oo.jsx)(ed,{themedStyle:c.textBox,children:"jane@example.com"})]}),(0,oo.jsxs)(Kl,{children:[(0,oo.jsxs)(Xl,{height:"0.625rem",themedStyle:c.sectionHeader,children:[(0,w.__)("Ship to","woocommerce-payments"),(0,oo.jsx)(td,{})]}),(0,oo.jsx)(ed,{themedStyle:c.textBox,children:"Jane Smith, 123 Main St, San Francisco, CA 94105"})]}),(0,oo.jsxs)(Kl,{children:[(0,oo.jsxs)(Xl,{height:"0.625rem",themedStyle:c.sectionHeader,children:[(0,w.__)("Shipping method","woocommerce-payments"),(0,oo.jsx)(td,{})]}),(0,oo.jsx)(ed,{themedStyle:c.textBox,children:(0,w.sprintf)((0,w.__)("%s — Free","woocommerce-payments"),(0,w.__)("Free shipping","woocommerce-payments"))})]}),(0,oo.jsxs)(Kl,{children:[(0,oo.jsxs)(Xl,{height:"0.625rem",themedStyle:c.sectionHeader,children:[(0,w.__)("Pay with","woocommerce-payments"),(0,oo.jsx)(td,{})]}),(0,oo.jsx)(ed,{themedStyle:c.textBox,children:(0,oo.jsxs)("span",{className:"preview-layout__pay-with-value",children:[(0,oo.jsx)("img",{className:"preview-layout__visa-icon",src:zl,alt:""}),"Visa ···· 4242 Exp. 12/29"]})})]})]}),(0,oo.jsx)(ql,{height:"1.25rem"}),(0,oo.jsx)(cd,{height:"1.5rem"}),l&&(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)(ql,{height:"0.25rem"}),(0,oo.jsx)(ad,{maxHeight:"1.5rem",themedStyle:{...c.textBox,"--preview-link-color":c.link?.color},children:l})]}),(0,oo.jsx)(ql,{height:"0.75rem"})]}),(0,oo.jsxs)(Ql,{themedStyle:c.card,children:[(0,oo.jsx)(Xl,{height:"0.625rem",themedStyle:c.sectionHeader,children:(0,w.__)("Order summary","woocommerce-payments")}),(0,oo.jsx)(ql,{height:"0.6rem"}),(0,oo.jsxs)("div",{className:"preview-layout__cart-header",style:c.textBox,children:[(0,oo.jsx)("span",{className:"preview-layout__cart-header-text",children:(0,w.sprintf)((0,w.__)("%d item","woocommerce-payments"),1)}),(0,oo.jsxs)("span",{className:"preview-layout__cart-header-toggle",style:c.link,children:[(0,w.__)("Hide","woocommerce-payments"),(0,oo.jsx)("span",{className:"preview-layout__chevron-up",children:"›"})]})]}),(0,oo.jsx)(ql,{height:"0.5625rem"}),(0,oo.jsx)(od,{name:"Beanie",unitPrice:"$ 18.00",price:"$ 18.00",quantity:1,imageSrc:Bl,themedStyle:c.textBox}),(0,oo.jsx)(ql,{height:"0.75rem"}),(0,oo.jsx)("hr",{className:"preview-layout__hr preview-layout__hr--dotted"}),(0,oo.jsx)(ql,{height:"0.15rem"}),(0,oo.jsxs)("div",{className:"preview-layout__add-coupon",style:c.link,children:[(0,oo.jsxs)("svg",{className:"preview-layout__add-coupon-icon",viewBox:"0 0 24 24",fill:"none",children:[(0,oo.jsx)("path",{d:"M4.41387 11.8743L11.442 4.84616L18.8667 4.84616L18.8667 12.2708L11.8385 19.299L4.41387 11.8743Z",stroke:"currentColor",strokeWidth:"1.5"}),(0,oo.jsx)("circle",{cx:"14.667",cy:"9.04605",r:"1",transform:"rotate(45 14.667 9.04605)",fill:"currentColor"})]}),(0,w.__)("Add a coupon","woocommerce-payments")]}),(0,oo.jsx)(ql,{height:"0.108rem"}),(0,oo.jsxs)("div",{className:"preview-layout__add-coupon",style:c.link,children:[(0,oo.jsxs)("svg",{className:"preview-layout__add-coupon-icon",viewBox:"0 0 24 24",fill:"none",children:[(0,oo.jsx)("rect",{x:"-0.75",y:"-0.75",width:"9.5",height:"14.5",transform:"matrix(3.97376e-08 -1 -1 -4.80825e-08 18.5 18.5)",stroke:"currentColor",strokeWidth:"1.5"}),(0,oo.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13 19L13 9L11.5 9L11.5 19L13 19Z",fill:"currentColor"}),(0,oo.jsx)("path",{d:"M16.5 6.5C16.5 7.4665 15.7165 8.25 14.75 8.25H13V6.5C13 5.5335 13.7835 4.75 14.75 4.75C15.7165 4.75 16.5 5.5335 16.5 6.5Z",stroke:"currentColor",strokeWidth:"1.5"}),(0,oo.jsx)("path",{d:"M8 6.5C8 7.4665 8.7835 8.25 9.75 8.25H11.5V6.5C11.5 5.5335 10.7165 4.75 9.75 4.75C8.7835 4.75 8 5.5335 8 6.5Z",stroke:"currentColor",strokeWidth:"1.5"})]}),(0,w.__)("Add a gift card","woocommerce-payments")]}),(0,oo.jsx)(ql,{height:"0.24rem"}),(0,oo.jsx)(nd,{label:(0,w.__)("Subtotal","woocommerce-payments"),value:"$ 18.00",themedStyle:c.textBox}),(0,oo.jsx)(nd,{label:(0,w.__)("Shipping","woocommerce-payments"),value:(0,w.__)("Free","woocommerce-payments"),themedStyle:c.textBox}),(0,oo.jsx)(ql,{height:"0.5rem"}),(0,oo.jsx)(nd,{label:(0,w.__)("Total","woocommerce-payments"),value:"$ 18.00",themedStyle:{...c.textBox,fontWeight:600}}),(0,oo.jsx)(ql,{height:"0.25rem"})]})]}),(0,oo.jsx)(ql,{height:"1.15rem"})]})]}),(0,oo.jsx)(sd,{themedStyle:c.footer,guestTextStyle:c.footerGuestText})]})};(Object.getOwnPropertyDescriptor(dd,"name")||{}).writable||Object.defineProperty(dd,"name",{value:"default",configurable:!0});const ud=({section:e})=>{const[t]=At(),[o,n]=Jt(),[r,s]=(()=>{const{updateWooPayCustomMessage:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getWooPayCustomMessage()),e]})(),[a,i]=(()=>{const{updateIsWooPayGlobalThemeSupportEnabled:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getIsWooPayGlobalThemeSupportEnabled()),e]})(),[c,l]=(()=>{const{updateWooPayStoreLogo:e}=(0,v.useDispatch)(Mt);return[(0,v.useSelect)(e=>e(Mt).getWooPayStoreLogo()),e]})(),[d,u]=Kt(),m=e=>t=>{u(e,t)},p=t.includes("link"),h=eo()&&!p;return(0,oo.jsxs)(b.Card,{className:uo({"woopay-settings":!0,"woopay-settings--appearance":"appearance"===e}),children:["enable"===e&&(0,oo.jsxs)(mo,{className:"wcpay-card-body",children:[h&&(0,oo.jsx)(Bo,{}),p&&(0,oo.jsx)(wo,{status:"warning",isDismissible:!1,children:(0,w.__)("To enable WooPay, you must first disable Link by Stripe.","woocommerce-payments")}),(0,oo.jsxs)("div",{className:"wcpay-woopay-settings__enable",children:[(0,oo.jsx)(b.CheckboxControl,{checked:o,disabled:p,onChange:n,label:(0,w.__)("Enable WooPay","woocommerce-payments"),help:o?(0,w.__)("When enabled, customers will be able to checkout using WooPay.","woocommerce-payments"):ao({mixedString:(0,w.__)("When enabled, customers will be able to checkout using WooPay. In order to use {{wooPayLink}}WooPay{{/wooPayLink}}, you must agree to our {{tosLink}}WooCommerce Terms of Service{{/tosLink}} and {{privacyLink}}Privacy Policy{{/privacyLink}}. {{trackingLink}}Click here{{/trackingLink}} to learn more about the data you will be sharing and opt-out options.","woocommerce-payments"),components:{wooPayLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://woocommerce.com/document/woopay-merchant-documentation/"}),tosLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://wordpress.com/tos/"}),privacyLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://automattic.com/privacy/"}),trackingLink:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://woocommerce.com/usage-tracking/"})}}),__nextHasNoMarginBottom:!0}),(0,oo.jsx)(b.BaseControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:(0,oo.jsxs)("ul",{className:"payment-request-settings__location",children:[(0,oo.jsx)("li",{children:(0,oo.jsx)(b.CheckboxControl,{disabled:!o,checked:o&&d.includes("product"),onChange:m("product"),label:(0,w.__)("Show on product page","woocommerce-payments"),__nextHasNoMarginBottom:!0})}),(0,oo.jsx)("li",{children:(0,oo.jsx)(b.CheckboxControl,{disabled:!o,checked:o&&d.includes("cart"),onChange:m("cart"),label:(0,w.__)("Show on cart page","woocommerce-payments"),__nextHasNoMarginBottom:!0})}),(0,oo.jsx)("li",{children:(0,oo.jsx)(b.CheckboxControl,{disabled:!o,checked:o&&d.includes("checkout"),onChange:m("checkout"),label:(0,w.__)("Show on checkout page","woocommerce-payments"),__nextHasNoMarginBottom:!0})})]})})]})]}),"appearance"===e&&(0,oo.jsxs)(mo,{className:"wcpay-card-body woopay-settings__appearance-card-settings",children:[(0,oo.jsx)(Rl,{fieldKey:"woopay-store-logo",label:(0,w.__)("Checkout logo","woocommerce-payments"),accept:"image/png, image/jpeg",disabled:!1,help:(0,w.__)("Upload a custom logo. Upload a horizontal image with a white or transparent background for best results. Use a PNG or JPG image format. Recommended width: 512 pixels minimum.","woocommerce-payments"),purpose:"business_logo",fileID:c,updateFileID:l}),wcpaySettings.isWooPayGlobalThemeSupportEligible&&(0,oo.jsxs)("div",{className:"woopay-global-theme-support",children:[(0,oo.jsx)("h4",{children:(0,w.__)("Checkout theme","woocommerce-payments")}),(0,oo.jsx)("div",{className:"woopay-settings__global-theme-checkbox",children:(0,oo.jsx)(b.CheckboxControl,{disabled:!o,checked:a,onChange:i,label:(0,oo.jsxs)("div",{className:"woopay-settings__global-theme-label",children:[(0,w.__)("Enable global theme support","woocommerce-payments"),(0,oo.jsx)("span",{className:"woopay-settings__badge",children:"Beta"})]}),help:ao({mixedString:(0,w.__)("When enabled, WooPay checkout will be themed with your store’s brand colors and fonts. {{docs}}Learn more {{/docs}}","woocommerce-payments"),components:{docs:(0,oo.jsx)("a",{target:"_blank",rel:"noreferrer",href:"https://woocommerce.com/document/woopay-merchant-documentation/#checkout-appearance"})}}),__nextHasNoMarginBottom:!0})})]}),(0,oo.jsx)(b.TextareaControl,{label:(0,w.__)("Checkout policies","woocommerce-payments"),help:ao({mixedString:(0,w.__)("Override the default {{privacyLink}}privacy policy{{/privacyLink}} and {{termsLink}}terms of service{{/termsLink}}, or add custom text to WooPay checkout. {{learnMoreLink}}Learn more{{/learnMoreLink}}.","woocommerce-payments"),components:{privacyLink:window.wcSettings?.storePages?.privacy?.permalink?(0,oo.jsx)(Qr.Link,{href:window.wcSettings.storePages.privacy.permalink,type:"external"}):(0,oo.jsx)("span",{}),termsLink:window.wcSettings?.storePages?.terms?.permalink?(0,oo.jsx)(Qr.Link,{href:window.wcSettings.storePages.terms.permalink,type:"external"}):(0,oo.jsx)("span",{}),learnMoreLink:(0,oo.jsx)(b.ExternalLink,{href:"https://woocommerce.com/document/woopay-merchant-documentation/#checkout-appearance"})}}),value:r,onChange:s,__nextHasNoMarginBottom:!0}),(0,oo.jsx)(b.BaseControl,{className:"woopay-settings__preview",label:(0,w.__)("Preview of checkout","woocommerce-payments"),__nextHasNoMarginBottom:!0,children:(0,oo.jsx)(dd,{storeName:wcSettings.siteTitle,storeLogo:c,customMessage:r,appearance:a?wcpaySettings.woopayAppearance:null,fontRules:a?wcpaySettings.woopayFontRules:null})})]}),"general"===e&&(0,oo.jsx)(Nl,{type:"woopay"})]})},md=e=>ao({mixedString:e,components:{helpText:(0,oo.jsx)("span",{className:"payment-method-settings__option-muted-text"})}}),pd=[{label:md((0,w.__)("Small {{helpText}}(40 px){{/helpText}}","woocommerce-payments")),value:"small"},{label:md((0,w.__)("Medium {{helpText}}(48 px){{/helpText}}","woocommerce-payments")),value:"medium"},{label:md((0,w.__)("Large {{helpText}}(55 px){{/helpText}}","woocommerce-payments")),value:"large"}],hd=()=>{const[e,t]=Vt();return(0,oo.jsxs)(mo,{className:"wcpay-card-body",children:[(0,oo.jsx)(kl,{currentMethod:"amazon_pay"}),(0,oo.jsx)(b.RadioControl,{label:(0,w.__)("Button size","woocommerce-payments"),selected:e,options:pd,onChange:t})]})},yd=({section:e})=>{const[t,o]=Qt(),[n,r]=Xt(),[s,a]=Ht(),i=e=>t=>{r(e,t)};return(0,oo.jsxs)(b.Card,{children:["enable"===e&&(0,oo.jsx)(mo,{className:"wcpay-card-body",children:(0,oo.jsxs)("div",{className:"wcpay-payment-request-settings__enable",children:[(0,oo.jsx)(b.CheckboxControl,{className:"wcpay-payment-request-settings__enable__checkbox",checked:t,onChange:o,label:(0,w.__)("Enable Amazon Pay as an express payment button","woocommerce-payments"),help:(0,w.__)("Show Amazon Pay buttons on store pages for faster purchases. Customers with Amazon accounts can use their stored payment information.","woocommerce-payments"),__nextHasNoMarginBottom:!0}),wcpaySettings.featureFlags.isDynamicCheckoutPlaceOrderButtonEnabled&&(0,oo.jsx)(b.CheckboxControl,{className:"wcpay-payment-request-settings__enable__checkbox",checked:s,onChange:a,label:(0,w.__)("Enable express checkout methods as options in the payment methods list","woocommerce-payments"),help:(0,w.__)("Apple Pay, Google Pay, and Amazon Pay will appear as options in the payment methods list instead of as separate express checkout buttons.","woocommerce-payments"),__nextHasNoMarginBottom:!0}),(0,oo.jsx)(b.BaseControl,{__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0,children:(0,oo.jsxs)("ul",{className:"payment-request-settings__location",children:[(0,oo.jsx)("li",{children:(0,oo.jsx)(b.CheckboxControl,{disabled:!t||s,checked:!s&&t&&n.includes("product"),onChange:i("product"),label:(0,w.__)("Show on product page","woocommerce-payments"),__nextHasNoMarginBottom:!0})}),(0,oo.jsx)("li",{children:(0,oo.jsx)(b.CheckboxControl,{disabled:!t||s,checked:!s&&t&&n.includes("cart"),onChange:i("cart"),label:(0,w.__)("Show on cart page","woocommerce-payments"),__nextHasNoMarginBottom:!0})}),(0,oo.jsx)("li",{children:(0,oo.jsx)(b.CheckboxControl,{disabled:!t||s,checked:!!s||t&&n.includes("checkout"),onChange:i("checkout"),label:(0,w.__)("Show on checkout page","woocommerce-payments"),__nextHasNoMarginBottom:!0})})]})})]})}),"general"===e&&(0,oo.jsx)(hd,{})]})},_d={woopay:{title:"WooPay",sections:[{section:"enable",description:()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("div",{className:"express-checkout-settings__icon",children:(0,oo.jsx)(Qo,{})}),(0,oo.jsx)("p",{children:(0,w.__)("Allow your customers to collect payments via WooPay.","woocommerce-payments")})]})},{section:"appearance",description:()=>(0,oo.jsx)(oo.Fragment,{children:(0,oo.jsx)("div",{children:(0,oo.jsx)("h2",{children:(0,w.__)("Checkout appearance","woocommerce-payments")})})})},{section:"general",description:()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Settings","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Configure the display of WooPay buttons on your store.","woocommerce-payments")})]})}],controls:e=>(0,oo.jsx)(ud,{...e})},payment_request:{title:"Apple Pay / Google Pay",sections:[{section:"enable",description:()=>{const{icon:e}=yn.apple_pay,{icon:t}=yn.google_pay;return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsxs)("div",{className:"express-checkout-settings__icons",children:[(0,oo.jsx)("div",{className:"express-checkout-settings__icon",children:(0,oo.jsx)(e,{})}),(0,oo.jsx)("div",{className:"express-checkout-settings__icon",children:(0,oo.jsx)(t,{})})]}),(0,oo.jsx)("p",{children:(0,w.__)("Allow your customers to collect payments via Apple Pay and Google Pay.","woocommerce-payments")})]})}},{section:"general",description:()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Settings","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Configure the display of Apple Pay and Google Pay buttons on your store.","woocommerce-payments")})]})}],controls:e=>(0,oo.jsx)(Tl,{...e})},amazon_pay:{title:"Amazon Pay",sections:[{section:"enable",description:()=>{const{icon:e}=yn.amazon_pay;return(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("div",{className:"express-checkout-settings__icon",children:(0,oo.jsx)(e,{})}),(0,oo.jsx)("p",{children:(0,w.__)("Allow your customers to collect payments via Amazon Pay.","woocommerce-payments")})]})}},{section:"general",description:()=>(0,oo.jsxs)(oo.Fragment,{children:[(0,oo.jsx)("h2",{children:(0,w.__)("Settings","woocommerce-payments")}),(0,oo.jsx)("p",{children:(0,w.__)("Configure the display of Amazon Pay buttons on your store.","woocommerce-payments")})]})}],controls:e=>(0,oo.jsx)(yd,{...e})}},fd=({methodId:e})=>{const{isSaving:t}=zt(),o=_d[e];if(!o)return(0,oo.jsx)("p",{children:(0,w.__)("Invalid express checkout method ID specified.","woocommerce-payments")});let{sections:n}=o;"WooPay"!==o.title||wcpaySettings.featureFlags.woopayExpressCheckout||(n=n.filter(e=>"general"!==e.section));const{controls:r}=o;return(0,oo.jsx)(Gn,{children:(0,oo.jsxs)(fa,{isBusy:t,children:[n.map(({section:e,description:t})=>(0,oo.jsx)(jn,{description:t,className:`wcpay-express-checkout__${e}`,children:(0,oo.jsx)(ss,{numLines:30,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(r,{section:e})})})},e)),(0,oo.jsx)(Xn,{})]})})};window.addEventListener("load",()=>{g(wcpaySettings.fraudServices)});const gd=document.getElementById("wcpay-account-settings-container");gd&&(0,m.createRoot)(gd).render((0,oo.jsx)(Ro.Provider,{value:wcpaySettings,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(ri,{})})}));const bd=document.getElementById("wcpay-express-checkout-settings-container");if(bd){const e=bd.dataset.methodId;(0,m.createRoot)(bd).render((0,oo.jsx)(Ro.Provider,{value:wcpaySettings,children:(0,oo.jsx)(as,{children:(0,oo.jsx)(fd,{methodId:e})})}))}})()})();