(()=>{"use strict";var e,t={599(){const e=window.wp.blocks,t=window.wp.blockEditor,a=window.wp.components,o=window.wp.i18n,n=JSON.parse('{"UU":"gateway/gtx-click-control"}'),l=window.ReactJSXRuntime;(0,e.registerBlockType)(n.UU,{edit:({attributes:e,setAttributes:n})=>{const{text:i,elementType:r,namespace:c,action:s}=e,p=(0,t.useBlockProps)();return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.InspectorControls,{children:(0,l.jsxs)(a.PanelBody,{title:(0,o.__)("Click Control Settings","gateway"),children:[(0,l.jsx)(a.TextControl,{label:(0,o.__)("Button Text","gateway"),help:(0,o.__)("The text displayed in the button or link","gateway"),value:i,onChange:e=>n({text:e}),placeholder:"Click me"}),(0,l.jsx)(a.SelectControl,{label:(0,o.__)("Element Type","gateway"),help:(0,o.__)("Choose whether to render as a button or link","gateway"),value:r,options:[{label:(0,o.__)("Button","gateway"),value:"button"},{label:(0,o.__)("Link (a)","gateway"),value:"a"}],onChange:e=>n({elementType:e})}),(0,l.jsx)(a.TextControl,{label:(0,o.__)("Namespace","gateway"),help:(0,o.__)('The interactivity namespace (e.g., "gateway/expander"). Required to call actions.',"gateway"),value:c,onChange:e=>n({namespace:e}),placeholder:"gateway/my-store"}),(0,l.jsx)(a.TextControl,{label:(0,o.__)("Action","gateway"),help:(0,o.__)('The action/method to call (e.g., "actions.toggle", "actions.submit")',"gateway"),value:s,onChange:e=>n({action:e}),placeholder:"actions.toggle"})]})}),(0,l.jsxs)("div",{...p,children:["button"===r?(0,l.jsx)("button",{type:"button",className:"wp-block-gateway-click-control__button",disabled:!0,children:i||(0,o.__)("Click me","gateway")}):(0,l.jsx)("a",{href:"#",className:"wp-block-gateway-click-control__link",onClick:e=>e.preventDefault(),children:i||(0,o.__)("Click me","gateway")}),c&&s&&(0,l.jsxs)("div",{style:{marginTop:"8px",padding:"8px",background:"#f9f9f9",border:"1px solid #ddd",borderRadius:"3px",fontSize:"11px",fontFamily:"monospace"},children:[(0,l.jsx)("strong",{children:"On Click:"})," ",c," → ",s]})]})]})},save:({attributes:e})=>{const{text:a,elementType:n,namespace:i,action:r}=e,c=t.useBlockProps.save(),s={...c,className:`${c.className||""} wp-block-gateway-click-control__${n}`.trim()};if("a"===n){s["data-wp-interactive"]="gateway/click-control",s.href="#";const e={namespace:i||"",action:r||""};return s["data-wp-context"]=JSON.stringify(e),s["data-wp-on--click"]=r?"actions.handleLinkClick":"actions.preventDefault",(0,l.jsx)("a",{...s,children:a||(0,o.__)("Click me","gateway")})}return i&&(s["data-wp-interactive"]=i),r&&(s["data-wp-on--click"]=r),s.type="button",s.role="button",(0,l.jsx)("button",{...s,children:a||(0,o.__)("Click me","gateway")})}})}},a={};function o(e){var n=a[e];if(void 0!==n)return n.exports;var l=a[e]={exports:{}};return t[e](l,l.exports,o),l.exports}o.m=t,e=[],o.O=(t,a,n,l)=>{if(!a){var i=1/0;for(p=0;p<e.length;p++){for(var[a,n,l]=e[p],r=!0,c=0;c<a.length;c++)(!1&l||i>=l)&&Object.keys(o.O).every(e=>o.O[e](a[c]))?a.splice(c--,1):(r=!1,l<i&&(i=l));if(r){e.splice(p--,1);var s=n();void 0!==s&&(t=s)}}return t}l=l||0;for(var p=e.length;p>0&&e[p-1][2]>l;p--)e[p]=e[p-1];e[p]=[a,n,l]},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={901:0,241:0};o.O.j=t=>0===e[t];var t=(t,a)=>{var n,l,[i,r,c]=a,s=0;if(i.some(t=>0!==e[t])){for(n in r)o.o(r,n)&&(o.m[n]=r[n]);if(c)var p=c(o)}for(t&&t(a);s<i.length;s++)l=i[s],o.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return o.O(p)},a=globalThis.webpackChunkgateway_block_types=globalThis.webpackChunkgateway_block_types||[];a.forEach(t.bind(null,0)),a.push=t.bind(null,a.push.bind(a))})();var n=o.O(void 0,[241],()=>o(599));n=o.O(n)})();