(()=>{var e={5151:()=>{}},o={};function n(t){var s=o[t];if(void 0!==s)return s.exports;var c=o[t]={exports:{}};return e[t](c,c.exports,n),c.exports}(()=>{"use strict";const e=window.wp.blocks,o=window.wp.components,t=JSON.parse('{"name":"woocommerce/payment-method-icons","version":"1.0.0","title":"Payment Method Icons","description":"Display icons for available payment methods.","category":"woocommerce","keywords":["woocommerce","payments","payment methods"],"textdomain":"woocommerce","attributes":{"numberOfIcons":{"type":"number","default":0}},"supports":{"spacing":{"margin":true,"padding":true}},"apiVersion":3,"$schema":"https://schemas.wp.org/trunk/block.json"}'),s=window.ReactJSXRuntime,c=(0,s.jsxs)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[(0,s.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,s.jsx)("path",{d:"M20 4H4c-1.11 0-1.99.89-1.99 2L2 18c0 1.11.89 2 2 2h16c1.11 0 2-.89 2-2V6c0-1.11-.89-2-2-2zm0 14H4v-6h16v6zm0-10H4V6h16v2z"})]}),i=window.wp.i18n,r=window.wp.blockEditor,a=({type:e,icon:o})=>{let n=null;return e&&o&&(n=(0,s.jsx)("div",{className:"wc-block-payment-method-icons__item",children:(0,s.jsx)("span",{className:"wc-block-payment-method-icons__icon",style:{backgroundImage:`url(${o})`},role:"img","aria-label":e})})),n};n(5151),(0,e.registerBlockType)(t,{icon:{src:(0,s.jsx)(o.Icon,{icon:c})},edit:({attributes:e,setAttributes:n})=>{const t=(0,r.useBlockProps)(),c=window.wcSettings?.availablePaymentMethods||{},{numberOfIcons:m}=e;if(c&&Object.keys(c).length>0){const e=Object.keys(c).reduce(((e,o)=>c[o]&&c[o].icon?(e.push({type:o,icon:c[o].icon}),e):e),[]),l=0===m?e.length:Math.min(m,e.length);return(0,s.jsxs)("div",{...t,children:[(0,s.jsx)(r.InspectorControls,{children:(0,s.jsx)(o.PanelBody,{title:(0,i.__)("Payment Method Icon Settings","woocommerce"),children:(0,s.jsx)(o.RangeControl,{label:(0,i.__)("Number of icons","woocommerce"),value:m,onChange:e=>n({numberOfIcons:e||0}),min:0,max:e.length,help:(0,i.__)("Choose how many icons to display. To show all icons, use 0 (zero).","woocommerce")})})}),(0,s.jsx)("div",{className:"wc-block-payment-method-icons",children:e.slice(0,l).map((e=>(0,s.jsx)(a,{type:e?.type,icon:e?.icon},e?.type)))})]})}return(0,s.jsx)("div",{...t,children:(0,i.__)("No active payment methods found.","woocommerce")})},save:()=>null})})(),((this.wc=this.wc||{}).blocks=this.wc.blocks||{})["payment-method-icons"]={}})();