{"version":3,"file":"FAQDynamique.BoxxW4yc.mjs","names":["useState","p"],"sources":["https:/framerusercontent.com/modules/oK4jJHHr9mCckZHmgNS6/POS2IDGCHFge9SLmqzhA/FAQDynamique.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect}from\"react\";// ─── JSON-LD FAQ (rendu côté serveur) ─────────────────────────────────────────\n// Strip les balises HTML pour le JSON-LD (Google veut du texte pur)\nfunction stripHtml(html){return html.replace(/<[^>]*>/g,\"\").replace(/&nbsp;/g,\" \").trim();}// Construit le bloc FAQPage en JSON pour la section.\n// La chaîne est rendue directement dans le JSX (<script>), donc présente dès le\n// HTML servi par le serveur, sans dépendre du JavaScript exécuté côté client.\n// On échappe \"<\" en \\u003c pour empêcher toute fermeture prématurée de la balise <script>\n// si une réponse contient des balises HTML.\nfunction buildFaqSchema(items){if(items.length===0)return\"\";const schema={\"@context\":\"https://schema.org\",\"@type\":\"FAQPage\",mainEntity:items.map(item=>({\"@type\":\"Question\",name:item.question.trim(),// Texte pur pour le JSON-LD — les liens HTML sont retirés\n    acceptedAnswer:{\"@type\":\"Answer\",text:stripHtml(item.answer)}}))};return JSON.stringify(schema).replace(/</g,\"\\\\u003c\");}// ─── Registre TOC ─────────────────────────────────────────────────────────────\nfunction getTocRegistry(){const w=window;if(!w.__fleetiFaqToc)w.__fleetiFaqToc=new Map;return w.__fleetiFaqToc;}const TOC_EVENT=\"fleeti-toc-update\";function notifyToc(){window.dispatchEvent(new CustomEvent(TOC_EVENT));}// ─── FAQ Item — supporte le HTML dans les réponses ────────────────────────────\nfunction FAQItem({question,answer}){const[isOpen,setIsOpen]=useState(false);// Détecte si la réponse contient du HTML\nconst isHtml=/<[a-z][\\s\\S]*>/i.test(answer);return /*#__PURE__*/_jsxs(\"div\",{onClick:()=>setIsOpen(!isOpen),style:{width:\"100%\",backgroundColor:isOpen?\"rgb(250, 250, 250)\":\"rgb(255, 255, 255)\",borderRadius:16,padding:20,cursor:\"pointer\",boxSizing:\"border-box\",transition:\"background-color 0.2s ease\"},children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",gap:16},children:[/*#__PURE__*/_jsx(\"span\",{style:{fontFamily:\"Satoshi, sans-serif\",fontWeight:700,fontSize:18,lineHeight:\"22px\",letterSpacing:\"-0.5px\",color:\"rgb(33, 36, 39)\",flex:1},children:question}),/*#__PURE__*/_jsx(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",style:{transform:isOpen?\"rotate(180deg)\":\"rotate(0deg)\",transition:\"transform 0.3s ease\",opacity:.5,flexShrink:0},children:/*#__PURE__*/_jsx(\"path\",{d:\"M6 9L12 15L18 9\",stroke:\"rgb(33, 36, 39)\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})})]}),answer?isHtml?// Réponse avec HTML — liens cliquables, masquée en CSS quand fermée\n/*#__PURE__*/_jsx(\"div\",{onClick:e=>e.stopPropagation(),dangerouslySetInnerHTML:{__html:answer},style:{display:isOpen?\"block\":\"none\",marginTop:12,fontFamily:\"Satoshi, sans-serif\",fontWeight:400,fontSize:16,lineHeight:\"22px\",letterSpacing:\"0.16px\",color:\"rgb(66, 72, 78)\",whiteSpace:\"pre-line\"}}):// Réponse texte pur — masquée en CSS quand fermée\n/*#__PURE__*/_jsx(\"div\",{style:{display:isOpen?\"block\":\"none\",marginTop:12,fontFamily:\"Satoshi, sans-serif\",fontWeight:400,fontSize:16,lineHeight:\"22px\",letterSpacing:\"0.16px\",color:\"rgb(66, 72, 78)\",whiteSpace:\"pre-line\"},children:answer}):null]});}// ─── Styles globaux pour les liens dans les réponses ─────────────────────────\n// Injectés une seule fois dans le <head>\nfunction injectAnswerLinkStyles(){const styleId=\"faq-answer-link-styles\";if(document.getElementById(styleId))return;const style=document.createElement(\"style\");style.id=styleId;style.textContent=`\n        .faq-answer a {\n            color: rgb(57, 121, 193);\n            text-decoration: underline;\n            text-decoration-color: rgba(57, 121, 193, 0.4);\n            text-underline-offset: 2px;\n            font-weight: 500;\n            transition: color 0.15s ease, text-decoration-color 0.15s ease;\n        }\n        .faq-answer a:hover {\n            color: rgb(45, 96, 154);\n            text-decoration-color: rgb(45, 96, 154);\n        }\n    `;document.head.appendChild(style);}export default function FAQDynamique({titre=\"Questions fr\\xe9quentes\",questionCount=6,injectSchema=true,...props}){const[isMobile,setIsMobile]=useState(false);useEffect(()=>{injectAnswerLinkStyles();const mq=window.matchMedia(\"(max-width: 768px)\");setIsMobile(mq.matches);const handler=e=>setIsMobile(e.matches);mq.addEventListener(\"change\",handler);return()=>mq.removeEventListener(\"change\",handler);},[]);const containerPadding=isMobile?\"20px 20px 20px 20px\":\"50px 40px 30px 40px\";const items=[];for(let i=1;i<=Math.min(questionCount,10);i++){const question=props[`question${i}`];const answer=props[`answer${i}`];if(question?.trim())items.push({question,answer:answer||\"\"});}const registryKey=titre.toLowerCase().normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g,\"\").replace(/[^a-z0-9]+/g,\"-\").replace(/^-|-$/g,\"\");// ── JSON-LD rendu côté serveur (présent dès le source HTML) ───────────────\n// Calculé au rendu (et non dans un useEffect), donc inclus dans le HTML\n// pré-rendu par Framer et visible des crawlers qui n'exécutent pas le JS.\nconst faqSchemaJson=injectSchema?buildFaqSchema(items):\"\";// ── Registre TOC ──────────────────────────────────────────────────────────\nuseEffect(()=>{const toc=getTocRegistry();if(items.length>0){const existing=toc.get(registryKey);toc.set(registryKey,{titre,mountTime:existing?.mountTime??Date.now()});}else{toc.delete(registryKey);}notifyToc();return()=>{getTocRegistry().delete(registryKey);notifyToc();};},[registryKey,titre,items.length]);return /*#__PURE__*/_jsxs(\"div\",{id:`faq-${registryKey}`,style:{width:\"100%\",backgroundColor:\"rgb(255, 255, 255)\",display:\"flex\",flexDirection:\"column\",alignItems:\"start\",gap:10,padding:containerPadding,boxSizing:\"border-box\"},children:[faqSchemaJson?/*#__PURE__*/_jsx(\"script\",{type:\"application/ld+json\",dangerouslySetInnerHTML:{__html:faqSchemaJson}}):null,/*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",maxWidth:760,display:\"flex\",flexDirection:\"column\",alignItems:\"start\",gap:24},children:/*#__PURE__*/_jsx(\"h2\",{style:{fontFamily:\"Satoshi, sans-serif\",fontWeight:700,fontSize:20,lineHeight:\"28px\",letterSpacing:\"-0.3px\",color:\"rgb(33, 36, 39)\",margin:0},children:titre})}),/*#__PURE__*/_jsx(\"div\",{className:\"faq-answer\",style:{width:\"100%\",maxWidth:900,display:\"flex\",flexDirection:\"column\",alignItems:\"stretch\",gap:10},children:items.length>0?items.map((item,index)=>/*#__PURE__*/_jsx(FAQItem,{question:item.question,answer:item.answer},index)):/*#__PURE__*/_jsx(\"div\",{style:{padding:20,borderRadius:16,backgroundColor:\"rgb(250, 250, 250)\",fontFamily:\"Satoshi, sans-serif\",fontSize:16,color:\"rgb(100, 109, 118)\",textAlign:\"center\"},children:\"Ajoutez vos questions dans les propri\\xe9t\\xe9s du composant.\"})})]});}// ─── Property Controls ────────────────────────────────────────────────────────\nconst controls={titre:{type:ControlType.String,title:\"Titre section\",defaultValue:\"Questions fr\\xe9quentes\"},questionCount:{type:ControlType.Number,title:\"Nombre de Q/R\",defaultValue:6,min:1,max:10,step:1,displayStepper:true},injectSchema:{type:ControlType.Boolean,title:\"JSON-LD SEO\",defaultValue:true,enabledTitle:\"Actif\",disabledTitle:\"D\\xe9sactiv\\xe9\"}};for(let i=1;i<=10;i++){const n=i;controls[`question${n}`]={type:ControlType.String,title:`Q${n} \\xb7 Question`,defaultValue:n===1?\"Comment connectez-vous les op\\xe9rations terrain \\xe0 votre plateforme ?\":\"\",hidden:p=>n>p.questionCount};controls[`answer${n}`]={type:ControlType.String,title:`Q${n} \\xb7 R\\xe9ponse`,defaultValue:n===1?\"Nous utilisons des boitiers intelligents, certifi\\xe9s CE et adaptables sur tous types d'\\xe9quipements.\":\"\",displayTextArea:true,hidden:p=>n>p.questionCount};}addPropertyControls(FAQDynamique,controls);\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQDynamique\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQDynamique.map"],"mappings":"sMAEA,SAAS,EAAU,EAAK,CAAC,OAAO,EAAK,QAAQ,WAAW,GAAG,CAAC,QAAQ,UAAU,IAAI,CAAC,MAAM,CAKzF,SAAS,EAAe,EAAM,CAAC,GAAG,EAAM,SAAS,EAAE,MAAM,GAAG,IAAM,EAAO,CAAC,WAAW,qBAAqB,QAAQ,UAAU,WAAW,EAAM,IAAI,IAAO,CAAC,QAAQ,WAAW,KAAK,EAAK,SAAS,MAAM,CACjM,eAAe,CAAC,QAAQ,SAAS,KAAK,EAAU,EAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,OAAO,KAAK,UAAU,EAAO,CAAC,QAAQ,KAAK,UAAU,CAC3H,SAAS,GAAgB,CAAC,IAAM,EAAE,EAAqD,MAA9C,CAAqB,EAAE,iBAAe,IAAI,IAAW,EAAE,eAAoD,SAAS,GAAW,CAAC,EAAO,cAAc,IAAI,YAAY,EAAU,CAAC,CACzN,SAAS,EAAQ,CAAC,WAAS,UAAQ,CAAC,GAAK,CAAC,EAAO,GAAWA,EAAS,GAAM,CACrE,EAAO,kBAAkB,KAAK,EAAO,CAAC,OAAoB,EAAM,MAAM,CAAC,YAAY,EAAU,CAAC,EAAO,CAAC,MAAM,CAAC,MAAM,OAAO,gBAAgB,EAAO,qBAAqB,qBAAqB,aAAa,GAAG,QAAQ,GAAG,OAAO,UAAU,UAAU,aAAa,WAAW,6BAA6B,CAAC,SAAS,CAAc,EAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,WAAW,SAAS,eAAe,gBAAgB,IAAI,GAAG,CAAC,SAAS,CAA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