{"version":3,"file":"useInheritedSectionBreakpoint.SWt6FHMf.mjs","names":["useContext","useState","useLayoutEffect","createContext","__esmMin","le","init_npm_react_18_3_1","_e","oe","B","PLACEHOLDER","init_placeholders","LEGACY_PLACEHOLDER","normalize","value","isPlaceholderHeading","text","PLACEHOLDER_HEADINGS","isPlaceholderDescription","PLACEHOLDER_DESCRIPTIONS","withoutPlaceholderDescription","withoutPlaceholderVideoTitle","isPlaceholderButtonLabel","PLACEHOLDER_BUTTON_LABELS","isPlaceholderDisclaimer","getPageHeadingTag","headingTag","isSectionContentEmpty","input","VIDEO_TITLE_PLACEHOLDER","init_placeholderContent","parseBreakpoint","readInheritedSectionBreakpoint","element","host","SECTION_BREAKPOINT_ATTR","useInheritedSectionBreakpoint","ref","contextBreakpoint","SectionBreakpointContext","domBreakpoint","setInheritedBreakpoint","inheritedBreakpoint","observer","cancelled","syncBreakpoint","tryAttach","useSlotFallbackBreakpoint","ownBreakpoint","init_useInheritedSectionBreakpoint"],"sources":["https:/framerusercontent.com/modules/KDfveHo63L4sw1u1VKXA/ZXrfzIqLTl9zHuAQh2P1/placeholderContent.js","https:/framerusercontent.com/modules/32lLnZM0JIvZiCq3FHwZ/WgKpuzdbDUVfrJppGYj1/useInheritedSectionBreakpoint.js"],"sourcesContent":["import{LEGACY_PLACEHOLDER,PLACEHOLDER}from\"https://framerusercontent.com/modules/OLc7zyD9XUIwhQjReyyh/2kEaZkeNd5UpNHwwEkVM/placeholders.js\";const PLACEHOLDER_HEADINGS=new Set([PLACEHOLDER.HEADING,PLACEHOLDER.PAGE_HEADING,PLACEHOLDER.HERO_HEADING,PLACEHOLDER.ITEM_HEADING,\"Short section heading goes here\",\"Short page heading goes here\",\"Short hero heading goes here\",\"Short item heading goes here\"]);const PLACEHOLDER_DESCRIPTIONS=new Set([PLACEHOLDER.DESCRIPTION,PLACEHOLDER.DESCRIPTION_SHORT,LEGACY_PLACEHOLDER.DESCRIPTION]);const PLACEHOLDER_BUTTON_LABELS=new Set([PLACEHOLDER.PRIMARY_BUTTON,PLACEHOLDER.SECONDARY_BUTTON,\"Get started\",\"Learn more\"]);function normalize(value){return(value??\"\").trim();}export function isPlaceholderHeading(value){const text=normalize(value);return text===\"\"||PLACEHOLDER_HEADINGS.has(text);}export function isPlaceholderDescription(value){const text=normalize(value);return text===\"\"||PLACEHOLDER_DESCRIPTIONS.has(text);}export function withoutPlaceholderDescription(value){return isPlaceholderDescription(value)?\"\":value??\"\";}export const VIDEO_TITLE_PLACEHOLDER=\"Video title\";export function withoutPlaceholderVideoTitle(value){const text=normalize(value);if(text===VIDEO_TITLE_PLACEHOLDER)return\"\";return isPlaceholderHeading(text)?\"\":text;}export function isPlaceholderButtonLabel(value){const text=normalize(value);return text===\"\"||PLACEHOLDER_BUTTON_LABELS.has(text);}export function isPlaceholderDisclaimer(value){return normalize(value)===\"\"||normalize(value)===\"Terms and conditions apply.\";}export function getResponsivePageHeadingTag(breakpoint,headingTag){return headingTag??(breakpoint===\"desktop\"?\"h1\":\"h2\");}export function getPageHeadingTag(headingTag){return headingTag??\"h1\";}export function isSectionContentEmpty(input){return isPlaceholderHeading(input.heading)&&isPlaceholderDescription(input.description)&&isPlaceholderButtonLabel(input.buttonLabel)&&isPlaceholderDisclaimer(input.disclaimer);}\nexport const __FramerMetadata__ = {\"exports\":{\"isPlaceholderButtonLabel\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getResponsivePageHeadingTag\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isSectionContentEmpty\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isPlaceholderHeading\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isPlaceholderDisclaimer\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getPageHeadingTag\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"isPlaceholderDescription\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"VIDEO_TITLE_PLACEHOLDER\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withoutPlaceholderVideoTitle\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withoutPlaceholderDescription\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}","import{createContext,useContext,useLayoutEffect,useState}from\"react\";export const SECTION_BREAKPOINT_ATTR=\"data-bunq-section-breakpoint\";export const SectionBreakpointContext=/*#__PURE__*/createContext(undefined);function parseBreakpoint(value){if(value===\"desktop\"||value===\"tablet\"||value===\"phone\"){return value;}return undefined;}export function readInheritedSectionBreakpoint(element){if(!element)return undefined;const host=element.closest(`[${SECTION_BREAKPOINT_ATTR}]`);if(!(host instanceof HTMLElement))return undefined;return parseBreakpoint(host.getAttribute(SECTION_BREAKPOINT_ATTR));}export function useInheritedSectionBreakpoint(ref){const contextBreakpoint=useContext(SectionBreakpointContext);const[domBreakpoint,setInheritedBreakpoint]=useState();const inheritedBreakpoint=domBreakpoint??contextBreakpoint;useLayoutEffect(()=>{const element=ref.current;if(!element)return undefined;let observer;let cancelled=false;const syncBreakpoint=()=>{setInheritedBreakpoint(readInheritedSectionBreakpoint(element));};const tryAttach=()=>{const host=element.closest(`[${SECTION_BREAKPOINT_ATTR}]`);if(!(host instanceof HTMLElement))return false;syncBreakpoint();observer?.disconnect();observer=new MutationObserver(syncBreakpoint);observer.observe(host,{attributes:true,attributeFilter:[SECTION_BREAKPOINT_ATTR]});return true;};if(!tryAttach()){queueMicrotask(()=>{if(!cancelled)tryAttach();});}return()=>{cancelled=true;observer?.disconnect();};},[ref]);return inheritedBreakpoint;}export function useSlotFallbackBreakpoint(ownBreakpoint){const contextBreakpoint=useContext(SectionBreakpointContext);if(ownBreakpoint!==\"desktop\"||contextBreakpoint===undefined){return ownBreakpoint;}return contextBreakpoint;}// recompile: 1792504624476\n\nexport const __FramerMetadata__ = {\"exports\":{\"useInheritedSectionBreakpoint\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SectionBreakpointContext\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"SECTION_BREAKPOINT_ATTR\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"useSlotFallbackBreakpoint\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"readInheritedSectionBreakpoint\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./useInheritedSectionBreakpoint.map"],"mappings":"A,2LAA6oB,SAASa,EAAUC,EAAM,CAAC,OAAOA,GAAO,GAAA,CAAI,KAAK,CAAE,CAAC,SAAgBC,EAAqBD,EAAM,CAAC,IAAME,EAAKH,EAAUC,CAAK,EAAE,OAAOE,IAAO,IAAIC,EAAqB,IAAID,CAAI,CAAE,CAAC,SAAgBE,EAAyBJ,EAAM,CAAC,IAAME,EAAKH,EAAUC,CAAK,EAAE,OAAOE,IAAO,IAAIG,EAAyB,IAAIH,CAAI,CAAE,CAAC,SAAgBI,EAA8BN,EAAM,CAAC,OAAOI,EAAyBJ,CAAK,EAAE,GAAGA,GAAO,EAAG,CAAoD,SAAgBO,EAA6BP,EAAM,CAAC,IAAME,EAAKH,EAAUC,CAAK,EAA6C,OAAxCE,IAAA,eAA+CD,EAAqBC,CAAI,EAAnC,GAAwCA,CAAK,CAAC,SAAgBM,EAAyBR,EAAM,CAAC,IAAME,EAAKH,EAAUC,CAAK,EAAE,OAAOE,IAAO,IAAIO,EAA0B,IAAIP,CAAI,CAAE,CAAC,SAAgBQ,EAAwBV,EAAM,CAAC,OAAOD,EAAUC,CAAK,IAAI,IAAID,EAAUC,CAAK,IAAI,6BAA8B,CAA2H,SAAgBW,EAAkBC,EAAW,CAAC,OAAOA,GAAY,IAAK,CAAC,SAAgBC,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