(function(){"use strict";var wp;(wp||={}).viewport=(()=>{var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf;var __hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function __require(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports;};var __export=(target,all)=>{for(var name in all)
__defProp(target,name,{get:all[name],enumerable:true});};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))
if(!__hasOwnProp.call(to,key)&&key!==except)
__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});}
return to;};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:true}):target,mod));var __toCommonJS=(mod)=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var require_compose=__commonJS({"package-external:@wordpress/compose"(exports,module){module.exports=window.wp.compose;}});var require_data=__commonJS({"package-external:@wordpress/data"(exports,module){module.exports=window.wp.data;}});var require_element=__commonJS({"package-external:@wordpress/element"(exports,module){module.exports=window.wp.element;}});var index_exports={};__export(index_exports,{ifViewportMatches:()=>if_viewport_matches_default,store:()=>store,withViewportMatch:()=>with_viewport_match_default});var import_compose=__toESM(require_compose(),1);var import_data2=__toESM(require_data(),1);var import_data=__toESM(require_data(),1);function reducer(state={},action){switch(action.type){case"SET_IS_MATCHING":return action.values;}
return state;}
var reducer_default=reducer;var actions_exports={};__export(actions_exports,{setIsMatching:()=>setIsMatching});function setIsMatching(values){return{type:"SET_IS_MATCHING",values};}
var selectors_exports={};__export(selectors_exports,{isViewportMatch:()=>isViewportMatch});function isViewportMatch(state,query){if(query.indexOf(" ")===-1){query=">= "+query;}
return!!state[query];}
var STORE_NAME="core/viewport";var store=(0,import_data.createReduxStore)(STORE_NAME,{reducer:reducer_default,actions:actions_exports,selectors:selectors_exports});(0,import_data.register)(store);var addDimensionsEventListener=(breakpoints,operators)=>{const setIsMatching2=(0,import_compose.debounce)(()=>{const values=Object.fromEntries(queries.map(([key,query])=>[key,query.matches]));(0,import_data2.dispatch)(store).setIsMatching(values);},0,{leading:true});const operatorEntries=Object.entries(operators);const queries=Object.entries(breakpoints).flatMap(([name,width])=>{return operatorEntries.map(([operator,condition])=>{const list=window.matchMedia(`(${condition}: ${width}px)`);list.addEventListener("change",setIsMatching2);return[`${operator} ${name}`,list];});});window.addEventListener("orientationchange",setIsMatching2);setIsMatching2();setIsMatching2.flush();};var listener_default=addDimensionsEventListener;var import_compose3=__toESM(require_compose(),1);var import_element=__toESM(require_element(),1);var import_compose2=__toESM(require_compose(),1);var withViewportMatch=(queries)=>{const queryEntries=Object.entries(queries);const useViewPortQueriesResult=()=>Object.fromEntries(queryEntries.map(([key,query])=>{let[operator,breakpointName]=query.split(" ");if(breakpointName===void 0){breakpointName=operator;operator=">=";}
return[key,(0,import_compose2.useViewportMatch)(breakpointName,operator)];}));return(0,import_compose2.createHigherOrderComponent)((WrappedComponent)=>{return function WithViewportMatch(props){const queriesResult=useViewPortQueriesResult();return(0,import_element.createElement)(WrappedComponent,{...props,...queriesResult});};},"withViewportMatch");};var with_viewport_match_default=withViewportMatch;var ifViewportMatches=(query)=>(0,import_compose3.createHigherOrderComponent)((0,import_compose3.compose)([with_viewport_match_default({isViewportMatch:query}),(0,import_compose3.ifCondition)((props)=>props.isViewportMatch)]),"ifViewportMatches");var if_viewport_matches_default=ifViewportMatches;var BREAKPOINTS={huge:1440,wide:1280,large:960,medium:782,small:600,mobile:480};var OPERATORS={"<":"max-width",">=":"min-width"};listener_default(BREAKPOINTS,OPERATORS);return __toCommonJS(index_exports);})();(window.wp||={}).viewport=wp.viewport;})();