{"version":3,"file":"Blog.BbBSCL_x.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js","https:/framer.com/m/Utilities-LgUQ.js@YgTH7d8XoflBisXAiR7m","https:/framerusercontent.com/modules/8IJxaKQCb443ePbwbpyX/ZrIgcoCkEhCcgOKhFBgE/Blog.js"],"sourcesContent":["/**\n * Reusable framer utilities\n * @description This file contains utility functions which can be used in any code-overides or\n * code-components in framer.\n * @author Manjunath\n * @see {@link https://manjumjn.com/}\n *//**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */import{jsx as _jsx}from\"react/jsx-runtime\";export default function Utilities(props){return /*#__PURE__*/_jsx(\"div\",{});}/**\n * Get element props by tag inside the component\n * @param {Object} elementProps Component props\n * @param {String} elementTag Tag of props to be returned. Eg: a, div, p\n * @returns {Object} props of the `elementTag`\n */export const getPropertiesByTag=(elemProps,elementTag)=>{// Check if the current object is of the target type\nif(elemProps.type===elementTag){return elemProps;}// Iterate through object properties that can hold nested objects (children and props)\nfor(const key of[\"children\",\"props\"]){if(elemProps[key]&&typeof elemProps[key]===\"object\"){// Check if props has more children, if so get first one\nconst childrenProps=Array.isArray(elemProps[key])?elemProps[key][0]:elemProps[key];// Recursively search for the target type within the nested object\nconst result=getPropertiesByTag(childrenProps,elementTag);if(result){return result;}}}// Not found in current object or its children/props\nreturn null;};\nexport const __FramerMetadata__ = {\"exports\":{\"getPropertiesByTag\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"Utilities\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Utilities.map","/*\n * Utilities\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js\"\nexport { default } from \"https://framerusercontent.com/modules/1rYQMgPBy2BHwN1a8Z5O/YgTH7d8XoflBisXAiR7m/Utilities.js\"\n","import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";import{createStore}from\"https://framer.com/m/framer/store.js@^1.0.0\";import{getPropertiesByTag}from\"https://framer.com/m/Utilities-LgUQ.js@YgTH7d8XoflBisXAiR7m\";// import { getPropertiesByTag } from \"./Miscellaneous.tsx\"\n// Learn more: https://www.framer.com/docs/guides/overrides/\nconst useStore=createStore({titles:[],chagedLink:false,className:\"\",pTagStyle:{},pTagClass:\"\",aTagClass:\"\"});export function withClassNameWeglot(Component){return props=>{const newClassName=`${props.className||\"\"} blog-article`.trim();return /*#__PURE__*/_jsx(Component,{...props,className:newClassName});};}export function getTitles(Component){return props=>{const[store,setStore]=useStore();const[activeIndex,setActiveIndex]=useState(null);useEffect(()=>{const html=document.querySelector(\"html\");html.style.scrollBehavior=\"smooth\";const content=document.getElementById(\"content-data\");if(!content)return;const ptagProps=getPropertiesByTag(props,\"p\");const atagProps=getPropertiesByTag(ptagProps||{},\"a\");const headings=content.querySelectorAll(\"h2\");const headingsArray=[];for(let i=0;i<headings.length;i++){const el=headings[i];el.style.position=\"relative\";el.insertAdjacentHTML(\"beforeend\",`<span id=\"title-${i}\" style=\"position: absolute; top:-144px;\"></span>`);headingsArray.push(el.innerText.replace(/(\\r\\n|\\n|\\r)/gm,\"\"));}setStore({titles:headingsArray,pTagStyle:ptagProps?.props?.style||{},pTagClass:ptagProps?.props?.className||\"\",aTagClass:atagProps?.props?.className||\"\"});},[]);const handleClick=index=>{setActiveIndex(index);};const baseLinkStyle={color:\"#000\",textDecoration:\"none\",transition:\"color 0.2s ease\"};const hoverStyle={color:\"#0E6FDE\"};return /*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",flexDirection:\"column\",gap:\"12px\"},children:Array.isArray(store.titles)&&store.titles.map((element,i)=>{const isActive=activeIndex===i;return /*#__PURE__*/_jsx(\"p\",{className:`framer-text ${store.pTagClass}`,style:store.pTagStyle,children:/*#__PURE__*/_jsx(\"a\",{href:`#title-${i}`,onClick:()=>handleClick(i),className:`framer-text ${store.aTagClass}`,style:{...baseLinkStyle,...isActive?hoverStyle:{}},onMouseEnter:e=>e.currentTarget.style.color=\"#0E6FDE\",onMouseLeave:e=>{if(!isActive){e.currentTarget.style.color=baseLinkStyle.color;}},children:element})},i);})});};}const useStore2=createStore({titles:[],pTagStyle:{},pTagClass:\"\",aTagClass:\"\"});export function getTitlesSpoilerStyled(Component){return props=>{const[store,setStore]=useStore();const[open,setOpen]=useState(false);const[activeIndex,setActiveIndex]=useState(null);useEffect(()=>{const html=document.querySelector(\"html\");html.style.scrollBehavior=\"smooth\";const content=document.getElementById(\"content-data\");if(!content)return;const ptagProps=getPropertiesByTag(props,\"p\");const atagProps=getPropertiesByTag(ptagProps||{},\"a\");const headings=content.querySelectorAll(\"h2\");const titles=[];headings.forEach((el,i)=>{if(!document.getElementById(`title-${i}`)){el.style.position=\"relative\";el.insertAdjacentHTML(\"beforeend\",`<span id=\"title-${i}\" style=\"position: absolute; top:-144px;\"></span>`);}titles.push({text:el.innerText,id:`title-${i}`});});setStore({titles,pTagStyle:ptagProps?.props?.style||{},pTagClass:ptagProps?.props?.className||\"\",aTagClass:atagProps?.props?.className||\"\"});},[]);const handleClick=index=>{setActiveIndex(index);};const baseLinkStyle={color:\"#000\",textDecoration:\"none\",transition:\"color 0.2s ease\",fontSize:\"16px\",fontFamily:\"Inter\"};const hoverStyle={color:\"#0E6FDE\"};return /*#__PURE__*/_jsx(Component,{...props,children:/*#__PURE__*/_jsxs(\"div\",{style:{borderRadius:\"16px\",boxShadow:\"0 4px 12px rgba(0, 0, 0, 0.06)\",padding:\"20px\",background:\"#fff\",maxWidth:\"100%\",marginBottom:\"20px\"},children:[/*#__PURE__*/_jsxs(\"div\",{onClick:()=>setOpen(!open),style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",cursor:\"pointer\"},children:[/*#__PURE__*/_jsx(\"h3\",{style:{fontFamily:\"Inter\",fontSize:\"18px\",fontWeight:600,color:\"#0E6FDE\",margin:0},children:\"Table des mati\\xe8res\"}),/*#__PURE__*/_jsx(\"span\",{style:{fontSize:\"22px\",fontWeight:\"bold\",color:\"#0E6FDE\",lineHeight:1},children:open?\"−\":\"+\"})]}),open&&/*#__PURE__*/_jsx(\"div\",{style:{marginTop:\"12px\",paddingLeft:\"0px\"},children:store.titles.map((item,i)=>{const isActive=activeIndex===i;return /*#__PURE__*/_jsx(\"p\",{className:`framer-text ${store.pTagClass}`,style:{margin:\"8px 0\",...store.pTagStyle},children:/*#__PURE__*/_jsx(\"a\",{href:`#${item.id}`,onClick:()=>handleClick(i),className:`framer-text ${store.aTagClass}`,style:{...baseLinkStyle,...isActive?hoverStyle:{}},onMouseEnter:e=>e.currentTarget.style.color=\"#0E6FDE\",onMouseLeave:e=>{if(!isActive){e.currentTarget.style.color=baseLinkStyle.color;}},children:item.text})},i);})})]})});};}\nexport const __FramerMetadata__ = {\"exports\":{\"getTitles\":{\"type\":\"reactHoc\",\"name\":\"getTitles\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"getTitlesSpoilerStyled\":{\"type\":\"reactHoc\",\"name\":\"getTitlesSpoilerStyled\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withClassNameWeglot\":{\"type\":\"reactHoc\",\"name\":\"withClassNameWeglot\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Blog.map"],"mappings":"qMAY6C,EAK7B,GAAoB,EAAU,IAAa,CAC3D,GAAG,EAAU,OAAO,EAAY,OAAO,EACvC,IAAI,IAAM,IAAM,CAAC,W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