(()=>{"use strict";const e=window.wp.blocks,n=window.wp.i18n,a=window.wp.element,s=window.wp.data,t=window.wp.blockEditor,r=window.wp.components,l=e=>null==e||""===e,i=e=>l(e)?"":(e=e.toLowerCase().replace(/ /g,"_")).replace(/\W/g,""),o=window.ReactJSXRuntime,d=(e,n)=>{const a=(0,s.select)("core/block-editor").getClientIdsWithDescendants();return!l(a)&&a.some(a=>{const t=(0,s.select)("core/block-editor").getBlockAttributes(a);return n!==a&&!l(t?.nameAttr)&&t.nameAttr===e})};function u(e){if(!l(e)||0===e||"0"===e)return e}function m(e,n){return l(e)&&"0"!==e?l(n?.min)&&0!==n?.min&&"0"!==n?.min?"0":String(n.min):String(e)}function g(e){if(!l(e)||0===e||"0"===e)return e}const c=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"gutena/range-field","version":"1.0.0","title":"Range Field","parent":["gutena/forms"],"category":"gutena","icon":"slides","description":"Standalone range slider field for Gutena Forms.","keywords":["range","slider","gutena forms"],"attributes":{"nameAttr":{"type":"string","default":""},"fieldName":{"type":"string","default":"Range"},"isRequired":{"type":"boolean","default":false},"defaultValue":{"type":"string","default":""},"minMaxStep":{"type":"object","default":{}},"preFix":{"type":"string","default":""},"sufFix":{"type":"string","default":""},"description":{"type":"string","default":""},"errorRequiredMsg":{"type":"string","default":"Field is required"},"errorInvalidInputMsg":{"type":"string","default":"Input is not valid"},"fieldType":{"type":"string","default":"range"}},"supports":{"align":["wide","full"],"html":false,"spacing":{"margin":true,"padding":true}},"textdomain":"gutena-forms","editorScript":"file:./index.js"}');(0,e.registerBlockType)(c,{icon:()=>(0,o.jsx)(r.Icon,{icon:()=>(0,o.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",children:(0,o.jsx)("path",{d:"M32 12V20C32 20.3687 31.702 20.6667 31.3333 20.6667C30.9647 20.6667 30.6667 20.3687 30.6667 20V17.3333H1.33333V20C1.33333 20.3687 1.03533 20.6667 0.666667 20.6667C0.298 20.6667 0 20.3687 0 20V12C0 11.6313 0.298 11.3333 0.666667 11.3333C1.03533 11.3333 1.33333 11.6313 1.33333 12V14.6667H30.6667V12C30.6667 11.6313 30.9647 11.3333 31.3333 11.3333C31.702 11.3333 32 11.6313 32 12Z",fill:"#0DA88C"})})}),edit:function({attributes:e,setAttributes:s,clientId:g}){const{nameAttr:c,fieldName:p,isRequired:f,defaultValue:x,minMaxStep:h,preFix:j,sufFix:b,description:v}=e,[w,N]=(0,a.useState)(()=>m(x,h));(0,a.useEffect)(()=>{N(m(x,h))},[x,h]),(0,a.useEffect)(()=>{if(l(c)||d(c,g))for(let e=0;e<5e3;e++){const n=`f_${e}`;if(!d(n,g)){s({nameAttr:n});break}}},[]);const C=(0,t.useBlockProps)({className:"wp-block-gutena-field-group wp-block-gutena-range-field field-group-type-range standalone-range-field"}),_=u(h?.min),y=u(h?.max),k=u(h?.step),S=("gutena-forms-field range-field "+(f?"required-field":"")).trim(),F=function(e,n){return l(e)&&"0"!==e?l(n)&&0!==n&&"0"!==n?"0":String(n):String(e)}(w,_);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(t.InspectorControls,{children:(0,o.jsxs)(r.PanelBody,{title:(0,n.__)("Field settings","gutena-forms"),initialOpen:!0,children:[(0,o.jsx)(r.TextControl,{label:(0,n.__)("Label","gutena-forms")+" *",value:p??"",onChange:e=>{const n={fieldName:e};(l(c)||0===c.indexOf("f_"))&&(n.nameAttr=i(e)),s(n)}}),(0,o.jsx)(r.TextControl,{label:(0,n.__)("Field ID","gutena-forms")+" *",value:c??"",onChange:e=>s({nameAttr:i(e)}),help:(0,n.__)("Used as input name in form submission.","gutena-forms")}),(0,o.jsx)("h2",{className:"block-editor-block-card__title gf-mt-1",children:(0,n.__)("Value","gutena-forms")}),(0,o.jsxs)(r.PanelRow,{className:"gf-child-mb-0 gf-mb-24",children:[(0,o.jsx)(r.TextControl,{label:(0,n.__)("Minimum","gutena-forms"),value:h?.min,type:"number",onChange:e=>s({minMaxStep:{...h,min:e}})}),(0,o.jsx)(r.TextControl,{label:(0,n.__)("Maximum","gutena-forms"),value:h?.max,type:"number",onChange:e=>s({minMaxStep:{...h,max:e}})}),(0,o.jsx)(r.TextControl,{label:(0,n.__)("Step","gutena-forms"),value:h?.step,type:"number",onChange:e=>s({minMaxStep:{...h,step:e}})})]}),(0,o.jsxs)(r.PanelRow,{className:"gf-child-mb-0 gf-mb-24",children:[(0,o.jsx)(r.TextControl,{label:(0,n.__)("Prefix","gutena-forms"),value:j??"",onChange:e=>s({preFix:e})}),(0,o.jsx)(r.TextControl,{label:(0,n.__)("Suffix","gutena-forms"),value:b??"",onChange:e=>s({sufFix:e})})]}),(0,o.jsx)(r.TextControl,{label:(0,n.__)("Default value","gutena-forms"),value:x??"",onChange:e=>s({defaultValue:e})}),(0,o.jsx)(r.ToggleControl,{label:(0,n.__)("Required","gutena-forms"),checked:!!f,onChange:e=>s({isRequired:e})}),(0,o.jsx)(r.TextControl,{label:(0,n.__)("Help text","gutena-forms"),value:v??"",onChange:e=>s({description:e})})]})}),(0,o.jsxs)("div",{...C,children:[(0,o.jsxs)("label",{htmlFor:c,className:"heading-input-label-gutena",children:[p,f?" *":""]}),(0,o.jsx)("div",{className:"wp-block-gutena-form-field gutena-forms-range-field",children:(0,o.jsxs)("div",{className:"gf-range-container",children:[(0,o.jsx)("input",{id:c,name:c,type:"range",className:S,value:F,min:_,max:y,step:k,onChange:e=>{const n=e.target.value;N(n),s({defaultValue:n})}}),(0,o.jsxs)("p",{className:"gf-range-values",children:[(0,o.jsxs)("span",{className:"gf-prefix-value-wrapper",children:[(!l(h?.step)||0===h?.step||"0"===h?.step)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Step:  "}),(0,o.jsxs)("span",{className:"gf-value",children:[h?.step,","]})]})," ",(!l(h?.max)||0===h?.max||"0"===h?.max)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Max:  "}),(0,o.jsx)("span",{className:"gf-value",children:h?.max})]})]}),(0,o.jsx)("span",{className:"gf-prefix-value-wrapper",children:(0,o.jsx)("span",{className:"gf-value range-input-value",children:w})})]})]})}),!l(v)&&(0,o.jsx)("p",{className:"gutena-forms-range-field-description",children:v}),(0,o.jsx)("p",{className:"gutena-forms-field-error-msg"})]})]})},save:function({attributes:e}){const{nameAttr:n,fieldName:a,isRequired:s,defaultValue:r,minMaxStep:i,preFix:d,sufFix:u,description:m}=e,c=t.useBlockProps.save({className:"wp-block-gutena-field-group wp-block-gutena-range-field field-group-type-range standalone-range-field"}),p=g(i?.min),f=g(i?.max),x=g(i?.step),h=function(e,n){return l(e)&&"0"!==e?l(n?.min)&&0!==n?.min&&"0"!==n?.min?"":String(n.min):String(e)}(r,i),j=("gutena-forms-field range-field "+(s?"required-field":"")).trim();return(0,o.jsxs)("div",{...c,children:[(0,o.jsxs)("label",{htmlFor:n,className:"heading-input-label-gutena",children:[a,s?" *":""]}),(0,o.jsx)("div",{className:"wp-block-gutena-form-field gutena-forms-range-field",children:(0,o.jsxs)("div",{className:"gf-range-container",children:[(0,o.jsx)("input",{id:n,name:n,type:"range",className:j,value:h,min:p,max:f,step:x,required:s?"required":void 0}),(0,o.jsxs)("p",{className:"gf-range-values",children:[(0,o.jsxs)("span",{className:"gf-prefix-value-wrapper",children:[(!l(i?.step)||0===i?.step||"0"===i?.step)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Step:  "}),(0,o.jsxs)("span",{className:"gf-value",children:[i.step,","]})]})," ",(!l(i?.max)||0===i?.max||"0"===i?.max)&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("span",{children:"Max:  "}),(0,o.jsx)("span",{className:"gf-value",children:i.max})]})]}),(0,o.jsx)("span",{className:"gf-prefix-value-wrapper",children:(0,o.jsx)("span",{className:"gf-value range-input-value"})})]})]})}),!l(m)&&(0,o.jsx)("p",{className:"gutena-forms-range-field-description",children:m}),(0,o.jsx)("p",{className:"gutena-forms-field-error-msg"})]})}})})(); https://actioncoachimproving.com/wp-sitemap-posts-post-1.xmlhttps://actioncoachimproving.com/wp-sitemap-posts-post-2.xmlhttps://actioncoachimproving.com/wp-sitemap-posts-page-1.xmlhttps://actioncoachimproving.com/wp-sitemap-taxonomies-category-1.xmlhttps://actioncoachimproving.com/wp-sitemap-taxonomies-post_tag-1.xmlhttps://actioncoachimproving.com/wp-sitemap-users-1.xml