← Back
Editing: fluent_gutenblock.js
/*! For license information please see fluent_gutenblock.js.LICENSE.txt */ (()=>{var e={59927(e){e.exports={toSafeFormId:function(e){return/^[1-9][0-9]*$/.test(String(e))?String(e):""}}},39684(e,t,n){var o=n(42275).isSafeRestUrl;e.exports={safeApiFetch:function(e){var t,n,r=null===(t=window.fluentform_block_vars)||void 0===t?void 0:t.rest;if(null==r||!r.base_url||null==r||!r.url)return Promise.reject(new Error("Unsafe REST path"));if("string"==typeof e.path){var l=r.base_url,a=e.path.replace(/^\//,"");-1!==l.indexOf("?")&&(a=a.replace("?","&")),n=l+a}else"string"==typeof e.url&&(n=e.url);return void 0===n||o(n,r.url)?wp.apiFetch(e):Promise.reject(new Error("Unsafe REST path"))}}},42275(e){function t(e,t){var o="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!o){if(Array.isArray(e)||(o=function(e,t){if(e){if("string"==typeof e)return n(e,t);var o={}.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?n(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){o&&(e=o);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){o=o.call(e)},n:function(){var e=o.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==o.return||o.return()}finally{if(u)throw a}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var o=["_method","_jsonp","_envelope"],r=new Map;function l(e){var t=e.split("\0")[0].replace(/^ +/,""),n=t.indexOf("[");return-1!==n&&-1!==t.indexOf("]",n)?t.slice(0,n).replace(/[ .]/g,"_"):t.replace(/[ .[]/g,"_")}e.exports={isSafeRestUrl:function(e,n){if(!e||"string"!=typeof e||!n)return!1;if(/[#\\]/.test(e)||e.split(/[?#]/)[0].split("/").some(function(e){var t=e.replace(/%2e/gi,".");return"."===t||".."===t}))return!1;try{var a,i=function(e){var t=r.get(e);if(t)return t;var n=new URL(e,window.location.href),o=n.searchParams.get("rest_route");return t={origin:n.origin,pathname:n.pathname,plain:null!==o,prefix:(null!==o?o:n.pathname).replace(/\/$/,"")+"/"},r.set(e,t),t}(n),u=new URL(e,window.location.href),c=0,s=t(u.searchParams.keys());try{for(s.s();!(a=s.n()).done;){var f=l(a.value);if(o.includes(f))return!1;"rest_route"===f&&c++}}catch(e){s.e(e)}finally{s.f()}var d=(i.plain?u.searchParams.get("rest_route"):u.pathname)||"";return u.origin===i.origin&&c===(i.plain?1:0)&&(!i.plain||u.pathname===i.pathname)&&d.startsWith(i.prefix)&&!d.split("/").some(function(e){return"."===e||".."===e})}catch(e){return!1}},normalizeParamName:l,OVERRIDE_PARAMS:o}},21020(e,t,n){"use strict";var o=n(96540),r=Symbol.for("react.element"),l=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,i=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var o,l={},c=null,s=null;for(o in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(s=t.ref),t)a.call(t,o)&&!u.hasOwnProperty(o)&&(l[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps)void 0===l[o]&&(l[o]=t[o]);return{$$typeof:r,type:e,key:c,ref:s,props:l,_owner:i.current}}t.Fragment=l,t.jsx=c,t.jsxs=c},15287(e,t){"use strict";var n=Symbol.for("react.element"),o=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),s=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.iterator;var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},h=Object.assign,g={};function m(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||b}function v(){}function y(e,t,n){this.props=e,this.context=t,this.refs=g,this.updater=n||b}m.prototype.isReactComponent={},m.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},m.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},v.prototype=m.prototype;var x=y.prototype=new v;x.constructor=y,h(x,m.prototype),x.isPureReactComponent=!0;var k=Array.isArray,S=Object.prototype.hasOwnProperty,j={current:null},C={key:!0,ref:!0,__self:!0,__source:!0};function w(e,t,o){var r,l={},a=null,i=null;if(null!=t)for(r in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(a=""+t.key),t)S.call(t,r)&&!C.hasOwnProperty(r)&&(l[r]=t[r]);var u=arguments.length-2;if(1===u)l.children=o;else if(1<u){for(var c=Array(u),s=0;s<u;s++)c[s]=arguments[s+2];l.children=c}if(e&&e.defaultProps)for(r in u=e.defaultProps)void 0===l[r]&&(l[r]=u[r]);return{$$typeof:n,type:e,key:a,ref:i,props:l,_owner:j.current}}function B(e){return"object"==typeof e&&null!==e&&e.$$typeof===n}var O=/\/+/g;function T(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function P(e,t,r,l,a){var i=typeof e;"undefined"!==i&&"boolean"!==i||(e=null);var u=!1;if(null===e)u=!0;else switch(i){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case n:case o:u=!0}}if(u)return a=a(u=e),e=""===l?"."+T(u,0):l,k(a)?(r="",null!=e&&(r=e.replace(O,"$&/")+"/"),P(a,t,r,"",function(e){return e})):null!=a&&(B(a)&&(a=function(e,t){return{$$typeof:n,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,r+(!a.key||u&&u.key===a.key?"":(""+a.key).replace(O,"$&/")+"/")+e)),t.push(a)),1;if(u=0,l=""===l?".":l+":",k(e))for(var c=0;c<e.length;c++){var s=l+T(i=e[c],c);u+=P(i,t,r,s,a)}else if(s=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=p&&e[p]||e["@@iterator"])?e:null}(e),"function"==typeof s)for(e=s.call(e),c=0;!(i=e.next()).done;)u+=P(i=i.value,t,r,s=l+T(i,c++),a);else if("object"===i)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function _(e,t,n){if(null==e)return e;var o=[],r=0;return P(e,o,"","",function(e){return t.call(n,e,r++)}),o}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var E={current:null},N={transition:null},I={ReactCurrentDispatcher:E,ReactCurrentBatchConfig:N,ReactCurrentOwner:j};function R(){throw Error("act(...) is not supported in production builds of React.")}t.Children={map:_,forEach:function(e,t,n){_(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return _(e,function(){t++}),t},toArray:function(e){return _(e,function(e){return e})||[]},only:function(e){if(!B(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=m,t.Fragment=r,t.Profiler=a,t.PureComponent=y,t.StrictMode=l,t.Suspense=s,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=I,t.act=R,t.cloneElement=function(e,t,o){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=h({},e.props),l=e.key,a=e.ref,i=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,i=j.current),void 0!==t.key&&(l=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)S.call(t,c)&&!C.hasOwnProperty(c)&&(r[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)r.children=o;else if(1<c){u=Array(c);for(var s=0;s<c;s++)u[s]=arguments[s+2];r.children=u}return{$$typeof:n,type:e.type,key:l,ref:a,props:r,_owner:i}},t.createContext=function(e){return(e={$$typeof:u,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:i,_context:e},e.Consumer=e},t.createElement=w,t.createFactory=function(e){var t=w.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=B,t.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:A}},t.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},t.unstable_act=R,t.useCallback=function(e,t){return E.current.useCallback(e,t)},t.useContext=function(e){return E.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return E.current.useDeferredValue(e)},t.useEffect=function(e,t){return E.current.useEffect(e,t)},t.useId=function(){return E.current.useId()},t.useImperativeHandle=function(e,t,n){return E.current.useImperativeHandle(e,t,n)},t.useInsertionEffect=function(e,t){return E.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return E.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return E.current.useMemo(e,t)},t.useReducer=function(e,t,n){return E.current.useReducer(e,t,n)},t.useRef=function(e){return E.current.useRef(e)},t.useState=function(e){return E.current.useState(e)},t.useSyncExternalStore=function(e,t,n){return E.current.useSyncExternalStore(e,t,n)},t.useTransition=function(){return E.current.useTransition()},t.version="18.3.1"},96540(e,t,n){"use strict";e.exports=n(15287)},74848(e,t,n){"use strict";e.exports=n(21020)}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o](l,l.exports,n),l.exports}(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,l=function(){};return{s:l,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:l}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(u)throw a}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var r=function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e&&!n||e===n||!o.length)return!0;if(!e||!n)return!1;var r,l=t(o);try{for(l.s();!(r=l.n()).done;){var a=r.value;if(null!=e&&e[a]||null!=n&&n[a]){if(null==e||!e[a]||null==n||!n[a])return!1;if(JSON.stringify(e[a])!==JSON.stringify(n[a]))return!1}}}catch(e){l.e(e)}finally{l.f()}return!0},l=function(n,o){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!r.length)return!0;var l,a=t(r);try{for(a.s();!(l=a.n()).done;){var i=l.value,u=n[i],c=o[i];if("object"!==e(u)||"object"!==e(c)){if(u!==c)return!1}else if(JSON.stringify(u)!==JSON.stringify(c))return!1}}catch(e){a.e(e)}finally{a.f()}return!0},a=n(74848);wp.i18n.__;const i=(0,wp.element.memo)(function(e){var t=e.label,n=void 0===t?"":t,o=e.className,r=void 0===o?"":o,l=e.style,i="fluent-separator fluent-separator-".concat(void 0===l?"default":l," ").concat(r);return n?(0,a.jsx)("div",{className:i,children:(0,a.jsx)("span",{className:"fluent-separator-label",children:n})}):(0,a.jsx)("hr",{className:i})},function(e,t){return l(e,t,["label","className","style"])});function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,s(o.key),o)}}function s(e){var t=function(e,t){if("object"!=u(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==u(t)?t:t+""}const f=function(){return e=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.formId=t,this.targetDocument=n||document,this.TABLET_BREAKPOINT="780px",this.MOBILE_BREAKPOINT="480px",this.styleElementId="fluentform-block-custom-styles-".concat(t),this.baseSelector=".fluentform.fluentform_wrapper_".concat(t,".ff_guten_block.ff_guten_block-").concat(t),this.setStyleElement()},t=[{key:"setStyleElement",value:function(){var e=this.targetDocument.getElementById(this.styleElementId);if(e)this.styleElement=e;else{var t=this.targetDocument.createElement("style");t.id=this.styleElementId,this.targetDocument.head.appendChild(t),this.styleElement=t}}},{key:"updateStyles",value:function(e){if(e){if(this.styleElement||this.setStyleElement(),this.styleElement){var t=this.generateAllStyles(e);return this.styleElement.innerHTML=t,t}return!1}}},{key:"generateAllStyles",value:function(e){if(!e||0===Object.keys(e).length)return"";var t="";return t+=this.generateContainerStyles(e),t+=this.generateLabelStyles(e),t+=this.generateInputStyles(e),t+=this.generatePlaceholderStyles(e),t+=this.generateButtonStyles(e),t+=this.generateRadioCheckboxStyles(e),t+=this.generateMessageStyles(e)}},{key:"generateContainerStyles",value:function(e){var t="",n=this.baseSelector,o=[];if("gradient"===e.backgroundType&&e.gradientColor1&&e.gradientColor2){var r=e.gradientType||"linear",l=e.gradientAngle||90;"linear"===r?o.push("background: linear-gradient(".concat(l,"deg, ").concat(e.gradientColor1,", ").concat(e.gradientColor2,")")):o.push("background: radial-gradient(circle, ".concat(e.gradientColor1,", ").concat(e.gradientColor2,")"))}else e.backgroundColor&&o.push("background-color: ".concat(e.backgroundColor));if("classic"===e.backgroundType&&e.backgroundImage&&(o.push("background-image: url(".concat(e.backgroundImage,")")),e.backgroundSize&&o.push("background-size: ".concat(e.backgroundSize)),e.backgroundPosition&&o.push("background-position: ".concat(e.backgroundPosition)),e.backgroundRepeat&&o.push("background-repeat: ".concat(e.backgroundRepeat))),e.containerPadding&&(t+=this.generateSpacingWithResponsive(e.containerPadding,"padding",n)),e.containerMargin&&(t+=this.generateSpacingWithResponsive(e.containerMargin,"margin",n)),e.containerBoxShadow&&e.containerBoxShadow.enable){var a=this.generateBoxShadow(e.containerBoxShadow);a&&o.push("box-shadow: ".concat(a))}return o.length>0&&(t+="".concat(n," { ").concat(o.join("; "),"; }\n")),e.formBorder&&(t+=this.generateBorder(e.formBorder,n)),t}},{key:"generateLabelStyles",value:function(e){var t="",n="".concat(this.baseSelector," .ff-el-input--label label"),o=[];if(e.labelColor&&o.push("color: ".concat(e.labelColor)),e.labelTypography){var r=this.generateTypography(e.labelTypography);r&&o.push(r)}return o.length>0&&(t+="".concat(n," { ").concat(o.join("; "),"; }\n")),t}},{key:"generateInputStyles",value:function(e){var t="",n=["".concat(this.baseSelector," .ff-el-form-control"),"".concat(this.baseSelector," .ff-el-input--content input"),"".concat(this.baseSelector," .ff-el-input--content textarea"),"".concat(this.baseSelector," .ff-el-input--content select")],o=n.join(", "),r=[];if(e.inputTextColor&&r.push("color: ".concat(e.inputTextColor)),e.inputBackgroundColor&&r.push("background-color: ".concat(e.inputBackgroundColor)),e.inputTypography){var l=this.generateTypography(e.inputTypography);l&&r.push(l)}if(e.inputSpacing&&(t+=this.generateSpacingWithResponsive(e.inputSpacing,"padding",o)),e.inputBoxShadow&&e.inputBoxShadow.enable){var a=this.generateBoxShadow(e.inputBoxShadow);a&&r.push("box-shadow: ".concat(a))}r.length>0&&(t+="".concat(o," { ").concat(r.join("; "),"; }\n")),e.inputBorder&&(t+=this.generateBorder(e.inputBorder,o));var i=[],u=n.map(function(e){return"".concat(e,":focus")}).join(", ");if(e.inputTextFocusColor&&i.push("color: ".concat(e.inputTextFocusColor)),e.inputBackgroundFocusColor&&i.push("background-color: ".concat(e.inputBackgroundFocusColor)),e.inputFocusSpacing&&(t+=this.generateSpacingWithResponsive(e.inputFocusSpacing,"padding",u)),e.inputBoxShadowFocus&&e.inputBoxShadowFocus.enable){var c=this.generateBoxShadow(e.inputBoxShadowFocus);c&&i.push("box-shadow: ".concat(c))}return i.length>0&&(t+="".concat(u," { ").concat(i.join("; "),"; }\n")),e.inputBorderFocus&&(t+=this.generateBorder(e.inputBorderFocus,u)),t}},{key:"generatePlaceholderStyles",value:function(e){var t="";if(e.placeholderColor){var n=["".concat(this.baseSelector," .ff-el-input--content input::placeholder"),"".concat(this.baseSelector," .ff-el-input--content textarea::placeholder")];t+="".concat(n.join(", ")," { color: ").concat(e.placeholderColor,"; }\n")}if(e.placeholderTypography){var o=this.generateTypography(e.placeholderTypography);if(o){var r=["".concat(this.baseSelector," .ff-el-input--content input::placeholder"),"".concat(this.baseSelector," .ff-el-input--content textarea::placeholder")];t+="".concat(r.join(", ")," { ").concat(o,"; }\n")}}return t}},{key:"generateButtonStyles",value:function(e){var t="",n="".concat(this.baseSelector," .ff_submit_btn_wrapper .ff-btn-submit");e.buttonAlignment&&"left"!==e.buttonAlignment&&(t+="".concat(this.baseSelector," .ff_submit_btn_wrapper { text-align: ").concat(e.buttonAlignment,"; }\n"));var o=[];if(e.buttonWidth&&o.push("width: ".concat(e.buttonWidth,"%")),e.buttonColor&&o.push("color: ".concat(e.buttonColor)),e.buttonBGColor&&o.push("background-color: ".concat(e.buttonBGColor)),e.buttonTypography){var r=this.generateTypography(e.buttonTypography);r&&o.push(r)}if(e.buttonPadding&&(t+=this.generateSpacingWithResponsive(e.buttonPadding,"padding",n)),e.buttonMargin&&(t+=this.generateSpacingWithResponsive(e.buttonMargin,"margin",n)),e.buttonBoxShadow&&e.buttonBoxShadow.enable){var l=this.generateBoxShadow(e.buttonBoxShadow);l&&o.push("box-shadow: ".concat(l))}o.length>0&&(t+="".concat(n," { ").concat(o.join("; "),"; }\n")),e.buttonBorder&&(t+=this.generateBorder(e.buttonBorder,n));var a=[],i="".concat(n,":hover");if(e.buttonHoverColor&&a.push("color: ".concat(e.buttonHoverColor)),e.buttonHoverBGColor&&a.push("background-color: ".concat(e.buttonHoverBGColor)),e.buttonHoverTypography){var u=this.generateTypography(e.buttonHoverTypography);u&&a.push(u)}if(e.buttonHoverPadding&&(t+=this.generateSpacingWithResponsive(e.buttonHoverPadding,"padding",i)),e.buttonHoverMargin&&(t+=this.generateSpacingWithResponsive(e.buttonHoverMargin,"margin",i)),e.buttonHoverBoxShadow&&e.buttonHoverBoxShadow.enable){var c=this.generateBoxShadow(e.buttonHoverBoxShadow);c&&a.push("box-shadow: ".concat(c))}return a.length>0&&(t+="".concat(i," { ").concat(a.join("; "),"; }\n")),e.buttonHoverBorder&&(t+=this.generateBorder(e.buttonHoverBorder,i)),t}},{key:"generateRadioCheckboxStyles",value:function(e){var t="",n=[];return e.radioCheckboxItemsColor&&n.push("color: ".concat(e.radioCheckboxItemsColor)),e.radioCheckboxItemsSize&&n.push("font-size: ".concat(e.radioCheckboxItemsSize,"px;")),n.length>0&&(t+="".concat(this.baseSelector," .ff-el-form-check label { ").concat(n.join("; "),"; }\n")),t}},{key:"generateMessageStyles",value:function(e){var t="";return e.successMessageColor&&(t+="".concat(this.baseSelector," .ff-message-success { color: ").concat(e.successMessageColor,"; }\n")),e.successMessageBgColor&&(t+="".concat(this.baseSelector," .ff-message-success { background-color: ").concat(e.successMessageBgColor,"; }\n")),e.successMessageAlignment&&"left"!==e.successMessageAlignment&&(t+="".concat(this.baseSelector," .ff-message-success { text-align: ").concat(e.successMessageAlignment,"; }\n")),e.errorMessageColor&&(t+="".concat(this.baseSelector," .ff-errors-in-stack, ").concat(this.baseSelector," .error { color: ").concat(e.errorMessageColor,"; }\n")),e.errorMessageBgColor&&(t+="".concat(this.baseSelector," .ff-errors-in-stack, ").concat(this.baseSelector," .error { background-color: ").concat(e.errorMessageBgColor,"; }\n")),e.errorMessageAlignment&&"left"!==e.errorMessageAlignment&&(t+="".concat(this.baseSelector," .ff-errors-in-stack, ").concat(this.baseSelector," .error { text-align: ").concat(e.errorMessageAlignment,"; }\n")),e.submitErrorMessageColor&&(t+="".concat(this.baseSelector," .ff-submit-error { color: ").concat(e.submitErrorMessageColor,"; }\n")),e.submitErrorMessageBgColor&&(t+="".concat(this.baseSelector," .ff-submit-error { background-color: ").concat(e.submitErrorMessageBgColor,"; }\n")),e.submitErrorMessageAlignment&&"left"!==e.submitErrorMessageAlignment&&(t+="".concat(this.baseSelector," .ff-submit-error { text-align: ").concat(e.submitErrorMessageAlignment,"; }\n")),e.asteriskColor&&(t+="".concat(this.baseSelector," .asterisk-right label:after, ").concat(this.baseSelector," .asterisk-left label:before { color: ").concat(e.asteriskColor,"; }\n")),t}},{key:"generateTypography",value:function(e){if(!e)return"";var t=[];return e.fontSize&&t.push("font-size: ".concat(e.fontSize,"px")),e.fontWeight&&t.push("font-weight: ".concat(e.fontWeight)),e.lineHeight&&t.push("line-height: ".concat(e.lineHeight)),e.letterSpacing&&t.push("letter-spacing: ".concat(e.letterSpacing,"px")),e.textTransform&&t.push("text-transform: ".concat(e.textTransform)),t.join("; ")}},{key:"generateBorder",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(!e||!e.enable||!e.color)return"";var n="",o=[];if(e.type&&o.push("border-style: ".concat(e.type)),e.color&&o.push("border-color: ".concat(e.color)),e.width&&e.width.desktop){var r=this.generateBorderWidth(e.width.desktop);r&&o.push(r)}if(e.radius&&e.radius.desktop){var l=this.generateBorderRadius(e.radius.desktop);l&&o.push(l)}if(!t)return o.join("; ");if(o.length>0&&(n+="".concat(t," { ").concat(o.join("; "),"; }\n")),e.width&&e.width.tablet&&e.width.desktop&&!this.areSpacingValuesEqual(e.width.desktop,e.width.tablet)){var a=this.generateBorderWidth(e.width.tablet);a&&(n+="@media (max-width: ".concat(this.TABLET_BREAKPOINT,") { ").concat(t," { ").concat(a,"; } }\n"))}if(e.radius&&e.radius.tablet&&e.radius.desktop&&!this.areSpacingValuesEqual(e.radius.desktop,e.radius.tablet)){var i=this.generateBorderRadius(e.radius.tablet);i&&(n+="@media (max-width: ".concat(this.TABLET_BREAKPOINT,") { ").concat(t," { ").concat(i,"; } }\n"))}if(e.width&&e.width.mobile&&e.width.desktop&&!this.areSpacingValuesEqual(e.width.desktop,e.width.mobile)){var u=this.generateBorderWidth(e.width.mobile);u&&(n+="@media (max-width: ".concat(this.MOBILE_BREAKPOINT,") { ").concat(t," { ").concat(u,"; } }\n"))}if(e.radius&&e.radius.mobile&&e.radius.desktop&&!this.areSpacingValuesEqual(e.radius.desktop,e.radius.mobile)){var c=this.generateBorderRadius(e.radius.mobile);c&&(n+="@media (max-width: ".concat(this.MOBILE_BREAKPOINT,") { ").concat(t," { ").concat(c,"; } }\n"))}return n}},{key:"generateBorderWidth",value:function(e){if(!e)return"";var t=e.unit||"px";if(e.linked&&void 0!==e.top&&""!==e.top)return"border-width: ".concat(e.top).concat(t);var n=[];return void 0!==e.top&&""!==e.top&&n.push("border-top-width: ".concat(e.top).concat(t)),void 0!==e.right&&""!==e.right&&n.push("border-right-width: ".concat(e.right).concat(t)),void 0!==e.bottom&&""!==e.bottom&&n.push("border-bottom-width: ".concat(e.bottom).concat(t)),void 0!==e.left&&""!==e.left&&n.push("border-left-width: ".concat(e.left).concat(t)),n.join("; ")}},{key:"generateBorderRadius",value:function(e){if(!e)return"";var t=e.unit||"px";if(e.linked&&void 0!==e.top&&""!==e.top)return"border-radius: ".concat(e.top).concat(t);var n=[];return void 0!==e.top&&""!==e.top&&n.push("border-top-left-radius: ".concat(e.top).concat(t)),void 0!==e.right&&""!==e.right&&n.push("border-top-right-radius: ".concat(e.right).concat(t)),void 0!==e.bottom&&""!==e.bottom&&n.push("border-bottom-right-radius: ".concat(e.bottom).concat(t)),void 0!==e.left&&""!==e.left&&n.push("border-bottom-left-radius: ".concat(e.left).concat(t)),n.join("; ")}},{key:"generateSpacingWithResponsive",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"padding",n=arguments.length>2?arguments[2]:void 0;if(!e||!n||Array.isArray(e)&&0===e.length||"object"===u(e)&&0===Object.keys(e).length)return"";var o="";if(e.desktop){var r=this.getSpacingRules(e.desktop,t);r.length>0&&(o+="".concat(n," { ").concat(r.join("; "),"; }\n"))}if(e.tablet&&e.desktop&&!this.areSpacingValuesEqual(e.desktop,e.tablet)){var l=this.getSpacingRules(e.tablet,t);l.length>0&&(o+="@media (max-width: ".concat(this.TABLET_BREAKPOINT,") { ").concat(n," { ").concat(l.join("; "),"; } }\n"))}if(e.mobile&&e.desktop&&!this.areSpacingValuesEqual(e.desktop,e.mobile)){var a=this.getSpacingRules(e.mobile,t);a.length>0&&(o+="@media (max-width: ".concat(this.MOBILE_BREAKPOINT,") { ").concat(n," { ").concat(a.join("; "),"; } }\n"))}return o}},{key:"getSpacingRules",value:function(e,t){if(!e)return[];var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:null)||e.unit||"px",o=[];return e.linked&&void 0!==e.top&&""!==e.top?o.push("".concat(t,": ").concat(e.top).concat(n)):(void 0!==e.top&&""!==e.top&&o.push("".concat(t,"-top: ").concat(e.top).concat(n)),void 0!==e.right&&""!==e.right&&o.push("".concat(t,"-right: ").concat(e.right).concat(n)),void 0!==e.bottom&&""!==e.bottom&&o.push("".concat(t,"-bottom: ").concat(e.bottom).concat(n)),void 0!==e.left&&""!==e.left&&o.push("".concat(t,"-left: ").concat(e.left).concat(n))),o}},{key:"generateBoxShadow",value:function(e){var t,n,o,r,l,a,i,u;if(!e||!e.enable||!e.color)return"";var c="inset"===e.position?"inset ":"",s="".concat((null===(t=e.horizontal)||void 0===t?void 0:t.value)||"0").concat((null===(n=e.horizontal)||void 0===n?void 0:n.unit)||"px"),f="".concat((null===(o=e.vertical)||void 0===o?void 0:o.value)||"0").concat((null===(r=e.vertical)||void 0===r?void 0:r.unit)||"px"),d="".concat((null===(l=e.blur)||void 0===l?void 0:l.value)||"5").concat((null===(a=e.blur)||void 0===a?void 0:a.unit)||"px"),p="".concat((null===(i=e.spread)||void 0===i?void 0:i.value)||"0").concat((null===(u=e.spread)||void 0===u?void 0:u.unit)||"px");return"".concat(c).concat(s," ").concat(f," ").concat(d," ").concat(p," ").concat(e.color)}},{key:"areSpacingValuesEqual",value:function(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;if(e.unit!==t.unit)return!1;if(t.linked){var n=t.top||"";if(""===n)return!0;if(e.linked)return(e.top||"")===n;for(var o=0,r=["top","right","bottom","left"];o<r.length;o++){var l=e[r[o]]||"";if(""!==l&&l!==n)return!1}return!0}for(var a=0,i=["top","right","bottom","left"];a<i.length;a++){var u=i[a],c=e.linked?e.top||"":e[u]||"",s=t[u]||"";if(""!==s&&c!==s)return!1}return!0}}],t&&c(e.prototype,t),n&&c(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();var d=wp.i18n.__,p=wp.components,b=p.PanelBody,h=p.SelectControl;const g=(0,wp.element.memo)(function(e){var t=e.attributes,n=e.handlePresetChange,o=window.fluentform_block_vars.style_presets;return(0,a.jsx)(b,{title:d("Form Style Template"),initialOpen:!0,children:(0,a.jsx)(h,{label:d("Choose a Template"),value:t.themeStyle,options:o,onChange:function(e){return n(e)}})})},function(e,t){return e.attributes.themeStyle===t.attributes.themeStyle});function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){x(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=m(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=m(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==m(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=l.call(n)).done)&&(i.push(o.value),i.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return S(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?S(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var j=wp.components,C=j.Button,w=j.Flex,B=j.Popover,O=j.FontSizePicker,T=j.SelectControl,P=j.RangeControl,_=wp.element,A=_.useState,E=_.useEffect,N=_.useMemo;const I=(0,_.memo)(function(e){var t=e.label,n=e.typography,o=void 0===n?{}:n,r=e.onChange,l=k(A(!1),2),i=l[0],u=l[1],c=k(A({fontSize:"",fontWeight:"",lineHeight:"",letterSpacing:"",textTransform:""}),2),s=c[0],f=c[1];E(function(){f({fontSize:(null==o?void 0:o.fontSize)||"",fontWeight:(null==o?void 0:o.fontWeight)||"",lineHeight:(null==o?void 0:o.lineHeight)||"",letterSpacing:(null==o?void 0:o.letterSpacing)||"",textTransform:(null==o?void 0:o.textTransform)||""})},[o]);var d=function(){return u(!i)},p=function(e){var t=y(y({},o),e);r(t)},b=N(function(){return""!==s.fontSize&&null!=s.fontSize||""!==s.fontWeight&&null!=s.fontWeight||""!==s.lineHeight&&null!=s.lineHeight||""!==s.letterSpacing&&null!=s.letterSpacing||""!==s.textTransform&&null!=s.textTransform},[s]);return(0,a.jsxs)("div",{className:"ffblock-control-field ffblock-control-typography-wrap",children:[(0,a.jsxs)(w,{align:"center",justify:"space-between",children:[(0,a.jsx)("span",{className:"ffblock-label",children:t}),(0,a.jsxs)("div",{className:"ffblock-flex-gap",children:[b&&(0,a.jsx)(C,{icon:"image-rotate",isSmall:!0,onClick:function(){r({}),i&&u(!1)},label:"Reset to default",className:"ffblock-reset-button"}),(0,a.jsx)(C,{icon:"edit",isSmall:!0,onClick:d,className:"fluent-typography-edit-btn"})]})]}),i&&(0,a.jsx)(B,{className:"fluent-typography-popover",onClose:d,position:"bottom center",children:(0,a.jsxs)("div",{className:"ffblock-popover-content",children:[(0,a.jsx)(O,{fontSizes:[{name:"Small",slug:"small",size:12},{name:"Medium",slug:"medium",size:16},{name:"Large",slug:"large",size:24},{name:"Extra Large",slug:"x-large",size:32}],value:s.fontSize,onChange:function(e){return p({fontSize:e})},withSlider:!0}),(0,a.jsx)(T,{label:"Font Weight",value:s.fontWeight,options:[{value:"",label:"Select"},{value:"300",label:"Light (300)"},{value:"400",label:"Regular (400)"},{value:"500",label:"Medium (500)"},{value:"600",label:"Semi Bold (600)"},{value:"700",label:"Bold (700)"},{value:"800",label:"Extra Bold (800)"}],onChange:function(e){return p({fontWeight:e})}}),(0,a.jsx)(P,{label:"Line Height",value:s.lineHeight,onChange:function(e){return p({lineHeight:e})},min:.5,max:3,step:.1}),(0,a.jsx)(P,{label:"Letter Spacing (px)",value:s.letterSpacing,onChange:function(e){return p({letterSpacing:e})},min:-5,max:10,step:.1}),(0,a.jsx)(T,{label:"Text Transform",value:s.textTransform,options:[{value:"",label:"Select"},{value:"none",label:"None"},{value:"capitalize",label:"Capitalize"},{value:"uppercase",label:"UPPERCASE"},{value:"lowercase",label:"lowercase"}],onChange:function(e){return p({textTransform:e})}})]})},"typo-popover")]})},function(e,t){return l(e,t,["label","typography"])});function R(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=l.call(n)).done)&&(i.push(o.value),i.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return M(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?M(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var F=wp.components,H=F.Button,z=F.Flex,D=F.Popover,L=F.ColorPalette,W=wp.element,$=W.useState,U=W.useRef,G=W.useEffect;const V=(0,W.memo)(function(e){var t=e.label,n=e.value,o=e.onChange,r=e.defaultColor,l=void 0===r?"":r,i=R($(!1),2),u=i[0],c=i[1],s=R($(n||l),2),f=s[0],d=s[1],p=R($(!1),2),b=p[0],h=(p[1],R($(!1),2)),g=h[0],m=h[1],v=U(null),y=U(null),x=U(null);G(function(){d(n||"")},[n]),G(function(){m(f!==l&&null!=f)},[f,l]);return G(function(){if(u){var e=function(e){e.target.closest(".components-color-picker, .components-color-palette")||y.current&&!y.current.contains(e.target)&&x.current&&!x.current.contains(e.target)&&c(!1)};return document.addEventListener("mousedown",e,!0),function(){document.removeEventListener("mousedown",e,!0)}}},[u]),(0,a.jsxs)("div",{className:"ffblock-control-field ffblock-control-color-wrap",ref:v,children:[(0,a.jsxs)(z,{align:"center",justify:"space-between",children:[(0,a.jsx)("span",{className:"ffblock-label",children:t}),(0,a.jsxs)("div",{className:"ffblock-flex-gap",children:[g&&(0,a.jsx)(H,{icon:"image-rotate",isSmall:!0,onClick:function(){d(l),o(l)},label:"Reset to default",className:"ffblock-reset-button"}),(0,a.jsx)("div",{className:"ffblock-color-button",onClick:function(e){e.stopPropagation(),c(!u)},ref:y,children:(0,a.jsx)("div",{className:"ffblock-color-swatch ".concat(b?"ffblock-color-transparent-pattern":""),style:{backgroundColor:f||"transparent"},title:f||"transparent"})})]})]}),u&&(0,a.jsx)(D,{onClose:function(){},anchor:y.current,focusOnMount:!1,noArrow:!1,position:"middle right",expandOnMobile:!0,className:"ffblock-color-popover",offset:16,flip:!0,resize:!0,__unstableSlotName:"ffblock-popover-content",children:(0,a.jsxs)("div",{className:"ffblock-popover-content",ref:x,children:[(0,a.jsxs)("div",{className:"ffblock-color-picker-header",children:[(0,a.jsx)("span",{children:"Select Color"}),(0,a.jsx)(H,{className:"ffblock-color-picker-close",onClick:function(){return c(!1)},icon:"no-alt",isSmall:!0,label:"Close"})]}),(0,a.jsx)(L,{colors:[{name:"Theme Blue",color:"#72aee6"},{name:"Theme Red",color:"#e65054"},{name:"Theme Green",color:"#68de7c"},{name:"Black",color:"#000000"},{name:"White",color:"#ffffff"},{name:"Gray",color:"#dddddd"}],value:f,onChange:function(e){d(e),o(e)},enableAlpha:!0,clearable:!0})]})})]})},function(e,t){return l(e,t,["label","value","defaultColor"])});var q=wp.element.memo,K=wp.i18n.__,J=wp.components.PanelBody;const Z=q(function(e){var t=e.styles,n=e.updateStyles;return(0,a.jsxs)(J,{title:K("Label Styles"),initialOpen:!1,children:[(0,a.jsx)(V,{label:"Color",value:t.labelColor,onChange:function(e){return n({labelColor:e})},defaultColor:""}),(0,a.jsx)(I,{label:"Typography",typography:t.labelTypography||{},onChange:function(e){return n({labelTypography:e})}})]})},function(e,t){return r(e.styles,t.styles,["labelColor","labelTypography"])});function Y(e){return Y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Y(e)}function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function Q(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?X(Object(n),!0).forEach(function(t){ee(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ee(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Y(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Y(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Y(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function te(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=l.call(n)).done)&&(i.push(o.value),i.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ne(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ne(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ne(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var oe=wp.components,re=oe.Button,le=oe.ButtonGroup,ae=oe.TextControl,ie=oe.Tooltip,ue=oe.DropdownMenu,ce=wp.element,se=ce.useState,fe=ce.useEffect,de=ce.memo,pe=wp.i18n.__;const be=de(function(e){var t=e.label,n=e.values,o=e.onChange,r=e.units,l=void 0===r?[{value:"px",key:"px-unit"},{value:"em",key:"em-unit"},{value:"%",key:"percent-unit"}]:r,i=e.showPresetsToggle,u=void 0===i||i,c=e.presetType,s=void 0===c?"spacing":c,f=te(se("desktop"),2),d=f[0],p=f[1],b=!n||!n[d]||void 0===n[d].linked||n[d].linked,h=te(se(b),2),g=h[0],m=h[1],v=te(se("px"),2),y=v[0],x=v[1],k=te(se(!1),2),S=k[0],j=k[1],C=te(se({}),2),w=C[0],B=C[1],O=te(se(!1),2),T=O[0],P=O[1];fe(function(){if(n){var e,t,o,r,l,a,i,u,c,s,f,p,b,h,g,v,y,k,S,C,w,O,T,P,A,E,N,I,R,M,F,H,z={desktop:{unit:(null===(e=n.desktop)||void 0===e?void 0:e.unit)||n.unit||"px",top:null!==(t=null===(o=n.desktop)||void 0===o?void 0:o.top)&&void 0!==t?t:"",right:null!==(r=null===(l=n.desktop)||void 0===l?void 0:l.right)&&void 0!==r?r:"",bottom:null!==(a=null===(i=n.desktop)||void 0===i?void 0:i.bottom)&&void 0!==a?a:"",left:null!==(u=null===(c=n.desktop)||void 0===c?void 0:c.left)&&void 0!==u?u:"",linked:void 0===(null===(s=n.desktop)||void 0===s?void 0:s.linked)||n.desktop.linked},tablet:{unit:null!==(f=null===(p=n.tablet)||void 0===p?void 0:p.unit)&&void 0!==f?f:n.unit||"px",top:null!==(b=null===(h=n.tablet)||void 0===h?void 0:h.top)&&void 0!==b?b:"",right:null!==(g=null===(v=n.tablet)||void 0===v?void 0:v.right)&&void 0!==g?g:"",bottom:null!==(y=null===(k=n.tablet)||void 0===k?void 0:k.bottom)&&void 0!==y?y:"",left:null!==(S=null===(C=n.tablet)||void 0===C?void 0:C.left)&&void 0!==S?S:"",linked:void 0===(null===(w=n.tablet)||void 0===w?void 0:w.linked)||n.tablet.linked},mobile:{unit:null!==(O=null===(T=n.mobile)||void 0===T?void 0:T.unit)&&void 0!==O?O:n.unit||"px",top:null!==(P=null===(A=n.mobile)||void 0===A?void 0:A.top)&&void 0!==P?P:"",right:null!==(E=null===(N=n.mobile)||void 0===N?void 0:N.right)&&void 0!==E?E:"",bottom:null!==(I=null===(R=n.mobile)||void 0===R?void 0:R.bottom)&&void 0!==I?I:"",left:null!==(M=null===(F=n.mobile)||void 0===F?void 0:F.left)&&void 0!==M?M:"",linked:void 0===(null===(H=n.mobile)||void 0===H?void 0:H.linked)||n.mobile.linked}};B(z),m(!1!==z[d].linked),x(z[d].unit||"px"),j(_(z))}},[n,d]);var _=function(e){for(var t=0,n=["desktop","tablet","mobile"];t<n.length;t++){var o=n[t];if(e[o]){var r=e[o];if(""!==r.top||""!==r.right||""!==r.bottom||""!==r.left)return!0}}return!1};fe(function(){w[d]&&(m(!1!==w[d].linked),x(w[d].unit||"px"),j(_(w)))},[d,w]);var A=function(e,t){var n=""===t?"":"em"===y||"%"===y?parseFloat(t):parseInt(t);if(""!==t)j(!0);else{var r=Q({},w),l=Q({},r[d]);l[e]=n,r[d]=l,j(_(r))}if(g){var a=Q({},w),i=Q({},a[d]);i.top=n,i.right=n,i.bottom=n,i.left=n,i.linked=!0,a[d]=i,B(a),o&&o(a)}else{var u=Q({},w),c=Q({},u[d]);c[e]=n,c.linked=g,u[d]=c,B(u),o&&o(u)}},E=w[d]||{desktop:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},tablet:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},mobile:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0}}[d],N=[{label:pe("None"),value:{desktop:{unit:"px",top:"0",right:"0",bottom:"0",left:"0",linked:!0},tablet:{unit:"px",top:"0",right:"0",bottom:"0",left:"0",linked:!0},mobile:{unit:"px",top:"0",right:"0",bottom:"0",left:"0",linked:!0}}},{label:pe("Small"),value:{desktop:{unit:"px",top:"10",right:"10",bottom:"10",left:"10",linked:!0},tablet:{unit:"px",top:"8",right:"8",bottom:"8",left:"8",linked:!0},mobile:{unit:"px",top:"5",right:"5",bottom:"5",left:"5",linked:!0}}},{label:pe("Medium"),value:{desktop:{unit:"px",top:"20",right:"20",bottom:"20",left:"20",linked:!0},tablet:{unit:"px",top:"15",right:"15",bottom:"15",left:"15",linked:!0},mobile:{unit:"px",top:"10",right:"10",bottom:"10",left:"10",linked:!0}}},{label:pe("Large"),value:{desktop:{unit:"px",top:"30",right:"30",bottom:"30",left:"30",linked:!0},tablet:{unit:"px",top:"25",right:"25",bottom:"25",left:"25",linked:!0},mobile:{unit:"px",top:"20",right:"20",bottom:"20",left:"20",linked:!0}}},{label:pe("Custom V"),value:{desktop:{unit:"px",top:"20",right:"0",bottom:"20",left:"0",linked:!1},tablet:{unit:"px",top:"15",right:"0",bottom:"15",left:"0",linked:!1},mobile:{unit:"px",top:"10",right:"0",bottom:"10",left:"0",linked:!1}}},{label:pe("Custom H"),value:{desktop:{unit:"px",top:"0",right:"20",bottom:"0",left:"20",linked:!1},tablet:{unit:"px",top:"0",right:"15",bottom:"0",left:"15",linked:!1},mobile:{unit:"px",top:"0",right:"10",bottom:"0",left:"10",linked:!1}}}],I=[{label:pe("None"),value:{desktop:{unit:"px",top:"0",right:"0",bottom:"0",left:"0",linked:!0},tablet:{unit:"px",top:"0",right:"0",bottom:"0",left:"0",linked:!0},mobile:{unit:"px",top:"0",right:"0",bottom:"0",left:"0",linked:!0}}},{label:pe("Small"),value:{desktop:{unit:"px",top:"3",right:"3",bottom:"3",left:"3",linked:!0},tablet:{unit:"px",top:"3",right:"3",bottom:"3",left:"3",linked:!0},mobile:{unit:"px",top:"3",right:"3",bottom:"3",left:"3",linked:!0}}},{label:pe("Medium"),value:{desktop:{unit:"px",top:"5",right:"5",bottom:"5",left:"5",linked:!0},tablet:{unit:"px",top:"5",right:"5",bottom:"5",left:"5",linked:!0},mobile:{unit:"px",top:"5",right:"5",bottom:"5",left:"5",linked:!0}}},{label:pe("Large"),value:{desktop:{unit:"px",top:"10",right:"10",bottom:"10",left:"10",linked:!0},tablet:{unit:"px",top:"10",right:"10",bottom:"10",left:"10",linked:!0},mobile:{unit:"px",top:"10",right:"10",bottom:"10",left:"10",linked:!0}}},{label:pe("Rounded"),value:{desktop:{unit:"px",top:"15",right:"15",bottom:"15",left:"15",linked:!0},tablet:{unit:"px",top:"15",right:"15",bottom:"15",left:"15",linked:!0},mobile:{unit:"px",top:"15",right:"15",bottom:"15",left:"15",linked:!0}}},{label:pe("Pill"),value:{desktop:{unit:"px",top:"50",right:"50",bottom:"50",left:"50",linked:!0},tablet:{unit:"px",top:"50",right:"50",bottom:"50",left:"50",linked:!0},mobile:{unit:"px",top:"50",right:"50",bottom:"50",left:"50",linked:!0}}}],R="radius"===s?I:N;return(0,a.jsxs)("div",{className:"ffblock-control-field ffblock-control-space",children:[(0,a.jsxs)("div",{className:"ffblock-space-header",children:[(0,a.jsx)("div",{className:"ffblock-label-container",children:(0,a.jsx)("span",{className:"ffblock-label",children:t})}),(0,a.jsxs)("div",{className:"ffblock-header-actions",children:[u&&(0,a.jsx)(re,{icon:"grid-view",isSmall:!0,onClick:function(){return P(!T)},className:"ffblock-preset-toggle",label:pe("radius"===s?"Border Radius Presets":"Spacing Presets")}),S&&(0,a.jsx)(ie,{text:pe("Reset spacing values"),children:(0,a.jsx)(re,{onClick:function(){m(!0),x("px"),j(!1);var e={desktop:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},tablet:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},mobile:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0}};B(e),o&&o(e)},className:"ffblock-reset-button",icon:"image-rotate",isSmall:!0})})]})]}),u&&T&&(0,a.jsx)("div",{className:"ffblock-presets-container",children:(0,a.jsx)("div",{className:"ffblock-presets-grid",children:R.map(function(e,t){return(0,a.jsxs)(re,{className:"ffblock-preset-button ".concat("radius"===s?"":"ffblock-preset-text-only"),onClick:function(){return function(e){B(e.value),m(e.value[d].linked),x(e.value[d].unit),j(!0),o&&o(e.value),P(!1)}(e)},children:["radius"===s&&(0,a.jsx)("div",{className:"ffblock-preset-preview ffblock-radius-preview",children:(0,a.jsx)("div",{className:"ffblock-radius-box",style:{border:"2px solid #dddddd",borderRadius:"".concat(e.value.desktop.top||0,"px")}})}),(0,a.jsx)("span",{className:"ffblock-preset-label",children:e.label})]},t)})})}),(0,a.jsx)("div",{className:"ffblock-space-body",children:(0,a.jsxs)("div",{className:"ffblock-space-controls",children:[(0,a.jsx)("div",{className:"ffblock-device-selector",children:(0,a.jsx)(ue,{className:"ffblock-device-dropdown",icon:"desktop"===d?"desktop":"tablet"===d?"tablet":"smartphone",label:pe("Select device"),controls:[{value:"desktop",label:pe("Desktop"),icon:"desktop"},{value:"tablet",label:pe("Tablet"),icon:"tablet"},{value:"mobile",label:pe("Mobile"),icon:"smartphone"}].map(function(e){return{title:e.label,icon:e.icon,isActive:d===e.value,onClick:function(){p(e.value),w[e.value]&&m(!1!==w[e.value].linked)}}})})}),(0,a.jsx)("div",{className:"ffblock-unit-selector",children:(0,a.jsx)(le,{children:l.map(function(e){return(0,a.jsx)(re,{isSmall:!0,isPrimary:y===e.value,onClick:function(){return function(e){x(e);var t=Q(Q({},w),{},ee({},d,Q(Q({},w[d]),{},{unit:e})));o(t)}(e.value)},children:e.value.toUpperCase()},e.key)})})})]})}),(0,a.jsx)("div",{className:"ffblock-space-inputs device-".concat(d),children:(0,a.jsxs)("div",{className:"ffblock-space-input-row",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)(ae,{type:"number",value:E.top,onChange:function(e){return A("top",e)},min:0,step:"em"===y||"%"===y?.1:1}),(0,a.jsx)("span",{children:"TOP"},"label-top")]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(ae,{type:"number",value:E.right,onChange:function(e){return A("right",e)},min:0,step:"em"===y||"%"===y?.1:1}),(0,a.jsx)("span",{children:"RIGHT"},"label-right")]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(ae,{type:"number",value:E.bottom,onChange:function(e){return A("bottom",e)},min:0,step:"em"===y||"%"===y?.1:1}),(0,a.jsx)("span",{children:"BOTTOM"},"label-bottom")]}),(0,a.jsxs)("div",{children:[(0,a.jsx)(ae,{type:"number",value:E.left,onChange:function(e){return A("left",e)},min:0,step:"em"===y||"%"===y?.1:1}),(0,a.jsx)("span",{children:"LEFT"},"label-left")]}),(0,a.jsx)(re,{icon:g?"admin-links":"editor-unlink",onClick:function(){var e=!g;m(e);var t=Q(Q({},w),{},ee({},d,Q(Q({},w[d]),{},{linked:e})));o(t)},className:"ffblock-linked-button"})]})})]})},function(e,t){return l(e,t,["label","values","units"])});function he(e){return he="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(e)}function ge(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function me(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ge(Object(n),!0).forEach(function(t){ve(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ge(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ve(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=he(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=he(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==he(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ye(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=l.call(n)).done)&&(i.push(o.value),i.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return xe(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?xe(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function xe(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var ke=wp.components,Se=ke.BaseControl,je=ke.ToggleControl,Ce=ke.SelectControl,we=ke.Button,Be=wp.element,Oe=Be.useEffect,Te=Be.memo,Pe=Be.useCallback,_e=Be.useRef,Ae=Be.useState,Ee=wp.i18n.__;const Ne=Te(function(e){var t=e.label,n=void 0===t?Ee("Border"):t,o=e.border,r=void 0===o?{}:o,l=e.onChange,i=e.defaultColor,u=void 0===i?"#dddddd":i,c=ye(Ae(!1),2),s=c[0],f=c[1],d=_e(r||{enable:!1,type:"solid",color:"",width:{},radius:{}});Oe(function(){d.current=r||d.current},[r]);var p=Pe(function(e){var t=me(me({},d.current),e);d.current=t,l&&l(t)},[d,l]),b=[{label:Ee("Solid"),value:"solid"},{label:Ee("Dashed"),value:"dashed"},{label:Ee("Dotted"),value:"dotted"},{label:Ee("Double"),value:"double"}],h=[{label:Ee("None"),value:{enable:!1,type:"solid",color:"",width:{desktop:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},tablet:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},mobile:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0}},radius:{desktop:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},tablet:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},mobile:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0}}}},{label:Ee("Thin"),value:{enable:!0,type:"solid",color:"#dddddd",width:{desktop:{unit:"px",top:"1",right:"1",bottom:"1",left:"1",linked:!0},tablet:{unit:"px",top:"1",right:"1",bottom:"1",left:"1",linked:!0},mobile:{unit:"px",top:"1",right:"1",bottom:"1",left:"1",linked:!0}},radius:{desktop:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},tablet:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},mobile:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0}}}},{label:Ee("Medium"),value:{enable:!0,type:"solid",color:"#dddddd",width:{desktop:{unit:"px",top:"2",right:"2",bottom:"2",left:"2",linked:!0},tablet:{unit:"px",top:"2",right:"2",bottom:"2",left:"2",linked:!0},mobile:{unit:"px",top:"2",right:"2",bottom:"2",left:"2",linked:!0}},radius:{desktop:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},tablet:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},mobile:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0}}}},{label:Ee("Rounded"),value:{enable:!0,type:"solid",color:"#dddddd",width:{desktop:{unit:"px",top:"1",right:"1",bottom:"1",left:"1",linked:!0},tablet:{unit:"px",top:"1",right:"1",bottom:"1",left:"1",linked:!0},mobile:{unit:"px",top:"1",right:"1",bottom:"1",left:"1",linked:!0}},radius:{desktop:{unit:"px",top:"5",right:"5",bottom:"5",left:"5",linked:!0},tablet:{unit:"px",top:"5",right:"5",bottom:"5",left:"5",linked:!0},mobile:{unit:"px",top:"5",right:"5",bottom:"5",left:"5",linked:!0}}}},{label:Ee("Pill"),value:{enable:!0,type:"solid",color:"#dddddd",width:{desktop:{unit:"px",top:"1",right:"1",bottom:"1",left:"1",linked:!0},tablet:{unit:"px",top:"1",right:"1",bottom:"1",left:"1",linked:!0},mobile:{unit:"px",top:"1",right:"1",bottom:"1",left:"1",linked:!0}},radius:{desktop:{unit:"px",top:"50",right:"50",bottom:"50",left:"50",linked:!0},tablet:{unit:"px",top:"50",right:"50",bottom:"50",left:"50",linked:!0},mobile:{unit:"px",top:"50",right:"50",bottom:"50",left:"50",linked:!0}}}},{label:Ee("Dashed"),value:{enable:!0,type:"dashed",color:"#dddddd",width:{desktop:{unit:"px",top:"2",right:"2",bottom:"2",left:"2",linked:!0},tablet:{unit:"px",top:"2",right:"2",bottom:"2",left:"2",linked:!0},mobile:{unit:"px",top:"2",right:"2",bottom:"2",left:"2",linked:!0}},radius:{desktop:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},tablet:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},mobile:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0}}}}];return(0,a.jsxs)(Se,{label:n,className:"ffblock-border-control",children:[(0,a.jsxs)("div",{className:"ffblock-control-header",children:[(0,a.jsx)(je,{label:Ee("Enable Border"),checked:r.enable,onChange:function(e){var t={enable:e};e&&(r.color||(t.color=u),r.type||(t.type="solid"),r.width&&0!==Object.keys(r.width).length||(t.width={desktop:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},tablet:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},mobile:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0}}),r.radius&&0!==Object.keys(r.radius).length||(t.radius={desktop:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},tablet:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0},mobile:{unit:"px",top:"",right:"",bottom:"",left:"",linked:!0}})),p(t)}}),(0,a.jsx)(we,{icon:"grid-view",isSmall:!0,onClick:function(){return f(!s)},className:"ffblock-preset-toggle",label:Ee("Border Presets")})]}),s&&(0,a.jsx)("div",{className:"ffblock-presets-container",children:(0,a.jsx)("div",{className:"ffblock-presets-grid",children:h.map(function(e,t){return(0,a.jsxs)(we,{className:"ffblock-preset-button",onClick:function(){return function(e){p(e.value),f(!1)}(e)},children:[(0,a.jsx)("div",{className:"ffblock-preset-preview ffblock-border-preview",children:(0,a.jsx)("div",{className:"ffblock-border-box",style:{border:e.value.enable?"".concat(e.value.width.desktop.top||0,"px ").concat(e.value.type," ").concat(e.value.color):"none",borderRadius:e.value.enable&&e.value.radius.desktop.top?"".concat(e.value.radius.desktop.top,"px"):"0"}})}),(0,a.jsx)("span",{className:"ffblock-preset-label",children:e.label})]},t)})})}),r.enable&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Ce,{label:Ee("Border Type"),value:r.type||"solid",options:b,onChange:function(e){return p({type:e})}}),(0,a.jsx)(V,{label:Ee("Border Color"),value:r.color||"",onChange:function(e){return p({color:e})},defaultColor:u}),(0,a.jsx)(be,{label:Ee("Border Width"),values:r.width,onChange:function(e){return p({width:e})},showPresetsToggle:!1}),(0,a.jsx)(be,{label:Ee("Border Radius"),values:r.radius,onChange:function(e){return p({radius:e})},showPresetsToggle:!0,presetType:"radius"})]})]})},function(e,t){return l(e,t,["label","defaultColor","border"])});function Ie(e){return Ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ie(e)}function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function Me(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Re(Object(n),!0).forEach(function(t){Fe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Fe(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=Ie(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=Ie(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ie(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function He(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=l.call(n)).done)&&(i.push(o.value),i.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ze(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ze(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var De=wp.components,Le=De.BaseControl,We=De.ToggleControl,$e=De.SelectControl,Ue=De.Button,Ge=(De.ButtonGroup,wp.element),Ve=Ge.useEffect,qe=Ge.memo,Ke=(Ge.useCallback,Ge.useRef),Je=Ge.useState,Ze=wp.i18n.__;const Ye=qe(function(e){var t,n,o,r,l,i,u,c,s=e.label,f=void 0===s?Ze("Box Shadow"):s,d=e.shadow,p=void 0===d?{}:d,b=e.onChange,h=e.defaultColor,g=void 0===h?"rgba(0,0,0,0.5)":h,m=He(Je(!1),2),v=m[0],y=m[1],x=Ke(p||{enable:!1,color:"",position:"outline",horizontal:{value:"0",unit:"px"},vertical:{value:"0",unit:"px"},blur:{value:"5",unit:"px"},spread:{value:"0",unit:"px"}});Ve(function(){x.current=p||x.current},[p]);var k=function(e){var t=Me(Me({},x.current),e);x.current=t,b&&b(t)},S=[{label:Ze("Outline"),value:"outline"},{label:Ze("Inset"),value:"inset"}],j=[{label:"px",value:"px"},{label:"em",value:"em"},{label:"%",value:"%"}],C=[{label:Ze("None"),value:{enable:!1,color:"",position:"outline",horizontal:{value:"0",unit:"px"},vertical:{value:"0",unit:"px"},blur:{value:"0",unit:"px"},spread:{value:"0",unit:"px"}}},{label:Ze("Subtle"),value:{enable:!0,color:"rgba(0,0,0,0.1)",position:"outline",horizontal:{value:"0",unit:"px"},vertical:{value:"2",unit:"px"},blur:{value:"4",unit:"px"},spread:{value:"0",unit:"px"}}},{label:Ze("Small"),value:{enable:!0,color:"rgba(0,0,0,0.15)",position:"outline",horizontal:{value:"0",unit:"px"},vertical:{value:"4",unit:"px"},blur:{value:"6",unit:"px"},spread:{value:"0",unit:"px"}}},{label:Ze("Medium"),value:{enable:!0,color:"rgba(0,0,0,0.2)",position:"outline",horizontal:{value:"0",unit:"px"},vertical:{value:"6",unit:"px"},blur:{value:"12",unit:"px"},spread:{value:"0",unit:"px"}}},{label:Ze("Large"),value:{enable:!0,color:"rgba(0,0,0,0.25)",position:"outline",horizontal:{value:"0",unit:"px"},vertical:{value:"10",unit:"px"},blur:{value:"20",unit:"px"},spread:{value:"0",unit:"px"}}},{label:Ze("Inset"),value:{enable:!0,color:"rgba(0,0,0,0.15)",position:"inset",horizontal:{value:"0",unit:"px"},vertical:{value:"2",unit:"px"},blur:{value:"4",unit:"px"},spread:{value:"0",unit:"px"}}}];return(0,a.jsxs)(Le,{label:f,className:"ffblock-box-shadow-control",children:[(0,a.jsxs)("div",{className:"ffblock-control-header",children:[(0,a.jsx)(We,{label:Ze("Enable Box Shadow"),checked:p.enable,onChange:function(e){var t,n,o,r,l={enable:e};e&&(p.color||(l.color=g),p.position||(l.position="outline"),null!==(t=p.horizontal)&&void 0!==t&&t.value||(l.horizontal={value:"0",unit:"px"}),null!==(n=p.vertical)&&void 0!==n&&n.value||(l.vertical={value:"0",unit:"px"}),null!==(o=p.blur)&&void 0!==o&&o.value||(l.blur={value:"5",unit:"px"}),null!==(r=p.spread)&&void 0!==r&&r.value||(l.spread={value:"0",unit:"px"}));k(l)}}),(0,a.jsx)(Ue,{icon:"grid-view",isSmall:!0,onClick:function(){return y(!v)},className:"ffblock-preset-toggle",label:Ze("Shadow Presets")})]}),v&&(0,a.jsx)("div",{className:"ffblock-presets-container",children:(0,a.jsx)("div",{className:"ffblock-presets-grid",children:C.map(function(e,t){return(0,a.jsxs)(Ue,{className:"ffblock-preset-button",onClick:function(){return function(e){k(e.value),y(!1)}(e)},children:[(0,a.jsx)("div",{className:"ffblock-preset-preview ffblock-shadow-preview",children:(0,a.jsx)("div",{className:"ffblock-shadow-box",style:{boxShadow:e.value.enable?"".concat("inset"===e.value.position?"inset ":"").concat(e.value.horizontal.value).concat(e.value.horizontal.unit," ").concat(e.value.vertical.value).concat(e.value.vertical.unit," ").concat(e.value.blur.value).concat(e.value.blur.unit," ").concat(e.value.spread.value).concat(e.value.spread.unit," ").concat(e.value.color):"none"}})}),(0,a.jsx)("span",{className:"ffblock-preset-label",children:e.label})]},t)})})}),p.enable&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(V,{label:Ze("Shadow Color"),value:p.color||"",onChange:function(e){return k({color:e})},defaultColor:g}),(0,a.jsx)($e,{label:Ze("Shadow Position"),value:p.position||"outline",options:S,onChange:function(e){return k({position:e})}}),(0,a.jsx)(Le,{label:Ze("Horizontal Offset"),children:(0,a.jsxs)("div",{className:"ffblock-unit-control",children:[(0,a.jsx)("input",{type:"number",className:"components-text-control__input",value:(null===(t=p.horizontal)||void 0===t?void 0:t.value)||"",onChange:function(e){return k({horizontal:Me(Me({},p.horizontal),{},{value:e.target.value})})},min:"-50",max:"50",placeholder:"0"}),(0,a.jsx)($e,{value:(null===(n=p.horizontal)||void 0===n?void 0:n.unit)||"px",options:j,onChange:function(e){return k({horizontal:Me(Me({},p.horizontal),{},{unit:e})})}})]})}),(0,a.jsx)(Le,{label:Ze("Vertical Offset"),children:(0,a.jsxs)("div",{className:"ffblock-unit-control",children:[(0,a.jsx)("input",{type:"number",className:"components-text-control__input",value:(null===(o=p.vertical)||void 0===o?void 0:o.value)||"",onChange:function(e){return k({vertical:Me(Me({},p.vertical),{},{value:e.target.value})})},min:"-50",max:"50",placeholder:"0"}),(0,a.jsx)($e,{value:(null===(r=p.vertical)||void 0===r?void 0:r.unit)||"px",options:j,onChange:function(e){return k({vertical:Me(Me({},p.vertical),{},{unit:e})})}})]})}),(0,a.jsx)(Le,{label:Ze("Blur Radius"),children:(0,a.jsxs)("div",{className:"ffblock-unit-control",children:[(0,a.jsx)("input",{type:"number",className:"components-text-control__input",value:(null===(l=p.blur)||void 0===l?void 0:l.value)||"",onChange:function(e){return k({blur:Me(Me({},p.blur),{},{value:e.target.value})})},min:"0",max:"100",placeholder:"0"}),(0,a.jsx)($e,{value:(null===(i=p.blur)||void 0===i?void 0:i.unit)||"px",options:j,onChange:function(e){return k({blur:Me(Me({},p.blur),{},{unit:e})})}})]})}),(0,a.jsx)(Le,{label:Ze("Spread Radius"),children:(0,a.jsxs)("div",{className:"ffblock-unit-control",children:[(0,a.jsx)("input",{type:"number",className:"components-text-control__input",value:(null===(u=p.spread)||void 0===u?void 0:u.value)||"",onChange:function(e){return k({spread:Me(Me({},p.spread),{},{value:e.target.value})})},min:"-50",max:"50",placeholder:"0"}),(0,a.jsx)($e,{value:(null===(c=p.spread)||void 0===c?void 0:c.unit)||"px",options:j,onChange:function(e){return k({spread:Me(Me({},p.spread),{},{unit:e})})}})]})})]})]})},function(e,t){return l(e,t,["label","defaultColor","shadow"])});var Xe=wp.element.memo,Qe=wp.i18n.__,et=wp.components,tt=et.PanelBody,nt=et.TabPanel;const ot=Xe(function(e){var t=e.styles,n=e.updateStyles;return(0,a.jsx)(tt,{title:Qe("Input & Textarea"),initialOpen:!1,children:(0,a.jsx)(nt,{className:"input-styles-tabs",activeClass:"is-active",tabs:[{name:"normal",title:Qe("Normal"),className:"tab-normal"},{name:"focus",title:Qe("Focus"),className:"tab-focus"}],children:function(e){return"normal"===e.name?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(V,{label:"Text Color",value:(null==t?void 0:t.inputTextColor)||"",onChange:function(e){n({inputTextColor:e})},defaultColor:""},"input-text-color-normal"),(0,a.jsx)(V,{label:"Background Color",value:(null==t?void 0:t.inputBackgroundColor)||"",onChange:function(e){n({inputBackgroundColor:e})},defaultColor:""},"input-bg-color-normal"),(0,a.jsx)(I,{label:"Typography",typography:t.inputTypography||{},onChange:function(e){return n({inputTypography:e})}}),(0,a.jsx)(be,{label:"Spacing",values:t.inputSpacing,onChange:function(e){return n({inputSpacing:e})}}),(0,a.jsx)(Ne,{label:Qe("Border"),border:t.inputBorder||{},onChange:function(e){return n({inputBorder:e})}}),(0,a.jsx)(Ye,{label:Qe("Box Shadow"),shadow:t.inputBoxShadow||{},onChange:function(e){return n({inputBoxShadow:e})}})]}):"focus"===e.name?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(V,{label:"Text Color",value:t.inputTextFocusColor||"",onChange:function(e){n({inputTextFocusColor:e})},defaultColor:""},"input-text-color-focus"),(0,a.jsx)(V,{label:"Background Color",value:(null==t?void 0:t.inputBackgroundFocusColor)||"",onChange:function(e){n({inputBackgroundFocusColor:e})},defaultColor:""},"input-bg-color-focus"),(0,a.jsx)(be,{label:"Spacing",values:t.inputFocusSpacing,onChange:function(e){return n({inputFocusSpacing:e})}}),(0,a.jsx)(Ne,{label:Qe("Border"),border:t.inputBorderFocus||{},onChange:function(e){return n({inputBorderFocus:e})}}),(0,a.jsx)(Ye,{label:Qe("Box Shadow"),shadow:t.inputBoxShadowFocus||{},onChange:function(e){return n({inputBoxShadowFocus:e})}})]}):null}})})},function(e,t){return r(e.styles,t.styles,["inputTextColor","inputBackgroundColor","inputTypography","inputSpacing","inputBorder","inputBoxShadow","inputTextFocusColor","inputBackgroundFocusColor","inputFocusSpacing","inputBorderFocus","inputBoxShadowFocus"])});function rt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=l.call(n)).done)&&(i.push(o.value),i.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return lt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?lt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function lt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var at=wp.element,it=at.useState,ut=at.useEffect,ct=at.memo,st=wp.i18n.__,ft=wp.components,dt=ft.ButtonGroup,pt=ft.Button,bt=ft.Tooltip;const ht=ct(function(e){var t=e.label,n=(void 0===t&&st("Alignment"),e.value),o=void 0===n?"left":n,r=e.onChange,l=e.options,i=void 0===l?[{value:"left",icon:"editor-alignleft",label:st("Left")},{value:"center",icon:"editor-aligncenter",label:st("Center")},{value:"right",icon:"editor-alignright",label:st("Right")}]:l,u=rt(it(o),2),c=u[0],s=u[1];ut(function(){o!==c&&s(o)},[o]);return(0,a.jsx)("div",{className:"ffblock-alignment-control",children:(0,a.jsx)("div",{className:"ffblock-alignment-buttons",children:(0,a.jsx)(dt,{children:i.map(function(e){return(0,a.jsx)(bt,{text:e.label,children:(0,a.jsx)(pt,{icon:e.icon,isPrimary:c===e.value,isSecondary:c!==e.value,onClick:function(){return t=e.value,s(t),void(r&&r(t));var t},"aria-label":e.label})},e.value)})})})})},function(e,t){return l(e,t,["label","value","options"])});var gt=wp.element.memo,mt=wp.i18n.__,vt=wp.components,yt=vt.PanelBody,xt=vt.TabPanel,kt=vt.RangeControl;const St=gt(function(e){var t=e.styles,n=e.updateStyles;return(0,a.jsxs)(yt,{title:mt("Button Styles"),initialOpen:!1,children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"ffblock-label",children:mt("Alignment")}),(0,a.jsx)(ht,{value:t.buttonAlignment,onChange:function(e){return n({buttonAlignment:e})},options:[{value:"left",icon:"editor-alignleft",label:mt("Left")},{value:"center",icon:"editor-aligncenter",label:mt("Center")},{value:"right",icon:"editor-alignright",label:mt("Right")}]})]}),(0,a.jsx)(kt,{label:mt("Width (%)"),value:t.buttonWidth,onChange:function(e){return n({buttonWidth:e})},min:0,max:100,allowReset:!0,initialPosition:0,help:mt("Set to 0 for auto width")}),(0,a.jsx)(xt,{className:"button-styles-tabs",activeClass:"is-active",tabs:[{name:"normal",title:mt("Normal"),className:"tab-normal"},{name:"hover",title:mt("Hover"),className:"tab-hover"}],children:function(e){return"normal"===e.name?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(V,{label:"Text Color",value:t.buttonColor,onChange:function(e){return n({buttonColor:e})},defaultColor:"#ffffff"}),(0,a.jsx)(V,{label:"Background Color",value:t.buttonBGColor,onChange:function(e){return n({buttonBGColor:e})},defaultColor:"#409EFF"}),(0,a.jsx)(I,{label:"Typography",typography:t.buttonTypography||{},onChange:function(e){return n({buttonTypography:e})}}),(0,a.jsx)(be,{label:"Padding",values:t.buttonPadding,onChange:function(e){return n({buttonPadding:e})}}),(0,a.jsx)(be,{label:"Margin",values:t.buttonMargin,onChange:function(e){return n({buttonMargin:e})}}),(0,a.jsx)(Ye,{label:mt("Box Shadow"),shadow:t.buttonBoxShadow||{},onChange:function(e){return n({buttonBoxShadow:e})}}),(0,a.jsx)(Ne,{label:mt("Border"),border:t.buttonBorder||{},onChange:function(e){return n({buttonBorder:e})}})]}):"hover"===e.name?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(V,{label:"Text Color",value:t.buttonHoverColor,onChange:function(e){return n({buttonHoverColor:e})},defaultColor:"#ffffff"}),(0,a.jsx)(V,{label:"Background Color",value:t.buttonHoverBGColor,onChange:function(e){return n({buttonHoverBGColor:e})},defaultColor:"#66b1ff"}),(0,a.jsx)(I,{label:"Typography",typography:t.buttonHoverTypography||{},onChange:function(e){return n({buttonHoverTypography:e})}}),(0,a.jsx)(be,{label:"Padding",values:t.buttonHoverPadding,onChange:function(e){return n({buttonHoverPadding:e})}}),(0,a.jsx)(be,{label:"Margin",values:t.buttonHoverMargin,onChange:function(e){return n({buttonHoverMargin:e})}}),(0,a.jsx)(Ye,{label:mt("Box Shadow"),shadow:t.buttonHoverBoxShadow||{},onChange:function(e){return n({buttonHoverBoxShadow:e})}}),(0,a.jsx)(Ne,{label:mt("Border"),border:t.buttonHoverBorder||{},onChange:function(e){return n({buttonHoverBorder:e})}})]}):null}})]})},function(e,t){return r(e.styles,t.styles,["buttonWidth","buttonAlignment","buttonColor","buttonBGColor","buttonTypography","buttonPadding","buttonMargin","buttonBoxShadow","buttonBorder","buttonHoverColor","buttonHoverBGColor","buttonHoverTypography","buttonHoverPadding","buttonHoverMargin","buttonHoverBoxShadow","buttonHoverBorder"])});var jt=wp.element.memo,Ct=wp.i18n.__,wt=wp.components.PanelBody;const Bt=jt(function(e){var t=e.styles,n=e.updateStyles;return(0,a.jsxs)(wt,{title:Ct("Placeholder Styles"),initialOpen:!1,children:[(0,a.jsx)(V,{label:"Text Color",value:t.placeholderColor,onChange:function(e){return n({placeholderColor:e})},defaultColor:""}),(0,a.jsx)(I,{label:"Typography",typography:t.placeholderTypography||{},onChange:function(e){return n({placeholderTypography:e})}})]})},function(e,t){return r(e.styles,t.styles,["placeholderColor","placeholderTypography"])});function Ot(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=l.call(n)).done)&&(i.push(o.value),i.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Tt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Tt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var Pt=wp.element,_t=Pt.useState,At=Pt.useEffect,Et=Pt.memo,Nt=wp.i18n.__,It=wp.components,Rt=It.PanelBody,Mt=It.RangeControl;const Ft=Et(function(e){var t=e.styles,n=e.updateStyles,o=Ot(_t(t.radioCheckboxItemsSize||15),2),r=o[0],l=o[1];At(function(){void 0!==t.radioCheckboxItemsSize&&t.radioCheckboxItemsSize!==r&&l(t.radioCheckboxItemsSize)},[t.radioCheckboxItemsSize]);return(0,a.jsxs)(Rt,{title:Nt("Radio & Checkbox Styles"),initialOpen:!1,children:[(0,a.jsx)(V,{label:"Items Color",value:t.radioCheckboxItemsColor,onChange:function(e){return n({radioCheckboxItemsColor:e})},defaultColor:""}),(0,a.jsxs)("div",{className:"ffblock-control-field",children:[(0,a.jsx)("span",{className:"ffblock-label",children:"Size (px)"}),(0,a.jsx)(Mt,{value:r,min:1,max:30,step:1,onChange:function(e){l(e),n({radioCheckboxItemsSize:e})}})]})]})},function(e,t){return r(e.styles,t.styles,["radioCheckboxItemsColor","radioCheckboxItemsSize"])});var Ht=wp.element.memo,zt=["labelColor","labelTypography","inputTextColor","inputBackgroundColor","inputTypography","inputSpacing","inputBorder","inputBorderFocus","inputTextFocusColor","inputBackgroundFocusColor","inputFocusSpacing","inputBoxShadow","inputBoxShadowFocus","placeholderColor","placeholderFocusColor","placeholderTypography","radioCheckboxLabelColor","radioCheckboxTypography","radioCheckboxItemsColor","radioCheckboxItemsSize","checkboxSize","checkboxBorderColor","checkboxBgColor","checkboxCheckedColor","radioSize","radioBorderColor","radioBgColor","radioCheckedColor","buttonWidth","buttonAlignment","buttonColor","buttonBGColor","buttonTypography","buttonPadding","buttonMargin","buttonBoxShadow","buttonBorder","buttonHoverColor","buttonHoverBGColor","buttonHoverTypography","buttonHoverPadding","buttonHoverMargin","buttonHoverBoxShadow","buttonHoverBorder"];const Dt=Ht(function(e){var t=e.attributes,n=e.updateStyles,o=e.handlePresetChange;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(g,{attributes:t,handlePresetChange:o}),(0,a.jsx)(Z,{styles:t.styles,updateStyles:n}),(0,a.jsx)(ot,{styles:t.styles,updateStyles:n}),(0,a.jsx)(Bt,{styles:t.styles,updateStyles:n}),(0,a.jsx)(Ft,{styles:t.styles,updateStyles:n}),(0,a.jsx)(St,{styles:t.styles,updateStyles:n})]})},function(e,t){return e.attributes.themeStyle===t.attributes.themeStyle&&r(e.attributes.styles,t.attributes.styles,zt)});function Lt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=l.call(n)).done)&&(i.push(o.value),i.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Wt(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}var $t=wp.element,Ut=$t.useState,Gt=$t.useEffect,Vt=$t.memo,qt=wp.i18n.__,Kt=wp.components,Jt=Kt.PanelBody,Zt=Kt.SelectControl,Yt=Kt.RangeControl,Xt=Kt.Button,Qt=Kt.BaseControl,en=["backgroundType","backgroundImage","backgroundImageId","backgroundColor","gradientColor1","gradientColor2","containerPadding","containerMargin","containerBoxShadow","borderType","borderColor","borderWidth","borderRadius","enableFormBorder","formBorder","formWidth","backgroundSize","backgroundPosition","backgroundRepeat","backgroundAttachment","backgroundOverlayColor","backgroundOverlayOpacity","gradientType","gradientAngle","enableBoxShadow","boxShadowColor","boxShadowPosition","boxShadowHorizontal","boxShadowHorizontalUnit","boxShadowVertical","boxShadowVerticalUnit","boxShadowBlur","boxShadowBlurUnit","boxShadowSpread","boxShadowSpreadUnit","asteriskColor","errorMessageBgColor","errorMessageColor","errorMessageAlignment","successMessageBgColor","successMessageColor","successMessageAlignment","submitErrorMessageBgColor","submitErrorMessageColor","submitErrorMessageAlignment"];const tn=Vt(function(e){var t=e.attributes,n=e.updateStyles,o=Lt(Ut(t.styles.backgroundType||"classic"),2),r=o[0],l=o[1],u=Lt(Ut(t.styles.backgroundImage||""),2),c=u[0],s=u[1];Gt(function(){void 0!==t.styles.backgroundType&&t.styles.backgroundType!==r&&l(t.styles.backgroundType)},[t.styles.backgroundType]),Gt(function(){t.styles.backgroundImage!==c&&s(t.styles.backgroundImage||"")},[t.styles.backgroundImage]);var f=function(e){l(e),n({backgroundType:e})},d=function(){var e=wp.media({title:qt("Select Background Image"),button:{text:qt("Use this image")},multiple:!1,library:{type:"image"}});e.on("select",function(){var t=e.state().get("selection").first().toJSON();s(t.url),n({backgroundImage:t.url,backgroundImageId:t.id})}),e.open()},p=c||t.styles.backgroundImage;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(Jt,{title:qt("Container Styles"),initialOpen:!1,children:[(0,a.jsxs)("div",{className:"ffblock-control-field",children:[(0,a.jsx)("strong",{className:"ffblock-label",children:qt("Background Type")}),(0,a.jsxs)("div",{className:"ffblock-radio-options",style:{display:"flex",gap:"8px",marginTop:"8px"},children:[(0,a.jsx)(Xt,{isPrimary:"classic"===r,isSecondary:"classic"!==r,onClick:function(){return f("classic")},style:{flex:1,justifyContent:"center"},children:qt("Classic")}),(0,a.jsx)(Xt,{isPrimary:"gradient"===r,isSecondary:"gradient"!==r,onClick:function(){return f("gradient")},style:{flex:1,justifyContent:"center"},children:qt("Gradient")})]})]}),"classic"===r&&(0,a.jsxs)("div",{className:"ffblock-control-field",children:[(0,a.jsxs)("div",{className:"ffblock-media-upload",children:[(0,a.jsx)("span",{className:"ffblock-label",children:qt("Background Image")}),p?(0,a.jsxs)("div",{className:"ffblock-image-preview",style:{marginTop:"8px"},children:[(0,a.jsx)("div",{style:{backgroundImage:"url(".concat(p,")"),backgroundSize:"cover",backgroundPosition:"center",height:"120px",width:"100%",borderRadius:"4px",position:"relative",marginBottom:"8px",border:"1px solid #ddd"},children:(0,a.jsx)(Xt,{icon:"no-alt",onClick:function(){s(""),n({backgroundImage:"",backgroundImageId:0})},isDestructive:!0,style:{position:"absolute",top:"8px",right:"8px",background:"rgba(0,0,0,0.7)",color:"white",borderRadius:"50%",padding:"4px",minWidth:"auto",height:"28px",width:"28px"}})}),(0,a.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,a.jsx)(Xt,{isSecondary:!0,onClick:d,children:qt("Replace Image")})})]}):(0,a.jsx)(Xt,{className:"ffblock-upload-button",icon:"upload",onClick:d,children:qt("Upload Media")})]}),p&&(0,a.jsxs)("div",{style:{marginTop:"16px"},children:[(0,a.jsx)(Zt,{label:qt("Background Size"),value:t.styles.backgroundSize||"cover",options:[{label:qt("Cover"),value:"cover"},{label:qt("Contain"),value:"contain"},{label:qt("Auto"),value:"auto"}],onChange:function(e){return n({backgroundSize:e})}}),(0,a.jsx)(Zt,{label:qt("Background Position"),value:t.styles.backgroundPosition||"center center",options:[{label:qt("Center Center"),value:"center center"},{label:qt("Center Top"),value:"center top"},{label:qt("Center Bottom"),value:"center bottom"},{label:qt("Left Center"),value:"left center"},{label:qt("Left Top"),value:"left top"},{label:qt("Left Bottom"),value:"left bottom"},{label:qt("Right Center"),value:"right center"},{label:qt("Right Top"),value:"right top"},{label:qt("Right Bottom"),value:"right bottom"}],onChange:function(e){return n({backgroundPosition:e})}}),(0,a.jsx)(Zt,{label:qt("Background Repeat"),value:t.styles.backgroundRepeat||"no-repeat",options:[{label:qt("No Repeat"),value:"no-repeat"},{label:qt("Repeat"),value:"repeat"},{label:qt("Repeat X"),value:"repeat-x"},{label:qt("Repeat Y"),value:"repeat-y"}],onChange:function(e){return n({backgroundRepeat:e})}})]})]}),"gradient"===r&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"ffblock-label",children:qt("Background Gradient")}),(0,a.jsxs)("div",{className:"ffblock-bg-gradient",children:[(0,a.jsx)(V,{label:qt("Primary Color"),value:t.styles.gradientColor1||"",onChange:function(e){return n({gradientColor1:e})},defaultColor:""}),(0,a.jsx)(V,{label:qt("Secondary Color"),value:t.styles.gradientColor2||"",onChange:function(e){return n({gradientColor2:e})},defaultColor:""}),(0,a.jsx)(Zt,{label:qt("Gradient Type"),value:t.styles.gradientType||"linear",options:[{label:qt("Linear"),value:"linear"},{label:qt("Radial"),value:"radial"}],onChange:function(e){return n({gradientType:e})}}),"linear"===t.styles.gradientType&&(0,a.jsx)(Yt,{label:qt("Gradient Angle (°)"),value:t.styles.gradientAngle||90,onChange:function(e){return n({gradientAngle:e})},min:0,max:360})]})]}),(0,a.jsx)(V,{label:qt("Background Color"),value:t.styles.backgroundColor||"",onChange:function(e){return n({backgroundColor:e})},defaultColor:""}),(0,a.jsx)(be,{label:qt("Padding"),values:t.styles.containerPadding,onChange:function(e){return n({containerPadding:e})}}),(0,a.jsx)(be,{label:qt("Margin"),values:t.styles.containerMargin,onChange:function(e){return n({containerMargin:e})}}),(0,a.jsx)(i,{label:qt("Box Shadow")}),(0,a.jsx)(Ye,{label:qt("Box Shadow"),shadow:t.styles.containerBoxShadow||{},onChange:function(e){return n({containerBoxShadow:e})}}),(0,a.jsx)(i,{label:qt("Form Border Settings")}),(0,a.jsx)(Ne,{label:qt("Form Border"),border:t.styles.formBorder||{},onChange:function(e){return n({formBorder:e})}})]}),(0,a.jsx)(Jt,{title:qt("Asterisk Styles"),initialOpen:!1,children:(0,a.jsx)(V,{label:qt("Asterisk Color"),value:t.styles.asteriskColor||"",onChange:function(e){return n({asteriskColor:e})},defaultColor:"#ff0000"})}),(0,a.jsxs)(Jt,{title:qt("Inline Error Message Styles"),initialOpen:!1,children:[(0,a.jsx)(V,{label:qt("Background Color"),value:t.styles.errorMessageBgColor||"",onChange:function(e){return n({errorMessageBgColor:e})},defaultColor:""}),(0,a.jsx)(V,{label:qt("Text Color"),value:t.styles.errorMessageColor||"",onChange:function(e){return n({errorMessageColor:e})},defaultColor:"#ff0000"}),(0,a.jsx)(Qt,{label:qt("Alignment"),children:(0,a.jsx)(ht,{value:t.styles.errorMessageAlignment||"left",onChange:function(e){return n({errorMessageAlignment:e})},options:[{value:"left",icon:"editor-alignleft",title:qt("Align Left")},{value:"center",icon:"editor-aligncenter",title:qt("Align Center")},{value:"right",icon:"editor-alignright",title:qt("Align Right")}]})})]}),(0,a.jsxs)(Jt,{title:qt("After Submit Success Message Styles"),initialOpen:!1,children:[(0,a.jsx)(V,{label:qt("Background Color"),value:t.styles.successMessageBgColor||"",onChange:function(e){return n({successMessageBgColor:e})},defaultColor:"#dff0d8"}),(0,a.jsx)(V,{label:qt("Text Color"),value:t.styles.successMessageColor||"",onChange:function(e){return n({successMessageColor:e})},defaultColor:"#3c763d"}),(0,a.jsx)(Qt,{label:qt("Alignment"),children:(0,a.jsx)(ht,{value:t.styles.successMessageAlignment||"left",onChange:function(e){return n({successMessageAlignment:e})},options:[{value:"left",icon:"editor-alignleft",title:qt("Align Left")},{value:"center",icon:"editor-aligncenter",title:qt("Align Center")},{value:"right",icon:"editor-alignright",title:qt("Align Right")}]})})]}),(0,a.jsxs)(Jt,{title:qt("After Submit Error Message Styles"),initialOpen:!1,children:[(0,a.jsx)(V,{label:qt("Background Color"),value:t.styles.submitErrorMessageBgColor||"",onChange:function(e){return n({submitErrorMessageBgColor:e})},defaultColor:"#f2dede"}),(0,a.jsx)(V,{label:qt("Text Color"),value:t.styles.submitErrorMessageColor||"",onChange:function(e){return n({submitErrorMessageColor:e})},defaultColor:"#a94442"}),(0,a.jsx)(Qt,{label:qt("Alignment"),children:(0,a.jsx)(ht,{value:t.styles.submitErrorMessageAlignment||"left",onChange:function(e){return n({submitErrorMessageAlignment:e})},options:[{value:"left",icon:"editor-alignleft",title:qt("Align Left")},{value:"center",icon:"editor-aligncenter",title:qt("Align Center")},{value:"right",icon:"editor-alignright",title:qt("Align Right")}]})})]})]})},function(e,t){return r(e.attributes.styles,t.attributes.styles,en)});var nn=wp.i18n.__,on=wp.components.TabPanel;const rn=(0,wp.element.memo)(function(e){var t=e.attributes,n=e.updateStyles,o=e.handlePresetChange;return(0,a.jsx)(on,{className:"fluent-form-block-style-tabs",activeClass:"is-active",tabs:[{name:"general",title:nn("General"),key:"general-tab"},{name:"misc",title:nn("Misc"),key:"misc-tab"}],children:function(e){return"general"===e.name?(0,a.jsx)("div",{children:(0,a.jsx)(Dt,{attributes:t,updateStyles:n,handlePresetChange:o})},"general-tab-content"):"misc"===e.name?(0,a.jsx)("div",{children:(0,a.jsx)(tn,{attributes:t,updateStyles:n})},"misc-tab-content"):null}})},function(e,t){return e.updateStyles===t.updateStyles&&e.handlePresetChange===t.handlePresetChange&&e.attributes===t.attributes});function ln(e){return ln="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ln(e)}function an(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function un(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?an(Object(n),!0).forEach(function(t){cn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):an(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=ln(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=ln(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==ln(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,l,a,i=[],u=!0,c=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=l.call(n)).done)&&(i.push(o.value),i.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fn(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fn(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function fn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=Array(t);n<t;n++)o[n]=e[n];return o}function dn(){var e,t,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",r=n.toStringTag||"@@toStringTag";function l(n,o,r,l){var u=o&&o.prototype instanceof i?o:i,c=Object.create(u.prototype);return pn(c,"_invoke",function(n,o,r){var l,i,u,c=0,s=r||[],f=!1,d={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,n){return l=t,i=0,u=e,d.n=n,a}};function p(n,o){for(i=n,u=o,t=0;!f&&c&&!r&&t<s.length;t++){var r,l=s[t],p=d.p,b=l[2];n>3?(r=b===o)&&(u=l[(i=l[4])?5:(i=3,3)],l[4]=l[5]=e):l[0]<=p&&((r=n<2&&p<l[1])?(i=0,d.v=o,d.n=l[1]):p<b&&(r=n<3||l[0]>o||o>b)&&(l[4]=n,l[5]=o,d.n=b,i=0))}if(r||n>1)return a;throw f=!0,o}return function(r,s,b){if(c>1)throw TypeError("Generator is already running");for(f&&1===s&&p(s,b),i=s,u=b;(t=i<2?e:u)||!f;){l||(i?i<3?(i>1&&(d.n=-1),p(i,u)):d.n=u:d.v=u);try{if(c=2,l){if(i||(r="next"),t=l[r]){if(!(t=t.call(l,u)))throw TypeError("iterator result is not an object");if(!t.done)return t;u=t.value,i<2&&(i=0)}else 1===i&&(t=l.return)&&t.call(l),i<2&&(u=TypeError("The iterator does not provide a '"+r+"' method"),i=1);l=e}else if((t=(f=d.n<0)?u:n.call(o,d))!==a)break}catch(t){l=e,i=1,u=t}finally{c=1}}return{value:t,done:f}}}(n,r,l),!0),c}var a={};function i(){}function u(){}function c(){}t=Object.getPrototypeOf;var s=[][o]?t(t([][o]())):(pn(t={},o,function(){return this}),t),f=c.prototype=i.prototype=Object.create(s);function d(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,pn(e,r,"GeneratorFunction")),e.prototype=Object.create(f),e}return u.prototype=c,pn(f,"constructor",c),pn(c,"constructor",u),u.displayName="GeneratorFunction",pn(c,r,"GeneratorFunction"),pn(f),pn(f,r,"Generator"),pn(f,o,function(){return this}),pn(f,"toString",function(){return"[object Generator]"}),(dn=function(){return{w:l,m:d}})()}function pn(e,t,n,o){var r=Object.defineProperty;try{r({},"",{})}catch(e){r=0}pn=function(e,t,n,o){function l(t,n){pn(e,t,function(e){return this._invoke(t,n,e)})}t?r?r(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(l("next",0),l("throw",1),l("return",2))},pn(e,t,n,o)}function bn(e,t,n,o,r,l,a){try{var i=e[l](a),u=i.value}catch(e){return void n(e)}i.done?t(u):Promise.resolve(u).then(o,r)}function hn(e){return function(){var t=this,n=arguments;return new Promise(function(o,r){var l=e.apply(t,n);function a(e){bn(l,o,r,a,i,"next",e)}function i(e){bn(l,o,r,a,i,"throw",e)}a(void 0)})}}var gn=n(59927).toSafeFormId,mn=n(39684).safeApiFetch,vn=wp.i18n.__,yn=wp.blockEditor,xn=yn.InspectorControls,kn=yn.BlockControls,Sn=wp.serverSideRender,jn=wp.element.memo,Cn=wp.components,wn=Cn.SelectControl,Bn=Cn.PanelBody,On=Cn.Spinner,Tn=Cn.ToolbarGroup,Pn=Cn.ToolbarButton,_n=wp.element,An=_n.useState,En=_n.useEffect,Nn=_n.useRef,In=_n.useCallback,Rn=_n.useMemo,Mn=wp.compose.useRefEffect,Fn=function(){var e=hn(dn().m(function e(t,n){var o,r,l;return dn().w(function(e){for(;;)switch(e.n){case 0:if(o=gn(t)){e.n=1;break}return e.a(2,!1);case 1:return r="".concat(window.fluentform_block_vars.rest.namespace,"/").concat(window.fluentform_block_vars.rest.version,"/settings/").concat(o,"?meta_key=").concat(encodeURIComponent(n)),e.n=2,mn({path:r});case 2:return l=e.v,e.a(2,l.length&&l[0].value||!1)}},e)}));return function(t,n){return e.apply(this,arguments)}}();const Hn=jn(function(e){var t,n=e.attributes,o=e.setAttributes,r=sn(An(!1),2),l=r[0],u=r[1],c=gn(n.formId),s=Nn(null),d=Nn(n.styles||{});En(function(){d.current=n.styles||{}},[n.styles]);var p=Mn(function(e){if(c&&e){var t=e.ownerDocument;s.current=new f(c,t)}},[c]),b=In(function(e){!1!==e&&(e=e?JSON.stringify(e):"")!==n.customCss&&o({customCss:e})},[n.customCss,o]),h=In(function(e){var t=un(un({},d.current),e);d.current=t,o({styles:t})},[o]),g=In(function(){var e=hn(dn().m(function e(t){var n;return dn().w(function(e){for(;;)switch(e.n){case 0:if(t){e.n=1;break}return e.a(2);case 1:return u(!0),e.n=2,Fn(t,"is_conversion_form");case 2:n=e.v,o({isConversationalForm:"yes"===n}),u(!1);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),[o]),m=In(function(e){u(!0),o({formId:e}),e?g(e):(o({themeStyle:"",isConversationalForm:!1}),u(!1))},[o,g]),v=In(function(e){u(!0),o({themeStyle:e}),setTimeout(function(){u(!1)},300)},[o]),y=In(function(){window.confirm(vn("Are you sure you want to reset all styles? This cannot be undone."))&&(u(!0),o({styles:{},customCss:"",themeStyle:""}),s.current&&s.current.updateStyles({}),setTimeout(function(){u(!1)},300))},[o]),x=Rn(function(){return un(un({},n),{},{styles:{},customCss:""})},[n.formId,n.themeStyle]);En(function(){var e,t=!n.themeStyle&&(null===(e=window.fluentform_block_vars)||void 0===e?void 0:e.theme_style),r=window.fluentform_block_vars||{};t&&o({themeStyle:r.theme_style}),c&&g(c)},[]),En(function(){if(s.current){var e=s.current.updateStyles(n.styles);b(e)}},[n.formId,n.styles]);var k,S,j=window.fluentform_block_vars||{},C=(0,a.jsxs)(xn,{children:[(0,a.jsx)(Bn,{title:vn("Form Selection"),initialOpen:!n.formId,children:(0,a.jsx)(wn,{label:vn("Select a Form"),value:n.formId||"",options:(null===(t=j.forms)||void 0===t?void 0:t.map(function(e){return{value:e.id,label:e.title}}))||[],onChange:m})}),n.formId&&!n.isConversationalForm&&(0,a.jsx)(rn,{attributes:n,updateStyles:h,handlePresetChange:v})]},"ff-inspector-controls"),w=null;return l&&(w=(0,a.jsxs)("div",{className:"fluent-form-loading-overlay",children:[(0,a.jsx)(On,{}),(0,a.jsx)("p",{children:"Loading form preview..."}),(0,a.jsx)(i,{style:"dotted",className:"fluent-separator-sm"})]})),k=n.formId?!0===n.isConversationalForm?(0,a.jsxs)("div",{className:"fluent-form-conv-demo",children:[j.conversational_demo_img&&(0,a.jsx)("img",{src:j.conversational_demo_img,alt:vn("Fluent Forms Conversational Form"),className:"fluent-form-conv-img"}),(0,a.jsx)("p",{className:"fluent-form-conv-message",children:(0,a.jsx)("strong",{children:vn("This is a demo preview. The actual Conversational Form will appear on your live page.")})})]}):(0,a.jsx)("div",{className:"fluent-form-preview-wrapper",style:{pointerEvents:"none"},children:(0,a.jsx)(Sn,{block:"fluentfom/guten-block",attributes:x},"ff-preview")}):(0,a.jsxs)("div",{className:"fluent-form-initial-wrapper",children:[(0,a.jsx)("div",{className:"fluent-form-logo",children:j.logo&&(0,a.jsx)("img",{src:j.logo,alt:vn("Fluent Forms Logo"),className:"fluent-form-logo-img"})}),(0,a.jsx)(wn,{label:vn("Select a Form"),value:"",options:(null===(S=j.forms)||void 0===S?void 0:S.map(function(e){return{value:e.id,label:e.title}}))||[],onChange:m}),(0,a.jsx)("p",{style:{marginTop:"16px",fontSize:"13px",color:"#666"},children:"Select a form to display and customize its appearance."})]}),(0,a.jsxs)("div",{ref:p,className:"fluentform-guten-wrapper",children:[C,c&&(0,a.jsxs)(kn,{children:[(0,a.jsx)(Tn,{children:(0,a.jsx)(Pn,{icon:"edit",label:vn("Edit Form"),onClick:function(){return window.open("admin.php?page=fluent_forms&route=editor&form_id=".concat(c),"_blank","noopener")}})}),n.customCss&&(0,a.jsx)(Tn,{children:(0,a.jsx)(Pn,{icon:"image-rotate",label:vn("Reset All Styles"),onClick:y})})]}),k,w]})},function(e,t){return e.attributes===t.attributes});function zn(e){return zn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zn(e)}function Dn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function Ln(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Dn(Object(n),!0).forEach(function(t){Wn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Dn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Wn(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=zn(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=zn(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==zn(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var $n=wp.blockEditor.useBlockProps;const Un=function(e){var t=$n({className:"fluentform-guten-wrapper"});return(0,a.jsx)("div",Ln(Ln({},t),{},{children:(0,a.jsx)(Hn,Ln({},e))}))};var Gn=wp.i18n.__,Vn=wp.blocks.registerBlockType,qn=wp.element.createElement("svg",{width:20,height:20},wp.element.createElement("path",{d:"M15.57,0H4.43A4.43,4.43,0,0,0,0,4.43V15.57A4.43,4.43,0,0,0,4.43,20H15.57A4.43,4.43,0,0,0,20,15.57V4.43A4.43,4.43,0,0,0,15.57,0ZM12.82,14a2.36,2.36,0,0,1-1.66.68H6.5A2.31,2.31,0,0,1,7.18,13a2.36,2.36,0,0,1,1.66-.68l4.66,0A2.34,2.34,0,0,1,12.82,14Zm3.3-3.46a2.36,2.36,0,0,1-1.66.68H3.21a2.25,2.25,0,0,1,.68-1.64,2.36,2.36,0,0,1,1.66-.68H16.79A2.25,2.25,0,0,1,16.12,10.53Zm0-3.73a2.36,2.36,0,0,1-1.66.68H3.21a2.25,2.25,0,0,1,.68-1.64,2.36,2.36,0,0,1,1.66-.68H16.79A2.25,2.25,0,0,1,16.12,6.81Z"}));Vn("fluentfom/guten-block",{title:Gn("Fluent Forms"),icon:qn,category:"formatting",keywords:[Gn("Contact Form"),Gn("Fluent Forms"),Gn("Forms"),Gn("Advanced Forms"),Gn("fluentforms-gutenberg-block")],apiVersion:3,edit:Un})})()})();
Save File
Cancel