{"version":3,"file":"FAQ_CHAT_WIDGET.BNPWE2jZ.mjs","names":["React.useState","React.useMemo"],"sources":["https:/framerusercontent.com/modules/VTAAxgjX74CMXiS0xvoQ/Idybly3WLbVDt7XrSPSU/FAQ_CHAT_WIDGET.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * FAQChatWidget – Widget FAQ flottant avec recherche (style chatbot)\n * ---------------------------------------------------------------\n * ✅ Fonctionne 100% côté Framer (sans service externe)\n * ✅ Bouton flottant en bas à droite\n * ✅ Liste de cartes cliquables (question ➜ affiche la réponse)\n * ✅ Barre de recherche (filtre en temps réel)\n * ✅ Personnalisable depuis les Property Controls\n *\n * ASTUCE\n * - Place le composant sur une page une seule fois (il s'affichera en bas à droite).\n * - Édite les Q/R dans le champ JSON ou via le tableau intégré aux controls.\n */// Exemple de données par défaut\nconst defaultItems=[{q:\"Quelle application mes \\xe9quipes doivent installer ?\",a:\"Les membres d’\\xe9quipe (closeurs, livreurs…) doivent installer **ECEAMS Teams** t\\xe9l\\xe9chargeable <a href='https://eceams.com/teams' target='_blank' rel='noopener'>ici</a>. L’app **ECEAMS** est pour l’administrateur/gestion..\"},{q:\"Faut-il obligatoirement Shopify ?\",a:\"Non. ECEAMS g\\xe8re aussi les **commandes manuelles** et les **multi-boutiques**.\"},{q:\"R\\xf4les dans ECEAMS : quelle diff\\xe9rence entre Responsable et Closeur ?\",a:\"<p><strong>Closeur</strong> : traite ses commandes. Il peut mettre les statuts <em>Rejet\\xe9</em>, <em>Annul\\xe9</em>, <em>Report\\xe9</em>. Il ne peut pas mettre <em>En attente</em> (ce statut est automatique) ni <em>Livr\\xe9</em> tant que le livreur n’a pas confirm\\xe9 la livraison.</p><p><strong>Responsable</strong> : m\\xeames capacit\\xe9s qu’un closeur, mais avec <strong>droits \\xe9tendus</strong> : il peut mettre <em>tous</em> les statuts (y compris <em>En attente</em> et <em>Livr\\xe9</em> m\\xeame si la commande n’est pas assign\\xe9e \\xe0 un livreur), et il peut <strong>retirer/r\\xe9assigner</strong> des closeurs sur les commandes des pays qui lui sont attribu\\xe9s.</p>\"},{q:\"Pourquoi le closeur ne peut pas mettre le statut \\xab En attente \\xbb ?\",a:\"<p>Parce que <strong>\\xab En attente \\xbb est pos\\xe9 automatiquement</strong> d\\xe8s que le closeur <strong>attribue la commande \\xe0 un livreur</strong>. Cela \\xe9vite les incoh\\xe9rences et garantit que l’\\xe9tat refl\\xe8te bien que la commande est chez le livreur.</p>\"},{q:\"Pourquoi le closeur ne peut pas mettre \\xab Livr\\xe9 \\xbb directement ?\",a:\"<p>Pour s\\xe9curiser le flux : d’abord, <strong>le livreur marque la livraison comme \\xab Livr\\xe9 \\xbb</strong> dans son application. Ensuite, le closeur re\\xe7oit une <strong>notification</strong> et voit l’<strong>ic\\xf4ne de moto en vert</strong> (preuve de livraison c\\xf4t\\xe9 livreur). <br/>\\xc0 partir de l\\xe0 seulement, le closeur peut mettre le statut <strong>\\xab Livr\\xe9 \\xbb</strong> sur la commande.</p>\"},{q:\"Que se passe-t-il quand le closeur met \\xab Livr\\xe9 \\xbb ?\",a:\"<p>Le statut <strong>devient d\\xe9finitif</strong> (on ne peut plus l’annuler) et le <strong>stock est recalcul\\xe9 automatiquement</strong> (d\\xe9cr\\xe9ment\\xe9). Cette \\xe9tape cl\\xf4ture la commande dans le syst\\xe8me.</p>\"},{q:\"D\\xe9finitions des statuts (r\\xe9sum\\xe9)\",a:\"<ul><li><strong>Rejet\\xe9</strong> : le client refuse la commande.</li><li><strong>Annul\\xe9</strong> : la commande est annul\\xe9e (erreur, doublon, etc.).</li><li><strong>Report\\xe9</strong> : rappel/traitement d\\xe9cal\\xe9 \\xe0 une date ult\\xe9rieure.</li><li><strong>En attente</strong> : <em>automatique</em> quand la commande est <strong>assign\\xe9e \\xe0 un livreur</strong> (chez le livreur, en cours de livraison).</li><li><strong>Livr\\xe9</strong> : <em>s\\xe9quence s\\xe9curis\\xe9e</em> : le livreur confirme d’abord la livraison → notification + ic\\xf4ne moto verte → le closeur peut ensuite marquer \\xab Livr\\xe9 \\xbb (statut final, impact stock).</li></ul>\"},{q:\"Le responsable peut-il forcer ou corriger un statut ?\",a:\"<p>Oui. Le <strong>Responsable</strong> peut appliquer <em>tous</em> les statuts (y compris <em>En attente</em> et <em>Livr\\xe9</em> sans assignation pr\\xe9alable), et il peut <strong>retirer</strong> un closeur d’une commande ou <strong>r\\xe9assigner</strong> la commande dans les pays dont il a la charge.</p> Cependant, une fois la commande marqu\\xe9e comme \\xe9tant livr\\xe9e, le responsable ne peut pas l'annuler. Seul le boutiquier le peut\"},{q:\"Comment activer mon abonnement ?\",a:\"Apr\\xe8s votre paiement, envoyez la preuve et l’e‑mail du compte ECEAMS. L’activation est faite sous 5h ouvrables.\"},{q:\"Puis‑je utiliser ECEAMS sans boutique Shopify ?\",a:\"Oui. ECEAMS g\\xe8re aussi les commandes manuelles et multi‑boutiques sans Shopify.\"}];// Petit utilitaire pour parser en douceur le JSON fourni en prop\nfunction safeParseJSON(text,fallback){try{const parsed=JSON.parse(text);if(Array.isArray(parsed))return parsed;return fallback;}catch(e){return fallback;}}export default function FAQChatWidget(props){const{title,placeholder,itemsJSON,buttonLabel,openByDefault,accentColor,cardRadius,maxHeight,shadow,zIndex}=props;const[open,setOpen]=React.useState(!!openByDefault);const[query,setQuery]=React.useState(\"\");const[expandedIndex,setExpandedIndex]=React.useState(null);const items=React.useMemo(()=>{const parsed=safeParseJSON(itemsJSON,defaultItems);return parsed.map(it=>({q:String(it.q||\"\").trim(),a:String(it.a||\"\").trim()}));},[itemsJSON]);const filtered=items.filter(it=>{if(!query)return true;const qlc=query.toLowerCase();return it.q.toLowerCase().includes(qlc)||it.a.toLowerCase().includes(qlc);});const theme={accent:accentColor||\"#4f46e5\",radius:cardRadius,shadow:shadow?\"0 10px 30px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.08)\":\"0 1px 3px rgba(0,0,0,0.08)\"};return /*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",right:16,bottom:16,zIndex},children:[/*#__PURE__*/_jsx(\"button\",{onClick:()=>setOpen(v=>!v),style:{display:open?\"none\":\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",width:56,height:56,borderRadius:999,background:theme.accent,color:\"white\",fontWeight:700,border:\"none\",cursor:\"pointer\",boxShadow:theme.shadow},\"aria-label\":buttonLabel,children:buttonLabel||\"?\"}),open&&/*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",inset:0,zIndex:(zIndex||9999)+1},onClick:()=>setOpen(false),children:[/*#__PURE__*/_jsx(\"div\",{style:{position:\"absolute\",inset:0,background:\"rgba(0,0,0,0.25)\",backdropFilter:\"blur(1px)\"}}),/*#__PURE__*/_jsxs(\"div\",{style:{position:\"fixed\",right:16,bottom:16,width:360,maxWidth:\"calc(100vw - 32px)\",background:\"#fff\",borderRadius:16,boxShadow:theme.shadow,overflow:\"hidden\"},onClick:e=>e.stopPropagation(),children:[/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",alignItems:\"center\",justifyContent:\"space-between\",padding:\"12px 14px\",background:\"#fff\",color:\"#080C15\"},children:[/*#__PURE__*/_jsx(\"div\",{style:{fontWeight:700},children:title||\"R\\xe9ponses instantan\\xe9es\"}),/*#__PURE__*/_jsx(\"button\",{onClick:()=>setOpen(false),style:{background:\"transparent\",border:\"1px solid rgba(255,255,255,0.25)\",color:\"#080C15\",borderRadius:10,padding:\"6px 10px\",cursor:\"pointer\"},children:\"Fermer\"})]}),/*#__PURE__*/_jsx(\"div\",{style:{padding:12,borderBottom:\"1px solid #eee\"},children:/*#__PURE__*/_jsx(\"input\",{value:query,onChange:e=>setQuery(e.target.value),placeholder:placeholder||\"Rechercher une question…\",style:{width:\"100%\",height:40,padding:\"0 12px\",borderRadius:10,border:\"1px solid #ddd\",outline:\"none\"}})}),/*#__PURE__*/_jsxs(\"div\",{style:{padding:12,maxHeight:maxHeight,overflowY:\"auto\",background:\"#fafafa\"},children:[filtered.length===0&&/*#__PURE__*/_jsx(\"div\",{style:{padding:12,color:\"#666\"},children:\"Aucune r\\xe9ponse trouv\\xe9e.\"}),filtered.map((it,idx)=>{const isOpen=expandedIndex===idx;return /*#__PURE__*/_jsxs(\"div\",{style:{background:\"#fff\",borderRadius:theme.radius,boxShadow:\"0 1px 2px rgba(0,0,0,0.05)\",border:\"1px solid #eee\",marginBottom:10,overflow:\"hidden\"},children:[/*#__PURE__*/_jsxs(\"button\",{onClick:()=>setExpandedIndex(isOpen?null:idx),style:{width:\"100%\",textAlign:\"left\",padding:12,background:\"transparent\",border:\"none\",cursor:\"pointer\",display:\"flex\",gap:10,alignItems:\"center\"},children:[/*#__PURE__*/_jsx(\"span\",{\"aria-hidden\":true,style:{display:\"inline-flex\",width:8,height:8,borderRadius:999,background:theme.accent,flexShrink:0}}),/*#__PURE__*/_jsx(\"span\",{style:{fontWeight:600,color:\"#2563eb\"},children:it.q}),/*#__PURE__*/_jsx(\"span\",{style:{marginLeft:\"auto\",opacity:.6},children:isOpen?\"▾\":\"▸\"})]}),isOpen&&/*#__PURE__*/_jsx(\"div\",{style:{padding:\"0 12px 12px 30px\",color:\"#222\"},children:/*#__PURE__*/_jsx(\"div\",{style:{background:\"#f6f6f7\",border:\"1px solid #eee\",borderRadius:12,padding:12,lineHeight:1.5},dangerouslySetInnerHTML:{__html:it.a.replace(/\\n/g,\"<br/>\").replace(/\\*\\*(.*?)\\*\\*/g,\"<strong>$1</strong>\")}})})]},idx);})]})]})]})]});}// Property Controls pour éditer depuis l'UI Framer\nFAQChatWidget.defaultProps={title:\"R\\xe9ponses instantan\\xe9es\",placeholder:\"Rechercher une question…\",itemsJSON:JSON.stringify(defaultItems,null,2),buttonLabel:\"?\",openByDefault:false,accentColor:\"#4f46e5\",cardRadius:14,maxHeight:420,shadow:true,zIndex:9999};addPropertyControls(FAQChatWidget,{title:{type:ControlType.String,title:\"Titre\"},placeholder:{type:ControlType.String,title:\"Placeholder\"},itemsJSON:{type:ControlType.String,title:\"Q/R (JSON)\",displayTextArea:true},buttonLabel:{type:ControlType.String,title:\"Bouton\"},openByDefault:{type:ControlType.Boolean,title:\"Ouvert par d\\xe9faut\"},accentColor:{type:ControlType.Color,title:\"Accent\"},cardRadius:{type:ControlType.Number,title:\"Rayon\",min:8,max:28},maxHeight:{type:ControlType.Number,title:\"MaxHeight\",min:240,max:800},shadow:{type:ControlType.Boolean,title:\"Ombre\"},zIndex:{type:ControlType.Number,title:\"zIndex\",min:1,max:99999}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FAQChatWidget\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FAQ_CHAT_WIDGET.map"],"mappings":"iRAcA,SAAS,EAAc,EAAK,EAAS,CAAC,GAAG,CAAC,IAAM,EAAO,KAAK,MAAM,EAAK,CAAwC,OAApC,MAAM,QAAQ,EAAO,CAAQ,EAAc,OAAkB,CAAC,OAAO,GAAW,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,QAAM,cAAY,YAAU,cAAY,gBAAc,cAAY,aAAW,YAAU,SAAO,UAAQ,EAAW,CAAC,EAAK,GAASA,EAAe,CAAC,CAAC,EAAc,CAAM,CAAC,EAAM,GAAUA,EAAe,GAAG,CAAM,CAAC,EAAc,GAAkBA,EAAe,KAAK,CAAuL,EAA1KC,MAAgC,EAAc,EAAU,EAAa,CAAe,IAAI,IAAK,CAAC,EAAE,OAAO,EAAG,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,EAAG,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAG,CAAC,EAAU,CAAC,CAAsB,OAAO,GAAI,CAAC,GAAG,CAAC,EAAM,MAAO,GAAK,IAAM,EAAI,EAAM,aAAa,CAAC,OAAO,EAAG,EAAE,aAAa,CAAC,SAAS,EAA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