(()=>{"use strict";const e=window.wp.blocks,t=window.wp.blockEditor,a=window.wp.components,s=window.wp.i18n,o=JSON.parse('{"UU":"gateway/route"}'),l=window.ReactJSXRuntime;(0,e.registerBlockType)(o.UU,{edit:({attributes:e,setAttributes:o})=>{const{path:n,label:r}=e,i=(0,t.useBlockProps)({className:"gateway-route"});return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(t.InspectorControls,{children:(0,l.jsxs)(a.PanelBody,{title:(0,s.__)("Route Settings","gateway"),children:[(0,l.jsx)(a.TextControl,{label:(0,s.__)("Path","gateway"),help:(0,s.__)('The route path that activates this view (e.g., "/", "/about", "/products/:id").',"gateway"),value:n,onChange:e=>o({path:e}),placeholder:"/"}),(0,l.jsx)(a.TextControl,{label:(0,s.__)("Label","gateway"),help:(0,s.__)("An optional label for this route, shown in the editor.","gateway"),value:r,onChange:e=>o({label:e}),placeholder:(0,s.__)("Home","gateway")})]})}),(0,l.jsxs)("div",{...i,children:[(0,l.jsxs)("div",{className:"gateway-route__header",children:[(0,l.jsx)("span",{className:"gateway-route__icon",children:"◈"}),(0,l.jsx)("span",{className:"gateway-route__path",children:n||"/"}),r&&(0,l.jsx)("span",{className:"gateway-route__label",children:r})]}),(0,l.jsx)("div",{className:"gateway-route__content",children:(0,l.jsx)(t.InnerBlocks,{templateLock:!1,placeholder:(0,s.__)("Add content for this route...","gateway")})})]})]})},save:({attributes:e})=>{const{path:a,label:s}=e,o=JSON.stringify({routePath:a||"/"});return(0,l.jsx)("div",{...t.useBlockProps.save({className:"gateway-route",style:{display:"none"}}),"data-wp-context":o,"data-router-path":a||"/",...s?{"data-router-label":s}:{},children:(0,l.jsx)(t.InnerBlocks.Content,{})})}})})();