(()=>{"use strict";var e={2619:e=>{e.exports=window.wp.hooks},6272:(e,o,n)=>{n.d(o,{Ap:()=>l,K8:()=>a,_i:()=>i,kn:()=>s,u5:()=>r});var t=n(2619);const s={DESKTOP:"desktop",TABLET:"tablet",MOBILE:"mobile"},i={hideOnDesktop:!1,hideOnTablet:!1,hideOnMobile:!1},r=(0,t.applyFilters)("spectra.excludedResponsiveConditionsBlocks",[]),l=(0,t.applyFilters)("spectra.supportedResponsiveConditionsBlocks",["core/image"]),a=["spectra/","spectra-pro/"]},8692:(e,o,n)=>{n.d(o,{W:()=>i});var t=n(2619),s=n(6272);const i=e=>{if(!e||!e.name)return!1;const o=e.name;return!(0,t.applyFilters)("spectra.excludedResponsiveConditionsBlocks",s.u5,o).includes(o)&&(!!(0,t.applyFilters)("spectra.supportedResponsiveConditionsBlocks",s.Ap,o).includes(o)||(0,t.applyFilters)("spectra.allowedResponsiveConditionsPrefixes",s.K8,o).some((e=>o.startsWith(e))))}}},o={};function n(t){var s=o[t];if(void 0!==s)return s.exports;var i=o[t]={exports:{}};return e[t](i,i.exports,n),i.exports}n.n=e=>{var o=e&&e.__esModule?()=>e.default:()=>e;return n.d(o,{a:o}),o},n.d=(e,o)=>{for(var t in o)n.o(o,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:o[t]})},n.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o);const t=window.wp.blockEditor,s=window.wp.components,i=window.wp.i18n,r=window.wp.compose,l=window.wp.data;var a=n(6272),d=n(8692);const p=window.ReactJSXRuntime,c=e=>{const{setAttributes:o,attributes:{responsiveConditions:n=a._i}}=e,t=(e,t)=>{o({responsiveConditions:{...n,[e]:t}})};return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(s.__experimentalToolsPanelItem,{label:(0,i.__)("Hide on Desktop","ultimate-addons-for-gutenberg"),hasValue:()=>n.hideOnDesktop,onDeselect:()=>t("hideOnDesktop",!1),isShownByDefault:!0,children:(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,i.__)("Hide on Desktop","ultimate-addons-for-gutenberg"),checked:n.hideOnDesktop,onChange:e=>t("hideOnDesktop",e)})}),(0,p.jsx)(s.__experimentalToolsPanelItem,{label:(0,i.__)("Hide on Tablet","ultimate-addons-for-gutenberg"),hasValue:()=>n.hideOnTablet,onDeselect:()=>t("hideOnTablet",!1),isShownByDefault:!0,children:(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,i.__)("Hide on Tablet","ultimate-addons-for-gutenberg"),checked:n.hideOnTablet,onChange:e=>t("hideOnTablet",e)})}),(0,p.jsx)(s.__experimentalToolsPanelItem,{label:(0,i.__)("Hide on Mobile","ultimate-addons-for-gutenberg"),hasValue:()=>n.hideOnMobile,onDeselect:()=>t("hideOnMobile",!1),isShownByDefault:!0,children:(0,p.jsx)(s.ToggleControl,{__nextHasNoMarginBottom:!0,label:(0,i.__)("Hide on Mobile","ultimate-addons-for-gutenberg"),checked:n.hideOnMobile,onChange:e=>t("hideOnMobile",e)})})]})};(0,r.createHigherOrderComponent)((e=>o=>{if(!(0,d.W)({name:o.name}))return(0,p.jsx)(e,{...o});const{setAttributes:n,isSelected:r}=o;return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(e,{...o}),r&&(0,p.jsx)(t.InspectorControls,{children:(0,p.jsxs)(s.__experimentalToolsPanel,{label:(0,i.__)("Responsive Conditions","ultimate-addons-for-gutenberg"),resetAll:()=>{n({responsiveConditions:a._i})},children:[(0,p.jsx)(c,{...o}),(0,p.jsx)("div",{style:{gridColumn:"span 2"},children:(0,p.jsx)(s.BaseControl,{help:(0,i.__)("Hide this block on desktop, tablet, or mobile devices. Striped blocks in the editor indicate hidden blocks that will not appear on the live site.","ultimate-addons-for-gutenberg")})})]})})]})}),"addResponsiveConditionsControls"),(0,r.createHigherOrderComponent)((e=>o=>{const{attributes:n,name:t}=o;if(!(0,d.W)({name:t})||!n?.responsiveConditions)return(0,p.jsx)(e,{...o});const{responsiveConditions:s}=n;let i=!1;const r=(0,l.useSelect)((e=>e("core/editor")?.getDeviceType?.()||a.kn.DESKTOP),[]).toLowerCase();(r===a.kn.DESKTOP&&s.hideOnDesktop||r===a.kn.TABLET&&s.hideOnTablet||r===a.kn.MOBILE&&s.hideOnMobile)&&(i=!0);const c=i?"spectra-responsive-hidden":"",u=c?{...o,className:o.className?`${o.className} ${c}`:c}:o;return(0,p.jsx)(e,{...u})}),"addResponsiveConditionsClasses")})();