(()=>{"use strict";const e=window.wp.blocks,t=window.wp.i18n,n=window.wp.blockEditor,a=window.wp.components,l=window.React,r=function(e){var a=e.attributes,r=e.setAttributes,i=a.label,c=a.hide_label,o=a.required,d=a.instructions,u=function(){return Math.random().toString(36).substring(2,10)};return(0,l.useEffect)((function(){if(!(!1 in a)){a.field_key||r({field_key:u()});var e=a.field_key;if(Array.from(document.querySelectorAll(".fea-field-key")).filter((function(t){return t.textContent===e})).length>1){var t=u();r({field_key:t})}}}),[]),React.createElement("div",{className:"acf-field"},React.createElement("span",{hidden:!0,className:"fea-field-key"},a.field_key),React.createElement("div",{className:"acf-label"},React.createElement("label",null,!c&&React.createElement(n.RichText,{tagName:"span",onChange:function(e){return r({label:e})},withoutInteractiveFormatting:!0,placeholder:(0,t.__)("Text Field","frontend-admin"),value:i}),o&&React.createElement("span",{className:"acf-required"},"*"))),React.createElement("div",{className:"acf-input"},d&&React.createElement(n.RichText,{tagName:"p",className:"description",onChange:function(e){return r({instructions:e})},withoutInteractiveFormatting:!0,value:d}),React.createElement("div",{className:"acf-input-wrap"+(e.wrapperClass?" "+e.wrapperClass:""),style:{display:"flex",width:"100%"}},e.children)))};var i="frontend-admin";const c=function(e){var l=e.attributes,r=e.setAttributes,c=l.label,o=l.hide_label,d=l.required,u=l.instructions,s=function(e){return e.toLowerCase().replace(/[^a-z0-9 _]/g,"").replace(/\s+/g,"_")};return React.createElement(n.InspectorControls,{field_key:"fea-inspector-controls"},React.createElement(a.PanelBody,{title:(0,t.__)("General",i),initialOpen:!0},React.createElement(a.TextControl,{label:(0,t.__)("Label",i),value:c,onChange:function(e){return r({label:e})}}),React.createElement(a.ToggleControl,{label:(0,t.__)("Hide Label",i),checked:o,onChange:function(e){return r({hide_label:e})}}),"name"in l&&React.createElement(a.TextControl,{label:(0,t.__)("Name",i),value:l.name||s(c),onChange:function(e){return r({name:s(e)})}}),"field_key"in l&&React.createElement(a.TextControl,{label:(0,t.__)("Field Key",i),value:l.field_key,readOnly:!0,onChange:function(e){}}),React.createElement(a.TextareaControl,{label:(0,t.__)("Instructions",i),rows:"3",value:u,onChange:function(e){return r({instructions:e})}}),React.createElement(a.ToggleControl,{label:(0,t.__)("Required",i),checked:d,onChange:function(e){return r({required:e})}}),e.children))};var o="frontend-admin";const d=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":2,"name":"frontend-admin/password-field","title":"Password Field","description":"Displays a password field.","category":"frontend-admin","textdomain":"frontend-admin","icon":"list-view","supports":{"align":["wide"]},"attributes":{"field_key":{"type":"string","default":""},"name":{"type":"string","default":""},"label":{"type":"string","default":"Text Field"},"hide_label":{"type":"boolean","default":""},"required":{"type":"boolean","default":""},"default_value":{"type":"string","default":""},"placeholder":{"type":"string","default":""},"instructions":{"type":"string","default":""},"prepend":{"type":"string","default":""},"append":{"type":"string","default":""}},"editorScript":"file:../../password/index.js"}');(0,e.registerBlockType)(d,{edit:function(e){var l=e.attributes,i=e.setAttributes,d=l.default_value,u=l.placeholder,s=l.prepend,p=l.append,f=(0,n.useBlockProps)();return React.createElement("div",f,React.createElement(c,e,React.createElement(a.TextControl,{label:(0,t.__)("Placeholder",o),value:u,onChange:function(e){return i({placeholder:e})}}),React.createElement(a.TextControl,{label:(0,t.__)("Prepend",o),value:s,onChange:function(e){return i({prepend:e})}}),React.createElement(a.TextControl,{label:(0,t.__)("Append",o),value:p,onChange:function(e){return i({append:e})}}),React.createElement(a.TextControl,{type:"number",label:(0,t.__)("Character Limit",o),value:maxlength,onChange:function(e){return i({maxlength:e})}})),React.createElement(r,e,s&&React.createElement("span",{className:"acf-input-prepend"},s),React.createElement("input",{type:"email",placeholder:u,value:d,onChange:function(e){i({default_value:e.target.value})},style:{width:"auto",flexGrow:1}}),p&&React.createElement("span",{className:"acf-input-append"},p)))},save:function(){return null}})})();