From ef303951a3f2f355400363f9a89a8094fb218507 Mon Sep 17 00:00:00 2001 From: Xor290 Date: Sat, 8 Aug 2026 12:20:56 +0200 Subject: [PATCH] chore: update --- deploy/chart-gestion/backend/values.yaml | 6 +- deploy/chart-gestion/postgresql/values.yaml | 4 +- deploy/chart-gestion/redis/values.yaml | 4 +- .../traefik/templates/middleware-chain.yaml | 5 +- deploy/chart-gestion/traefik/values.yaml | 28 +++---- deploy/longhorn/storageclass.yml | 42 ++++++++++ deploy/velero/schedule.yml | 36 ++++++++ deploy/velero/values.yaml | 83 +++++++++++++++++++ .../{index-iTNViNPy.js => index-DyH0C5cq.js} | 2 +- web/dist/index.html | 2 +- web/src/components/Footer.tsx | 2 +- web/src/theme.ts | 31 +++++++ 12 files changed, 221 insertions(+), 24 deletions(-) create mode 100644 deploy/longhorn/storageclass.yml create mode 100644 deploy/velero/schedule.yml create mode 100644 deploy/velero/values.yaml rename web/dist/assets/{index-iTNViNPy.js => index-DyH0C5cq.js} (99%) diff --git a/deploy/chart-gestion/backend/values.yaml b/deploy/chart-gestion/backend/values.yaml index a41add3..e2cbeca 100644 --- a/deploy/chart-gestion/backend/values.yaml +++ b/deploy/chart-gestion/backend/values.yaml @@ -27,7 +27,11 @@ persistence: uploads: enabled: true size: 5Gi - storageClass: "" + # Répliqué sur 2 nœuds (Longhorn) : survit à la perte d'un nœud. Voir + # deploy/longhorn/storageclass.yml pour le prérequis d'installation. + # N'a d'effet que pour storage_driver=local (les uploads S3 ne passent + # jamais par ce PVC, voir ProvisionConfig.StorageDriver). + storageClass: "longhorn-replicated" accessMode: ReadWriteOnce env: diff --git a/deploy/chart-gestion/postgresql/values.yaml b/deploy/chart-gestion/postgresql/values.yaml index 5b63c97..2f44926 100644 --- a/deploy/chart-gestion/postgresql/values.yaml +++ b/deploy/chart-gestion/postgresql/values.yaml @@ -12,7 +12,9 @@ auth: persistence: enabled: true size: 10Gi - storageClass: "" + # Répliqué sur 2 nœuds (Longhorn) : survit à la perte d'un nœud. Voir + # deploy/longhorn/storageclass.yml pour le prérequis d'installation. + storageClass: "longhorn-replicated" accessMode: ReadWriteOnce resources: diff --git a/deploy/chart-gestion/redis/values.yaml b/deploy/chart-gestion/redis/values.yaml index 7956231..d9524da 100644 --- a/deploy/chart-gestion/redis/values.yaml +++ b/deploy/chart-gestion/redis/values.yaml @@ -10,7 +10,9 @@ auth: persistence: enabled: true size: 2Gi - storageClass: "" + # Répliqué sur 2 nœuds (Longhorn) : survit à la perte d'un nœud. Voir + # deploy/longhorn/storageclass.yml pour le prérequis d'installation. + storageClass: "longhorn-replicated" accessMode: ReadWriteOnce resources: diff --git a/deploy/chart-gestion/traefik/templates/middleware-chain.yaml b/deploy/chart-gestion/traefik/templates/middleware-chain.yaml index b5ec08e..7226e7d 100644 --- a/deploy/chart-gestion/traefik/templates/middleware-chain.yaml +++ b/deploy/chart-gestion/traefik/templates/middleware-chain.yaml @@ -9,8 +9,5 @@ spec: chain: middlewares: - name: rate-limit - # coraza-waf retiré temporairement : le plugin WASM échoue à charger - # (module/version pas fiablement confirmés), ce qui invalidait TOUTE - # la chaîne et cassait le routage de toutes les démos. À réactiver une - # fois la config du plugin vérifiée (voir middleware-waf.yaml). + - name: coraza-waf - name: security-headers diff --git a/deploy/chart-gestion/traefik/values.yaml b/deploy/chart-gestion/traefik/values.yaml index 781fe10..c9ad9e5 100644 --- a/deploy/chart-gestion/traefik/values.yaml +++ b/deploy/chart-gestion/traefik/values.yaml @@ -56,20 +56,20 @@ traefik: accessLog: enabled: true - # Plugin Coraza WAF — DÉSACTIVÉ temporairement : "github.com/corazawaf/ - # coraza-traefik@v0.3.0" n'existe pas sur le catalogue de plugins Traefik - # (404 au démarrage), ce qui invalidait toute la chaîne de middlewares et - # cassait le routage de TOUTES les démos. Le bon plugin est probablement - # github.com/jcchavezs/coraza-http-wasm-traefik (WASM), mais le nom de - # module exact + la version doivent être repris tels quels depuis - # https://plugins.traefik.io (bouton "Install this plugin" génère le - # snippet exact et garanti à jour) avant de les remettre ici — deux - # tentatives de deviner la bonne valeur ont déjà cassé la prod. - # experimental: - # plugins: - # coraza-traefik: - # moduleName: "" - # version: "" + # Plugin Coraza WAF — module/version confirmés directement depuis les tags + # git du dépôt (github.com/jcchavezs/coraza-http-wasm-traefik, dernier tag + # v0.3.0, vérifié via l'API GitHub le 2026-08-03) et son .traefik.yml + # (runtime: wasm, type: middleware). L'ancien module "github.com/corazawaf/ + # coraza-traefik" n'existe pas (404 au chargement) et cassait toute la + # chaîne de middlewares — ne jamais y revenir. Le CRS (OWASP Core Rule Set) + # est embarqué dans le binaire WASM du plugin (voir coraza-http-wasm/main.go, + # includeCRS=true par défaut) : les directives "Include @owasp_crs/*.conf" + # etc. dans templates/middleware-waf.yaml fonctionnent sans fichiers externes. + experimental: + plugins: + coraza-traefik: + moduleName: github.com/jcchavezs/coraza-http-wasm-traefik + version: v0.3.0 # ACME interne désactivé : c'est cert-manager qui gère le cycle de vie du # certificat wildcard (voir deploy/cert-manager/), Traefik ne fait que le diff --git a/deploy/longhorn/storageclass.yml b/deploy/longhorn/storageclass.yml new file mode 100644 index 0000000..132f1f7 --- /dev/null +++ b/deploy/longhorn/storageclass.yml @@ -0,0 +1,42 @@ +# Prérequis (à faire une seule fois, hors de ce manifeste — même logique que +# deploy/cert-manager/, un composant partagé du cluster, pas par démo) : +# +# 1. Sur CHAQUE nœud du cluster (y compris les workers ARM64 Raspberry Pi — +# Longhorn supporte officiellement l'ARM64) : +# apt-get update && apt-get install -y open-iscsi nfs-common +# systemctl enable --now iscsid +# +# 2. Installer Longhorn (v1.12.0, dernière version stable au moment de +# l'écriture — vérifier https://github.com/longhorn/longhorn/releases +# avant d'appliquer une version plus récente) : +# kubectl apply -f https://raw.githubusercontent.com/longhorn/longhorn/v1.12.0/deploy/longhorn.yaml +# +# 3. Attendre que tous les pods soient Running avant de déployer une démo : +# kubectl -n longhorn-system get pods +# +# 4. Appliquer ce manifeste : +# kubectl apply -f deploy/longhorn/storageclass.yml +# +# Pourquoi : la StorageClass par défaut du cluster (local-path, fournie par +# k3s) attache chaque volume au disque LOCAL du nœud où le pod tourne — si ce +# nœud tombe, le volume devient inaccessible tant qu'il ne redémarre pas, +# avec un vrai risque de perte de données. Cette StorageClass réplique +# chaque volume sur 2 nœuds différents (numberOfReplicas) : si le nœud qui +# héberge le pod tombe, Kubernetes reprogramme le pod ailleurs et Longhorn +# rattache une réplique déjà à jour, sans interruption ni perte. +# +# Utilisée par les PVC postgres/redis/uploads des démos — voir +# deploy/chart-gestion/{postgresql,redis,backend}/values.yaml +# (persistence.storageClass / persistence.uploads.storageClass). +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: longhorn-replicated +provisioner: driver.longhorn.io +allowVolumeExpansion: true +reclaimPolicy: Delete +volumeBindingMode: Immediate +parameters: + numberOfReplicas: "2" + staleReplicaTimeout: "30" + fsType: "ext4" diff --git a/deploy/velero/schedule.yml b/deploy/velero/schedule.yml new file mode 100644 index 0000000..4dc225d --- /dev/null +++ b/deploy/velero/schedule.yml @@ -0,0 +1,36 @@ +# Sauvegarde quotidienne de tous les namespaces de démo (postgres, redis, +# uploads, et le reste : Secrets/ConfigMaps/Deployments pour une +# restauration complète) vers le bucket S3 configuré dans values.yaml. +# S'applique par défaut à TOUT namespace non exclu ci-dessous — une nouvelle +# démo créée dynamiquement (demo-xxxxx, premium-xxxxx) est donc couverte +# automatiquement, sans modifier ce fichier. +# +# À appliquer après l'installation de Velero (voir values.yaml) : +# kubectl apply -f deploy/velero/schedule.yml +apiVersion: velero.io/v1 +kind: Schedule +metadata: + name: demos-daily + namespace: velero +spec: + # 03h00 UTC, tous les jours — heure creuse pour ce cluster. + schedule: "0 3 * * *" + template: + includedNamespaces: + - "*" + excludedNamespaces: + - kube-system + - kube-public + - kube-node-lease + - default + - velero + - traefik + - longhorn-system + - cert-manager + # Sauvegarde le contenu réel des PVC (postgres/redis/uploads) via + # File System Backup — voir values.yaml. + defaultVolumesToFsBackup: true + storageLocation: default + # Conservation 30 jours : au-delà, la sauvegarde devient éligible à la + # purge automatique (garbage collection Velero). + ttl: 720h0m0s diff --git a/deploy/velero/values.yaml b/deploy/velero/values.yaml new file mode 100644 index 0000000..2e3f7b4 --- /dev/null +++ b/deploy/velero/values.yaml @@ -0,0 +1,83 @@ +# Prérequis (à faire une seule fois, hors de ce manifeste — même logique que +# deploy/cert-manager/ et deploy/longhorn/, un composant partagé du cluster, +# jamais par démo) : +# +# 1. Créer le bucket S3 (ou compatible S3 : MinIO, Backblaze B2, OVH, +# Scaleway, Wasabi...) qui recevra les sauvegardes, avec une paire de +# clés d'accès dédiée (droits limités à ce bucket). +# +# 2. Créer le fichier de credentials LOCALEMENT (ne jamais le committer) : +# cat > credentials-velero < +# aws_secret_access_key= +# EOF +# +# 3. Créer le namespace + le secret à partir de ce fichier : +# kubectl create namespace velero +# kubectl create secret generic cloud-credentials \ +# --namespace velero --from-file cloud=./credentials-velero +# rm credentials-velero +# +# 4. Renseigner bucket / region / s3Url ci-dessous selon votre fournisseur, +# puis installer Velero (chart officiel, version vérifiée) : +# helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts +# helm install velero vmware-tanzu/velero \ +# --namespace velero --version 12.1.0 \ +# -f deploy/velero/values.yaml +# kubectl apply -f deploy/velero/schedule.yml +# +# Pourquoi File System Backup (kopia) plutôt que des snapshots CSI Longhorn : +# ça fonctionne indépendamment du provisioner de stockage (pas de +# VolumeSnapshotClass/CRD supplémentaire à maintenir), et couvre aussi bien +# les PVC postgres/redis/uploads que le reste de chaque namespace de démo +# (Secrets, ConfigMaps, Deployments...) pour une restauration complète, pas +# seulement les données. + +# velero-plugin-for-aws v1.14.2 : dernière version compatible avec Velero +# 1.18.x (appVersion de ce chart) — vérifié sur le tableau de compatibilité +# du plugin. Fonctionne aussi bien avec AWS S3 qu'avec un stockage +# compatible S3 (MinIO, OVH, Backblaze...). +initContainers: + - name: velero-plugin-for-aws + image: velero/velero-plugin-for-aws:v1.14.2 + imagePullPolicy: IfNotPresent + volumeMounts: + - mountPath: /target + name: plugins + +credentials: + useSecret: false + existingSecret: cloud-credentials + +configuration: + backupStorageLocation: + - name: default + provider: aws + # Nom du bucket créé à l'étape 1. Requis. + bucket: "CHANGE_ME_bucket_name" + default: true + credential: + name: cloud-credentials + key: cloud + config: + # Région du bucket (AWS) ou région arbitraire acceptée par votre + # fournisseur S3-compatible (souvent "us-east-1" par défaut). + region: "CHANGE_ME_region" + # URL du endpoint S3-compatible — uniquement si ce n'est PAS AWS S3 + # (ex: "https://s3.fr-par.scw.cloud", "https://s3.eu-de.io.cloud.ovh.net"). + # Laisser vide pour AWS S3. + s3Url: "" + # La plupart des fournisseurs S3-compatibles (hors AWS) exigent le + # style "path" plutôt que "virtual-hosted" pour adresser un bucket. + s3ForcePathStyle: "true" + + # Pas de VolumeSnapshotLocation : sauvegarde des volumes via File System + # Backup (node-agent + kopia) plutôt que des snapshots CSI natifs. + volumeSnapshotLocation: [] + +snapshotsEnabled: false + +# Node-agent (DaemonSet) : nécessaire pour sauvegarder le contenu réel des +# PVC (postgres, redis, uploads) via File System Backup. +deployNodeAgent: true diff --git a/web/dist/assets/index-iTNViNPy.js b/web/dist/assets/index-DyH0C5cq.js similarity index 99% rename from web/dist/assets/index-iTNViNPy.js rename to web/dist/assets/index-DyH0C5cq.js index ed6d1e8..3403dde 100644 --- a/web/dist/assets/index-iTNViNPy.js +++ b/web/dist/assets/index-DyH0C5cq.js @@ -1507,4 +1507,4 @@ If it declares any Font Awesome CSS pseudo-elements, they will not be rendered a * Font Awesome Free 7.3.1 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) * Copyright 2026 Fonticons, Inc. - */var Yv={prefix:"fas",iconName:"truck",icon:[576,512,[128666,9951],"f0d1","M0 96C0 60.7 28.7 32 64 32l288 0c35.3 0 64 28.7 64 64l0 32 50.7 0c17 0 33.3 6.7 45.3 18.7L557.3 192c12 12 18.7 28.3 18.7 45.3L576 384c0 35.3-28.7 64-64 64l-3.3 0c-10.4 36.9-44.4 64-84.7 64s-74.2-27.1-84.7-64l-102.6 0c-10.4 36.9-44.4 64-84.7 64s-74.2-27.1-84.7-64L64 448c-35.3 0-64-28.7-64-64L0 96zM512 288l0-50.7-45.3-45.3-50.7 0 0 96 96 0zM192 424a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm232 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]},vx={prefix:"fas",iconName:"user-check",icon:[640,512,[],"f4fc","M286 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L78 512c-16.4 0-29.7-13.3-29.7-29.7 0-98.5 79.8-178.3 178.3-178.3l59.4 0zM585.7 105.9c7.8-10.7 22.8-13.1 33.5-5.3s13.1 22.8 5.3 33.5L522.1 274.9c-4.2 5.7-10.7 9.4-17.7 9.8s-14-2.2-18.9-7.3l-46.4-48c-9.2-9.5-9-24.7 .6-33.9 9.5-9.2 24.7-8.9 33.9 .6l26.5 27.4 85.6-117.7zM256.3 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240z"]},yx={prefix:"fas",iconName:"bell",icon:[448,512,[128276,61602],"f0f3","M224 0c-17.7 0-32 14.3-32 32l0 3.2C119 50 64 114.6 64 192l0 21.7c0 48.1-16.4 94.8-46.4 132.4L7.8 358.3C2.7 364.6 0 372.4 0 380.5 0 400.1 15.9 416 35.5 416l376.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2l-9.8-12.2C400.4 308.5 384 261.8 384 213.7l0-21.7c0-77.4-55-142-128-156.8l0-3.2c0-17.7-14.3-32-32-32zM162 464c7.1 27.6 32.2 48 62 48s54.9-20.4 62-48l-124 0z"]},Q3={prefix:"fas",iconName:"trophy",icon:[512,512,[127942],"f091","M144.3 0l224 0c26.5 0 48.1 21.8 47.1 48.2-.2 5.3-.4 10.6-.7 15.8l49.6 0c26.1 0 49.1 21.6 47.1 49.8-7.5 103.7-60.5 160.7-118 190.5-15.8 8.2-31.9 14.3-47.2 18.8-20.2 28.6-41.2 43.7-57.9 51.8l0 73.1 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0 0-73.1c-16-7.7-35.9-22-55.3-48.3-18.4-4.8-38.4-12.1-57.9-23.1-54.1-30.3-102.9-87.4-109.9-189.9-1.9-28.1 21-49.7 47.1-49.7l49.6 0c-.3-5.2-.5-10.4-.7-15.8-1-26.5 20.6-48.2 47.1-48.2zM101.5 112l-52.4 0c6.2 84.7 45.1 127.1 85.2 149.6-14.4-37.3-26.3-86-32.8-149.6zM380 256.8c40.5-23.8 77.1-66.1 83.3-144.8L411 112c-6.2 60.9-17.4 108.2-31 144.8z"]},ile={prefix:"fas",iconName:"gift",icon:[512,512,[127873],"f06b","M321.5 68.8C329.1 55.9 342.9 48 357.8 48l2.2 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-73.3 0 34.8-59.2zm-131 0l34.8 59.2-73.3 0c-22.1 0-40-17.9-40-40s17.9-40 40-40l2.2 0c14.9 0 28.8 7.9 36.3 20.8zm89.6-24.3l-24.1 41-24.1-41C215.7 16.9 186.1 0 154.2 0L152 0c-48.6 0-88 39.4-88 88 0 14.4 3.5 28 9.6 40L32 128c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l448 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-41.6 0c6.1-12 9.6-25.6 9.6-40 0-48.6-39.4-88-88-88l-2.2 0c-31.9 0-61.5 16.9-77.7 44.4zM480 272l-200 0 0 208 136 0c35.3 0 64-28.7 64-64l0-144zm-248 0l-200 0 0 144c0 35.3 28.7 64 64 64l136 0 0-208z"]},P7={prefix:"fas",iconName:"power-off",icon:[512,512,[9211],"f011","M288 0c0-17.7-14.3-32-32-32S224-17.7 224 0l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32L288 0zM146.3 98.4c14.5-10.1 18-30.1 7.9-44.6s-30.1-18-44.6-7.9C43.4 92.1 0 169 0 256 0 397.4 114.6 512 256 512S512 397.4 512 256c0-87-43.4-163.9-109.7-210.1-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6c49.8 34.8 82.3 92.4 82.3 157.6 0 106-86 192-192 192S64 362 64 256c0-65.2 32.5-122.9 82.3-157.6z"]},ole={prefix:"fas",iconName:"cash-register",icon:[512,512,[],"f788","M96 0C60.7 0 32 28.7 32 64s28.7 64 64 64l48 0 0 32-57 0c-31.6 0-58.5 23.1-63.3 54.4L1.1 364.1C.4 368.8 0 373.6 0 378.4L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-69.6c0-4.8-.4-9.6-1.1-14.4L488.2 214.4C483.5 183.1 456.6 160 425 160l-217 0 0-32 48 0c35.3 0 64-28.7 64-64S291.3 0 256 0L96 0zm0 48l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L96 80c-8.8 0-16-7.2-16-16s7.2-16 16-16zM64 424c0-13.3 10.7-24 24-24l336 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 448c-13.3 0-24-10.7-24-24zm48-160a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm120-24a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM160 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM328 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM256 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM424 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM352 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48z"]},ale={prefix:"fas",iconName:"map-location-dot",icon:[640,512,["map-marked-alt"],"f5a0","M576 48c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4L413.5 77.5 234.1 17.6c-8.1-2.7-16.8-2.1-24.4 1.7l-128 64C70.8 88.8 64 99.9 64 112l0 352c0 11.1 5.7 21.4 15.2 27.2s21.2 6.4 31.1 1.4l116.1-58.1 173.3 57.8c-4.3-6.4-8.5-13.1-12.6-19.9-11-18.3-21.9-39.3-30-61.8l-101.2-33.7 0-284.5 128 42.7 0 99.3c31-35.8 77-58.4 128-58.4 22.6 0 44.2 4.4 64 12.5L576 48zM512 224c-66.3 0-120 52.8-120 117.9 0 68.9 64.1 150.4 98.6 189.3 11.6 13 31.3 13 42.9 0 34.5-38.9 98.6-120.4 98.6-189.3 0-65.1-53.7-117.9-120-117.9zM472 344a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z"]},sle={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]},lle={prefix:"fas",iconName:"boxes-stacked",icon:[512,512,[62625,"boxes","boxes-alt"],"f468","M224 0l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64 32 0c35.3 0 64 28.7 64 64l0 128c0 5.5-.7 10.9-2 16l-252 0c-1.3-5.1-2-10.5-2-16l0-128c0-35.3 28.7-64 64-64l32 0zm96 512c-11.2 0-21.8-2.9-31-8 9.5-16.5 15-35.6 15-56l0-128c0-20.4-5.5-39.5-15-56 9.2-5.1 19.7-8 31-8l32 0 0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64 32 0c35.3 0 64 28.7 64 64l0 128c0 35.3-28.7 64-64 64l-128 0zM0 320c0-35.3 28.7-64 64-64l32 0 0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64 32 0c35.3 0 64 28.7 64 64l0 128c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 320z"]},_7={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8c-22.4 31.4-35.5 69.8-35.5 111.2 0 106 86 192 192 192 41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3c22.4-31.4 35.5-69.8 35.5-111.2 0-106-86-192-192-192-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z"]},Z3={prefix:"fas",iconName:"palette",icon:[512,512,[127912],"f53f","M512 256c0 .9 0 1.8 0 2.7-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48 0 3.4 .4 6.7 1 9.9 2.1 10.2 6.5 20 10.8 29.9 6.1 13.8 12.1 27.5 12.1 42 0 31.8-21.6 60.7-53.4 62-3.5 .1-7 .2-10.6 .2-141.4 0-256-114.6-256-256S114.6 0 256 0 512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]},T7={prefix:"fas",iconName:"eye",icon:[576,512,[128065],"f06e","M288 32c-80.8 0-145.5 36.8-192.6 80.6-46.8 43.5-78.1 95.4-93 131.1-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64-11.5 0-22.3-3-31.7-8.4-1 10.9-.1 22.1 2.9 33.2 13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-12.2-45.7-55.5-74.8-101.1-70.8 5.3 9.3 8.4 20.1 8.4 31.7z"]},E7={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M136.7 5.9L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-8.7-26.1C306.9-7.2 294.7-16 280.9-16L167.1-16c-13.8 0-26 8.8-30.4 21.9zM416 144L32 144 53.1 467.1C54.7 492.4 75.7 512 101 512L347 512c25.3 0 46.3-19.6 47.9-44.9L416 144z"]},cle={prefix:"fas",iconName:"receipt",icon:[384,512,[129534],"f543","M14 2.2C22.5-1.7 32.5-.3 39.6 5.8L80 40.4 120.4 5.8c9-7.7 22.3-7.7 31.2 0L192 40.4 232.4 5.8c9-7.7 22.2-7.7 31.2 0L304 40.4 344.4 5.8c7.1-6.1 17.1-7.5 25.6-3.6S384 14.6 384 24l0 464c0 9.4-5.5 17.9-14 21.8s-18.5 2.5-25.6-3.6l-40.4-34.6-40.4 34.6c-9 7.7-22.2 7.7-31.2 0l-40.4-34.6-40.4 34.6c-9 7.7-22.3 7.7-31.2 0L80 471.6 39.6 506.2c-7.1 6.1-17.1 7.5-25.6 3.6S0 497.4 0 488L0 24C0 14.6 5.5 6.1 14 2.2zM104 136c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0zM80 352c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0c-13.3 0-24 10.7-24 24zm24-120c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0z"]},A7={prefix:"fas",iconName:"chevron-up",icon:[448,512,[],"f077","M201.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 173.3 54.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]},qu={prefix:"fas",iconName:"clock",icon:[512,512,[128339,"clock-four"],"f017","M256 0a256 256 0 1 1 0 512 256 256 0 1 1 0-512zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]},ule={prefix:"fas",iconName:"paper-plane",icon:[576,512,[61913],"f1d8","M536.4-26.3c9.8-3.5 20.6-1 28 6.3s9.8 18.2 6.3 28l-178 496.9c-5 13.9-18.1 23.1-32.8 23.1-14.2 0-27-8.6-32.3-21.7l-64.2-158c-4.5-11-2.5-23.6 5.2-32.6l94.5-112.4c5.1-6.1 4.7-15-.9-20.6s-14.6-6-20.6-.9L229.2 276.1c-9.1 7.6-21.6 9.6-32.6 5.2L38.1 216.8c-13.1-5.3-21.7-18.1-21.7-32.3 0-14.7 9.2-27.8 23.1-32.8l496.9-178z"]},dle={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},fle={prefix:"fas",iconName:"fire",icon:[448,512,[128293],"f06d","M160.5-26.4c9.3-7.8 23-7.5 31.9 .9 12.3 11.6 23.3 24.4 33.9 37.4 13.5 16.5 29.7 38.3 45.3 64.2 5.2-6.8 10-12.8 14.2-17.9 1.1-1.3 2.2-2.7 3.3-4.1 7.9-9.8 17.7-22.1 30.8-22.1 13.4 0 22.8 11.9 30.8 22.1 1.3 1.7 2.6 3.3 3.9 4.8 10.3 12.4 24 30.3 37.7 52.4 27.2 43.9 55.6 106.4 55.6 176.6 0 123.7-100.3 224-224 224S0 411.7 0 288c0-91.1 41.1-170 80.5-225 19.9-27.7 39.7-49.9 54.6-65.1 8.2-8.4 16.5-16.7 25.5-24.2zM225.7 416c25.3 0 47.7-7 68.8-21 42.1-29.4 53.4-88.2 28.1-134.4-4.5-9-16-9.6-22.5-2l-25.2 29.3c-6.6 7.6-18.5 7.4-24.7-.5-17.3-22.1-49.1-62.4-65.3-83-5.4-6.9-15.2-8-21.5-1.9-18.3 17.8-51.5 56.8-51.5 104.3 0 68.6 50.6 109.2 113.7 109.2z"]},$7={prefix:"fas",iconName:"users",icon:[640,512,[],"f0c0","M320 16a104 104 0 1 1 0 208 104 104 0 1 1 0-208zM96 88a72 72 0 1 1 0 144 72 72 0 1 1 0-144zM0 416c0-70.7 57.3-128 128-128 12.8 0 25.2 1.9 36.9 5.4-32.9 36.8-52.9 85.4-52.9 138.6l0 16c0 11.4 2.4 22.2 6.7 32L32 480c-17.7 0-32-14.3-32-32l0-32zm521.3 64c4.3-9.8 6.7-20.6 6.7-32l0-16c0-53.2-20-101.8-52.9-138.6 11.7-3.5 24.1-5.4 36.9-5.4 70.7 0 128 57.3 128 128l0 32c0 17.7-14.3 32-32 32l-86.7 0zM472 160a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zM160 432c0-88.4 71.6-160 160-160s160 71.6 160 160l0 16c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-16z"]},z7={prefix:"fas",iconName:"location-arrow",icon:[512,512,[],"f124","M477.9 75.5c4.5-11.8 1.7-25.2-7.2-34.1s-22.3-11.8-34.1-7.2l-416 160C7.9 199-.3 211.2 0 224.7s9.1 25.4 21.9 29.6l176.8 58.9 58.9 176.8c4.3 12.8 16.1 21.6 29.6 21.9s25.7-7.9 30.6-20.5l160-416z"]},ple={prefix:"fas",iconName:"video",icon:[576,512,["video-camera"],"f03d","M96 64c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L96 64zM464 336l73.5 58.8c4.2 3.4 9.4 5.2 14.8 5.2 13.1 0 23.7-10.6 23.7-23.7l0-240.6c0-13.1-10.6-23.7-23.7-23.7-5.4 0-10.6 1.8-14.8 5.2L464 176 464 336z"]},mle={prefix:"fas",iconName:"utensils",icon:[512,512,[127860,61685,"cutlery"],"f2e7","M63.9 14.4C63.1 6.2 56.2 0 48 0s-15.1 6.2-16 14.3L17.9 149.7c-1.3 6-1.9 12.1-1.9 18.2 0 45.9 35.1 83.6 80 87.7L96 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224.4c44.9-4.1 80-41.8 80-87.7 0-6.1-.6-12.2-1.9-18.2L223.9 14.3C223.1 6.2 216.2 0 208 0s-15.1 6.2-15.9 14.4L178.5 149.9c-.6 5.7-5.4 10.1-11.1 10.1-5.8 0-10.6-4.4-11.2-10.2L143.9 14.6C143.2 6.3 136.3 0 128 0s-15.2 6.3-15.9 14.6L99.8 149.8c-.5 5.8-5.4 10.2-11.2 10.2-5.8 0-10.6-4.4-11.1-10.1L63.9 14.4zM448 0C432 0 320 32 320 176l0 112c0 35.3 28.7 64 64 64l32 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-448c0-17.7-14.3-32-32-32z"]},hle={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM167 167c9.4-9.4 24.6-9.4 33.9 0l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9z"]},bx={prefix:"fas",iconName:"user-clock",icon:[576,512,[],"f4fd","M224 8a120 120 0 1 1 0 240 120 120 0 1 1 0-240zM194.3 304l59.4 0c3.9 0 7.9 .1 11.8 .4-16.2 28.2-25.5 60.8-25.5 95.6 0 41.8 13.4 80.5 36 112L45.7 512C29.3 512 16 498.7 16 482.3 16 383.8 95.8 304 194.3 304zM288 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-80c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0-48c0-8.8-7.2-16-16-16z"]},gle={prefix:"fas",iconName:"image",icon:[448,512,[],"f03e","M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 80a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM272 224c8.4 0 16.1 4.4 20.5 11.5l88 144c4.5 7.4 4.7 16.7 .5 24.3S368.7 416 360 416L88 416c-8.9 0-17.2-5-21.3-12.9s-3.5-17.5 1.6-24.8l56-80c4.5-6.4 11.8-10.2 19.7-10.2s15.2 3.8 19.7 10.2l26.4 37.8 61.4-100.5c4.4-7.1 12.1-11.5 20.5-11.5z"]},vle={prefix:"fas",iconName:"user-plus",icon:[640,512,[],"f234","M285.7 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L77.7 512C61.3 512 48 498.7 48 482.3 48 383.8 127.8 304 226.3 304l59.4 0zM528 80c13.3 0 24 10.7 24 24l0 48 48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0 0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48-48 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0 0-48c0-13.3 10.7-24 24-24zM256 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240z"]},R7={prefix:"fas",iconName:"link",icon:[576,512,[128279,"chain"],"f0c1","M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z"]},M7={prefix:"fas",iconName:"bicycle",icon:[640,512,[128690],"f206","M331.7 43.3C336 36.3 343.7 32 352 32l104 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-65.6 0 72.2 148.4c10.7-2.9 21.9-4.4 33.4-4.4 70.7 0 128 57.3 128 128s-57.3 128-128 128-128-57.3-128-128c0-42 20.2-79.2 51.4-102.6l-20.4-41.9-73.5 147c-2.3 4.8-6.3 8.8-11.4 11.2-.6 .3-1.2 .5-1.8 .7-2.9 1.1-5.9 1.6-8.9 1.5L271 368c-7.9 63.1-61.7 112-127 112-70.7 0-128-57.3-128-128S73.3 224 144 224c10.8 0 21.2 1.3 31.2 3.8l28.5-56.9-11.5-26.9-40.2 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l56 0c9.6 0 18.3 5.7 22.1 14.5l14.3 33.5 123.7 0-37.7-77.5c-3.6-7.4-3.2-16.2 1.2-23.2zM228.5 228.7l-45.6 91.3 84.8 0-39.1-91.3zM305.7 287l47.5-95-88.2 0 40.7 95zm168.7 75.5l-29.7-61c-12.8 13-20.7 30.8-20.7 50.5 0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72c-2.7 0-5.5 .2-8.1 .5l29.7 61c5.8 11.9 .8 26.3-11.1 32.1s-26.3 .8-32.1-11.1zM149.2 368c-20.2 0-33.4-21.3-24.3-39.4l24.2-48.5c-1.7-.1-3.4-.2-5.1-.2-39.8 0-72 32.2-72 72s32.2 72 72 72c34.3 0 62.9-23.9 70.2-56l-65 0z"]},yle={prefix:"fas",iconName:"bell-concierge",icon:[512,512,[128718,"concierge-bell"],"f562","M216 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0 0 33.3C124.8 156.7 40.2 243.7 32.6 352l446.9 0C471.8 243.7 387.2 156.7 280 145.3l0-33.3 16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zM24 400c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 400z"]},Ta={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z"]},xx={prefix:"fas",iconName:"user",icon:[448,512,[128100,62144,62470,"user-alt","user-large"],"f007","M224 248a120 120 0 1 0 0-240 120 120 0 1 0 0 240zm-29.7 56C95.8 304 16 383.8 16 482.3 16 498.7 29.3 512 45.7 512l356.6 0c16.4 0 29.7-13.3 29.7-29.7 0-98.5-79.8-178.3-178.3-178.3l-59.4 0z"]},ble={prefix:"fas",iconName:"tags",icon:[576,512,[],"f02c","M401.2 39.1L549.4 189.4c27.7 28.1 27.7 73.1 0 101.2L393 448.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L515.3 256.8c9.2-9.3 9.2-24.4 0-33.7L367 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM32.1 229.5L32.1 96c0-35.3 28.7-64 64-64l133.5 0c17 0 33.3 6.7 45.3 18.7l144 144c25 25 25 65.5 0 90.5L285.4 418.7c-25 25-65.5 25-90.5 0l-144-144c-12-12-18.7-28.3-18.7-45.3zm144-85.5a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},xle={prefix:"fas",iconName:"circle-check",icon:[512,512,[61533,"check-circle"],"f058","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zM374 145.7c-10.7-7.8-25.7-5.4-33.5 5.3L221.1 315.2 169 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.8 7.5 18.8 7s13.4-4.1 17.5-9.8L379.3 179.2c7.8-10.7 5.4-25.7-5.3-33.5z"]},Sle={prefix:"fas",iconName:"pen",icon:[512,512,[128394],"f304","M352.9 21.2L308 66.1 445.9 204 490.8 159.1C504.4 145.6 512 127.2 512 108s-7.6-37.6-21.2-51.1L455.1 21.2C441.6 7.6 423.2 0 404 0s-37.6 7.6-51.1 21.2zM274.1 100L58.9 315.1c-10.7 10.7-18.5 24.1-22.6 38.7L.9 481.6c-2.3 8.3 0 17.3 6.2 23.4s15.1 8.5 23.4 6.2l127.8-35.5c14.6-4.1 27.9-11.8 38.7-22.6L412 237.9 274.1 100z"]},wle={prefix:"fas",iconName:"phone",icon:[512,512,[128222,128379],"f095","M160.2 25C152.3 6.1 131.7-3.9 112.1 1.4l-5.5 1.5c-64.6 17.6-119.8 80.2-103.7 156.4 37.1 175 174.8 312.7 349.8 349.8 76.3 16.2 138.8-39.1 156.4-103.7l1.5-5.5c5.4-19.7-4.7-40.3-23.5-48.1l-97.3-40.5c-16.5-6.9-35.6-2.1-47 11.8l-38.6 47.2C233.9 335.4 177.3 277 144.8 205.3L189 169.3c13.9-11.3 18.6-30.4 11.8-47L160.2 25z"]},I7={prefix:"fas",iconName:"chevron-down",icon:[448,512,[],"f078","M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]},kle={prefix:"fas",iconName:"hourglass-half",icon:[384,512,["hourglass-2"],"f252","M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1l67.9 67.9-67.9 67.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1l-67.9-67.9 67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32S369.7 0 352 0L32 0zM96 75l0-11 192 0 0 11c0 19-5.6 37.4-16 53L112 128c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9l67.9-67.9 67.9 67.9c4.6 4.6 8.6 9.6 12.2 14.9L112 384z"]},Cle={prefix:"fas",iconName:"credit-card",icon:[512,512,[128179,62083,"credit-card-alt"],"f09d","M0 128l0 32 512 0 0-32c0-35.3-28.7-64-64-64L64 64C28.7 64 0 92.7 0 128zm0 80L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-176-512 0zM64 360c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zm144 0c0-13.3 10.7-24 24-24l64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0c-13.3 0-24-10.7-24-24z"]},jle={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},$p={prefix:"fas",iconName:"star",icon:[576,512,[11088,61446],"f005","M309.5-18.9c-4.1-8-12.4-13.1-21.4-13.1s-17.3 5.1-21.4 13.1L193.1 125.3 33.2 150.7c-8.9 1.4-16.3 7.7-19.1 16.3s-.5 18 5.8 24.4l114.4 114.5-25.2 159.9c-1.4 8.9 2.3 17.9 9.6 23.2s16.9 6.1 25 2L288.1 417.6 432.4 491c8 4.1 17.7 3.3 25-2s11-14.2 9.6-23.2L441.7 305.9 556.1 191.4c6.4-6.4 8.6-15.8 5.8-24.4s-10.1-14.9-19.1-16.3L383 125.3 309.5-18.9z"]},Fm={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 0c14.7 0 28.2 8.1 35.2 21l216 400c6.7 12.4 6.4 27.4-.8 39.5S486.1 480 472 480L40 480c-14.1 0-27.2-7.4-34.4-19.5s-7.5-27.1-.8-39.5l216-400c7-12.9 20.5-21 35.2-21zm0 352a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.5 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},Bm={prefix:"fas",iconName:"shield-halved",icon:[512,512,["shield-alt"],"f3ed","M256 0c4.6 0 9.2 1 13.4 2.9L457.8 82.8c22 9.3 38.4 31 38.3 57.2-.5 99.2-41.3 280.7-213.6 363.2-16.7 8-36.1 8-52.8 0-172.4-82.5-213.1-264-213.6-363.2-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.9 1 251.4 0 256 0zm0 66.8l0 378.1c138-66.8 175.1-214.8 176-303.4l-176-74.6 0 0z"]},Ple={prefix:"fas",iconName:"check-double",icon:[384,512,[],"f560","M249.9 66.8c10.4-14.3 7.2-34.3-7.1-44.7s-34.3-7.2-44.7 7.1l-106 145.7-37.5-37.5c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c6.6 6.6 15.8 10 25.1 9.3s17.9-5.5 23.4-13.1l128-176zm128 136c10.4-14.3 7.2-34.3-7.1-44.7s-34.3-7.2-44.7 7.1l-170 233.7-69.5-69.5c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c6.6 6.6 15.8 10 25.1 9.3s17.9-5.5 23.4-13.1l192-264z"]},Sx={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z"]},L7={prefix:"fas",iconName:"box",icon:[448,512,[128230],"f466","M335.1 16c20.7 0 40.1 10 52.1 26.8l48.9 68.5c7.7 10.8 11.9 23.9 11.9 37.2L448 416c0 35.3-28.7 64-64 64l-320 0-6.5-.3C25.2 476.4 0 449.1 0 416L0 148.5c0-11.7 3.2-23.1 9.2-33l2.7-4.2 48.9-68.5c10.5-14.7 26.7-24.2 44.4-26.3l7.7-.5 222.1 0zM248 128l121.3 0-34.3-48-87.1 0 0 48zM78.7 128l121.3 0 0-48-87.1 0-34.3 48z"]},N7={prefix:"fas",iconName:"link-slash",icon:[576,512,["chain-broken","chain-slash","unlink"],"f127","M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-122-122c4.2-3.4 8.3-7.1 12.1-10.9l71.1-71.1c29.3-29.3 45.8-69.1 45.8-110.6 0-86.4-70-156.5-156.5-156.5-37.3 0-73.1 13.3-101.3 37.2 20.3 10.1 38.7 23.5 54.5 39.5 14.1-8.3 30.2-12.7 46.8-12.7 51.1 0 92.5 41.4 92.5 92.5 0 24.5-9.7 48-27.1 65.4l-71.1 71.1c-3.9 3.9-8.1 7.4-12.6 10.5l-47.5-47.5c16.5-.9 29.7-14.4 30.2-31.1 0-1.3 0-2.6 0-3.9 0-86.3-69.9-156.9-156.5-156.9-19.2 0-37.9 3.5-55.5 10.2L41-24.9zM225.9 160c.6 0 1.1 0 1.7 0 15.1 0 29.5 3.7 42.1 10.2 1.8 1.2 3.6 2.3 5.5 3.1 26.8 16.3 44.8 45.9 44.8 79.6 0 .4 0 .8 0 1.2L225.9 160zM346.2 416L192 261.8c1.2 84.6 69.6 152.9 154.1 154.1zM139.7 209.5l-45.3-45.3-48.6 48.6c-29.3 29.3-45.8 69.1-45.8 110.6 0 86.4 70 156.5 156.5 156.5 37.2 0 73.1-13.3 101.3-37.2-20.3-10.1-38.8-23.5-54.6-39.5-14 8.2-30.1 12.6-46.7 12.6-51.1 0-92.5-41.4-92.5-92.5 0-24.5 9.7-48 27.1-65.4l48.6-48.6z"]},_le={prefix:"fas",iconName:"arrow-rotate-right",icon:[512,512,[8635,"arrow-right-rotate","arrow-rotate-forward","redo"],"f01e","M436.7 74.7L448 85.4 448 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l47.9 0-7.6-7.2c-.2-.2-.4-.4-.6-.6-75-75-196.5-75-271.5 0s-75 196.5 0 271.5 196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c99.9-99.9 261.7-100 361.7-.3z"]},D7={prefix:"fas",iconName:"eye-slash",icon:[576,512,[],"f070","M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-96.4-96.4c2.7-2.4 5.4-4.8 8-7.2 46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6-56.8 0-105.6 18.2-146 44.2L41-24.9zM204.5 138.7c23.5-16.8 52.4-26.7 83.5-26.7 79.5 0 144 64.5 144 144 0 31.1-9.9 59.9-26.7 83.5l-34.7-34.7c12.7-21.4 17-47.7 10.1-73.7-13.7-51.2-66.4-81.6-117.6-67.9-8.6 2.3-16.7 5.7-24 10l-34.7-34.7zM325.3 395.1c-11.9 3.2-24.4 4.9-37.3 4.9-79.5 0-144-64.5-144-144 0-12.9 1.7-25.4 4.9-37.3L69.4 139.2c-32.6 36.8-55 75.8-66.9 104.5-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6 37.3 0 71.2-7.9 101.5-20.6l-64.2-64.2z"]},zp={prefix:"fas",iconName:"arrow-rotate-left",icon:[512,512,[8634,"arrow-left-rotate","arrow-rotate-back","arrow-rotate-backward","undo"],"f0e2","M256 64c-56.8 0-107.9 24.7-143.1 64l47.1 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 192c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0S64 14.3 64 32l0 54.7C110.9 33.6 179.5 0 256 0 397.4 0 512 114.6 512 256S397.4 512 256 512c-87 0-163.9-43.4-210.1-109.7-10.1-14.5-6.6-34.4 7.9-44.6s34.4-6.6 44.6 7.9c34.8 49.8 92.4 82.3 157.6 82.3 106 0 192-86 192-192S362 64 256 64z"]},Tle={prefix:"fas",iconName:"desktop",icon:[512,512,[128421,61704,"desktop-alt"],"f390","M64 32C28.7 32 0 60.7 0 96L0 352c0 35.3 28.7 64 64 64l144 0-16 48-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l272 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-72 0-16-48 144 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 32zM96 96l320 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32L96 320c-17.7 0-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32z"]},Ele={prefix:"fas",iconName:"arrow-down",icon:[384,512,[8595],"f063","M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 402.7 224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 370.7-105.4-105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]},Vm={prefix:"fas",iconName:"location-dot",icon:[384,512,["map-marker-alt"],"f3c5","M0 188.6C0 84.4 86 0 192 0S384 84.4 384 188.6c0 119.3-120.2 262.3-170.4 316.8-11.8 12.8-31.5 12.8-43.3 0-50.2-54.5-170.4-197.5-170.4-316.8zM192 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128z"]},wx={prefix:"fas",iconName:"route",icon:[512,512,[],"f4d7","M512 96c0 50.2-59.1 125.1-84.6 155-3.8 4.4-9.4 6.1-14.5 5L320 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96 43 96 96s-43 96-96 96l-276.4 0c8.7-9.9 19.3-22.6 30-36.8 6.3-8.4 12.8-17.6 19-27.2L416 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c-53 0-96-43-96-96s43-96 96-96l39.8 0c-21-31.5-39.8-67.7-39.8-96 0-53 43-96 96-96s96 43 96 96zM117.1 489.1c-3.8 4.3-7.2 8.1-10.1 11.3l-1.8 2-.2-.2c-6 4.6-14.6 4-20-1.8-25.2-27.4-85-97.9-85-148.4 0-53 43-96 96-96s96 43 96 96c0 30-21.1 67-43.5 97.9-10.7 14.7-21.7 28-30.8 38.5l-.6 .7zM128 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]},Ale={prefix:"fas",iconName:"file-export",icon:[576,512,["arrow-right-from-file"],"f56e","M96.5 0c-35.3 0-64 28.7-64 64l0 384c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-96 78.1 0-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9l-72-72c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-78.1 0 0-133.5c0-17-6.7-33.3-18.7-45.3L291.2 18.7C279.2 6.7 263 0 246 0L96.5 0zM358 176l-93.5 0c-13.3 0-24-10.7-24-24L240.5 58.5 358 176zM224.5 328c0-13.3 10.7-24 24-24l104 0 0 48-104 0c-13.3 0-24-10.7-24-24z"]},$le={prefix:"fas",iconName:"arrows-rotate",icon:[512,512,[128472,"refresh","sync"],"f021","M65.9 228.5c13.3-93 93.4-164.5 190.1-164.5 53 0 101 21.5 135.8 56.2 .2 .2 .4 .4 .6 .6l7.6 7.2-47.9 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 53.4-11.3-10.7C390.5 28.6 326.5 0 256 0 127 0 20.3 95.4 2.6 219.5 .1 237 12.2 253.2 29.7 255.7s33.7-9.7 36.2-27.1zm443.5 64c2.5-17.5-9.7-33.7-27.1-36.2s-33.7 9.7-36.2 27.1c-13.3 93-93.4 164.5-190.1 164.5-53 0-101-21.5-135.8-56.2-.2-.2-.4-.4-.6-.6l-7.6-7.2 47.9 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 320c-8.5 0-16.7 3.4-22.7 9.5S-.1 343.7 0 352.3l1 127c.1 17.7 14.6 31.9 32.3 31.7S65.2 496.4 65 478.7l-.4-51.5 10.7 10.1c46.3 46.1 110.2 74.7 180.7 74.7 129 0 235.7-95.4 253.4-219.5z"]},zle=$le;const $={bg:"#0a0a0a",card:"#1e1e1e",border:"#333333",text:"rgba(255,255,255,.87)",text2:"rgba(255,255,255,.6)",text3:"rgba(255,255,255,.4)",accent:"#7c3aed",accentLight:"#8b5cf6",secondary:"#22d3ee",success:"#4ade80",danger:"#ef4444",warning:"#f59e0b",info:"#3b82f6"};function It({children:e}){return s.jsx(se,{bg:$.bg,borderRadius:"24px",p:"14px",maxW:"380px",mx:"auto",boxShadow:"0 30px 60px -20px rgba(60,20,110,.45)",border:"1px solid",borderColor:"whiteAlpha.100",children:s.jsx(se,{bg:$.bg,borderRadius:"16px",p:"16px 14px 20px",minH:"220px",children:e})})}function bn({title:e,subtitle:t,action:n}){return s.jsxs(kt,{justify:"space-between",align:"flex-start",mb:4,children:[s.jsxs(se,{children:[s.jsx(Z,{color:$.text,fontSize:"1rem",fontWeight:"800",mb:0,children:e}),t&&s.jsx(Z,{color:$.text3,fontSize:"0.72rem",children:t})]}),n]})}function We({children:e,mb:t=2.5,onClick:n,active:r=!1}){return s.jsx(se,{bg:$.card,border:"1px solid",borderColor:r?$.accent:$.border,borderRadius:"12px",p:3,mb:t,cursor:n?"pointer":void 0,transition:"border-color .15s, transform .1s",onClick:n,_hover:n?{borderColor:$.accentLight}:void 0,_active:n?{transform:"scale(0.99)"}:void 0,children:e})}function Ke({icon:e,value:t,label:n,color:r=$.accentLight}){return s.jsxs(se,{bg:$.card,border:"1px solid",borderColor:$.border,borderRadius:"12px",p:2.5,children:[s.jsx(kt,{w:"26px",h:"26px",borderRadius:"full",align:"center",justify:"center",bg:`${r}30`,mb:2,children:s.jsx(Oe,{icon:e,style:{color:r,fontSize:"0.7rem"}})}),s.jsx(Z,{color:$.text,fontSize:"1.15rem",fontWeight:"800",lineHeight:"1",children:t}),s.jsx(Z,{color:$.text3,fontSize:"0.62rem",mt:1,textTransform:"uppercase",letterSpacing:"0.02em",children:n})]})}function Y({children:e,variant:t="primary",mono:n=!1,size:r}){const i={primary:$.text,secondary:$.text2,muted:$.text3,success:$.success,danger:$.danger};return s.jsx(Z,{color:i[t],fontSize:r??"0.78rem",fontFamily:n?"mono":void 0,as:"span",children:e})}function Ct({children:e}){return s.jsx(ge,{justify:"space-between",align:"center",children:e})}function Rle({value:e,color:t=$.accent}){return s.jsx(kp,{value:e,size:"xs",borderRadius:"full",mt:1,sx:{"& > div":{background:t,transition:"width .4s ease"},background:"#2a2a2a"}})}function ll({color:e,size:t="9px"}){return s.jsx(se,{as:"span",display:"inline-block",w:t,h:t,borderRadius:"full",bg:e,mr:1.5,flexShrink:0})}function O7({icon:e,color:t,size:n="0.75rem"}){return s.jsx(Oe,{icon:e,style:{color:t??$.text2,fontSize:n,marginRight:6}})}function je({children:e,tone:t="outline",icon:n,onClick:r,isActive:i=!1}){const o={accent:{bg:$.accent,color:"white",border:"none"},outline:{bg:"transparent",color:$.text2,border:`1px solid ${$.border}`},outlineDanger:{bg:"transparent",color:$.danger,border:`1px solid ${$.danger}`},success:{bg:$.success,color:"#0a0a0a",border:"none"}}[t];return s.jsxs(se,{as:"button",type:"button",display:"inline-flex",alignItems:"center",borderRadius:"8px",px:3,py:1.5,fontSize:"0.68rem",fontWeight:"700",cursor:r?"pointer":"default",transition:"filter .15s, transform .1s",opacity:i?1:.92,_hover:r?{filter:"brightness(1.15)"}:void 0,_active:r?{transform:"scale(0.96)"}:void 0,onClick:r,...o,children:[n&&s.jsx(Oe,{icon:n,style:{marginRight:6,fontSize:"0.68rem"}}),e]})}function kx({tabs:e,active:t,onChange:n}){return s.jsx(ge,{spacing:1.5,mb:3,flexWrap:"wrap",children:e.map(r=>{const i=r.key===t;return s.jsx(se,{as:"button",type:"button",onClick:()=>n(r.key),px:2.5,py:1,borderRadius:"999px",fontSize:"0.66rem",fontWeight:"700",cursor:"pointer",transition:"all .15s",bg:i?$.accent:"transparent",color:i?"white":$.text3,border:"1px solid",borderColor:i?$.accent:$.border,_hover:{borderColor:$.accentLight,color:i?"white":$.text2},children:r.label},r.key)})})}function Mle({value:e,onChange:t,placeholder:n}){return s.jsxs(se,{position:"relative",my:2,children:[s.jsx(Oe,{icon:sle,style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:$.text3,fontSize:"0.65rem"}}),s.jsx(se,{as:"input",value:e,onChange:r=>t(r.target.value),placeholder:n,w:"100%",bg:$.bg,border:"1px solid",borderColor:$.border,borderRadius:"8px",color:$.text,fontSize:"0.7rem",py:1.5,pl:"26px",pr:2,outline:"none"})]})}function Wm({children:e}){return s.jsx(se,{border:"1px dashed",borderColor:$.border,borderRadius:"10px",p:2.5,mt:2,children:s.jsx(Z,{color:$.text3,fontSize:"0.64rem",fontStyle:"italic",children:e})})}function Ile({isOn:e,onToggle:t}){return s.jsx(se,{as:"button",type:"button",onClick:t,w:"34px",h:"20px",borderRadius:"full",bg:e?$.accent:$.border,position:"relative",cursor:"pointer",transition:"background .2s",flexShrink:0,children:s.jsx(se,{position:"absolute",top:"2px",left:e?"16px":"2px",w:"16px",h:"16px",borderRadius:"full",bg:"white",transition:"left .2s"})})}function Lle(){const[e,t]=m.useState(!0);return s.jsxs(It,{children:[s.jsx(bn,{title:"Bonjour, Admin",subtitle:"Vue d'ensemble"}),s.jsxs(gn,{columns:2,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:L7,value:312,label:"Total commandes",color:$.accentLight}),s.jsx(Ke,{icon:qu,value:8,label:"En attente",color:$.warning}),s.jsx(Ke,{icon:z7,value:5,label:"En route",color:$.info}),s.jsx(Ke,{icon:Ta,value:299,label:"Terminées",color:$.success}),s.jsx(Ke,{icon:xx,value:184,label:"Clients",color:$.accentLight}),s.jsx(Ke,{icon:$7,value:6,label:"Livreurs",color:$.secondary})]}),s.jsxs(We,{mb:0,children:[s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(O7,{icon:yx,color:$.secondary}),"Notifications Telegram"]}),s.jsx(je,{tone:e?"outlineDanger":"accent",icon:e?N7:R7,onClick:()=>t(n=>!n),children:e?"Délier":"Lier Telegram"})]}),s.jsx(Y,{variant:"muted",size:"0.68rem",children:e?"Compte Telegram lié — alertes actives.":"Aucun compte lié — cliquez pour connecter."})]})]})}const J3=[{id:"#1042",client:"client_marie · 12 rue des Lilas",extra:"il y a 4 min",tone:"warning",label:"En attente",amount:"46,00 €"},{id:"#1041",client:"client_paul · Livreur: lucas_d",extra:"Net après parrainage",tone:"info",label:"En route",amount:"33,00 €"},{id:"#1040",client:"client_lea · 8 avenue Foch",extra:"en attente d’assignation",tone:"accent",label:"Livreur arrivé",amount:"58,50 €"}],ek=[{id:"#1038",client:"client_sam · 3 rue Victor Hugo",extra:"Terminée il y a 1 h",tone:"info",label:"Livrée",amount:"27,00 €"},{id:"#1036",client:"client_ana · 21 bd Voltaire",extra:"Terminée hier",tone:"info",label:"Livrée",amount:"41,00 €"},{id:"#1030",client:"client_marie · 5 rue de Rivoli",extra:"Terminée il y a 3 j",tone:"info",label:"Livrée",amount:"22,00 €"}],tk=[{id:"#1029",client:"client_theo · adresse introuvable",extra:"Annulée par le livreur",tone:"warning",label:"Annulée",amount:"19,00 €"}],nk={warning:$.warning,info:$.info,accent:$.accentLight};function rk({o:e,isOpen:t,onClick:n,children:r}){return s.jsxs(We,{active:t,onClick:n,children:[s.jsxs(Ct,{children:[s.jsx(Y,{mono:!0,children:e.id}),s.jsx("span",{style:{background:`${nk[e.tone]}26`,color:nk[e.tone],padding:"2px 9px",borderRadius:999,fontWeight:800,fontSize:"0.62rem"},children:e.label})]}),s.jsx(Y,{variant:"secondary",size:"0.7rem",children:e.client}),s.jsxs(Ct,{children:[s.jsx(Y,{variant:"muted",size:"0.65rem",children:e.extra}),s.jsx(Y,{variant:"primary",size:"0.75rem",children:e.amount})]}),r]})}function Nle(){const[e,t]=m.useState("#1040"),[n,r]=m.useState(null),[i,o]=m.useState(""),a=n==="approuvees"?ek:n==="annulees"?tk:[],l=m.useMemo(()=>a.filter(u=>u.client.toLowerCase().includes(i.toLowerCase())),[a,i]),c=u=>{r(d=>d===u?null:u),o("")};return s.jsxs(It,{children:[s.jsxs(Ct,{children:[s.jsx(je,{tone:"outline",icon:zle,children:"Actualiser"}),s.jsx(je,{tone:"outline",icon:Ale,children:"Export CSV"})]}),s.jsxs("div",{style:{display:"flex",gap:6,marginTop:10,marginBottom:6},children:[s.jsxs("div",{onClick:()=>c("approuvees"),style:{cursor:"pointer",flex:1,textAlign:"center",padding:"6px 4px",borderRadius:999,fontSize:"0.66rem",fontWeight:700,border:`1px solid ${n==="approuvees"?$.success:$.border}`,background:n==="approuvees"?`${$.success}22`:"transparent",color:n==="approuvees"?$.success:$.text3},children:["Approuvées (",ek.length,")"]}),s.jsxs("div",{onClick:()=>c("annulees"),style:{cursor:"pointer",flex:1,textAlign:"center",padding:"6px 4px",borderRadius:999,fontSize:"0.66rem",fontWeight:700,border:`1px solid ${n==="annulees"?$.danger:$.border}`,background:n==="annulees"?`${$.danger}22`:"transparent",color:n==="annulees"?$.danger:$.text3},children:["Annulées (",tk.length,")"]})]}),n&&s.jsxs("div",{style:{marginBottom:10},children:[s.jsx(Mle,{value:i,onChange:o,placeholder:"Rechercher par username..."}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:[l.length," résultat",l.length>1?"s":""]}),l.map(u=>s.jsx(rk,{o:u,isOpen:!1,onClick:()=>{}},u.id)),s.jsx("div",{style:{borderTop:`1px solid ${$.border}`,margin:"10px 0"}})]}),s.jsxs(Y,{size:"0.78rem",variant:"primary",children:["Commandes actives (",J3.length,")"]}),s.jsx("div",{style:{marginTop:8},children:J3.map(u=>{const d=e===u.id;return s.jsx(rk,{o:u,isOpen:d,onClick:()=>t(d?null:u.id),children:d&&s.jsxs("div",{style:{marginTop:10,paddingTop:10,borderTop:`1px solid ${$.border}`,display:"flex",gap:6,flexWrap:"wrap"},children:[s.jsx(je,{tone:"accent",icon:vx,children:"Assigner livreur"}),s.jsx(je,{tone:"outline",icon:Yv,children:"Passer en route"}),s.jsx(je,{tone:"outline",icon:_le,children:"Proposer adresse"})]})},u.id)})})]})}const ik=[{name:"lucas_d",status:"busy",queue:1,today:14,total:512,distance:"1,8 km",eta:"6 min"},{name:"emma_l",status:"available",queue:0,today:9,total:340,distance:"0,6 km",eta:"2 min"},{name:"yanis_b",status:"offline",queue:0,today:5,total:128,distance:"—",eta:"—"}],Ka={available:$.success,busy:$.warning,offline:$.text3},Dle={available:"Disponible",busy:"Occupé",offline:"Hors ligne"};function Ole(){const[e,t]=m.useState("lucas_d"),n=ik.find(r=>r.name===e);return s.jsxs(It,{children:[s.jsxs(gn,{columns:3,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:Vm,value:1,label:"Dispo",color:$.success}),s.jsx(Ke,{icon:qu,value:1,label:"Occupés",color:$.warning}),s.jsx(Ke,{icon:P7,value:1,label:"Hors ligne",color:$.text3})]}),s.jsxs(We,{children:[s.jsx("div",{style:{height:110,borderRadius:8,position:"relative",backgroundImage:"linear-gradient(135deg,#161022 25%,#1c1330 25%,#1c1330 50%,#161022 50%,#161022 75%,#1c1330 75%)",backgroundSize:"18px 18px",marginBottom:6},children:s.jsxs("span",{style:{position:"absolute",top:8,left:8,background:`${Ka[n.status]}26`,color:Ka[n.status],fontSize:"0.62rem",fontWeight:800,padding:"3px 9px",borderRadius:999},children:[s.jsx(ll,{color:Ka[n.status],size:"7px"}),n.name," — ",n.distance," · ",n.eta]})}),s.jsx(Y,{variant:"muted",size:"0.62rem",children:"Cliquez un livreur ci-dessous pour suivre son trajet en direct"})]}),ik.map(r=>{const i=r.name===e;return s.jsxs(We,{active:i,onClick:()=>t(r.name),children:[s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(ll,{color:Ka[r.status]}),r.name]}),s.jsx("span",{style:{background:`${Ka[r.status]}26`,color:Ka[r.status],fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:Dle[r.status]})]}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:[r.queue," en attente · ",r.today," aujourd'hui · ",r.total," total"]}),i&&s.jsxs("div",{style:{marginTop:8,display:"flex",gap:6},children:[s.jsx(je,{tone:"outline",icon:$p,children:"Avis"}),s.jsx(je,{tone:r.status!=="offline"?"accent":"outline",icon:wx,children:r.status!=="offline"?"Suivre l'itinéraire":"Indisponible"})]})]},r.name)})]})}const Fle=[{label:"1u",price:"12€",active:!0},{label:"3u",price:"30€",active:!0},{label:"5u",price:"45€",active:!1}];function Ble(){const[e,t]=m.useState(Fle),n=r=>{t(i=>i.map((o,a)=>a===r?{...o,active:!o.active}:o))};return s.jsxs(It,{children:[s.jsx(bn,{title:"Produits (48)",action:s.jsx(je,{tone:"accent",icon:Sx,children:"Créer"})}),s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsx(Y,{variant:"primary",size:"0.82rem",children:"Pack Découverte"}),s.jsx("span",{style:{background:`${$.accentLight}26`,color:$.accentLight,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:"Premium"})]}),s.jsxs(Y,{variant:"muted",size:"0.65rem",children:[s.jsx(Oe,{icon:gle,style:{marginRight:4}}),"3 images ·"," ",s.jsx(Oe,{icon:ple,style:{marginRight:4}}),"1 vidéo · Stock: 24 u"]}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"Cliquez un tarif pour l'activer / le désactiver"}),s.jsx("div",{style:{display:"flex",gap:6,marginTop:6,flexWrap:"wrap"},children:e.map((r,i)=>s.jsxs("div",{onClick:()=>n(i),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:5,padding:"4px 9px",borderRadius:8,border:`1px solid ${$.border}`,opacity:r.active?1:.5,textDecoration:r.active?"none":"line-through"},children:[s.jsx(Oe,{icon:r.active?xle:hle,style:{color:r.active?$.success:$.danger,fontSize:"0.7rem"}}),s.jsxs("span",{style:{color:$.text,fontSize:"0.72rem"},children:[r.label," = ",r.price]})]},r.label))}),s.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[s.jsx(je,{tone:"outline",icon:Sle,children:"Modifier"}),s.jsx(je,{tone:"outlineDanger",icon:E7,children:"Supprimer"})]})]}),s.jsxs(We,{mb:0,children:[s.jsxs(Ct,{children:[s.jsx(Y,{variant:"primary",size:"0.82rem",children:"Édition Limitée"}),s.jsx("span",{style:{background:`${$.warning}26`,color:$.warning,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:"À venir"})]}),s.jsx(Y,{variant:"muted",size:"0.65rem",children:"Stock: 0 u — masqué du catalogue tant que le stock est vide"})]})]})}const Vle=[{id:"a",name:"Fleurs",color:"#10b981"},{id:"b",name:"Résines",color:"#9333ea"},{id:"c",name:"Comestibles",color:"#3dc2f7",soon:!0}];function Wle(){const[e,t]=m.useState(Vle),n=(r,i)=>{const o=r+i;o<0||o>=e.length||t(a=>{const l=[...a];return[l[r],l[o]]=[l[o],l[r]],l})};return s.jsxs(It,{children:[s.jsx(bn,{title:"Catégories",action:s.jsx(je,{tone:"accent",icon:Sx,children:"Ajouter"})}),e.map((r,i)=>s.jsx(We,{children:s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(ll,{color:r.color}),r.name,r.soon&&s.jsx("span",{style:{marginLeft:8,background:`${$.warning}26`,color:$.warning,fontSize:"0.58rem",fontWeight:800,padding:"2px 7px",borderRadius:999},children:"Prochainement"})]}),s.jsxs("div",{style:{display:"flex",gap:4},children:[s.jsx("button",{onClick:()=>n(i,-1),disabled:i===0,style:{background:"transparent",border:"none",cursor:i===0?"default":"pointer",color:i===0?$.border:$.text2,padding:4},"aria-label":"Monter",children:s.jsx(Oe,{icon:A7,style:{fontSize:"0.7rem"}})}),s.jsx("button",{onClick:()=>n(i,1),disabled:i===e.length-1,style:{background:"transparent",border:"none",cursor:i===e.length-1?"default":"pointer",color:i===e.length-1?$.border:$.text2,padding:4},"aria-label":"Descendre",children:s.jsx(Oe,{icon:I7,style:{fontSize:"0.7rem"}})})]})]})},r.id)),s.jsx(Y,{variant:"muted",size:"0.62rem",children:"Essayez les flèches ↑ / ↓ pour réordonner"})]})}function Bl({title:e,onReset:t,since:n,children:r}){return s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsx(Y,{variant:"secondary",size:"0.72rem",children:e}),t&&s.jsx(je,{tone:"outlineDanger",icon:zp,onClick:t,children:"Réinitialiser"})]}),n&&s.jsxs(Y,{variant:"muted",size:"0.58rem",children:["Depuis le ",n]}),s.jsx("div",{style:{marginTop:8},children:r})]})}function Oo({label:e,value:t,pct:n,color:r,highlight:i}){return s.jsxs("div",{style:{marginBottom:6},children:[s.jsxs(Ct,{children:[s.jsxs(Y,{variant:i?"primary":"muted",size:"0.64rem",children:[i&&s.jsx(Oe,{icon:fle,style:{color:$.warning,marginRight:4}}),e]}),s.jsx(Y,{variant:i?"primary":"muted",size:"0.64rem",children:t})]}),s.jsx(Rle,{value:n,color:i?$.warning:r})]})}const qa=["Mai 2026","Juin 2026","Juillet 2026","Août 2026"],Ule=[{day:"02/08",orders:14,revenue:"312€",best:!1},{day:"01/08",orders:22,revenue:"498€",best:!0},{day:"31/07",orders:9,revenue:"201€",best:!1}],Hle=[{key:"quantite",label:"Quantité"},{key:"commandes",label:"Commandes"},{key:"revenus",label:"Revenus"}],Gle={quantite:[{name:"Pack Découverte",value:210,display:"210"},{name:"Édition Standard",value:140,display:"140"},{name:"Format Duo",value:96,display:"96"}],commandes:[{name:"Pack Découverte",value:86,display:"86"},{name:"Édition Standard",value:54,display:"54"},{name:"Format Duo",value:41,display:"41"}],revenus:[{name:"Pack Découverte",value:1032,display:"1032€"},{name:"Édition Standard",value:648,display:"648€"},{name:"Format Duo",value:492,display:"492€"}]},$0=[{label:"10h",value:4},{label:"12h",value:18},{label:"14h",value:9},{label:"18h",value:22},{label:"20h",value:31},{label:"22h",value:12}],z0=[{label:"Lun",value:32},{label:"Mar",value:28},{label:"Mer",value:35},{label:"Jeu",value:41},{label:"Ven",value:58},{label:"Sam",value:71},{label:"Dim",value:47}],ok=[{label:"1g",value:40},{label:"3.5g",value:86},{label:"5g",value:22},{label:"10g",value:12}];function Kle(){const[e,t]=m.useState(qa.length-1),[n,r]=m.useState("revenus"),i=m.useMemo(()=>[...Gle[n]].sort((f,p)=>p.value-f.value),[n]),o=i[0].value,a=Math.max(...$0.map(f=>f.value)),l=$0.reduce((f,p)=>p.value>f.value?p:f),c=Math.max(...z0.map(f=>f.value)),u=z0.reduce((f,p)=>p.value>f.value?p:f),d=Math.max(...ok.map(f=>f.value));return s.jsxs(It,{children:[s.jsx(bn,{title:"Statistiques",subtitle:"Activité globale & produits"}),s.jsxs("div",{style:{maxHeight:560,overflowY:"auto",paddingRight:2},children:[s.jsxs(gn,{columns:2,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:cle,value:312,label:"Commandes totales",color:$.accentLight}),s.jsx(Ke,{icon:ole,value:"6,4k€",label:"Revenus (terminées)",color:$.success}),s.jsx(Ke,{icon:qu,value:"10,4",label:"Moy. commandes/jour",color:$.info}),s.jsx(Ke,{icon:Q3,value:"Samedi",label:"Jour de pointe",color:$.warning})]}),s.jsxs(We,{children:[s.jsx(Y,{variant:"secondary",size:"0.72rem",children:"Activité du jour"}),s.jsxs("div",{style:{display:"flex",gap:10,margin:"6px 0 8px"},children:[s.jsx(Y,{variant:"muted",size:"0.6rem",children:"18 commandes"}),s.jsx(Y,{variant:"muted",size:"0.6rem",children:"420g vendus"}),s.jsx(Y,{variant:"muted",size:"0.6rem",children:"312€"})]}),s.jsx(Oo,{label:"Fleurs — Pack Découverte",value:"86 · 1032€",pct:90,color:$.accent}),s.jsx(Oo,{label:"Résines — Format Duo",value:"41 · 492€",pct:45,color:$.info})]}),s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsx("button",{onClick:()=>t(f=>Math.max(0,f-1)),disabled:e===0,style:{background:"none",border:"none",cursor:e===0?"default":"pointer",color:e===0?$.border:$.text2},children:s.jsx(Oe,{icon:jle})}),s.jsx(Y,{variant:"primary",size:"0.72rem",children:qa[e]}),s.jsx("button",{onClick:()=>t(f=>Math.min(qa.length-1,f+1)),disabled:e===qa.length-1,style:{background:"none",border:"none",cursor:e===qa.length-1?"default":"pointer",color:e===qa.length-1?$.border:$.text2},children:s.jsx(Oe,{icon:dle})})]}),s.jsx(Y,{variant:"muted",size:"0.6rem",children:"Historique mensuel — cliquez les flèches"}),s.jsx("div",{style:{marginTop:8},children:Ule.map(f=>s.jsx(Oo,{label:f.day,value:`${f.orders} cmd · ${f.revenue}`,pct:f.orders/22*100,color:$.accent,highlight:f.best},f.day))})]}),s.jsx(Bl,{title:"30 derniers jours — commandes",onReset:()=>{},since:"15/07/2026",children:s.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:3,height:50},children:[4,8,6,10,7,12,9,14,6,11].map((f,p)=>s.jsx("div",{style:{flex:1,height:`${f/14*100}%`,background:$.accent,borderRadius:2}},p))})}),s.jsxs(Bl,{title:"Revenus par jour (30j)",onReset:()=>{},since:"15/07/2026",children:[s.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:3,height:50,marginBottom:6},children:[120,240,180,300,210,360,260,410,190,330].map((f,p)=>s.jsx("div",{style:{flex:1,height:`${f/410*100}%`,background:$.success,borderRadius:2}},p))}),s.jsxs(Y,{variant:"muted",size:"0.6rem",children:[s.jsx(Oe,{icon:Q3,style:{color:$.warning,marginRight:4}}),"Meilleure journée : 01/08 — 498€"]})]}),s.jsxs(Bl,{title:"Heures d'affluence",onReset:()=>{},since:"15/07/2026",children:[$0.map(f=>s.jsx(Oo,{label:f.label,value:String(f.value),pct:f.value/a*100,color:$.info,highlight:f.label===l.label},f.label)),s.jsxs(Y,{variant:"muted",size:"0.6rem",children:["Heure de pointe : ",l.label," (",l.value," commandes)"]})]}),s.jsxs(Bl,{title:"Jours d'affluence",onReset:()=>{},since:"15/07/2026",children:[z0.map(f=>s.jsx(Oo,{label:f.label,value:String(f.value),pct:f.value/c*100,color:$.accent,highlight:f.label===u.label},f.label)),s.jsxs(Y,{variant:"muted",size:"0.6rem",children:["Pic d'activité : ",u.label]})]}),s.jsx(Bl,{title:"Doses populaires — Pack Découverte",onReset:()=>{},since:"15/07/2026",children:ok.map(f=>s.jsx(Oo,{label:f.label,value:String(f.value),pct:f.value/d*100,color:$.secondary,highlight:f.value===d},f.label))}),s.jsxs(We,{mb:0,children:[s.jsxs(Ct,{children:[s.jsx(Y,{variant:"secondary",size:"0.72rem",children:"Top produits"}),s.jsx(je,{tone:"outlineDanger",icon:zp,onClick:()=>{},children:"Réinitialiser"})]}),s.jsx("div",{style:{marginTop:8},children:s.jsx(kx,{tabs:Hle,active:n,onChange:r})}),i.map((f,p)=>s.jsx(Oo,{label:f.name,value:f.display,pct:f.value/o*100,color:$.accent,highlight:p===0},f.name)),s.jsxs(Y,{variant:"muted",size:"0.6rem",children:["Moins vendu : ",i[i.length-1].name]})]})]})]})}const ak=[{name:"client_marie",role:"clients",icon:xx,tone:$.info,detail:"Cmd: 12 · Points: 340 · Parrain: +8€"},{name:"lucas_d",role:"livreurs",icon:M7,tone:$.success,detail:"512 livraisons · connecté aujourd’hui"},{name:"admin_yas",role:"admins",icon:Bm,tone:$.accentLight,detail:"Accès complet à la plateforme"}],qle=[{key:"tous",label:"Tous",icon:$7,count:3},{key:"clients",label:"Clients",icon:xx,count:1},{key:"livreurs",label:"Livreurs",icon:M7,count:1},{key:"admins",label:"Admins",icon:Bm,count:1}];function Xle(){const[e,t]=m.useState("tous"),n=e==="tous"?ak:ak.filter(r=>r.role===e);return s.jsxs(It,{children:[s.jsx(gn,{columns:4,spacing:1.5,mb:2.5,children:qle.map(r=>{const i=r.key===e;return s.jsxs("div",{onClick:()=>t(r.key),style:{cursor:"pointer",textAlign:"center",padding:"8px 2px",borderRadius:10,border:`1px solid ${i?$.accent:$.border}`,background:i?`${$.accent}22`:$.card},children:[s.jsx(Oe,{icon:r.icon,style:{color:i?$.accentLight:$.text3,fontSize:"0.75rem"}}),s.jsx("div",{style:{color:$.text,fontSize:"0.72rem",fontWeight:800,marginTop:4},children:r.count}),s.jsx("div",{style:{color:$.text3,fontSize:"0.55rem"},children:r.label})]},r.key)})}),n.map(r=>s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(Oe,{icon:r.icon,style:{color:r.tone,marginRight:6,fontSize:"0.72rem"}}),r.name]}),s.jsx("span",{style:{background:`${r.tone}26`,color:r.tone,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999,textTransform:"capitalize"},children:r.role==="clients"?"Client":r.role==="livreurs"?"Livreur":"Admin"})]}),s.jsx(Y,{variant:"muted",size:"0.65rem",children:r.detail})]},r.name))]})}const sk=[{id:"perso",icon:Z3,title:"Personnalisation",body:"Nom du shop affiché dans l’app · dégradé de couleur du titre (2 couleurs, aperçu en direct)."},{id:"amendes",icon:_7,title:"Amendes",body:"Barème par nombre d’annulations : 0 → 20€, 1 → 50€, 2 → 100€, 3 → 150€. Score affichable au client ou non.",hasSwitch:!0},{id:"parrainage",icon:vle,title:"Parrainage",body:"Active le solde de parrainage, utilisable directement au moment du paiement par le filleul.",hasSwitch:!0},{id:"points",icon:$p,title:"Système de points",body:"Créez vos propres types de points (nom + couleur), chacun avec son propre barème €→points.",hasSwitch:!0},{id:"attribution",icon:ble,title:"Attribution catégories → points",body:"Chaque catégorie de produit peut être reliée à un type de points précis, ou à aucun."},{id:"baremes",icon:$p,title:"Barème — Points Fidélité",body:"Paliers Min € / Max € / Points : ex. 0–20€ = 5 pts, 20–50€ = 15 pts, 50€+ = 40 pts."},{id:"recompense",icon:ile,title:"Récompenses par palier",body:"Seuil de points → produit offert ou à -50%. Récapitulatif généré automatiquement.",hasSwitch:!0},{id:"horaires",icon:Yv,title:"Horaires de livraison",body:"Lundi → Vendredi : 11h00–22h30 · Samedi : 12h00–23h00 · Dimanche : fermé."},{id:"zones",icon:ale,title:"Zones de livraison",body:"3 zones actives · minimum de commande et liste de codes postaux par zone, ajout en masse."},{id:"crypto",icon:Cle,title:"Paiement crypto",body:"BTC, ETH, LTC, USDT acceptés (NowPayments). Clé API et secret IPN masqués.",hasSwitch:!0},{id:"telegram",icon:ule,title:"Notifications Telegram",body:"Bot configuré — @votre_bot · authentification à deux facteurs activée.",hasSwitch:!0},{id:"mode-livraison",icon:Yv,title:"Mode de livraison",body:"« Par catégorie » : chaque livreur ne reçoit que les commandes des catégories qui lui sont assignées."},{id:"couleurs",icon:Z3,title:"Couleurs de l'interface",body:"Palette séparée pour l’espace admin et pour l’app client — 5 couleurs, restaurables en un clic."}];function Yle(){const[e,t]=m.useState("crypto"),[n,r]=m.useState(!0),[i,o]=m.useState(!0);return s.jsxs(It,{children:[s.jsx(bn,{title:"Paramètres",subtitle:`${sk.length} sections — cliquez pour ouvrir`}),s.jsx("div",{style:{maxHeight:480,overflowY:"auto",paddingRight:2},children:sk.map(a=>{const l=e===a.id,c=a.id==="crypto"?n:a.id==="telegram"?i:!0,u=a.id==="crypto"?r:o;return s.jsxs(We,{onClick:()=>t(l?null:a.id),children:[s.jsxs(Ct,{children:[s.jsxs(Y,{size:"0.72rem",children:[s.jsx(Oe,{icon:a.icon,style:{color:$.accentLight,marginRight:8,fontSize:"0.68rem"}}),a.title]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.hasSwitch&&(a.id==="crypto"||a.id==="telegram")&&s.jsx("span",{onClick:d=>d.stopPropagation(),children:s.jsx(Ile,{isOn:c,onToggle:()=>u(d=>!d)})}),a.hasSwitch&&a.id!=="crypto"&&a.id!=="telegram"&&s.jsx(Oe,{icon:yx,style:{color:$.success,fontSize:"0.55rem"}}),s.jsx(Oe,{icon:l?A7:I7,style:{color:$.text3,fontSize:"0.6rem"}})]})]}),l&&s.jsx("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${$.border}`},children:s.jsx(Y,{variant:"muted",size:"0.66rem",children:a.body})})]},a.id)})})]})}const Qle=[{id:"1",driver:"lucas_d",message:"Accès bloqué, portail fermé",time:"03/08/2026, 14:32",active:!0},{id:"2",driver:"emma_l",message:"Client injoignable",time:"02/08/2026, 19:05",active:!1}];function Zle(){const[e,t]=m.useState(Qle),n=r=>{t(i=>i.map(o=>o.id===r?{...o,active:!1}:o))};return s.jsxs(It,{children:[s.jsx(bn,{title:"Alertes",subtitle:"Cliquez « Résoudre » pour tester"}),e.map(r=>s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsxs(Y,{variant:r.active?"danger":"secondary",children:[s.jsx(Oe,{icon:Fm,style:{color:r.active?$.danger:$.text3,marginRight:6,fontSize:"0.72rem"}}),r.driver]}),s.jsx("span",{style:{background:r.active?`${$.danger}26`:`${$.success}26`,color:r.active?$.danger:$.success,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:r.active?"Active":"Terminée"})]}),r.active&&s.jsxs(Y,{variant:"danger",size:"0.7rem",children:['"',r.message,'"']}),s.jsxs(Ct,{children:[s.jsx(Y,{variant:"muted",size:"0.62rem",children:r.time}),r.active&&s.jsx(je,{tone:"success",icon:Ta,onClick:()=>n(r.id),children:"Résoudre"})]})]},r.id))]})}const Jle=[{id:"1",wrong:"10 rue de la paix",right:"10 Rue de la Paix, 75001 Paris"}];function ece(){const[e,t]=m.useState(Jle),[n,r]=m.useState(!1),[i,o]=m.useState(""),[a,l]=m.useState(""),c=()=>{!i.trim()||!a.trim()||(t(u=>[...u,{id:String(u.length+1),wrong:i,right:a}]),o(""),l(""),r(!1))};return s.jsxs(It,{children:[s.jsx(bn,{title:"Corrections d'adresses",action:s.jsx(je,{tone:"accent",icon:Sx,onClick:()=>r(u=>!u),children:n?"Fermer":"Ajouter"})}),n&&s.jsxs(We,{children:[s.jsx("input",{placeholder:"Adresse invalide (ex: 10 rue de la paix)",value:i,onChange:u=>o(u.target.value),style:{width:"100%",background:$.bg,border:`1px solid ${$.border}`,borderRadius:8,color:$.text,fontSize:"0.7rem",padding:"6px 8px",marginBottom:6,outline:"none"}}),s.jsx("input",{placeholder:"Adresse correcte (ex: 10 Rue de la Paix, 75001 Paris)",value:a,onChange:u=>l(u.target.value),style:{width:"100%",background:$.bg,border:`1px solid ${$.border}`,borderRadius:8,color:$.text,fontSize:"0.7rem",padding:"6px 8px",marginBottom:8,outline:"none"}}),s.jsx(je,{tone:"accent",onClick:c,children:"Ajouter la correction"})]}),e.map(u=>s.jsxs(We,{children:[s.jsx(Y,{variant:"danger",size:"0.72rem",children:u.wrong}),s.jsx("div",{style:{margin:"3px 0"},children:s.jsx(Oe,{icon:Ele,style:{color:$.text3,fontSize:"0.62rem"}})}),s.jsx(Y,{variant:"success",size:"0.72rem",children:u.right})]},u.id))]})}function tce(){const[e,t]=m.useState(!1);return s.jsxs(It,{children:[s.jsx(bn,{title:"Cabine — Nadia",subtitle:"Suivi des opérations"}),s.jsxs(gn,{columns:2,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:L7,value:11,label:"Commandes actives",color:$.info}),s.jsx(Ke,{icon:z7,value:4,label:"En route",color:$.warning}),s.jsx(Ke,{icon:qu,value:3,label:"En attente",color:$.accentLight}),s.jsx(Ke,{icon:vx,value:4,label:"Livreurs dispo",color:$.success}),s.jsx(Ke,{icon:bx,value:2,label:"Livreurs occupés",color:$.warning}),s.jsx(Ke,{icon:Ple,value:299,label:"Total terminées",color:$.success})]}),s.jsx(We,{mb:0,children:s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(O7,{icon:yx,color:$.secondary}),"Notifications Telegram"]}),s.jsx(je,{tone:e?"outlineDanger":"accent",icon:e?N7:R7,onClick:()=>t(n=>!n),children:e?"Délier":"Lier Telegram"})]})})]})}const nce=[{id:"#1042",client:"client_marie",address:"12 rue des Lilas",total:"46,00 €",label:"En attente",tone:$.warning},{id:"#1040",client:"client_lea",address:"8 avenue Foch",total:"58,50 €",label:"Livreur arrivé",tone:$.accentLight}];function rce(){const[e,t]=m.useState("#1042");return s.jsxs(It,{children:[s.jsx(bn,{title:"Commandes actives",subtitle:"Cliquez une commande"}),nce.map(n=>{const r=e===n.id;return s.jsxs(We,{active:r,onClick:()=>t(r?null:n.id),children:[s.jsxs(Ct,{children:[s.jsx(Y,{mono:!0,children:n.id}),s.jsx("span",{style:{background:`${n.tone}26`,color:n.tone,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:n.label})]}),s.jsxs(Y,{variant:"secondary",size:"0.7rem",children:[n.client," · ",n.address]}),s.jsx(Y,{variant:"primary",size:"0.75rem",children:n.total}),r&&s.jsxs("div",{style:{marginTop:10,paddingTop:10,borderTop:`1px solid ${$.border}`,display:"flex",gap:6,flexWrap:"wrap"},children:[s.jsx(je,{tone:"accent",icon:yle,children:"Le livreur est là"}),s.jsx(je,{tone:"outline",icon:vx,children:"Assigner livreur"}),s.jsx(je,{tone:"outline",icon:Vm,children:"Proposer adresse"}),s.jsx(je,{tone:"outlineDanger",icon:E7,children:"Supprimer"})]})]},n.id)}),s.jsx(Wm,{children:"Contrairement à l'espace admin, la cabine ne peut pas modifier le contenu d'une commande — seulement la faire avancer ou la supprimer."})]})}const ice=[{name:"lucas_d",status:"busy",queue:1,total:512},{name:"emma_l",status:"available",queue:0,total:340}],R0={available:$.success,busy:$.warning,offline:$.text3},oce={available:"Disponible",busy:"Occupé",offline:"Hors ligne"};function ace(){const[e,t]=m.useState("lucas_d");return s.jsxs(It,{children:[s.jsxs(gn,{columns:3,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:Vm,value:1,label:"Dispo",color:$.success}),s.jsx(Ke,{icon:bx,value:1,label:"Occupés",color:$.warning}),s.jsx(Ke,{icon:P7,value:0,label:"Offline",color:$.text3})]}),ice.map(n=>{const r=e===n.name;return s.jsxs(We,{active:r,children:[s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(ll,{color:R0[n.status]}),n.name]}),s.jsx("span",{style:{background:`${R0[n.status]}26`,color:R0[n.status],fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:oce[n.status]})]}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:["Queue: ",n.queue," · Total: ",n.total]}),s.jsx("div",{style:{marginTop:8},children:s.jsx(je,{tone:r?"accent":"outline",icon:wx,onClick:()=>t(r?null:n.name),children:r?"Arrêter le suivi":"Suivre"})})]},n.name)}),s.jsx(Wm,{children:"La cabine visualise et suit les livreurs en direct, mais l'assignation d'une commande se fait depuis l'écran Commandes."})]})}const lk=[{id:"1",driver:"lucas_d",message:"Accès bloqué, portail fermé",time:"14:32",active:!0},{id:"2",driver:"emma_l",message:"Client injoignable",time:"hier 19:05",active:!1}];function sce(){const[e,t]=m.useState("toutes"),n=e==="toutes"?lk:lk.filter(r=>r.active);return s.jsxs(It,{children:[s.jsx(bn,{title:"Alertes livreurs"}),s.jsx(kx,{tabs:[{key:"toutes",label:"Toutes"},{key:"actives",label:"Actives"}],active:e,onChange:t}),n.map(r=>s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsxs(Y,{variant:r.active?"danger":"secondary",children:[s.jsx(Oe,{icon:Fm,style:{color:r.active?$.danger:$.text3,marginRight:6,fontSize:"0.72rem"}}),r.driver]}),s.jsx("span",{style:{background:r.active?`${$.danger}26`:`${$.success}26`,color:r.active?$.danger:$.success,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:r.active?"Active":"Terminée"})]}),r.active&&s.jsxs(Y,{variant:"danger",size:"0.7rem",children:['"',r.message,'"']}),s.jsx(Y,{variant:"muted",size:"0.62rem",children:r.time})]},r.id)),s.jsx(Wm,{children:"La résolution des alertes reste réservée à l'espace admin."})]})}function lce(){const[e,t]=m.useState("35 €"),[n,r]=m.useState(340);return s.jsxs(It,{children:[s.jsx(bn,{title:"Clients",subtitle:"Réinitialisations rapides"}),s.jsxs(We,{mb:0,children:[s.jsx(Y,{variant:"primary",size:"0.82rem",children:"client_marie"}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"Marie D. · 06 12 34 56 78"}),s.jsxs("div",{style:{display:"flex",gap:12,margin:"8px 0"},children:[s.jsx(Y,{variant:"danger",size:"0.68rem",children:"Annul.: 2"}),s.jsxs(Y,{variant:"secondary",size:"0.68rem",mono:!0,children:["Amende: ",e]}),s.jsxs(Y,{variant:"success",size:"0.68rem",mono:!0,children:["Points: ",n]})]}),s.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[s.jsx(je,{tone:"outline",icon:zp,onClick:()=>t("0 €"),children:"Reset pénalités"}),s.jsx(je,{tone:"outline",icon:zp,onClick:()=>r(0),children:"Reset points"})]})]}),s.jsx(Wm,{children:"Pas de création, modification ni suppression de compte ici — uniquement des remises à zéro ponctuelles."})]})}const M0=["pending","in_progress","arrived","completed"],I0={pending:{label:"En attente",tone:$.info},in_progress:{label:"En cours",tone:$.warning},arrived:{label:"Arrivé",tone:$.accentLight},completed:{label:"Terminée",tone:$.success}},cce=[{key:"available",label:"Disponible",tone:$.success},{key:"busy",label:"Occupé",tone:$.warning},{key:"offline",label:"Hors ligne",tone:$.text3}];function uce(){const[e,t]=m.useState("available"),[n,r]=m.useState("in_progress"),i=()=>{const o=M0.indexOf(n);o{const a=e===o.key;return s.jsxs("div",{onClick:()=>t(o.key),style:{cursor:"pointer",display:"flex",alignItems:"center",padding:"5px 10px",borderRadius:999,fontSize:"0.65rem",fontWeight:700,border:`1px solid ${a?o.tone:$.border}`,background:a?`${o.tone}22`:"transparent",color:a?o.tone:$.text3},children:[s.jsx(ll,{color:o.tone,size:"7px"}),o.label]},o.key)})}),s.jsx(We,{children:s.jsx("div",{style:{height:96,borderRadius:8,position:"relative",backgroundImage:"linear-gradient(135deg,#161022 25%,#1c1330 25%,#1c1330 50%,#161022 50%,#161022 75%,#1c1330 75%)",backgroundSize:"18px 18px",marginBottom:6},children:s.jsxs("span",{style:{position:"absolute",top:8,left:8,background:`${$.success}26`,color:$.success,fontSize:"0.6rem",fontWeight:800,padding:"3px 9px",borderRadius:999},children:[s.jsx(ll,{color:$.success,size:"7px"}),"GPS actif — 48.85, 2.35"]})})}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"Mes livraisons (1) — cliquez « avancer » pour tester le cycle complet"}),s.jsxs(We,{mb:0,children:[s.jsxs(Ct,{children:[s.jsx(Y,{mono:!0,children:"Commande #1041"}),s.jsx("span",{style:{background:`${I0[n].tone}26`,color:I0[n].tone,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:I0[n].label})]}),s.jsx(Y,{variant:"secondary",size:"0.7rem",children:"client_paul · 12 rue des Lilas"}),s.jsxs("div",{style:{display:"flex",gap:6,marginTop:8,flexWrap:"wrap"},children:[s.jsx(je,{tone:"outline",icon:Vm,children:"Itinéraire"}),s.jsx(je,{tone:"outline",icon:wle,children:"Appeler"})]}),s.jsxs("div",{style:{marginTop:10,paddingTop:10,borderTop:`1px solid ${$.border}`,display:"flex",gap:6,flexWrap:"wrap"},children:[n==="pending"&&s.jsx(je,{tone:"success",icon:wx,onClick:i,children:"Démarrer la livraison"}),n==="in_progress"&&s.jsx(je,{tone:"accent",icon:bx,onClick:i,children:"J'arrive"}),n==="arrived"&&s.jsxs(s.Fragment,{children:[s.jsx(je,{tone:"accent",icon:Ta,onClick:i,children:"Terminer"}),s.jsx(je,{tone:"outlineDanger",icon:_7,children:"Annuler"})]}),n==="completed"&&s.jsxs(Y,{variant:"success",size:"0.7rem",children:[s.jsx(Oe,{icon:Ta,style:{marginRight:6}}),"Livraison terminée"]})]})]})]})}const Fo={police:{title:"Contrôle de police",icon:Bm,hint:"Restez calme, coopérez avec les forces de l’ordre. L’équipe est prévenue."},ambush:{title:"Guet-apens",icon:Fm,hint:"Éloignez-vous du danger si possible. L’équipe et les secours sont prévenus."}};function dce(){const[e,t]=m.useState("idle"),[n,r]=m.useState("police");return s.jsxs(It,{children:[s.jsx(bn,{title:"Alerte",subtitle:"Bouton d'urgence pour les livreurs"}),e==="idle"&&s.jsx(je,{tone:"outlineDanger",icon:Fm,onClick:()=>t("pick"),children:"Déclencher alerte police"}),e==="pick"&&s.jsxs(We,{mb:0,children:[s.jsx(Y,{size:"0.78rem",variant:"primary",children:"Type d'alerte"}),s.jsx(Y,{variant:"muted",size:"0.65rem",children:"Sélectionnez la raison de l'alerte."}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6,marginTop:8},children:Object.keys(Fo).map(i=>s.jsxs("div",{onClick:()=>{r(i),t("confirm")},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:8,border:`1px solid ${$.border}`},children:[s.jsx(Oe,{icon:Fo[i].icon,style:{color:$.danger,fontSize:"0.8rem"}}),s.jsx("span",{style:{color:$.text,fontSize:"0.74rem"},children:Fo[i].title})]},i))}),s.jsx("div",{style:{marginTop:10},children:s.jsx(je,{tone:"outline",onClick:()=>t("idle"),children:"Annuler"})})]}),e==="confirm"&&s.jsxs(We,{mb:0,children:[s.jsxs(Y,{size:"0.78rem",variant:"danger",children:[s.jsx(Oe,{icon:Fo[n].icon,style:{marginRight:6}}),"Alerte — ",Fo[n].title]}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:Fo[n].hint}),s.jsx(Y,{variant:"primary",size:"0.74rem",children:"Confirmez-vous le déclenchement ?"}),s.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[s.jsx(je,{tone:"outline",onClick:()=>t("idle"),children:"Annuler"}),s.jsx(je,{tone:"outlineDanger",onClick:()=>t("sent"),children:"Déclencher"})]})]}),e==="sent"&&s.jsxs(We,{mb:0,children:[s.jsx(Oe,{icon:Ta,style:{color:$.success,fontSize:"1.4rem",marginBottom:8}}),s.jsx(Y,{size:"0.8rem",variant:"success",children:"Alerte envoyée"}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"L'équipe admin a été notifiée immédiatement."}),s.jsx(Y,{variant:"secondary",size:"0.66rem",children:Fo[n].hint}),s.jsx("div",{style:{marginTop:10},children:s.jsx(je,{tone:"accent",onClick:()=>t("idle"),children:"Compris"})})]})]})}function ck({value:e}){return s.jsx("span",{children:[1,2,3,4,5].map(t=>s.jsx(Oe,{icon:$p,style:{color:t<=e?$.warning:$.border,fontSize:"0.7rem",marginRight:2}},t))})}const fce=[{client:"client_marie",order:"#1038",rating:5,comment:"Livraison rapide et sympa, merci !"},{client:"client_theo",order:"#1029",rating:4,comment:"Tout est arrivé nickel."}];function pce(){return s.jsxs(It,{children:[s.jsx(bn,{title:"Mes avis"}),s.jsxs(We,{children:[s.jsx(Y,{size:"1.5rem",variant:"primary",children:"4.7"}),s.jsx("div",{style:{marginTop:4},children:s.jsx(ck,{value:5})}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"38 avis clients"})]}),fce.map(e=>s.jsxs(We,{children:[s.jsx(Y,{size:"0.74rem",variant:"primary",children:e.client}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:["Commande ",e.order]}),s.jsx("div",{style:{margin:"4px 0"},children:s.jsx(ck,{value:e.rating})}),s.jsxs(Y,{variant:"secondary",size:"0.68rem",children:["« ",e.comment," »"]})]},e.order))]})}const mce={jour:[2,4,3,6,5,8,4],semaine:[18,24,21,27,15,30,22],mois:[80,92,76,101]},hce={jour:["L","M","M","J","V","S","D"],semaine:["S1","S2","S3","S4","S5","S6","S7"],mois:["Mai","Juin","Juil","Août"]};function gce(){const[e,t]=m.useState("semaine"),n=mce[e],r=hce[e],i=m.useMemo(()=>Math.max(...n),[n]);return s.jsxs(It,{children:[s.jsx(bn,{title:"Mes performances"}),s.jsxs(gn,{columns:2,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:lle,value:512,label:"Total livraisons",color:$.accentLight}),s.jsx(Ke,{icon:Ta,value:489,label:"Complétées",color:$.success}),s.jsx(Ke,{icon:qu,value:14,label:"Livraisons du jour",color:$.accentLight}),s.jsx(Ke,{icon:kle,value:3,label:"En attente",color:$.info})]}),s.jsxs(We,{mb:0,children:[s.jsx(Y,{variant:"secondary",size:"0.72rem",children:"Évolution"}),s.jsx("div",{style:{marginTop:8},children:s.jsx(kx,{tabs:[{key:"jour",label:"Jour"},{key:"semaine",label:"Semaine"},{key:"mois",label:"Mois"}],active:e,onChange:t})}),s.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:6,height:90,marginTop:6},children:n.map((o,a)=>s.jsxs("div",{style:{flex:1,textAlign:"center"},children:[s.jsx("div",{style:{height:`${o/i*70}px`,background:$.accent,borderRadius:4,transition:"height .3s ease"}}),s.jsx("div",{style:{color:$.text3,fontSize:"0.55rem",marginTop:4},children:r[a]})]},a))}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:[n.reduce((o,a)=>o+a,0)," livraisons sur la période"]})]})]})}const vce=[{id:"admin-dashboard",kicker:"Vue d'ensemble",title:"Toute votre activité en un coup d’œil",lead:"Dès l'ouverture, vous voyez l'essentiel : commandes en attente ou en route, clients et livreurs actifs — sans avoir à chercher l'information.",points:["Chiffres mis à jour en temps réel","Notifications Telegram liées à votre compte","Accès identique sur mobile et sur ordinateur"],mockup:s.jsx(Lle,{})},{id:"admin-commandes",kicker:"Suivi opérationnel",title:"Suivez chaque commande, de la validation à la livraison",lead:"Chaque commande apparaît avec son statut, son montant et le livreur assigné. Un menu d'actions par commande permet d'assigner un livreur ou de la finaliser en un geste.",points:["Archives des commandes approuvées et annulées, recherche instantanée","Export CSV pour votre comptabilité","Parrainage et fidélité pris en compte automatiquement dans le total"],mockup:s.jsx(Nle,{}),reverse:!0},{id:"admin-livraison",kicker:"Géolocalisation en direct",title:"Localisez vos livreurs en temps réel, sur la carte",lead:"La position de chaque livreur s'affiche en direct, avec la distance et le temps restant estimé. Vue d'ensemble de toute la flotte : disponible, occupée ou hors ligne.",points:["Distance et temps de trajet calculés automatiquement","Avis clients et historique de connexion par livreur",'Notification client en un tap : "le livreur est arrivé"'],mockup:s.jsx(Ole,{})},{id:"admin-produits",kicker:"Catalogue",title:"Un catalogue que vous gérez vous-même",lead:"Ajoutez, modifiez ou retirez un produit en quelques secondes : photos, vidéos, stock, description, et plusieurs tarifs par produit.",points:["Photos et vidéos multiples par produit","Plusieurs paliers de prix, activables indépendamment","Statut « à venir » pour annoncer un produit avant sa mise en vente"],mockup:s.jsx(Ble,{}),reverse:!0},{id:"admin-categories",kicker:"Organisation",title:"Organisez votre catalogue comme vous le souhaitez",lead:"Créez vos propres catégories, attribuez-leur une couleur, réordonnez-les en un clic. Une catégorie peut être marquée « prochainement » avant sa mise en ligne.",points:["Couleur personnalisée par catégorie","Réorganisation manuelle de l'ordre d'affichage","Aperçu immédiat du rendu côté client"],mockup:s.jsx(Wle,{})},{id:"admin-statistiques",kicker:"Pilotage",title:"Des chiffres clairs pour piloter votre activité",lead:"Chiffre d'affaires, produits les plus vendus, heures et jours d'affluence : tout est visualisé simplement, sans éplucher vos commandes une par une.",points:["Historique mensuel navigable, jour par jour","Classement des meilleurs produits (quantité, commandes ou revenus)","Repérage automatique du jour et de l'heure de pointe"],mockup:s.jsx(Kle,{}),reverse:!0},{id:"admin-utilisateurs",kicker:"Équipe & clients",title:"Clients, livreurs, équipe : tout au même endroit",lead:"Un seul espace pour gérer tous les comptes. Ajustez les points de fidélité, appliquez une pénalité ou consultez l'historique d'un client.",points:["Filtre par rôle et recherche instantanée","Gestion des points de fidélité et du parrainage","Suivi des annulations et de l'historique de connexion"],mockup:s.jsx(Xle,{})},{id:"admin-parametres",kicker:"Personnalisation",title:"Une plateforme qui s'adapte à votre activité",lead:"13 sections de réglages : fidélité, parrainage, pénalités, zones et horaires de livraison, paiement crypto, Telegram, couleurs de l’interface... Tout est configurable vous-même.",points:["Zones de livraison par code postal avec minimum de commande","Paiement crypto (NowPayments) et bot Telegram intégrés","Couleurs de l'espace admin et de l'app client personnalisables"],mockup:s.jsx(Yle,{}),reverse:!0},{id:"admin-alertes",kicker:"Réactivité",title:"Réagissez immédiatement en cas de problème",lead:"Si un livreur rencontre un souci sur le terrain, l'alerte remonte instantanément — avec son message et l'horodatage — jusqu'à ce qu'elle soit résolue.",points:["Distinction claire entre alerte active et résolue","Historique complet conservé"],mockup:s.jsx(Zle,{})},{id:"admin-adresses",kicker:"Fiabilité livraison",title:"Zéro commande perdue à cause d’une adresse mal saisie",lead:"Quand un client tape une adresse imprécise, corrigez-la une bonne fois pour toutes : les prochaines commandes utiliseront automatiquement la bonne adresse.",points:["Association simple « adresse saisie → adresse correcte »","Moins d’erreurs de livraison, moins d’allers-retours"],mockup:s.jsx(ece,{}),reverse:!0}],yce=[{id:"cabine-dashboard",kicker:"Opérations du jour",title:"Un espace dédié pour votre équipe en cuisine",lead:"Vos préparateurs voient uniquement ce qui les concerne : commandes en cours, livreurs disponibles — sans chiffre d'affaires ni réglages sensibles.",points:["Aucune donnée financière exposée","Notifications Telegram propres à chaque compte","Rafraîchissement en direct"],mockup:s.jsx(tce,{})},{id:"cabine-commandes",kicker:"Suivi des commandes",title:"Faire avancer une commande, en toute sécurité",lead:"La cabine assigne un livreur, prévient le client, propose une correction d’adresse — mais ne peut ni modifier ni voir les réglages de la commande.",points:["Actions limitées et guidées, pas de menu complexe","Confirmation demandée avant chaque action sensible","Zéro risque de modification accidentelle"],mockup:s.jsx(rce,{}),reverse:!0},{id:"cabine-livraison",kicker:"Suivi livreurs",title:"Suivre les livreurs en direct, sans les gérer",lead:"La cabine voit la carte, la disponibilité et la position de chaque livreur pour coordonner la préparation — la gestion des comptes reste réservée à l’admin.",points:["Carte et statuts en temps réel","Suivi d’itinéraire en un clic","Aucun accès à la création ou modification de compte"],mockup:s.jsx(ace,{})},{id:"cabine-alertes",kicker:"Information",title:"Rester informé, sans pouvoir de décision",lead:"Les alertes remontées par les livreurs sont visibles par la cabine pour garder tout le monde informé — seule l’équipe admin peut les résoudre.",points:['Filtre "Toutes" / "Actives"',"Lecture seule, aucune action destructrice possible"],mockup:s.jsx(sce,{}),reverse:!0},{id:"cabine-utilisateurs",kicker:"Service client",title:"Un geste commercial, sans accès aux comptes",lead:"Besoin d’annuler une pénalité ou d’offrir des points en guise de geste commercial ? La cabine peut le faire en un clic, sans jamais toucher au reste du compte client.",points:["Reset pénalités et points uniquement","Aucune création, édition ou suppression de compte"],mockup:s.jsx(lce,{})}],bce=[{id:"livreur-dashboard",kicker:"Terrain",title:"Le compagnon de route de vos livreurs",lead:"Statut en un tap (disponible / occupé / hors ligne), position GPS en direct, et un cycle de livraison guidé étape par étape jusqu’à la remise au client.",points:["Cycle complet : Démarrer → J’arrive → Terminer","Appel client et itinéraire en un tap","Gestion des cas « client absent » avec compte à rebours"],mockup:s.jsx(uce,{})},{id:"livreur-alertes",kicker:"Sécurité",title:"Un bouton d’urgence, toujours à portée de main",lead:"En cas de contrôle de police ou de situation dangereuse, le livreur alerte l’équipe admin en 2 taps — avec des consignes de sécurité affichées immédiatement.",points:["Deux types d’alerte : contrôle de police / guet-apens","Confirmation avant envoi pour éviter les fausses alertes","Consignes de sécurité affichées après envoi"],mockup:s.jsx(dce,{}),reverse:!0},{id:"livreur-avis",kicker:"Reconnaissance",title:"Chaque livreur voit ses propres avis clients",lead:"Note moyenne et commentaires clients, pour valoriser le travail de vos livreurs et repérer rapidement un souci de service.",points:["Note moyenne calculée automatiquement","Commentaires clients horodatés"],mockup:s.jsx(pce,{})},{id:"livreur-stats",kicker:"Performance",title:"Un livreur qui suit sa propre performance reste motivé",lead:"Nombre de livraisons, taux de complétion, évolution jour / semaine / mois : chaque livreur a une vision claire de son activité.",points:["Bascule Jour / Semaine / Mois","Totaux recalculés automatiquement"],mockup:s.jsx(gce,{}),reverse:!0}],uk=[{key:"admin",label:"Espace Admin",icon:Tle,features:vce,blurb:"Contrôle total de la plateforme."},{key:"cabine",label:"Espace Cabine",icon:mle,features:yce,blurb:"Équipe de préparation, accès restreint."},{key:"livreur",label:"Espace Livreur",icon:Bm,features:bce,blurb:"Application dédiée aux livreurs."}];function xce(){const[e,t]=m.useState("admin"),n=uk.find(r=>r.key===e);return s.jsxs(se,{children:[s.jsx(se,{bgGradient:"linear(to-b, blackAlpha.50, transparent)",py:{base:14,md:20},children:s.jsx(pn,{maxW:"container.lg",children:s.jsxs(Se,{spacing:5,textAlign:"center",align:"center",children:[s.jsxs(ge,{spacing:2,children:[s.jsx(se,{as:"span",px:3,py:1,borderRadius:"full",fontSize:"xs",fontWeight:"bold",bg:"primary.500",color:"white",children:"3 espaces, 1 seule plateforme"}),s.jsx(se,{as:"span",px:3,py:1,borderRadius:"full",fontSize:"xs",fontWeight:"bold",borderWidth:"1px",children:"Démo interactive"})]}),s.jsx(_t,{size:"2xl",children:"Admin, cabine, livreur : chacun son espace"}),s.jsx(Z,{fontSize:"lg",color:"gray.500",maxW:"2xl",children:"Chaque rôle a exactement les écrans dont il a besoin — rien de plus. Choisissez un espace ci-dessous et essayez les aperçus : ils sont interactifs, comme dans l'application réelle."})]})})}),s.jsx(se,{borderTopWidth:"1px",borderBottomWidth:"1px",bg:"chakra-subtle-bg",position:"sticky",top:0,zIndex:2,children:s.jsxs(pn,{maxW:"container.lg",py:3,children:[s.jsx(ge,{spacing:2,mb:2,overflowX:"auto",children:uk.map(r=>s.jsx(ve,{size:"sm",leftIcon:s.jsx(Oe,{icon:r.icon}),colorScheme:e===r.key?"primary":void 0,variant:e===r.key?"solid":"outline",onClick:()=>t(r.key),flexShrink:0,children:r.label},r.key))}),s.jsx(gT,{spacing:5,shouldWrapChildren:!0,children:n.features.map(r=>s.jsx(Bb,{children:s.jsx(Z,{as:"a",href:`#${r.id}`,fontSize:"sm",fontWeight:"semibold",color:"primary.500",whiteSpace:"nowrap",_hover:{textDecoration:"underline"},children:r.kicker})},r.id))})]})}),s.jsxs(pn,{maxW:"container.lg",children:[s.jsx(se,{py:6,children:s.jsx(Z,{color:"gray.500",fontSize:"sm",textAlign:"center",children:n.blurb})}),n.features.map(r=>s.jsxs(Se,{id:r.id,direction:{base:"column",md:r.reverse?"row-reverse":"row"},spacing:{base:10,md:16},align:"center",py:{base:14,md:20},borderBottomWidth:"1px",scrollMarginTop:"120px",children:[s.jsxs(se,{flex:"0.9",minW:0,children:[s.jsx(Z,{fontSize:"xs",fontWeight:"extrabold",letterSpacing:"wide",textTransform:"uppercase",color:"primary.500",mb:2,children:r.kicker}),s.jsx(_t,{size:"lg",mb:4,children:r.title}),s.jsx(Z,{color:"gray.500",mb:5,children:r.lead}),s.jsx(Nu,{spacing:2,children:r.points.map(i=>s.jsxs(_b,{fontSize:"sm",color:"gray.600",display:"flex",children:[s.jsx(O_,{as:()=>s.jsx(Oe,{icon:Ta}),color:"green.400",mt:1,mr:2}),s.jsx("span",{children:i})]},i))})]}),s.jsx(se,{flex:"1",minW:0,w:"full",children:r.mockup})]},r.id))]}),s.jsx(se,{bg:"gray.900",color:"white",py:20,textAlign:"center",children:s.jsxs(pn,{maxW:"container.md",children:[s.jsx(_t,{size:"xl",mb:4,children:"Prêt à essayer votre propre espace admin ?"}),s.jsx(Z,{color:"whiteAlpha.700",mb:8,children:"Une démo dédiée et isolée, prête en quelques minutes, pour tester la plateforme en conditions réelles."}),s.jsxs(gn,{columns:{base:1,sm:2},spacing:4,maxW:"sm",mx:"auto",children:[s.jsx(ve,{as:Yt,to:"/register",colorScheme:"primary",size:"lg",children:"Créer un compte"}),s.jsx(ve,{as:Yt,to:"/tarifs",variant:"outline",colorScheme:"whiteAlpha",size:"lg",children:"Voir les tarifs"})]})]})})]})}const Sce="http://localhost:8080",Cx="omnex.token";function Qv(){return localStorage.getItem(Cx)}function dk(e){localStorage.setItem(Cx,e)}function fk(){localStorage.removeItem(Cx)}class Je extends Error{constructor(n,r){super(r);Ux(this,"status");this.status=n}}async function ct(e,t,n){const r={"Content-Type":"application/json"},i=Qv();i&&(r.Authorization=`Bearer ${i}`);const o=await fetch(`${Sce}/api/v1${t}`,{method:e,headers:r,body:n?JSON.stringify(n):void 0});if(!o.ok){const a=await o.json().catch(()=>({error:`HTTP ${o.status}`}));throw new Je(o.status,a.error??`HTTP ${o.status}`)}return o.status===204?void 0:await o.json()}const Fe={login:(e,t,n)=>ct("POST","/auth/login",{username:e,password:t,role:n}),register:(e,t)=>ct("POST","/auth/register",{username:e,password:t}),me:()=>ct("GET","/auth/me"),logout:()=>ct("POST","/auth/logout"),listDemos:()=>ct("GET","/demos"),listMyDemos:()=>ct("GET","/demos/mine"),getDemo:e=>ct("GET",`/demos/${e}`),createDemo:e=>ct("POST","/demos",{username:e.username,...e.telegramBotUsername?{telegram_bot_username:e.telegramBotUsername}:{},...e.telegramBotToken?{telegram_bot_token:e.telegramBotToken}:{},...e.nowPaymentsApiKey?{nowpayments_api_key:e.nowPaymentsApiKey}:{},...e.nowPaymentsIpnSecret?{nowpayments_ipn_secret:e.nowPaymentsIpnSecret}:{},storage_driver:e.storageDriver,...e.storageDriver==="s3"?{s3_bucket:e.s3Bucket,s3_endpoint:e.s3Endpoint}:{},...e.tomtomApiKey?{tomtom_api_key:e.tomtomApiKey}:{},...e.tomtomApiKey1?{tomtom_api_key_1:e.tomtomApiKey1}:{},...e.tomtomApiKey2?{tomtom_api_key_2:e.tomtomApiKey2}:{},...e.tomtomApiKey3?{tomtom_api_key_3:e.tomtomApiKey3}:{},...e.lbBot1Username?{lb_bot1_username:e.lbBot1Username,lb_bot1_token:e.lbBot1Token}:{},...e.lbBot2Username?{lb_bot2_username:e.lbBot2Username,lb_bot2_token:e.lbBot2Token}:{},...e.lbStrategy?{lb_strategy:e.lbStrategy}:{},...e.lbJwtTtlSeconds?{lb_jwt_ttl_seconds:e.lbJwtTtlSeconds}:{},...e.lbHealthCheckInterval?{lb_health_check_interval:e.lbHealthCheckInterval}:{},admin_username:e.adminUsername,admin_password:e.adminPassword}),extendDemo:e=>ct("POST",`/demos/${e}/extend`),deleteDemo:e=>ct("DELETE",`/demos/${e}`),setDemoDomain:(e,t)=>ct("POST",`/demos/${e}/domain`,{domain:t}),listCodes:()=>ct("GET","/codes"),createCode:e=>ct("POST","/codes",{username:e}),addCode:e=>ct("POST","/subscription",{code_verif:e}),sendMessage:(e,t,n,r)=>ct("POST","/send/message",{username:e,telegram:t,sujet:n,message:r}),getMessage:()=>ct("GET","/messages"),getDemoDetails:e=>ct("POST","/demos/details",{namespace:e}),updateUsername:e=>ct("POST","/profile/username",{username:e}),updatePassword:e=>ct("POST","/profile/password",{password:e}),getTelegram:()=>ct("GET","/profile/telegram"),setTelegram:e=>ct("POST","/profile/telegram",{telegram:e}),getAlertSettings:()=>ct("GET","/profile/alerts"),setAlertSettings:e=>ct("POST","/profile/alerts",e)},F7=m.createContext(null);function wce({children:e}){const[t,n]=m.useState(Qv()),[r,i]=m.useState(null),[o,a]=m.useState(null),[l,c]=m.useState(!!Qv());m.useEffect(()=>{if(!t){c(!1);return}let v=!0;return Fe.me().then(y=>{v&&(i(y.role),a(y.type_abonnement))}).catch(()=>{v&&(fk(),n(null),i(null),a(null))}).finally(()=>{v&&c(!1)}),()=>{v=!1}},[]);const u=m.useCallback(async(v,y,x)=>{const b=await Fe.login(v,y,x);dk(b.token),n(b.token),i(b.role);const g=await Fe.me();a(g.type_abonnement)},[]),d=m.useCallback(async(v,y)=>{const x=await Fe.register(v,y);dk(x.token),n(x.token),i(x.role);const b=await Fe.me();a(b.type_abonnement)},[]),f=m.useCallback(async()=>{try{await Fe.logout()}finally{fk(),n(null),i(null),a(null)}},[]),p=m.useCallback(async()=>{const v=await Fe.me();a(v.type_abonnement)},[]),h=m.useMemo(()=>({isAuthenticated:!!t,isAdmin:r==="admin",isClient:r==="client",isPremium:o==="premium",role:r,typeAbo:o,initializing:l,login:u,register:d,logout:f,refreshAbo:p}),[t,r,o,l,u,d,f,p]);return s.jsx(F7.Provider,{value:h,children:e})}function $o(){const e=m.useContext(F7);if(!e)throw new Error("useAuth doit être utilisé dans ");return e}function Ea(e){const{toggleColorMode:t}=Tu(),n=Gg("Passer en mode sombre","Passer en mode clair");return s.jsx(On,{"aria-label":n,title:n,variant:"ghost",size:e.size??"sm",onClick:t,icon:Gg(s.jsx(Cce,{}),s.jsx(kce,{}))})}function kce(){return s.jsxs(Tt,{viewBox:"0 0 24 24",boxSize:5,fill:"none",stroke:"currentColor",strokeWidth:2,children:[s.jsx("circle",{cx:"12",cy:"12",r:"4"}),s.jsx("path",{strokeLinecap:"round",d:"M12 2v2m0 16v2M2 12h2m16 0h2M4.9 4.9l1.4 1.4m11.4 11.4l1.4 1.4M19.1 4.9l-1.4 1.4M6.3 17.7l-1.4 1.4"})]})}function Cce(){return s.jsx(Tt,{viewBox:"0 0 24 24",boxSize:5,fill:"currentColor",children:s.jsx("path",{d:"M21 12.8A9 9 0 1111.2 3a7 7 0 009.8 9.8z"})})}const un=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1);return s.jsxs(jb,{children:[s.jsx(yt,{ref:t,type:n?"text":"password",...e}),s.jsx(Sm,{children:s.jsx(On,{"aria-label":n?"Masquer le mot de passe":"Afficher le mot de passe",icon:s.jsx(Oe,{icon:n?D7:T7}),size:"sm",variant:"ghost",tabIndex:-1,onClick:()=>r(i=>!i)})})]})});un.displayName="PasswordInput";function jce(){const{login:e}=$o(),t=Er(),n=Zr(),[r,i]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(!1),u=async d=>{d.preventDefault(),c(!0);try{await e(r.trim(),o,"client"),t("/app",{replace:!0})}catch(f){const p=f instanceof Je?f.message:"Connexion impossible";n({status:"error",title:"Échec de connexion",description:p})}finally{c(!1)}};return s.jsxs(pn,{maxW:"sm",py:20,position:"relative",children:[s.jsx(se,{position:"absolute",top:4,right:4,children:s.jsx(Ea,{})}),s.jsxs(Se,{spacing:6,children:[s.jsxs(se,{textAlign:"center",children:[s.jsx(_t,{size:"lg",children:"Espace client"}),s.jsx(Z,{color:"gray.500",children:"Connectez-vous pour gérer votre abonnement."})]}),s.jsx(sb,{children:s.jsx(lb,{children:s.jsx("form",{onSubmit:u,children:s.jsxs(Se,{spacing:4,children:[s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Nom d'utilisateur"}),s.jsx(yt,{value:r,onChange:d=>i(d.target.value),autoComplete:"username"})]}),s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Mot de passe"}),s.jsx(un,{value:o,onChange:d=>a(d.target.value),autoComplete:"current-password"})]}),s.jsx(ve,{type:"submit",colorScheme:"primary",isLoading:l,children:"Se connecter"})]})})})}),s.jsxs(ge,{justify:"center",spacing:1,children:[s.jsx(Z,{fontSize:"sm",color:"gray.500",children:"Pas encore de compte ?"}),s.jsx(ve,{as:Yt,to:"/register",variant:"link",size:"sm",children:"Créer un compte"})]}),s.jsx(ve,{as:Yt,to:"/",variant:"outline",size:"sm",children:"← Retour au site"})]})]})}function Pce(){const{login:e}=$o(),t=Er(),n=Zr(),[r,i]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(!1),u=async d=>{d.preventDefault(),c(!0);try{await e(r.trim(),o,"admin"),t("/app",{replace:!0})}catch(f){const p=f instanceof Je?f.message:"Connexion impossible";n({status:"error",title:"Échec de connexion",description:p})}finally{c(!1)}};return s.jsxs(pn,{maxW:"sm",py:20,position:"relative",children:[s.jsx(se,{position:"absolute",top:4,right:4,children:s.jsx(Ea,{})}),s.jsxs(Se,{spacing:6,children:[s.jsxs(se,{textAlign:"center",children:[s.jsx(_t,{size:"lg",children:"Espace admin"}),s.jsx(Z,{color:"gray.500",children:"Connectez-vous pour administrer la plateforme."})]}),s.jsx(sb,{children:s.jsx(lb,{children:s.jsx("form",{onSubmit:u,children:s.jsxs(Se,{spacing:4,children:[s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Nom d'utilisateur"}),s.jsx(yt,{value:r,onChange:d=>i(d.target.value),autoComplete:"username"})]}),s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Mot de passe"}),s.jsx(un,{value:o,onChange:d=>a(d.target.value),autoComplete:"current-password"})]}),s.jsx(ve,{type:"submit",colorScheme:"primary",isLoading:l,children:"Se connecter"})]})})})}),s.jsx(ve,{as:Yt,to:"/",variant:"outline",size:"sm",children:"← Retour au site"})]})]})}function _ce(){const{register:e}=$o(),t=Er(),n=Zr(),[r,i]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(!1),f=/^[a-zA-Z0-9]{3,64}$/.test(r),p=o.length>=10,h=o===l,v=f&&p&&h,y=async x=>{if(x.preventDefault(),!!v){d(!0);try{await e(r.trim(),o),t("/app",{replace:!0})}catch(b){const g=b instanceof Je?b.message:"Inscription impossible";n({status:"error",title:"Échec de l’inscription",description:g})}finally{d(!1)}}};return s.jsxs(pn,{maxW:"sm",py:16,position:"relative",children:[s.jsx(se,{position:"absolute",top:4,right:4,children:s.jsx(Ea,{})}),s.jsxs(Se,{spacing:6,children:[s.jsxs(se,{textAlign:"center",children:[s.jsx(_t,{size:"lg",children:"Créer un compte"}),s.jsx(Z,{color:"gray.500",children:"Rejoignez l’espace commercial Omnex."})]}),s.jsx(sb,{children:s.jsx(lb,{children:s.jsx("form",{onSubmit:y,children:s.jsxs(Se,{spacing:4,children:[s.jsxs(be,{isRequired:!0,isInvalid:r.length>0&&!f,children:[s.jsx(xe,{children:"Nom d'utilisateur"}),s.jsx(yt,{value:r,onChange:x=>i(x.target.value),autoComplete:"username"}),s.jsx(au,{children:"3 à 64 caractères alphanumériques."})]}),s.jsxs(be,{isRequired:!0,isInvalid:o.length>0&&!p,children:[s.jsx(xe,{children:"Mot de passe"}),s.jsx(un,{value:o,onChange:x=>a(x.target.value),autoComplete:"new-password"}),s.jsx(au,{children:"10 caractères minimum."})]}),s.jsxs(be,{isRequired:!0,isInvalid:l.length>0&&!h,children:[s.jsx(xe,{children:"Confirmer le mot de passe"}),s.jsx(un,{value:l,onChange:x=>c(x.target.value),autoComplete:"new-password"})]}),s.jsx(ve,{type:"submit",colorScheme:"primary",isLoading:u,isDisabled:!v,children:"Créer mon compte"})]})})})}),s.jsxs(ge,{justify:"center",spacing:1,children:[s.jsx(Z,{fontSize:"sm",color:"gray.500",children:"Déjà un compte ?"}),s.jsx(ve,{as:Yt,to:"/login",variant:"link",size:"sm",children:"Se connecter"})]})]})]})}const Um=bm({displayName:"EditIcon",path:s.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[s.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),s.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),Tce=bm({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),Ece=bm({viewBox:"0 0 14 14",path:s.jsx("g",{fill:"currentColor",children:s.jsx("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});function Hm(e){switch(e){case"ready":return"green";case"provisioning":case"pending":return"blue";case"expiring":return"orange";case"failed":return"red";case"expired":default:return"gray"}}function Gm(e){return{pending:"En attente",provisioning:"Déploiement…",ready:"Active",expiring:"Suppression…",expired:"Expirée",failed:"Échec"}[e]??e}function pk(e){switch(e){case"Running":return"green";case"Pending":return"yellow";case"Succeeded":return"blue";case"Failed":return"red";case"Unknown":case"":default:return"gray"}}function Ace(e){return{Running:"En ligne",Pending:"En attente",Succeeded:"Terminé",Failed:"Down",Unknown:"Inconnu"}[e]??"Introuvable"}function mk(e,t=Date.now()){const n=new Date(e).getTime()-t;if(n<=0)return"expirée";const r=Math.floor(n/864e5),i=Math.floor(n%864e5/36e5);if(r>0)return`${r} j ${i} h`;const o=Math.floor(n%36e5/6e4);return`${i} h ${o} min`}function $ce({isOpen:e,title:t,children:n,confirmLabel:r="Confirmer",cancelLabel:i="Annuler",confirmColorScheme:o="red",isLoading:a=!1,onConfirm:l,onClose:c}){const u=m.useRef(null);return s.jsx(TY,{isOpen:e,leastDestructiveRef:u,onClose:c,isCentered:!0,motionPreset:"slideInBottom",children:s.jsx(yl,{backdropFilter:"blur(2px)",children:s.jsxs(EY,{borderRadius:"xl",children:[s.jsx(vl,{fontSize:"lg",fontWeight:"bold",children:t}),s.jsx(gl,{color:"gray.600",children:n}),s.jsxs(jm,{gap:3,children:[s.jsx(ve,{ref:u,onClick:c,variant:"ghost",isDisabled:a,children:i}),s.jsx(ve,{colorScheme:o,onClick:l,isLoading:a,children:r})]})]})})})}function B7({isOpen:e,onClose:t,onCreated:n}){const r=Zr(),[i,o]=m.useState(""),[a,l]=m.useState("admin"),[c,u]=m.useState(""),[d,f]=m.useState(!1),[p,h]=m.useState(""),[v,y]=m.useState(""),[x,b]=m.useState(!1),[g,S]=m.useState(""),[w,k]=m.useState(""),[P,j]=m.useState(!1),[_,M]=m.useState(""),[T,O]=m.useState(""),[q,ne]=m.useState(""),[z,X]=m.useState(""),[V,I]=m.useState(!1),[D,R]=m.useState(""),[F,G]=m.useState(""),[K,ee]=m.useState(""),[Pe,we]=m.useState(""),[Te,Ge]=m.useState("failover"),[Ye,te]=m.useState(""),[re,$e]=m.useState(""),[me,it]=m.useState("local"),[pe,lt]=m.useState(""),[Be,Et]=m.useState(""),[ye,xn]=m.useState(!1),Lt=()=>{o(""),l("admin"),u(""),f(!1),h(""),y(""),b(!1),S(""),k(""),j(!1),M(""),O(""),ne(""),X(""),I(!1),R(""),G(""),ee(""),we(""),Ge("failover"),te(""),$e(""),it("local"),lt(""),Et("")},dr=()=>{ye||(Lt(),t())},Jr=async()=>{if(!i.trim()){r({status:"warning",title:"Username requis"});return}if(!a.trim()||c.trim().length<8){r({status:"warning",title:"Identifiants admin requis (mot de passe : 8 caractères min.)"});return}if(me==="s3"&&(!pe.trim()||!Be.trim())){r({status:"warning",title:"Bucket et endpoint S3 requis"});return}if(V&&!D.trim()&&!K.trim()){r({status:"warning",title:"Au moins un bot (username) requis pour le load-balancer"});return}if(P&&!_.trim()){r({status:"warning",title:"La clé API TomTom principale est requise"});return}const oe={username:i.trim(),adminUsername:a.trim(),adminPassword:c.trim(),telegramBotUsername:d&&p.trim()||void 0,telegramBotToken:d&&v.trim()||void 0,nowPaymentsApiKey:x&&g.trim()||void 0,nowPaymentsIpnSecret:x&&w.trim()||void 0,storageDriver:me,...me==="s3"?{s3Bucket:pe.trim(),s3Endpoint:Be.trim()}:{},...P?{tomtomApiKey:_.trim(),tomtomApiKey1:T.trim()||void 0,tomtomApiKey2:q.trim()||void 0,tomtomApiKey3:z.trim()||void 0}:{},...V?{lbBot1Username:D.trim()||void 0,lbBot1Token:F.trim()||void 0,lbBot2Username:K.trim()||void 0,lbBot2Token:Pe.trim()||void 0,lbStrategy:Te,lbJwtTtlSeconds:Ye.trim()||void 0,lbHealthCheckInterval:re.trim()||void 0}:{}};xn(!0);try{await Fe.createDemo(oe),r({status:"success",title:"Démo lancée",description:"Provisioning en cours."}),Lt(),n(),t()}catch(ei){const zo=ei instanceof Je?ei.message:"Erreur";r({status:"error",title:"Lancement impossible",description:zo})}finally{xn(!1)}};return s.jsxs(Fu,{isOpen:e,onClose:dr,size:"lg",closeOnOverlayClick:!ye,children:[s.jsx(yl,{}),s.jsxs(Cm,{children:[s.jsx(vl,{children:"Nouvelle démo"}),s.jsx(Bu,{isDisabled:ye}),s.jsx(gl,{children:s.jsxs(Se,{spacing:5,children:[s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{children:"Username"}),s.jsx(yt,{placeholder:"ex: acme-corp",value:i,onChange:oe=>o(oe.target.value)})]}),s.jsxs(Se,{spacing:3,p:3,borderWidth:"1px",borderRadius:"md",children:[s.jsx(Z,{fontSize:"sm",fontWeight:"semibold",children:"Compte admin de la démo"}),s.jsx(Z,{fontSize:"xs",color:"gray.500",children:"Créé une fois postgres/redis/backend/frontend démarrés — c'est ce que le client utilisera pour se connecter au backoffice de sa démo."}),s.jsxs(ge,{spacing:3,align:"start",children:[s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Username"}),s.jsx(yt,{value:a,onChange:oe=>l(oe.target.value)})]}),s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Mot de passe"}),s.jsx(un,{placeholder:"8 caractères min.",value:c,onChange:oe=>u(oe.target.value),autoComplete:"off"})]})]})]}),s.jsx(be,{isDisabled:ye,children:s.jsxs(ge,{justify:"space-between",children:[s.jsx(xe,{mb:0,children:"Bot Telegram"}),s.jsx(oc,{isChecked:d,onChange:oe=>f(oe.target.checked)})]})}),d&&s.jsxs(Se,{spacing:3,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Nom du bot (username)"}),s.jsx(yt,{placeholder:"mon_bot",value:p,onChange:oe=>h(oe.target.value)})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Token bot Telegram"}),s.jsx(un,{placeholder:"123456:ABC-DEF...",value:v,onChange:oe=>y(oe.target.value),autoComplete:"off"})]})]}),s.jsx(be,{isDisabled:ye,children:s.jsxs(ge,{justify:"space-between",children:[s.jsx(xe,{mb:0,children:"NowPayments (paiement crypto)"}),s.jsx(oc,{isChecked:x,onChange:oe=>b(oe.target.checked)})]})}),x&&s.jsxs(Se,{spacing:3,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API NowPayments"}),s.jsx(un,{placeholder:"clé API du compte marchand",value:g,onChange:oe=>S(oe.target.value),autoComplete:"off"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Secret IPN NowPayments"}),s.jsx(un,{placeholder:"secret configuré côté NowPayments",value:w,onChange:oe=>k(oe.target.value),autoComplete:"off"}),s.jsx(Z,{fontSize:"xs",color:"gray.500",mt:1,children:"Laissez vide pour garder celui pré-généré automatiquement."})]})]}),s.jsx(be,{isDisabled:ye,children:s.jsxs(ge,{justify:"space-between",children:[s.jsx(xe,{mb:0,children:"TomTom (GPS livreur)"}),s.jsx(oc,{isChecked:P,onChange:oe=>j(oe.target.checked)})]})}),P&&s.jsxs(Se,{spacing:3,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsx(Z,{fontSize:"xs",color:"gray.500",children:"Géocodage, itinéraire et ETA des livreurs. Jusqu'à 4 clés — le backend bascule automatiquement sur la suivante si une clé atteint son quota."}),s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API TomTom (principale)"}),s.jsx(un,{placeholder:"clé API TomTom",value:_,onChange:oe=>M(oe.target.value),autoComplete:"off"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API TomTom #2 (optionnelle)"}),s.jsx(un,{placeholder:"clé de secours",value:T,onChange:oe=>O(oe.target.value),autoComplete:"off"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API TomTom #3 (optionnelle)"}),s.jsx(un,{placeholder:"clé de secours",value:q,onChange:oe=>ne(oe.target.value),autoComplete:"off"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API TomTom #4 (optionnelle)"}),s.jsx(un,{placeholder:"clé de secours",value:z,onChange:oe=>X(oe.target.value),autoComplete:"off"})]})]}),s.jsx(be,{isDisabled:ye,children:s.jsxs(ge,{justify:"space-between",children:[s.jsx(xe,{mb:0,children:"Load-balancer Telegram"}),s.jsx(oc,{isChecked:V,onChange:oe=>I(oe.target.checked)})]})}),V&&s.jsxs(Se,{spacing:4,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsx(Z,{fontSize:"xs",color:"gray.500",children:"Répartit le trafic entre plusieurs bots. Renseignez au moins le bot 1 ; le bot 2 est optionnel."}),s.jsxs(ge,{spacing:3,align:"start",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Bot 1 — username"}),s.jsx(yt,{placeholder:"mon_bot_1",value:D,onChange:oe=>R(oe.target.value)})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Bot 1 — token"}),s.jsx(un,{placeholder:"123456:ABC-DEF...",value:F,onChange:oe=>G(oe.target.value),autoComplete:"off"})]})]}),s.jsxs(ge,{spacing:3,align:"start",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Bot 2 — username (optionnel)"}),s.jsx(yt,{placeholder:"mon_bot_2",value:K,onChange:oe=>ee(oe.target.value)})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Bot 2 — token"}),s.jsx(un,{placeholder:"123456:ABC-DEF...",value:Pe,onChange:oe=>we(oe.target.value),autoComplete:"off"})]})]}),s.jsxs(ge,{spacing:3,align:"start",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Stratégie de répartition"}),s.jsxs(dT,{value:Te,onChange:oe=>Ge(oe.target.value),children:[s.jsx("option",{value:"failover",children:"Failover"}),s.jsx("option",{value:"roundrobin",children:"Round-robin"}),s.jsx("option",{value:"leastconn",children:"Moins de connexions"})]})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"TTL JWT (secondes)"}),s.jsx(yt,{placeholder:"300",value:Ye,onChange:oe=>te(oe.target.value),type:"number"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Intervalle health-check (s)"}),s.jsx(yt,{placeholder:"30",value:re,onChange:oe=>$e(oe.target.value),type:"number"})]})]})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{children:"Stockage des fichiers"}),s.jsx(cT,{value:me,onChange:oe=>it(oe),children:s.jsxs(Se,{direction:"row",spacing:6,children:[s.jsx(Cv,{value:"local",children:"Local (disque du cluster)"}),s.jsx(Cv,{value:"s3",children:"S3"})]})})]}),me==="s3"&&s.jsxs(Se,{spacing:4,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Nom du bucket"}),s.jsx(yt,{placeholder:"mon-bucket-demo",value:pe,onChange:oe=>lt(oe.target.value)})]}),s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Endpoint S3"}),s.jsx(yt,{placeholder:"https://s3.exemple.com",value:Be,onChange:oe=>Et(oe.target.value)})]})]})]})}),s.jsxs(jm,{children:[s.jsx(ve,{variant:"ghost",mr:3,onClick:dr,isDisabled:ye,children:"Annuler"}),s.jsx(ve,{colorScheme:"primary",onClick:Jr,isLoading:ye,children:"Lancer la démo"})]})]})]})}function V7({demo:e,onClose:t,onSaved:n}){const r=Zr(),[i,o]=m.useState(""),[a,l]=m.useState(!1);m.useEffect(()=>{o((e==null?void 0:e.custom_domain)??"")},[e]);const c=()=>{a||t()},u=async()=>{if(e){l(!0);try{await Fe.setDemoDomain(e.id,i.trim()),r({status:"success",title:"Domaine mis à jour"}),n(),t()}catch(d){const f=d instanceof Je?d.message:"Erreur";r({status:"error",title:"Mise à jour impossible",description:f})}finally{l(!1)}}};return s.jsxs(Fu,{isOpen:!!e,onClose:c,closeOnOverlayClick:!a,children:[s.jsx(yl,{}),s.jsxs(Cm,{children:[s.jsx(vl,{children:"Domaine de la plateforme"}),s.jsx(Bu,{isDisabled:a}),s.jsx(gl,{children:s.jsxs(be,{children:[s.jsx(xe,{fontSize:"sm",children:"Domaine personnalisé"}),s.jsx(yt,{placeholder:"boutique.mon-domaine.com",value:i,onChange:d=>o(d.target.value),isDisabled:a,fontFamily:"mono"}),s.jsxs(au,{children:["Laissez vide pour revenir au domaine par défaut (",e==null?void 0:e.namespace,".). Le DNS du domaine choisi doit pointer vers le cluster, et un certificat TLS valide doit le couvrir — le certificat wildcard partagé ne couvre que le domaine par défaut."]})]})}),s.jsxs(jm,{children:[s.jsx(ve,{variant:"ghost",mr:3,onClick:c,isDisabled:a,children:"Annuler"}),s.jsx(ve,{colorScheme:"primary",onClick:u,isLoading:a,children:"Enregistrer"})]})]})]})}const L0=[{key:"api",label:"Backend"},{key:"web",label:"Frontend"},{key:"db",label:"PostgreSQL"},{key:"dbm",label:"Redis"}];function jx({state:e}){const t=L0.every(r=>e[r.key].phase==="Running"),n=L0.filter(r=>e[r.key].phase!=="Running").length;return s.jsxs(Se,{spacing:3,children:[s.jsxs(ge,{spacing:2,children:[s.jsx(se,{w:"8px",h:"8px",borderRadius:"full",bg:t?"green.400":"red.400",flexShrink:0}),s.jsx(Z,{fontSize:"sm",fontWeight:"medium",children:t?"Tous les services sont opérationnels":`${n} service${n>1?"s":""} indisponible${n>1?"s":""}`})]}),s.jsx(gn,{columns:{base:1,lg:4},spacing:3,children:L0.map(r=>s.jsx(zce,{title:r.label,cs:e[r.key]},r.key))})]})}function zce({title:e,cs:t}){const n=t.cpu_limit_milli>0?Math.min(100,Math.round(t.cpu_milli/t.cpu_limit_milli*100)):0,r=t.memory_limit_mi>0?Math.min(100,Math.round(t.memory_mi/t.memory_limit_mi*100)):0;return s.jsxs(se,{p:3,borderWidth:"1px",borderRadius:"lg",bg:"bg-surface",minW:0,children:[s.jsxs(ge,{justify:"space-between",mb:3,children:[s.jsx(Z,{fontSize:"sm",fontWeight:"semibold",noOfLines:1,children:e}),s.jsxs(ge,{spacing:1.5,children:[s.jsx(se,{w:"7px",h:"7px",borderRadius:"full",bg:`${pk(t.phase)}.400`,flexShrink:0}),s.jsx(Wn,{colorScheme:pk(t.phase),fontSize:"10px",children:Ace(t.phase)})]})]}),s.jsxs(Se,{spacing:2,children:[s.jsxs(se,{children:[s.jsxs(kt,{justify:"space-between",fontSize:"xs",color:"gray.500",mb:1,children:[s.jsx(Z,{children:"CPU"}),s.jsxs(Z,{fontFamily:"mono",children:[t.cpu_milli,"m / ",t.cpu_limit_milli,"m"]})]}),s.jsx(kp,{value:n,size:"xs",borderRadius:"full",colorScheme:n>85?"red":n>60?"orange":"primary"})]}),s.jsxs(se,{children:[s.jsxs(kt,{justify:"space-between",fontSize:"xs",color:"gray.500",mb:1,children:[s.jsx(Z,{children:"Mémoire"}),s.jsxs(Z,{fontFamily:"mono",children:[t.memory_mi,"Mi / ",t.memory_limit_mi,"Mi"]})]}),s.jsx(kp,{value:r,size:"xs",borderRadius:"full",colorScheme:r>85?"red":r>60?"orange":"primary"})]})]})]})}function Px(e){return s.jsx(Tt,{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,...e,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 18l6-6-6-6"})})}function W7({demo:e,isOpen:t,onToggle:n,detailsLoading:r,details:i,onEditDomain:o,expiresLabel:a,actions:l}){return s.jsxs(se,{borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:"bg-surface",children:[s.jsxs(se,{p:4,cursor:"pointer",onClick:n,_active:{bg:"chakra-subtle-bg"},children:[s.jsxs(ge,{justify:"space-between",align:"start",children:[s.jsxs(ge,{spacing:2,minW:0,flex:"1",children:[s.jsx(Tt,{as:Px,boxSize:3,color:"gray.400",flexShrink:0,transform:t?"rotate(90deg)":void 0,transition:"transform 0.15s"}),s.jsx(Z,{fontFamily:"mono",fontSize:"sm",noOfLines:1,wordBreak:"break-all",minW:0,flex:"1",children:e.namespace})]}),s.jsx(Wn,{colorScheme:Hm(e.status),flexShrink:0,children:Gm(e.status)})]}),s.jsxs(Se,{spacing:1,mt:3,fontSize:"sm",children:[s.jsxs(ge,{justify:"space-between",children:[s.jsx(Z,{color:"gray.500",children:"Client"}),s.jsx(Z,{children:e.username||"—"})]}),s.jsxs(ge,{justify:"space-between",align:"start",children:[s.jsx(Z,{color:"gray.500",flexShrink:0,children:"URL"}),s.jsxs(ge,{spacing:1,minW:0,flex:"1",justify:"flex-end",children:[e.status==="ready"?s.jsx(_o,{href:e.url,color:"primary.500",isExternal:!0,noOfLines:1,wordBreak:"break-all",minW:0,flex:"1",onClick:c=>c.stopPropagation(),children:e.url}):s.jsx(Z,{color:"gray.400",children:"—"}),s.jsx(On,{"aria-label":"Modifier le domaine",icon:s.jsx(Um,{}),size:"xs",variant:"ghost",flexShrink:0,onClick:c=>{c.stopPropagation(),o()}})]})]}),a&&s.jsxs(ge,{justify:"space-between",children:[s.jsx(Z,{color:"gray.500",children:"Expire dans"}),s.jsx(Z,{children:a})]})]}),l&&s.jsx(ge,{mt:3,spacing:2,flexWrap:"wrap",rowGap:2,onClick:c=>c.stopPropagation(),children:l})]}),s.jsx(Mu,{in:t,unmountOnExit:!0,animateOpacity:!0,children:s.jsx(se,{p:4,bg:"chakra-subtle-bg",borderTopWidth:"1px",children:r&&!i?s.jsx(ge,{justify:"center",py:2,children:s.jsx(Vn,{size:"sm"})}):i?s.jsx(jx,{state:i.state}):s.jsx(Z,{color:"gray.500",fontSize:"sm",children:"Aucune donnée."})})})]})}const Rce=5e3,Mce=5e3;function Ice(){const e=Zr(),t=Er(),[n,r]=m.useState([]),[i,o]=m.useState(!0),[a,l]=m.useState(null),[c,u]=m.useState(null),[d,f]=m.useState(!1),[p,h]=m.useState(null),[v,y]=m.useState(null),[x,b]=m.useState(null),[g,S]=m.useState(!1),w=m.useCallback(async()=>{try{const T=await Fe.listDemos();r((T.items??[]).filter(O=>O.type_abonnement!=="premium"))}catch(T){T instanceof Je&&T.status===401?t("/admin/login"):e({status:"error",title:"Chargement des démos impossible"})}finally{o(!1)}},[t,e]);m.useEffect(()=>{w();const T=setInterval(()=>void w(),Rce);return()=>clearInterval(T)},[w]);const k=async T=>{l(T.id);try{await Fe.extendDemo(T.id),e({status:"success",title:"Démo prolongée de 30 jours"}),await w()}catch(O){const q=O instanceof Je?O.message:"Erreur";e({status:"error",title:"Prolongation impossible",description:q})}finally{l(null)}},P=async()=>{if(!c)return;const T=c;l(T.id);try{await Fe.deleteDemo(T.id),e({status:"success",title:"Démo détruite"}),u(null),await w()}catch(O){const q=O instanceof Je?O.message:"Erreur";e({status:"error",title:"Destruction impossible",description:q})}finally{l(null)}},j=async T=>{if(v===T.id){y(null),b(null);return}y(T.id),b(null),S(!0);try{const O=await Fe.getDemoDetails(T.namespace);b(O)}catch(O){const q=O instanceof Je?O.message:"Erreur";e({status:"error",title:"État des pods indisponible",description:q}),y(null)}finally{S(!1)}};m.useEffect(()=>{const T=n.find(ne=>ne.id===v);if(!T)return;const O=T.namespace,q=setInterval(()=>{Fe.getDemoDetails(O).then(b).catch(()=>{})},Mce);return()=>clearInterval(q)},[v]);const _=T=>T!=="expired"&&T!=="failed",M=T=>s.jsxs(s.Fragment,{children:[s.jsx(ve,{size:"sm",variant:"outline",isDisabled:!_(T.status)||a===T.id,onClick:O=>{O.stopPropagation(),k(T)},children:"+30 j"}),s.jsx(ve,{size:"sm",colorScheme:"red",variant:"outline",isDisabled:!_(T.status),onClick:O=>{O.stopPropagation(),u(T)},children:"Détruire"})]});return s.jsxs(s.Fragment,{children:[s.jsxs(kt,{mb:6,align:"center",gap:4,wrap:"wrap",children:[s.jsx(_t,{size:"md",mr:4,children:"Démos"}),s.jsx(ja,{}),s.jsx(ve,{colorScheme:"primary",onClick:()=>f(!0),children:"Nouvelle démo"})]}),s.jsx(B7,{isOpen:d,onClose:()=>f(!1),onCreated:()=>void w()}),i?s.jsx(Vn,{}):n.length===0?s.jsx(Z,{color:"gray.500",children:"Aucune démo active. Lancez-en une avec le bouton ci-dessus."}):s.jsxs(s.Fragment,{children:[s.jsx(Nb,{borderWidth:"1px",borderRadius:"lg",display:{base:"none",md:"block"},children:s.jsxs(Pm,{children:[s.jsx(Ob,{children:s.jsxs(fo,{children:[s.jsx(fn,{children:"Namespace"}),s.jsx(fn,{children:"Client"}),s.jsx(fn,{children:"Statut"}),s.jsx(fn,{children:"URL"}),s.jsx(fn,{children:"Expire dans"}),s.jsx(fn,{})]})}),s.jsx(Db,{children:n.map(T=>{const O=v===T.id;return s.jsxs(m.Fragment,{children:[s.jsxs(fo,{cursor:"pointer",bg:O?"chakra-subtle-bg":void 0,_hover:{bg:"chakra-subtle-bg"},onClick:()=>j(T),children:[s.jsx(qt,{fontFamily:"mono",children:s.jsxs(ge,{spacing:2,children:[s.jsx(Tt,{as:Px,boxSize:3,color:"gray.400",transform:O?"rotate(90deg)":void 0,transition:"transform 0.15s"}),s.jsx(Z,{children:T.namespace})]})}),s.jsx(qt,{children:T.username?s.jsx(Z,{children:T.username}):s.jsx(Z,{color:"gray.400",children:"—"})}),s.jsx(qt,{children:s.jsx(Wn,{colorScheme:Hm(T.status),children:Gm(T.status)})}),s.jsx(qt,{children:s.jsxs(ge,{spacing:1,children:[T.status==="ready"?s.jsx(_o,{href:T.url,color:"primary.500",isExternal:!0,onClick:q=>q.stopPropagation(),children:T.url}):s.jsx(Z,{color:"gray.400",children:"—"}),s.jsx(On,{"aria-label":"Modifier le domaine",icon:s.jsx(Um,{}),size:"xs",variant:"ghost",onClick:q=>{q.stopPropagation(),h(T)}})]})}),s.jsx(qt,{children:_(T.status)?mk(T.expires_at):"—"}),s.jsx(qt,{textAlign:"right",children:s.jsx(ge,{justify:"flex-end",children:M(T)})})]}),s.jsx(fo,{children:s.jsx(qt,{p:0,border:O?void 0:"none",colSpan:6,children:s.jsx(Mu,{in:O,unmountOnExit:!0,animateOpacity:!0,children:s.jsx(se,{p:4,bg:"chakra-subtle-bg",borderTopWidth:"1px",children:g&&!x?s.jsx(kt,{justify:"center",py:4,children:s.jsx(Vn,{size:"sm"})}):x?s.jsx(jx,{state:x.state}):s.jsx(Z,{color:"gray.500",fontSize:"sm",children:"Aucune donnée."})})})})})]},T.id)})})]})}),s.jsx(Se,{spacing:3,display:{base:"flex",md:"none"},children:n.map(T=>s.jsx(W7,{demo:T,isOpen:v===T.id,onToggle:()=>j(T),detailsLoading:g,details:v===T.id?x:null,onEditDomain:()=>h(T),expiresLabel:_(T.status)?mk(T.expires_at):"—",actions:M(T)},T.id))})]}),s.jsxs($ce,{isOpen:!!c,title:"Détruire la démo ?",confirmLabel:"Détruire",isLoading:!!c&&a===c.id,onConfirm:P,onClose:()=>u(null),children:["La démo"," ",s.jsx(Z,{as:"span",fontFamily:"mono",fontWeight:"semibold",children:c==null?void 0:c.namespace})," ","et toutes ses données seront supprimées définitivement. Les ressources du pool seront libérées. Cette action est irréversible."]}),s.jsx(V7,{demo:p,onClose:()=>h(null),onSaved:()=>void w()})]})}const Lce=5e3,Nce=5e3;function Dce(){const e=Zr(),t=Er(),[n,r]=m.useState([]),[i,o]=m.useState(!0),[a,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(null),[p,h]=m.useState(null),[v,y]=m.useState(!1),x=m.useCallback(async()=>{try{const g=await Fe.listDemos();r((g.items??[]).filter(S=>S.type_abonnement==="premium"))}catch(g){g instanceof Je&&g.status===401?t("/admin/login"):e({status:"error",title:"Chargement des démos impossible"})}finally{o(!1)}},[t,e]);m.useEffect(()=>{x();const g=setInterval(()=>void x(),Lce);return()=>clearInterval(g)},[x]);const b=async g=>{if(d===g.id){f(null),h(null);return}f(g.id),h(null),y(!0);try{const S=await Fe.getDemoDetails(g.namespace);h(S)}catch(S){const w=S instanceof Je?S.message:"Erreur";e({status:"error",title:"État des pods indisponible",description:w}),f(null)}finally{y(!1)}};return m.useEffect(()=>{const g=n.find(k=>k.id===d);if(!g)return;const S=g.namespace,w=setInterval(()=>{Fe.getDemoDetails(S).then(h).catch(()=>{})},Nce);return()=>clearInterval(w)},[d]),s.jsxs(s.Fragment,{children:[s.jsxs(kt,{mb:2,align:"center",gap:4,wrap:"wrap",children:[s.jsx(_t,{size:"md",mr:4,children:"Démos Premium"}),s.jsx(ja,{}),s.jsx(ve,{colorScheme:"primary",onClick:()=>l(!0),children:"Déployer une plateforme"})]}),s.jsx(Z,{color:"gray.500",mb:6,fontSize:"sm",children:"Démos rattachées à un client passé en abonnement payant — stockage persistant, n'expirent plus."}),s.jsx(B7,{isOpen:a,onClose:()=>l(!1),onCreated:()=>void x()}),i?s.jsx(Vn,{}):n.length===0?s.jsx(Z,{color:"gray.500",children:"Aucune démo premium pour le moment."}):s.jsxs(s.Fragment,{children:[s.jsx(Nb,{borderWidth:"1px",borderRadius:"lg",display:{base:"none",md:"block"},children:s.jsxs(Pm,{children:[s.jsx(Ob,{children:s.jsxs(fo,{children:[s.jsx(fn,{children:"Namespace"}),s.jsx(fn,{children:"Client"}),s.jsx(fn,{children:"Statut"}),s.jsx(fn,{children:"URL"})]})}),s.jsx(Db,{children:n.map(g=>{const S=d===g.id;return s.jsxs(m.Fragment,{children:[s.jsxs(fo,{cursor:"pointer",bg:S?"chakra-subtle-bg":void 0,_hover:{bg:"chakra-subtle-bg"},onClick:()=>b(g),children:[s.jsx(qt,{fontFamily:"mono",children:s.jsxs(ge,{spacing:2,children:[s.jsx(Tt,{as:Px,boxSize:3,color:"gray.400",transform:S?"rotate(90deg)":void 0,transition:"transform 0.15s"}),s.jsx(Z,{children:g.namespace})]})}),s.jsx(qt,{children:g.username||s.jsx(Z,{color:"gray.400",children:"—"})}),s.jsx(qt,{children:s.jsx(Wn,{colorScheme:Hm(g.status),children:Gm(g.status)})}),s.jsx(qt,{children:s.jsxs(ge,{spacing:1,children:[g.status==="ready"?s.jsx(_o,{href:g.url,color:"primary.500",isExternal:!0,onClick:w=>w.stopPropagation(),children:g.url}):s.jsx(Z,{color:"gray.400",children:"—"}),s.jsx(On,{"aria-label":"Modifier le domaine",icon:s.jsx(Um,{}),size:"xs",variant:"ghost",onClick:w=>{w.stopPropagation(),u(g)}})]})})]}),s.jsx(fo,{children:s.jsx(qt,{p:0,border:S?void 0:"none",colSpan:4,children:s.jsx(Mu,{in:S,unmountOnExit:!0,animateOpacity:!0,children:s.jsx(se,{p:4,bg:"chakra-subtle-bg",borderTopWidth:"1px",children:v&&!p?s.jsx(Vn,{size:"sm"}):p?s.jsx(jx,{state:p.state}):s.jsx(Z,{color:"gray.500",fontSize:"sm",children:"Aucune donnée."})})})})})]},g.id)})})]})}),s.jsx(Se,{spacing:3,display:{base:"flex",md:"none"},children:n.map(g=>s.jsx(W7,{demo:g,isOpen:d===g.id,onToggle:()=>b(g),detailsLoading:v,details:d===g.id?p:null,onEditDomain:()=>u(g)},g.id))})]}),s.jsx(V7,{demo:c,onClose:()=>u(null),onSaved:()=>void x()})]})}const Oce=1e4;function Fce(){const e=Zr(),t=Er(),[n,r]=m.useState([]),[i,o]=m.useState(!0),[a,l]=m.useState(null),[c,u]=m.useState(""),[d,f]=m.useState(null),p=m.useCallback(async()=>{try{const y=await Fe.listCodes();r(y.items??[])}catch(y){y instanceof Je&&y.status===401?t("/admin/login"):e({status:"error",title:"Chargement des codes impossible"})}finally{o(!1)}},[t,e]);m.useEffect(()=>{p();const y=setInterval(()=>void p(),Oce);return()=>clearInterval(y)},[p]);const h=async y=>{if(y.preventDefault(),!c.trim()){e({status:"error",title:"Veuillez entrer un nom d'utilisateur"});return}l("generate");try{const x=await Fe.createCode(c.trim());f(x.code),u(""),e({status:"success",title:"Code généré avec succès !"}),await p()}catch(x){const b=x instanceof Je?x.message:"Erreur";e({status:"error",title:"Génération impossible",description:b})}finally{l(null)}},v=async y=>{try{await navigator.clipboard.writeText(y),e({status:"success",title:"Code copié dans le presse-papiers !"})}catch{const b=document.createElement("textarea");b.value=y,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select();const g=document.execCommand("copy");document.body.removeChild(b),e(g?{status:"success",title:"Code copié dans le presse-papiers !"}:{status:"error",title:"Impossible de copier. Essayez manuellement."})}};return s.jsxs(s.Fragment,{children:[s.jsxs(kt,{mb:6,align:"center",children:[s.jsx(_t,{size:"md",children:"Gestion des codes de souscription"}),s.jsx(ja,{})]}),s.jsx(se,{mb:8,p:6,borderWidth:"1px",borderRadius:"lg",bg:"bg-surface",children:s.jsx("form",{onSubmit:h,children:s.jsxs(Cp,{spacing:4,align:"stretch",children:[s.jsxs(Se,{direction:{base:"column",sm:"row"},align:{base:"stretch",sm:"center"},gap:4,children:[s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Nom d\\'utilisateur"}),s.jsx(yt,{type:"text",value:c,onChange:y=>u(y.target.value),placeholder:"Entrez le nom d'utilisateur",isDisabled:a==="generate",maxLength:64})]}),s.jsx(ve,{colorScheme:"primary",type:"submit",isLoading:a==="generate",mt:{base:0,sm:6},h:"40px",flexShrink:0,w:{base:"full",sm:"auto"},children:"Générer un code"})]}),d&&s.jsxs(se,{p:4,bg:"gray.900",borderRadius:"md",borderWidth:"1px",borderColor:"whiteAlpha.200",children:[s.jsxs(Z,{fontSize:"sm",color:"gray.400",mb:2,children:["Code généré pour ",s.jsx("strong",{children:c})," :"]}),s.jsxs(ge,{children:[s.jsx(Z,{fontFamily:"mono",fontSize:"xl",fontWeight:"bold",letterSpacing:"widest",children:d}),s.jsx(ve,{size:"sm",variant:"outline",onClick:()=>v(d),children:"Copier"})]})]})]})})}),i?s.jsx(Vn,{}):n.length===0?s.jsx(Z,{color:"gray.500",children:"Aucun code de souscription généré."}):s.jsx(Nb,{borderWidth:"1px",borderRadius:"lg",children:s.jsxs(Pm,{children:[s.jsx(Ob,{children:s.jsxs(fo,{children:[s.jsx(fn,{children:"ID"}),s.jsx(fn,{children:"Utilisateur"}),s.jsx(fn,{children:"Code"}),s.jsx(fn,{children:"Date de création"}),s.jsx(fn,{})]})}),s.jsx(Db,{children:n.map(y=>s.jsxs(fo,{children:[s.jsxs(qt,{fontFamily:"mono",fontSize:"sm",children:[y.id.slice(0,8),"..."]}),s.jsx(qt,{children:s.jsx(Wn,{colorScheme:"gray",px:2,py:1,children:y.username})}),s.jsx(qt,{fontFamily:"mono",letterSpacing:"wide",children:y.code_verif}),s.jsx(qt,{fontSize:"sm",color:"gray.400",children:new Date(y.created_at).toLocaleString("fr-FR")}),s.jsx(qt,{textAlign:"right",children:s.jsx(ve,{size:"sm",variant:"outline",onClick:()=>v(y.code_verif),children:"Copier"})})]},y.id))})]})})]})}function Bce(){const e=Zr(),t=Er(),[n,r]=m.useState(null),[i,o]=m.useState(null),[a,l]=m.useState(!0),[c,u]=m.useState(!1),[d,f]=m.useState(""),[p,h]=m.useState(!1),[v,y]=m.useState([]),[x,b]=m.useState(!0),g=m.useCallback(async()=>{try{const _=await Fe.me();r(_.type_abonnement??null),o(_.expired_at?new Date(_.expired_at):null)}catch(_){_ instanceof Je&&_.status===401?t("/login"):e({status:"error",title:"Chargement de l'abonnement impossible"})}finally{l(!1)}},[t,e]),S=m.useCallback(async()=>{try{const _=await Fe.listMyDemos();y(_.items??[])}catch{}finally{b(!1)}},[]);m.useEffect(()=>{g(),S()},[g,S]);const w=async _=>{if(_.preventDefault(),!d.trim()){e({status:"error",title:"Veuillez entrer un code"});return}u(!0);try{await Fe.addCode(d.trim()),e({status:"success",title:"Abonnement premium activé !"}),f(""),h(!1),await g()}catch(M){const T=M instanceof Je?M.message:"Erreur";e({status:"error",title:"Code invalide",description:T})}finally{u(!1)}},k=n==="premium",P=!k||p,j=i?Math.ceil((i.getTime()-Date.now())/(1e3*60*60*24)):null;return s.jsxs(s.Fragment,{children:[s.jsxs(kt,{mb:6,align:"center",children:[s.jsx(_t,{size:"md",children:k?"Ma plateforme":"Ma démo"}),s.jsx(ja,{})]}),s.jsx(se,{mb:8,p:6,borderWidth:"1px",borderRadius:"lg",bg:"bg-surface",children:x?s.jsx(Vn,{size:"sm"}):v.length===0?s.jsx(Z,{color:"gray.500",children:k?"Aucune plateforme pour le moment.":"Aucune démo pour le moment."}):s.jsx(Cp,{align:"stretch",spacing:3,children:v.map(_=>s.jsxs(ge,{justify:"space-between",flexWrap:"wrap",rowGap:2,children:[_.status==="ready"?s.jsx(_o,{href:_.url,color:"primary.500",isExternal:!0,fontFamily:"mono",children:_.url}):s.jsx(Z,{color:"gray.400",fontFamily:"mono",children:_.url||"—"}),s.jsx(Wn,{colorScheme:Hm(_.status),children:Gm(_.status)})]},_.id))})}),s.jsxs(kt,{mb:6,align:"center",children:[s.jsx(_t,{size:"md",children:"Mon abonnement"}),s.jsx(ja,{})]}),s.jsx(se,{mb:8,p:6,borderWidth:"1px",borderRadius:"lg",bg:"bg-surface",children:a?s.jsx(Vn,{}):s.jsxs(Cp,{align:"stretch",spacing:4,children:[s.jsxs(ge,{flexWrap:"wrap",rowGap:2,children:[s.jsx(Z,{color:"gray.400",children:"Statut actuel :"}),s.jsx(Wn,{colorScheme:k?"purple":"gray",px:2,py:1,children:k?"Premium":"Demo"}),k&&!p&&s.jsx(ve,{size:"sm",variant:"link",ml:2,whiteSpace:"normal",textAlign:"left",onClick:()=>h(!0),children:"Renouveler avec un nouveau code"})]}),k&&i&&s.jsx(Z,{fontSize:"sm",color:j!==null&&j<=5?"orange.400":"gray.400",children:j!==null&&j>0?`Expire dans ${j} jour${j>1?"s":""} (le ${i.toLocaleDateString("fr-FR")})`:`Expiré depuis le ${i.toLocaleDateString("fr-FR")}`}),P&&s.jsx("form",{onSubmit:w,children:s.jsxs(Se,{direction:{base:"column",sm:"row"},align:{base:"stretch",sm:"center"},gap:4,children:[s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:k?"Nouveau code de renouvellement":"Code de souscription"}),s.jsx(yt,{type:"text",value:d,onChange:_=>f(_.target.value.toUpperCase()),placeholder:"XXXX-XXXX-XXXX-XXXX",isDisabled:c,fontFamily:"mono",letterSpacing:"wide"})]}),s.jsxs(ge,{flexShrink:0,children:[s.jsx(ve,{colorScheme:"primary",type:"submit",isLoading:c,mt:{base:0,sm:6},h:"40px",flexShrink:0,w:{base:"full",sm:"auto"},children:k?"Renouveler":"Activer"}),k&&s.jsx(ve,{variant:"ghost",mt:{base:0,sm:6},h:"40px",flexShrink:0,w:{base:"full",sm:"auto"},onClick:()=>{h(!1),f("")},isDisabled:c,children:"Annuler"})]})]})})]})})]})}function hk(e){return e==="admin"?"Administrateur":"Client"}function Vce(e){return e==="admin"?"purple":"blue"}function Wce(e){const t=(e==null?void 0:e.toLowerCase())??"";return t.includes("premium")||t.includes("pro")?"green":t.includes("expired")||t===""?"red":"gray"}function Uce(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleDateString("fr-FR",{day:"2-digit",month:"long",year:"numeric"})}function Xd(){const{isEditing:e,getSubmitButtonProps:t,getCancelButtonProps:n,getEditButtonProps:r}=AG();return e?s.jsxs(ab,{size:"sm",spacing:1,children:[s.jsx(On,{"aria-label":"Enregistrer",icon:s.jsx(Ece,{}),...t()}),s.jsx(On,{"aria-label":"Annuler",icon:s.jsx(Tce,{}),...n()})]}):s.jsx(On,{"aria-label":"Modifier le nom d'utilisateur",size:"sm",variant:"ghost",icon:s.jsx(Um,{}),...r()})}function Hce(){const e=Zr(),t=Er(),{logout:n}=$o(),[r,i]=m.useState(null),[o,a]=m.useState(!0),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,p]=m.useState(!1),[h,v]=m.useState(0),[y,x]=m.useState(!1),[b,g]=m.useState(""),[S,w]=m.useState(!1),[k,P]=m.useState(!1),[j,_]=m.useState(""),[M,T]=m.useState(""),[O,q]=m.useState(""),[ne,z]=m.useState(!1);m.useEffect(()=>{let F=!1;return(async()=>{try{const[G,K]=await Promise.all([Fe.me(),Fe.getTelegram()]);if(F)return;if(i(G),g(K.telegram??""),G.role==="admin"){const ee=await Fe.getAlertSettings();if(F)return;_(ee.discord_webhook_url),T(ee.telegram_bot_token),q(ee.telegram_chat_id)}}catch(G){if(G instanceof Je&&G.status===401){t("/login");return}e({status:"error",title:"Impossible de charger le profil"})}finally{F||a(!1)}})(),()=>{F=!0}},[t,e]);const X=async()=>{z(!0);try{const F=await Fe.setAlertSettings({discord_webhook_url:j.trim(),telegram_bot_token:M.trim(),telegram_chat_id:O.trim()});_(F.discord_webhook_url),T(F.telegram_bot_token),q(F.telegram_chat_id),e({status:"success",title:"Alertes enregistrées"})}catch(F){if(F instanceof Je&&F.status===401){t("/login");return}e({status:"error",title:"Impossible d'enregistrer les alertes",description:F instanceof Je?F.message:void 0})}finally{z(!1)}},V=async F=>{const G=F.trim();if(!(!r||!G||G===r.username)){d(!0);try{const K=await Fe.updateUsername(G);i({...r,username:K.username}),e({status:"success",title:"Nom d'utilisateur mis à jour"})}catch(K){if(K instanceof Je&&K.status===401){t("/login");return}e({status:"error",title:"Impossible de mettre à jour le nom d'utilisateur",description:K instanceof Je?K.message:void 0})}finally{d(!1)}}},I=async F=>{const G=F.trim();if(!r||G.length<8){G.length>0&&e({status:"warning",title:"Le mot de passe doit contenir au moins 8 caractères"}),v(K=>K+1);return}p(!0);try{await Fe.updatePassword(G),e({status:"success",title:"Mot de passe mis à jour"})}catch(K){if(K instanceof Je&&K.status===401){t("/login");return}e({status:"error",title:"Impossible de mettre à jour le mot de passe",description:K instanceof Je?K.message:void 0})}finally{p(!1),v(K=>K+1)}},D=async F=>{const G=F.trim();if(!G){P(!1);return}w(!0);try{const K=await Fe.setTelegram(G);g(K.telegram),P(!1),e({status:"success",title:"Telegram enregistré"})}catch(K){if(K instanceof Je&&K.status===401){t("/login");return}e({status:"error",title:"Impossible d'enregistrer le Telegram",description:K instanceof Je?K.message:void 0})}finally{w(!1)}},R=async()=>{c(!0);try{await Fe.logout(),n==null||n(),t("/login")}catch{e({status:"error",title:"Déconnexion impossible"})}finally{c(!1)}};return s.jsx(se,{bg:"chakra-subtle-bg",py:{base:10,md:14},minH:"100%",children:s.jsxs(pn,{maxW:"container.md",children:[s.jsxs(Se,{spacing:3,mb:8,children:[s.jsx(_t,{size:"lg",children:"Mon profil"}),s.jsx(Z,{color:"gray.400",fontSize:"md",children:"Informations de votre compte et de votre abonnement."})]}),s.jsx(se,{bg:"bg-surface",borderWidth:"1px",borderColor:"chakra-border-color",borderRadius:"xl",p:{base:6,md:10},boxShadow:"lg",children:o?s.jsx(kt,{justify:"center",py:10,children:s.jsx(Vn,{})}):r?s.jsxs(Se,{spacing:8,children:[s.jsxs(kt,{align:"center",gap:5,wrap:"wrap",children:[s.jsx(ob,{name:r.username,size:"xl"}),s.jsxs(se,{children:[s.jsx(tc,{defaultValue:r.username,onSubmit:V,isDisabled:u,submitOnBlur:!1,children:s.jsxs(ge,{spacing:2,children:[s.jsx(rc,{as:_t,size:"md",fontFamily:"mono"}),s.jsx(nc,{fontFamily:"mono",fontSize:"md",fontWeight:"bold"}),s.jsx(Xd,{})]})},r.username),s.jsxs(ge,{mt:2,spacing:2,children:[s.jsx(Wn,{colorScheme:Vce(r.role),children:hk(r.role)}),r.type_abonnement&&s.jsx(Wn,{colorScheme:Wce(r.type_abonnement),children:r.type_abonnement})]})]})]}),s.jsx(ua,{borderColor:"chakra-border-color"}),s.jsxs(gn,{columns:{base:1,sm:2},spacing:6,children:[s.jsxs(Ho,{children:[s.jsx(Go,{children:"Identifiant"}),s.jsx(Fi,{fontSize:"md",fontFamily:"mono",children:r.user_id})]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Rôle"}),s.jsx(Fi,{fontSize:"md",children:hk(r.role)})]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Type d'abonnement"}),s.jsx(Fi,{fontSize:"md",children:r.type_abonnement||"—"})]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Mot de passe"}),s.jsx(tc,{defaultValue:"",placeholder:"••••••••",onSubmit:I,isDisabled:f,submitOnBlur:!1,children:s.jsxs(ge,{spacing:2,children:[s.jsx(rc,{as:Fi,fontSize:"md",fontFamily:"mono"}),s.jsx(nc,{type:y?"text":"password",fontSize:"md",fontFamily:"mono"}),s.jsx(On,{"aria-label":y?"Masquer le mot de passe":"Afficher le mot de passe",icon:s.jsx(Oe,{icon:y?D7:T7}),size:"sm",variant:"ghost",tabIndex:-1,onClick:()=>x(F=>!F)}),s.jsx(Xd,{})]})},h)]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Telegram"}),b?s.jsx(tc,{defaultValue:b,onSubmit:D,isDisabled:S,submitOnBlur:!1,children:s.jsxs(ge,{spacing:2,children:[s.jsx(rc,{as:Fi,fontSize:"md",fontFamily:"mono"}),s.jsx(nc,{fontSize:"md",fontFamily:"mono"}),s.jsx(Xd,{})]})},b):k?s.jsx(tc,{defaultValue:"",placeholder:"@monpseudo",startWithEditView:!0,onSubmit:D,onCancel:()=>P(!1),isDisabled:S,submitOnBlur:!1,children:s.jsxs(ge,{spacing:2,children:[s.jsx(rc,{as:Fi,fontSize:"md",fontFamily:"mono"}),s.jsx(nc,{fontSize:"md",fontFamily:"mono"}),s.jsx(Xd,{})]})}):s.jsx(ve,{size:"sm",variant:"outline",onClick:()=>P(!0),children:"Ajouter mon Telegram"})]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Expire le"}),s.jsx(Fi,{fontSize:"md",children:Uce(r.expired_at)})]})]}),r.role==="admin"&&s.jsxs(s.Fragment,{children:[s.jsx(ua,{borderColor:"chakra-border-color"}),s.jsxs(Se,{spacing:4,children:[s.jsxs(se,{children:[s.jsx(_t,{size:"sm",children:"Alertes monitoring"}),s.jsx(Z,{color:"gray.500",fontSize:"sm",children:"Recevez une notification quand un pod d'une démo tombe en erreur (ou se rétablit). Réglages propres à votre compte."})]}),s.jsxs(be,{children:[s.jsx(xe,{fontSize:"sm",children:"Webhook Discord"}),s.jsx(yt,{fontFamily:"mono",fontSize:"sm",placeholder:"https://discord.com/api/webhooks/...",value:j,onChange:F=>_(F.target.value),isDisabled:ne})]}),s.jsxs(gn,{columns:{base:1,sm:2},spacing:4,children:[s.jsxs(be,{children:[s.jsx(xe,{fontSize:"sm",children:"Bot Telegram (token)"}),s.jsx(yt,{fontFamily:"mono",fontSize:"sm",placeholder:"123456789:AAExemple...",value:M,onChange:F=>T(F.target.value),isDisabled:ne})]}),s.jsxs(be,{children:[s.jsx(xe,{fontSize:"sm",children:"Telegram (chat ID)"}),s.jsx(yt,{fontFamily:"mono",fontSize:"sm",placeholder:"-100123456789",value:O,onChange:F=>q(F.target.value),isDisabled:ne}),s.jsx(au,{children:"Envoyez un message au bot puis récupérez le chat_id via son API."})]})]}),s.jsx(kt,{justify:"flex-end",children:s.jsx(ve,{size:"sm",colorScheme:"primary",isLoading:ne,onClick:X,children:"Enregistrer les alertes"})})]})]}),s.jsx(ua,{borderColor:"chakra-border-color"}),s.jsx(kt,{justify:"flex-end",children:s.jsx(ve,{colorScheme:"red",variant:"outline",isLoading:l,onClick:R,children:"Se déconnecter"})})]}):s.jsx(Z,{color:"gray.500",children:"Aucune information disponible."})})]})})}const gk=[{to:"/",label:"Accueil",end:!0},{to:"/tarifs",label:"Tarifs",end:!1},{to:"/documentation",label:"Documentation",end:!1},{to:"/contact",label:"Contact",end:!1}],Gce=()=>s.jsx(se,{as:"svg",w:"24px",h:"24px",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx(se,{as:"path",d:"M3 12h18M3 6h18M3 18h18"})});function Kce(){const{isOpen:e,onOpen:t,onClose:n}=Cu();return s.jsxs(se,{as:"header",position:"sticky",top:0,zIndex:"sticky",bg:"chakra-body-bg",borderBottomWidth:"1px",backdropFilter:"saturate(180%) blur(6px)",children:[s.jsx(pn,{maxW:"container.lg",children:s.jsxs(kt,{h:16,align:"center",justify:"space-between",children:[s.jsxs(ge,{spacing:8,children:[s.jsx(se,{as:Yt,to:"/",fontWeight:"bold",fontSize:"xl",letterSpacing:"tight",children:"Omnex"}),s.jsx(ge,{as:"nav",spacing:1,display:{base:"none",md:"flex"},children:gk.map(r=>s.jsx(vk,{to:r.to,end:r.end,children:r.label},r.to))})]}),s.jsxs(ge,{spacing:2,display:{base:"none",md:"flex"},children:[s.jsx(Ea,{}),s.jsx(ve,{as:Yt,to:"/login",variant:"ghost",size:"sm",children:"Espace client"}),s.jsx(ve,{as:Yt,to:"/register",colorScheme:"primary",size:"sm",children:"Créer un compte"})]}),s.jsxs(ge,{spacing:1,display:{base:"flex",md:"none"},children:[s.jsx(Ea,{}),s.jsx(On,{"aria-label":"Ouvrir le menu",variant:"ghost",onClick:t,icon:s.jsx(Gce,{})})]})]})}),s.jsxs(aT,{isOpen:e,placement:"right",onClose:n,size:"xs",children:[s.jsx(yl,{}),s.jsxs(Lb,{bg:"chakra-body-bg",children:[s.jsx(Bu,{size:"lg"}),s.jsx(vl,{borderBottomWidth:"1px",fontWeight:"bold",fontSize:"xl",children:"Omnex"}),s.jsxs(gl,{py:6,children:[s.jsx(Se,{as:"nav",spacing:1,children:gk.map(r=>s.jsx(vk,{to:r.to,end:r.end,onClick:n,mobile:!0,children:r.label},r.to))}),s.jsx(ua,{my:6}),s.jsxs(Se,{spacing:3,children:[s.jsx(ve,{as:Yt,to:"/login",variant:"outline",justifyContent:"flex-start",onClick:n,children:"Espace client"}),s.jsx(ve,{as:Yt,to:"/register",colorScheme:"primary",justifyContent:"flex-start",onClick:n,children:"Créer un compte"})]})]})]})]})]})}function vk({to:e,end:t,children:n,onClick:r,mobile:i=!1}){return s.jsx(ve,{as:p8,to:e,end:t,size:i?"lg":"sm",variant:"ghost",justifyContent:i?"flex-start":"center",onClick:r,_activeLink:{fontWeight:"bold",color:"primary.500"},children:n})}function qce(){return s.jsx(se,{as:"footer",borderTopWidth:"1px",mt:20,bg:"chakra-subtle-bg",children:s.jsxs(pn,{maxW:"container.lg",py:12,children:[s.jsxs(gn,{columns:{base:1,md:4},spacing:8,children:[s.jsxs(Se,{spacing:3,children:[s.jsx(Z,{fontWeight:"bold",fontSize:"lg",children:"Omnex"}),s.jsx(Z,{fontSize:"sm",color:"gray.500",children:"Plateforme de gestion de commandes & livraison, déployable en démo isolée en un clic."})]}),s.jsxs(Xce,{title:"Produit",children:[s.jsx(Yd,{to:"/",children:"Présentation"}),s.jsx(Yd,{to:"/tarifs",children:"Tarifs"}),s.jsx(Yd,{to:"/register",children:"Créer un compte"}),s.jsx(Yd,{to:"/documentation",children:"Documentation"})]})]}),s.jsx(ua,{my:8}),s.jsxs(ge,{justify:"space-between",flexWrap:"wrap",spacing:4,children:[s.jsxs(Z,{fontSize:"sm",color:"gray.500",children:["© ",new Date().getFullYear()," Omnex. Tous droits réservés."]}),s.jsxs(ge,{spacing:6,fontSize:"sm",color:"gray.500",children:[s.jsx(yk,{href:"#",children:"Mentions légales"}),s.jsx(yk,{href:"#",children:"Confidentialité"})]})]})]})})}function Xce({title:e,children:t}){return s.jsxs(Se,{spacing:2,children:[s.jsx(Z,{fontWeight:"semibold",fontSize:"sm",textTransform:"uppercase",color:"gray.500",children:e}),t]})}function Yd({to:e,children:t}){return s.jsx(_o,{as:Yt,to:e,fontSize:"sm",color:"gray.600",_hover:{color:"primary.500"},children:t})}function yk({href:e,children:t}){return s.jsx(_o,{href:e,fontSize:"sm",color:"gray.600",_hover:{color:"primary.500"},children:t})}function Yce(){return s.jsxs(kt,{direction:"column",minH:"100vh",children:[s.jsx(Kce,{}),s.jsx(se,{as:"main",flex:"1",children:s.jsx(d8,{})}),s.jsx(qce,{})]})}const Qce=()=>s.jsx(se,{as:"svg",w:"20px",h:"20px",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx(se,{as:"path",d:"M3 12h18M3 6h18M3 18h18"})}),bk="https://t.me/OMNEX_CORP";function Zce(){const{logout:e,isAdmin:t,isClient:n}=$o(),r=Er(),{isOpen:i,onOpen:o,onClose:a}=Cu(),l=async()=>{const d=t?"/admin/login":"/login";await e(),r(d,{replace:!0})},c=t?"Admin":n?"Client":"Utilisateur",u=t?"purple":"gray";return s.jsxs(se,{minH:"100vh",bg:"chakra-subtle-bg",overflowX:"hidden",children:[s.jsxs(kt,{as:"header",px:6,py:3,borderBottomWidth:"1px",align:"center",gap:6,children:[s.jsxs(_t,{size:"sm",as:Yt,to:"/app",children:["Omnex · ",t?"Espace admin":"Espace client"]}),s.jsxs(ge,{spacing:1,display:{base:"none",md:"flex"},children:[n&&s.jsx(Mr,{to:"/app/subscription",children:"Abonnement"}),(t||n)&&s.jsx(Mr,{to:"/app/profile",children:"Profile"}),t&&s.jsx(Mr,{to:"/app/demos",children:"Démos"}),t&&s.jsx(Mr,{to:"/app/premium",children:"Premium"}),t&&s.jsx(Mr,{to:"/app/codes",children:"Codes"})]}),s.jsx(ja,{}),s.jsxs(ge,{spacing:2,display:{base:"none",md:"flex"},children:[s.jsx(Wn,{colorScheme:u,children:c}),s.jsx(ve,{as:"a",href:bk,target:"_blank",rel:"noopener noreferrer",size:"sm",variant:"outline",children:"Support"}),s.jsx(Ea,{}),s.jsx(ve,{size:"sm",variant:"outline",onClick:l,children:"Déconnexion"})]}),s.jsxs(ge,{spacing:1,display:{base:"flex",md:"none"},children:[s.jsx(Wn,{colorScheme:u,children:c}),s.jsx(Ea,{}),s.jsx(On,{"aria-label":"Ouvrir le menu",variant:"ghost",onClick:o,icon:s.jsx(Qce,{})})]})]}),s.jsxs(aT,{isOpen:i,placement:"right",onClose:a,size:"xs",children:[s.jsx(yl,{}),s.jsxs(Lb,{bg:"chakra-body-bg",children:[s.jsx(Bu,{size:"lg"}),s.jsxs(vl,{borderBottomWidth:"1px",fontWeight:"bold",fontSize:"xl",children:["Omnex · ",t?"Espace admin":"Espace client"]}),s.jsxs(gl,{py:6,children:[s.jsxs(Se,{as:"nav",spacing:1,children:[n&&s.jsx(Mr,{to:"/app/subscription",onClick:a,mobile:!0,children:"Abonnement"}),t&&s.jsx(Mr,{to:"/app/demos",onClick:a,mobile:!0,children:"Démos"}),t&&s.jsx(Mr,{to:"/app/premium",onClick:a,mobile:!0,children:"Premium"}),t&&s.jsx(Mr,{to:"/app/codes",onClick:a,mobile:!0,children:"Codes"}),(t||n)&&s.jsx(Mr,{to:"/app/profile",onClick:a,mobile:!0,children:"Profile"})]}),s.jsx(ua,{my:6}),s.jsxs(Se,{spacing:3,children:[s.jsx(ve,{as:"a",href:bk,target:"_blank",rel:"noopener noreferrer",variant:"outline",justifyContent:"flex-start",onClick:a,children:"Support"}),s.jsx(ve,{variant:"outline",justifyContent:"flex-start",onClick:l,children:"Déconnexion"})]})]})]})]}),s.jsx(pn,{maxW:"container.xl",py:8,children:s.jsx(d8,{})})]})}function Mr({to:e,children:t,onClick:n,mobile:r=!1}){return s.jsx(ve,{as:p8,to:e,size:r?"lg":"sm",variant:"ghost",onClick:n,_activeLink:{fontWeight:"bold",color:"primary.500"},justifyContent:"flex-start",children:t})}const Jce=["/app/demos","/app/premium","/app/codes"];function eue({children:e}){const{isAuthenticated:t,initializing:n}=$o(),r=Ia();if(n)return s.jsx(qP,{h:"100vh",children:s.jsx(Vn,{})});if(t)return e;const i=Jce.some(o=>r.pathname.startsWith(o));return s.jsx(vu,{to:i?"/admin/login":"/login",replace:!0})}function N0({children:e}){const{isAdmin:t}=$o();return t?e:s.jsx(vu,{to:"/app/subscription",replace:!0})}function tue(){const{role:e}=$o();switch(e){case"admin":return s.jsx(vu,{to:"/app/demos",replace:!0});default:return s.jsx(vu,{to:"/app/subscription",replace:!0})}}function nue(){return s.jsxs(Fre,{children:[s.jsxs(rn,{element:s.jsx(Yce,{}),children:[s.jsx(rn,{path:"/",element:s.jsx(tie,{})}),s.jsx(rn,{path:"/tarifs",element:s.jsx(rie,{})}),s.jsx(rn,{path:"/documentation",element:s.jsx(xce,{})})]}),s.jsx(rn,{path:"/login",element:s.jsx(jce,{})}),s.jsx(rn,{path:"/admin/login",element:s.jsx(Pce,{})}),s.jsx(rn,{path:"/register",element:s.jsx(_ce,{})}),s.jsxs(rn,{path:"/app",element:s.jsx(eue,{children:s.jsx(Zce,{})}),children:[s.jsx(rn,{index:!0,element:s.jsx(tue,{})}),s.jsx(rn,{path:"demos",element:s.jsx(N0,{children:s.jsx(Ice,{})})}),s.jsx(rn,{path:"codes",element:s.jsx(N0,{children:s.jsx(Fce,{})})}),s.jsx(rn,{path:"premium",element:s.jsx(N0,{children:s.jsx(Dce,{})})}),s.jsx(rn,{path:"subscription",element:s.jsx(Bce,{})}),s.jsx(rn,{path:"profile",element:s.jsx(Hce,{})})]}),s.jsx(rn,{path:"*",element:s.jsx(vu,{to:"/",replace:!0})})]})}const rue={initialColorMode:"system",useSystemColorMode:!1},xk=db({config:rue,colors:{black:"#000000",gray:{50:"#f7f7f8",100:"#e8e8ea",200:"#c5c5c9",300:"#a2a2a9",400:"#7f7f88",500:"#5c5c66",600:"#43434c",700:"#2a2a33",800:"#15151b",900:"#0a0a0f"}},semanticTokens:{colors:{"chakra-body-bg":{_light:"white",_dark:"#000000"},"chakra-subtle-bg":{_light:"gray.50",_dark:"#050508"},"bg-surface":{_light:"white",_dark:"#08080c"},"chakra-body-text":{_light:"gray.800",_dark:"#f5f5f7"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.100"}}},styles:{global:{body:{bg:"chakra-body-bg",color:"chakra-body-text"}}},components:{Card:{baseStyle:{container:{bg:"bg-surface",borderColor:"whiteAlpha.50"}}},Button:{baseStyle:{_dark:{bg:"gray.800",_hover:{bg:"gray.700"}}}},Input:{baseStyle:{field:{_dark:{bg:"gray.900",borderColor:"whiteAlpha.200",_focus:{borderColor:"whiteAlpha.400"}}}}},Select:{baseStyle:{field:{_dark:{bg:"gray.900",borderColor:"whiteAlpha.200"}}}},Textarea:{baseStyle:{_dark:{bg:"gray.900",borderColor:"whiteAlpha.200"}}},Modal:{baseStyle:{overlay:{_dark:{bg:"blackAlpha.800"}},content:{_dark:{bg:"#08080c"}}}}}},ET);O0.createRoot(document.getElementById("root")).render(s.jsxs(Gt.StrictMode,{children:[s.jsx(PG,{initialColorMode:xk.config.initialColorMode}),s.jsx(Tte,{theme:xk,children:s.jsx(wce,{children:s.jsx(qre,{children:s.jsx(nue,{})})})})]})); + */var Yv={prefix:"fas",iconName:"truck",icon:[576,512,[128666,9951],"f0d1","M0 96C0 60.7 28.7 32 64 32l288 0c35.3 0 64 28.7 64 64l0 32 50.7 0c17 0 33.3 6.7 45.3 18.7L557.3 192c12 12 18.7 28.3 18.7 45.3L576 384c0 35.3-28.7 64-64 64l-3.3 0c-10.4 36.9-44.4 64-84.7 64s-74.2-27.1-84.7-64l-102.6 0c-10.4 36.9-44.4 64-84.7 64s-74.2-27.1-84.7-64L64 448c-35.3 0-64-28.7-64-64L0 96zM512 288l0-50.7-45.3-45.3-50.7 0 0 96 96 0zM192 424a40 40 0 1 0 -80 0 40 40 0 1 0 80 0zm232 40a40 40 0 1 0 0-80 40 40 0 1 0 0 80z"]},vx={prefix:"fas",iconName:"user-check",icon:[640,512,[],"f4fc","M286 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L78 512c-16.4 0-29.7-13.3-29.7-29.7 0-98.5 79.8-178.3 178.3-178.3l59.4 0zM585.7 105.9c7.8-10.7 22.8-13.1 33.5-5.3s13.1 22.8 5.3 33.5L522.1 274.9c-4.2 5.7-10.7 9.4-17.7 9.8s-14-2.2-18.9-7.3l-46.4-48c-9.2-9.5-9-24.7 .6-33.9 9.5-9.2 24.7-8.9 33.9 .6l26.5 27.4 85.6-117.7zM256.3 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240z"]},yx={prefix:"fas",iconName:"bell",icon:[448,512,[128276,61602],"f0f3","M224 0c-17.7 0-32 14.3-32 32l0 3.2C119 50 64 114.6 64 192l0 21.7c0 48.1-16.4 94.8-46.4 132.4L7.8 358.3C2.7 364.6 0 372.4 0 380.5 0 400.1 15.9 416 35.5 416l376.9 0c19.6 0 35.5-15.9 35.5-35.5 0-8.1-2.7-15.9-7.8-22.2l-9.8-12.2C400.4 308.5 384 261.8 384 213.7l0-21.7c0-77.4-55-142-128-156.8l0-3.2c0-17.7-14.3-32-32-32zM162 464c7.1 27.6 32.2 48 62 48s54.9-20.4 62-48l-124 0z"]},Q3={prefix:"fas",iconName:"trophy",icon:[512,512,[127942],"f091","M144.3 0l224 0c26.5 0 48.1 21.8 47.1 48.2-.2 5.3-.4 10.6-.7 15.8l49.6 0c26.1 0 49.1 21.6 47.1 49.8-7.5 103.7-60.5 160.7-118 190.5-15.8 8.2-31.9 14.3-47.2 18.8-20.2 28.6-41.2 43.7-57.9 51.8l0 73.1 64 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-192 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0 0-73.1c-16-7.7-35.9-22-55.3-48.3-18.4-4.8-38.4-12.1-57.9-23.1-54.1-30.3-102.9-87.4-109.9-189.9-1.9-28.1 21-49.7 47.1-49.7l49.6 0c-.3-5.2-.5-10.4-.7-15.8-1-26.5 20.6-48.2 47.1-48.2zM101.5 112l-52.4 0c6.2 84.7 45.1 127.1 85.2 149.6-14.4-37.3-26.3-86-32.8-149.6zM380 256.8c40.5-23.8 77.1-66.1 83.3-144.8L411 112c-6.2 60.9-17.4 108.2-31 144.8z"]},ile={prefix:"fas",iconName:"gift",icon:[512,512,[127873],"f06b","M321.5 68.8C329.1 55.9 342.9 48 357.8 48l2.2 0c22.1 0 40 17.9 40 40s-17.9 40-40 40l-73.3 0 34.8-59.2zm-131 0l34.8 59.2-73.3 0c-22.1 0-40-17.9-40-40s17.9-40 40-40l2.2 0c14.9 0 28.8 7.9 36.3 20.8zm89.6-24.3l-24.1 41-24.1-41C215.7 16.9 186.1 0 154.2 0L152 0c-48.6 0-88 39.4-88 88 0 14.4 3.5 28 9.6 40L32 128c-17.7 0-32 14.3-32 32l0 32c0 17.7 14.3 32 32 32l448 0c17.7 0 32-14.3 32-32l0-32c0-17.7-14.3-32-32-32l-41.6 0c6.1-12 9.6-25.6 9.6-40 0-48.6-39.4-88-88-88l-2.2 0c-31.9 0-61.5 16.9-77.7 44.4zM480 272l-200 0 0 208 136 0c35.3 0 64-28.7 64-64l0-144zm-248 0l-200 0 0 144c0 35.3 28.7 64 64 64l136 0 0-208z"]},P7={prefix:"fas",iconName:"power-off",icon:[512,512,[9211],"f011","M288 0c0-17.7-14.3-32-32-32S224-17.7 224 0l0 256c0 17.7 14.3 32 32 32s32-14.3 32-32L288 0zM146.3 98.4c14.5-10.1 18-30.1 7.9-44.6s-30.1-18-44.6-7.9C43.4 92.1 0 169 0 256 0 397.4 114.6 512 256 512S512 397.4 512 256c0-87-43.4-163.9-109.7-210.1-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6c49.8 34.8 82.3 92.4 82.3 157.6 0 106-86 192-192 192S64 362 64 256c0-65.2 32.5-122.9 82.3-157.6z"]},ole={prefix:"fas",iconName:"cash-register",icon:[512,512,[],"f788","M96 0C60.7 0 32 28.7 32 64s28.7 64 64 64l48 0 0 32-57 0c-31.6 0-58.5 23.1-63.3 54.4L1.1 364.1C.4 368.8 0 373.6 0 378.4L0 448c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-69.6c0-4.8-.4-9.6-1.1-14.4L488.2 214.4C483.5 183.1 456.6 160 425 160l-217 0 0-32 48 0c35.3 0 64-28.7 64-64S291.3 0 256 0L96 0zm0 48l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16L96 80c-8.8 0-16-7.2-16-16s7.2-16 16-16zM64 424c0-13.3 10.7-24 24-24l336 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L88 448c-13.3 0-24-10.7-24-24zm48-160a24 24 0 1 1 0-48 24 24 0 1 1 0 48zm120-24a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM160 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM328 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM256 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48zM424 240a24 24 0 1 1 -48 0 24 24 0 1 1 48 0zM352 344a24 24 0 1 1 0-48 24 24 0 1 1 0 48z"]},ale={prefix:"fas",iconName:"map-location-dot",icon:[640,512,["map-marked-alt"],"f5a0","M576 48c0-11.1-5.7-21.4-15.2-27.2s-21.2-6.4-31.1-1.4L413.5 77.5 234.1 17.6c-8.1-2.7-16.8-2.1-24.4 1.7l-128 64C70.8 88.8 64 99.9 64 112l0 352c0 11.1 5.7 21.4 15.2 27.2s21.2 6.4 31.1 1.4l116.1-58.1 173.3 57.8c-4.3-6.4-8.5-13.1-12.6-19.9-11-18.3-21.9-39.3-30-61.8l-101.2-33.7 0-284.5 128 42.7 0 99.3c31-35.8 77-58.4 128-58.4 22.6 0 44.2 4.4 64 12.5L576 48zM512 224c-66.3 0-120 52.8-120 117.9 0 68.9 64.1 150.4 98.6 189.3 11.6 13 31.3 13 42.9 0 34.5-38.9 98.6-120.4 98.6-189.3 0-65.1-53.7-117.9-120-117.9zM472 344a40 40 0 1 1 80 0 40 40 0 1 1 -80 0z"]},sle={prefix:"fas",iconName:"magnifying-glass",icon:[512,512,[128269,"search"],"f002","M416 208c0 45.9-14.9 88.3-40 122.7L502.6 457.4c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376C296.3 401.1 253.9 416 208 416 93.1 416 0 322.9 0 208S93.1 0 208 0 416 93.1 416 208zM208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288z"]},lle={prefix:"fas",iconName:"boxes-stacked",icon:[512,512,[62625,"boxes","boxes-alt"],"f468","M224 0l0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64 32 0c35.3 0 64 28.7 64 64l0 128c0 5.5-.7 10.9-2 16l-252 0c-1.3-5.1-2-10.5-2-16l0-128c0-35.3 28.7-64 64-64l32 0zm96 512c-11.2 0-21.8-2.9-31-8 9.5-16.5 15-35.6 15-56l0-128c0-20.4-5.5-39.5-15-56 9.2-5.1 19.7-8 31-8l32 0 0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64 32 0c35.3 0 64 28.7 64 64l0 128c0 35.3-28.7 64-64 64l-128 0zM0 320c0-35.3 28.7-64 64-64l32 0 0 64c0 8.8 7.2 16 16 16l32 0c8.8 0 16-7.2 16-16l0-64 32 0c35.3 0 64 28.7 64 64l0 128c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 320z"]},_7={prefix:"fas",iconName:"ban",icon:[512,512,[128683,"cancel"],"f05e","M367.2 412.5L99.5 144.8c-22.4 31.4-35.5 69.8-35.5 111.2 0 106 86 192 192 192 41.5 0 79.9-13.1 111.2-35.5zm45.3-45.3c22.4-31.4 35.5-69.8 35.5-111.2 0-106-86-192-192-192-41.5 0-79.9 13.1-111.2 35.5L412.5 367.2zM0 256a256 256 0 1 1 512 0 256 256 0 1 1 -512 0z"]},Z3={prefix:"fas",iconName:"palette",icon:[512,512,[127912],"f53f","M512 256c0 .9 0 1.8 0 2.7-.4 36.5-33.6 61.3-70.1 61.3L344 320c-26.5 0-48 21.5-48 48 0 3.4 .4 6.7 1 9.9 2.1 10.2 6.5 20 10.8 29.9 6.1 13.8 12.1 27.5 12.1 42 0 31.8-21.6 60.7-53.4 62-3.5 .1-7 .2-10.6 .2-141.4 0-256-114.6-256-256S114.6 0 256 0 512 114.6 512 256zM128 288a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm0-96a32 32 0 1 0 0-64 32 32 0 1 0 0 64zM288 96a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zm96 96a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]},T7={prefix:"fas",iconName:"eye",icon:[576,512,[128065],"f06e","M288 32c-80.8 0-145.5 36.8-192.6 80.6-46.8 43.5-78.1 95.4-93 131.1-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64-11.5 0-22.3-3-31.7-8.4-1 10.9-.1 22.1 2.9 33.2 13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-12.2-45.7-55.5-74.8-101.1-70.8 5.3 9.3 8.4 20.1 8.4 31.7z"]},E7={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M136.7 5.9L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-8.7-26.1C306.9-7.2 294.7-16 280.9-16L167.1-16c-13.8 0-26 8.8-30.4 21.9zM416 144L32 144 53.1 467.1C54.7 492.4 75.7 512 101 512L347 512c25.3 0 46.3-19.6 47.9-44.9L416 144z"]},cle={prefix:"fas",iconName:"receipt",icon:[384,512,[129534],"f543","M14 2.2C22.5-1.7 32.5-.3 39.6 5.8L80 40.4 120.4 5.8c9-7.7 22.3-7.7 31.2 0L192 40.4 232.4 5.8c9-7.7 22.2-7.7 31.2 0L304 40.4 344.4 5.8c7.1-6.1 17.1-7.5 25.6-3.6S384 14.6 384 24l0 464c0 9.4-5.5 17.9-14 21.8s-18.5 2.5-25.6-3.6l-40.4-34.6-40.4 34.6c-9 7.7-22.2 7.7-31.2 0l-40.4-34.6-40.4 34.6c-9 7.7-22.3 7.7-31.2 0L80 471.6 39.6 506.2c-7.1 6.1-17.1 7.5-25.6 3.6S0 497.4 0 488L0 24C0 14.6 5.5 6.1 14 2.2zM104 136c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0zM80 352c0 13.3 10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0c-13.3 0-24 10.7-24 24zm24-120c-13.3 0-24 10.7-24 24s10.7 24 24 24l176 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-176 0z"]},A7={prefix:"fas",iconName:"chevron-up",icon:[448,512,[],"f077","M201.4 105.4c12.5-12.5 32.8-12.5 45.3 0l192 192c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L224 173.3 54.6 342.6c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3l192-192z"]},qu={prefix:"fas",iconName:"clock",icon:[512,512,[128339,"clock-four"],"f017","M256 0a256 256 0 1 1 0 512 256 256 0 1 1 0-512zM232 120l0 136c0 8 4 15.5 10.7 20l96 64c11 7.4 25.9 4.4 33.3-6.7s4.4-25.9-6.7-33.3L280 243.2 280 120c0-13.3-10.7-24-24-24s-24 10.7-24 24z"]},ule={prefix:"fas",iconName:"paper-plane",icon:[576,512,[61913],"f1d8","M536.4-26.3c9.8-3.5 20.6-1 28 6.3s9.8 18.2 6.3 28l-178 496.9c-5 13.9-18.1 23.1-32.8 23.1-14.2 0-27-8.6-32.3-21.7l-64.2-158c-4.5-11-2.5-23.6 5.2-32.6l94.5-112.4c5.1-6.1 4.7-15-.9-20.6s-14.6-6-20.6-.9L229.2 276.1c-9.1 7.6-21.6 9.6-32.6 5.2L38.1 216.8c-13.1-5.3-21.7-18.1-21.7-32.3 0-14.7 9.2-27.8 23.1-32.8l496.9-178z"]},dle={prefix:"fas",iconName:"chevron-right",icon:[320,512,[9002],"f054","M311.1 233.4c12.5 12.5 12.5 32.8 0 45.3l-192 192c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L243.2 256 73.9 86.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l192 192z"]},fle={prefix:"fas",iconName:"fire",icon:[448,512,[128293],"f06d","M160.5-26.4c9.3-7.8 23-7.5 31.9 .9 12.3 11.6 23.3 24.4 33.9 37.4 13.5 16.5 29.7 38.3 45.3 64.2 5.2-6.8 10-12.8 14.2-17.9 1.1-1.3 2.2-2.7 3.3-4.1 7.9-9.8 17.7-22.1 30.8-22.1 13.4 0 22.8 11.9 30.8 22.1 1.3 1.7 2.6 3.3 3.9 4.8 10.3 12.4 24 30.3 37.7 52.4 27.2 43.9 55.6 106.4 55.6 176.6 0 123.7-100.3 224-224 224S0 411.7 0 288c0-91.1 41.1-170 80.5-225 19.9-27.7 39.7-49.9 54.6-65.1 8.2-8.4 16.5-16.7 25.5-24.2zM225.7 416c25.3 0 47.7-7 68.8-21 42.1-29.4 53.4-88.2 28.1-134.4-4.5-9-16-9.6-22.5-2l-25.2 29.3c-6.6 7.6-18.5 7.4-24.7-.5-17.3-22.1-49.1-62.4-65.3-83-5.4-6.9-15.2-8-21.5-1.9-18.3 17.8-51.5 56.8-51.5 104.3 0 68.6 50.6 109.2 113.7 109.2z"]},$7={prefix:"fas",iconName:"users",icon:[640,512,[],"f0c0","M320 16a104 104 0 1 1 0 208 104 104 0 1 1 0-208zM96 88a72 72 0 1 1 0 144 72 72 0 1 1 0-144zM0 416c0-70.7 57.3-128 128-128 12.8 0 25.2 1.9 36.9 5.4-32.9 36.8-52.9 85.4-52.9 138.6l0 16c0 11.4 2.4 22.2 6.7 32L32 480c-17.7 0-32-14.3-32-32l0-32zm521.3 64c4.3-9.8 6.7-20.6 6.7-32l0-16c0-53.2-20-101.8-52.9-138.6 11.7-3.5 24.1-5.4 36.9-5.4 70.7 0 128 57.3 128 128l0 32c0 17.7-14.3 32-32 32l-86.7 0zM472 160a72 72 0 1 1 144 0 72 72 0 1 1 -144 0zM160 432c0-88.4 71.6-160 160-160s160 71.6 160 160l0 16c0 17.7-14.3 32-32 32l-256 0c-17.7 0-32-14.3-32-32l0-16z"]},z7={prefix:"fas",iconName:"location-arrow",icon:[512,512,[],"f124","M477.9 75.5c4.5-11.8 1.7-25.2-7.2-34.1s-22.3-11.8-34.1-7.2l-416 160C7.9 199-.3 211.2 0 224.7s9.1 25.4 21.9 29.6l176.8 58.9 58.9 176.8c4.3 12.8 16.1 21.6 29.6 21.9s25.7-7.9 30.6-20.5l160-416z"]},ple={prefix:"fas",iconName:"video",icon:[576,512,["video-camera"],"f03d","M96 64c-35.3 0-64 28.7-64 64l0 256c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L96 64zM464 336l73.5 58.8c4.2 3.4 9.4 5.2 14.8 5.2 13.1 0 23.7-10.6 23.7-23.7l0-240.6c0-13.1-10.6-23.7-23.7-23.7-5.4 0-10.6 1.8-14.8 5.2L464 176 464 336z"]},mle={prefix:"fas",iconName:"utensils",icon:[512,512,[127860,61685,"cutlery"],"f2e7","M63.9 14.4C63.1 6.2 56.2 0 48 0s-15.1 6.2-16 14.3L17.9 149.7c-1.3 6-1.9 12.1-1.9 18.2 0 45.9 35.1 83.6 80 87.7L96 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-224.4c44.9-4.1 80-41.8 80-87.7 0-6.1-.6-12.2-1.9-18.2L223.9 14.3C223.1 6.2 216.2 0 208 0s-15.1 6.2-15.9 14.4L178.5 149.9c-.6 5.7-5.4 10.1-11.1 10.1-5.8 0-10.6-4.4-11.2-10.2L143.9 14.6C143.2 6.3 136.3 0 128 0s-15.2 6.3-15.9 14.6L99.8 149.8c-.5 5.8-5.4 10.2-11.2 10.2-5.8 0-10.6-4.4-11.1-10.1L63.9 14.4zM448 0C432 0 320 32 320 176l0 112c0 35.3 28.7 64 64 64l32 0 0 128c0 17.7 14.3 32 32 32s32-14.3 32-32l0-448c0-17.7-14.3-32-32-32z"]},hle={prefix:"fas",iconName:"circle-xmark",icon:[512,512,[61532,"times-circle","xmark-circle"],"f057","M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM167 167c9.4-9.4 24.6-9.4 33.9 0l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9z"]},bx={prefix:"fas",iconName:"user-clock",icon:[576,512,[],"f4fd","M224 8a120 120 0 1 1 0 240 120 120 0 1 1 0-240zM194.3 304l59.4 0c3.9 0 7.9 .1 11.8 .4-16.2 28.2-25.5 60.8-25.5 95.6 0 41.8 13.4 80.5 36 112L45.7 512C29.3 512 16 498.7 16 482.3 16 383.8 95.8 304 194.3 304zM288 400a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-80c-8.8 0-16 7.2-16 16l0 64c0 8.8 7.2 16 16 16l48 0c8.8 0 16-7.2 16-16s-7.2-16-16-16l-32 0 0-48c0-8.8-7.2-16-16-16z"]},gle={prefix:"fas",iconName:"image",icon:[448,512,[],"f03e","M64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32zm64 80a48 48 0 1 1 0 96 48 48 0 1 1 0-96zM272 224c8.4 0 16.1 4.4 20.5 11.5l88 144c4.5 7.4 4.7 16.7 .5 24.3S368.7 416 360 416L88 416c-8.9 0-17.2-5-21.3-12.9s-3.5-17.5 1.6-24.8l56-80c4.5-6.4 11.8-10.2 19.7-10.2s15.2 3.8 19.7 10.2l26.4 37.8 61.4-100.5c4.4-7.1 12.1-11.5 20.5-11.5z"]},vle={prefix:"fas",iconName:"user-plus",icon:[640,512,[],"f234","M285.7 304c98.5 0 178.3 79.8 178.3 178.3 0 16.4-13.3 29.7-29.7 29.7L77.7 512C61.3 512 48 498.7 48 482.3 48 383.8 127.8 304 226.3 304l59.4 0zM528 80c13.3 0 24 10.7 24 24l0 48 48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0 0 48c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-48-48 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0 0-48c0-13.3 10.7-24 24-24zM256 248a120 120 0 1 1 0-240 120 120 0 1 1 0 240z"]},R7={prefix:"fas",iconName:"link",icon:[576,512,[128279,"chain"],"f0c1","M419.5 96c-16.6 0-32.7 4.5-46.8 12.7-15.8-16-34.2-29.4-54.5-39.5 28.2-24 64.1-37.2 101.3-37.2 86.4 0 156.5 70 156.5 156.5 0 41.5-16.5 81.3-45.8 110.6l-71.1 71.1c-29.3 29.3-69.1 45.8-110.6 45.8-86.4 0-156.5-70-156.5-156.5 0-1.5 0-3 .1-4.5 .5-17.7 15.2-31.6 32.9-31.1s31.6 15.2 31.1 32.9c0 .9 0 1.8 0 2.6 0 51.1 41.4 92.5 92.5 92.5 24.5 0 48-9.7 65.4-27.1l71.1-71.1c17.3-17.3 27.1-40.9 27.1-65.4 0-51.1-41.4-92.5-92.5-92.5zM275.2 173.3c-1.9-.8-3.8-1.9-5.5-3.1-12.6-6.5-27-10.2-42.1-10.2-24.5 0-48 9.7-65.4 27.1L91.1 258.2c-17.3 17.3-27.1 40.9-27.1 65.4 0 51.1 41.4 92.5 92.5 92.5 16.5 0 32.6-4.4 46.7-12.6 15.8 16 34.2 29.4 54.6 39.5-28.2 23.9-64 37.2-101.3 37.2-86.4 0-156.5-70-156.5-156.5 0-41.5 16.5-81.3 45.8-110.6l71.1-71.1c29.3-29.3 69.1-45.8 110.6-45.8 86.6 0 156.5 70.6 156.5 156.9 0 1.3 0 2.6 0 3.9-.4 17.7-15.1 31.6-32.8 31.2s-31.6-15.1-31.2-32.8c0-.8 0-1.5 0-2.3 0-33.7-18-63.3-44.8-79.6z"]},M7={prefix:"fas",iconName:"bicycle",icon:[640,512,[128690],"f206","M331.7 43.3C336 36.3 343.7 32 352 32l104 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-65.6 0 72.2 148.4c10.7-2.9 21.9-4.4 33.4-4.4 70.7 0 128 57.3 128 128s-57.3 128-128 128-128-57.3-128-128c0-42 20.2-79.2 51.4-102.6l-20.4-41.9-73.5 147c-2.3 4.8-6.3 8.8-11.4 11.2-.6 .3-1.2 .5-1.8 .7-2.9 1.1-5.9 1.6-8.9 1.5L271 368c-7.9 63.1-61.7 112-127 112-70.7 0-128-57.3-128-128S73.3 224 144 224c10.8 0 21.2 1.3 31.2 3.8l28.5-56.9-11.5-26.9-40.2 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l56 0c9.6 0 18.3 5.7 22.1 14.5l14.3 33.5 123.7 0-37.7-77.5c-3.6-7.4-3.2-16.2 1.2-23.2zM228.5 228.7l-45.6 91.3 84.8 0-39.1-91.3zM305.7 287l47.5-95-88.2 0 40.7 95zm168.7 75.5l-29.7-61c-12.8 13-20.7 30.8-20.7 50.5 0 39.8 32.2 72 72 72s72-32.2 72-72-32.2-72-72-72c-2.7 0-5.5 .2-8.1 .5l29.7 61c5.8 11.9 .8 26.3-11.1 32.1s-26.3 .8-32.1-11.1zM149.2 368c-20.2 0-33.4-21.3-24.3-39.4l24.2-48.5c-1.7-.1-3.4-.2-5.1-.2-39.8 0-72 32.2-72 72s32.2 72 72 72c34.3 0 62.9-23.9 70.2-56l-65 0z"]},yle={prefix:"fas",iconName:"bell-concierge",icon:[512,512,[128718,"concierge-bell"],"f562","M216 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l16 0 0 33.3C124.8 156.7 40.2 243.7 32.6 352l446.9 0C471.8 243.7 387.2 156.7 280 145.3l0-33.3 16 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zM24 400c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24s-10.7-24-24-24L24 400z"]},Ta={prefix:"fas",iconName:"check",icon:[448,512,[10003,10004],"f00c","M434.8 70.1c14.3 10.4 17.5 30.4 7.1 44.7l-256 352c-5.5 7.6-14 12.3-23.4 13.1s-18.5-2.7-25.1-9.3l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l101.5 101.5 234-321.7c10.4-14.3 30.4-17.5 44.7-7.1z"]},xx={prefix:"fas",iconName:"user",icon:[448,512,[128100,62144,62470,"user-alt","user-large"],"f007","M224 248a120 120 0 1 0 0-240 120 120 0 1 0 0 240zm-29.7 56C95.8 304 16 383.8 16 482.3 16 498.7 29.3 512 45.7 512l356.6 0c16.4 0 29.7-13.3 29.7-29.7 0-98.5-79.8-178.3-178.3-178.3l-59.4 0z"]},ble={prefix:"fas",iconName:"tags",icon:[576,512,[],"f02c","M401.2 39.1L549.4 189.4c27.7 28.1 27.7 73.1 0 101.2L393 448.9c-9.3 9.4-24.5 9.5-33.9 .2s-9.5-24.5-.2-33.9L515.3 256.8c9.2-9.3 9.2-24.4 0-33.7L367 72.9c-9.3-9.4-9.2-24.6 .2-33.9s24.6-9.2 33.9 .2zM32.1 229.5L32.1 96c0-35.3 28.7-64 64-64l133.5 0c17 0 33.3 6.7 45.3 18.7l144 144c25 25 25 65.5 0 90.5L285.4 418.7c-25 25-65.5 25-90.5 0l-144-144c-12-12-18.7-28.3-18.7-45.3zm144-85.5a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"]},xle={prefix:"fas",iconName:"circle-check",icon:[512,512,[61533,"check-circle"],"f058","M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zM374 145.7c-10.7-7.8-25.7-5.4-33.5 5.3L221.1 315.2 169 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.8 7.5 18.8 7s13.4-4.1 17.5-9.8L379.3 179.2c7.8-10.7 5.4-25.7-5.3-33.5z"]},Sle={prefix:"fas",iconName:"pen",icon:[512,512,[128394],"f304","M352.9 21.2L308 66.1 445.9 204 490.8 159.1C504.4 145.6 512 127.2 512 108s-7.6-37.6-21.2-51.1L455.1 21.2C441.6 7.6 423.2 0 404 0s-37.6 7.6-51.1 21.2zM274.1 100L58.9 315.1c-10.7 10.7-18.5 24.1-22.6 38.7L.9 481.6c-2.3 8.3 0 17.3 6.2 23.4s15.1 8.5 23.4 6.2l127.8-35.5c14.6-4.1 27.9-11.8 38.7-22.6L412 237.9 274.1 100z"]},wle={prefix:"fas",iconName:"phone",icon:[512,512,[128222,128379],"f095","M160.2 25C152.3 6.1 131.7-3.9 112.1 1.4l-5.5 1.5c-64.6 17.6-119.8 80.2-103.7 156.4 37.1 175 174.8 312.7 349.8 349.8 76.3 16.2 138.8-39.1 156.4-103.7l1.5-5.5c5.4-19.7-4.7-40.3-23.5-48.1l-97.3-40.5c-16.5-6.9-35.6-2.1-47 11.8l-38.6 47.2C233.9 335.4 177.3 277 144.8 205.3L189 169.3c13.9-11.3 18.6-30.4 11.8-47L160.2 25z"]},I7={prefix:"fas",iconName:"chevron-down",icon:[448,512,[],"f078","M201.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 338.7 54.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"]},kle={prefix:"fas",iconName:"hourglass-half",icon:[384,512,["hourglass-2"],"f252","M32 0C14.3 0 0 14.3 0 32S14.3 64 32 64l0 11c0 42.4 16.9 83.1 46.9 113.1l67.9 67.9-67.9 67.9C48.9 353.9 32 394.6 32 437l0 11c-17.7 0-32 14.3-32 32s14.3 32 32 32l320 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l0-11c0-42.4-16.9-83.1-46.9-113.1l-67.9-67.9 67.9-67.9c30-30 46.9-70.7 46.9-113.1l0-11c17.7 0 32-14.3 32-32S369.7 0 352 0L32 0zM96 75l0-11 192 0 0 11c0 19-5.6 37.4-16 53L112 128c-10.3-15.6-16-34-16-53zm16 309c3.5-5.3 7.6-10.3 12.1-14.9l67.9-67.9 67.9 67.9c4.6 4.6 8.6 9.6 12.2 14.9L112 384z"]},Cle={prefix:"fas",iconName:"credit-card",icon:[512,512,[128179,62083,"credit-card-alt"],"f09d","M0 128l0 32 512 0 0-32c0-35.3-28.7-64-64-64L64 64C28.7 64 0 92.7 0 128zm0 80L0 384c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-176-512 0zM64 360c0-13.3 10.7-24 24-24l48 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-48 0c-13.3 0-24-10.7-24-24zm144 0c0-13.3 10.7-24 24-24l64 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-64 0c-13.3 0-24-10.7-24-24z"]},jle={prefix:"fas",iconName:"chevron-left",icon:[320,512,[9001],"f053","M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l192 192c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L77.3 256 246.6 86.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-192 192z"]},$p={prefix:"fas",iconName:"star",icon:[576,512,[11088,61446],"f005","M309.5-18.9c-4.1-8-12.4-13.1-21.4-13.1s-17.3 5.1-21.4 13.1L193.1 125.3 33.2 150.7c-8.9 1.4-16.3 7.7-19.1 16.3s-.5 18 5.8 24.4l114.4 114.5-25.2 159.9c-1.4 8.9 2.3 17.9 9.6 23.2s16.9 6.1 25 2L288.1 417.6 432.4 491c8 4.1 17.7 3.3 25-2s11-14.2 9.6-23.2L441.7 305.9 556.1 191.4c6.4-6.4 8.6-15.8 5.8-24.4s-10.1-14.9-19.1-16.3L383 125.3 309.5-18.9z"]},Fm={prefix:"fas",iconName:"triangle-exclamation",icon:[512,512,[9888,"exclamation-triangle","warning"],"f071","M256 0c14.7 0 28.2 8.1 35.2 21l216 400c6.7 12.4 6.4 27.4-.8 39.5S486.1 480 472 480L40 480c-14.1 0-27.2-7.4-34.4-19.5s-7.5-27.1-.8-39.5l216-400c7-12.9 20.5-21 35.2-21zm0 352a32 32 0 1 0 0 64 32 32 0 1 0 0-64zm0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.5 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"]},Bm={prefix:"fas",iconName:"shield-halved",icon:[512,512,["shield-alt"],"f3ed","M256 0c4.6 0 9.2 1 13.4 2.9L457.8 82.8c22 9.3 38.4 31 38.3 57.2-.5 99.2-41.3 280.7-213.6 363.2-16.7 8-36.1 8-52.8 0-172.4-82.5-213.1-264-213.6-363.2-.1-26.2 16.3-47.9 38.3-57.2L242.7 2.9C246.9 1 251.4 0 256 0zm0 66.8l0 378.1c138-66.8 175.1-214.8 176-303.4l-176-74.6 0 0z"]},Ple={prefix:"fas",iconName:"check-double",icon:[384,512,[],"f560","M249.9 66.8c10.4-14.3 7.2-34.3-7.1-44.7s-34.3-7.2-44.7 7.1l-106 145.7-37.5-37.5c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l64 64c6.6 6.6 15.8 10 25.1 9.3s17.9-5.5 23.4-13.1l128-176zm128 136c10.4-14.3 7.2-34.3-7.1-44.7s-34.3-7.2-44.7 7.1l-170 233.7-69.5-69.5c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l96 96c6.6 6.6 15.8 10 25.1 9.3s17.9-5.5 23.4-13.1l192-264z"]},Sx={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 64c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 160-160 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l160 0 0 160c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160 160 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-160 0 0-160z"]},L7={prefix:"fas",iconName:"box",icon:[448,512,[128230],"f466","M335.1 16c20.7 0 40.1 10 52.1 26.8l48.9 68.5c7.7 10.8 11.9 23.9 11.9 37.2L448 416c0 35.3-28.7 64-64 64l-320 0-6.5-.3C25.2 476.4 0 449.1 0 416L0 148.5c0-11.7 3.2-23.1 9.2-33l2.7-4.2 48.9-68.5c10.5-14.7 26.7-24.2 44.4-26.3l7.7-.5 222.1 0zM248 128l121.3 0-34.3-48-87.1 0 0 48zM78.7 128l121.3 0 0-48-87.1 0-34.3 48z"]},N7={prefix:"fas",iconName:"link-slash",icon:[576,512,["chain-broken","chain-slash","unlink"],"f127","M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-122-122c4.2-3.4 8.3-7.1 12.1-10.9l71.1-71.1c29.3-29.3 45.8-69.1 45.8-110.6 0-86.4-70-156.5-156.5-156.5-37.3 0-73.1 13.3-101.3 37.2 20.3 10.1 38.7 23.5 54.5 39.5 14.1-8.3 30.2-12.7 46.8-12.7 51.1 0 92.5 41.4 92.5 92.5 0 24.5-9.7 48-27.1 65.4l-71.1 71.1c-3.9 3.9-8.1 7.4-12.6 10.5l-47.5-47.5c16.5-.9 29.7-14.4 30.2-31.1 0-1.3 0-2.6 0-3.9 0-86.3-69.9-156.9-156.5-156.9-19.2 0-37.9 3.5-55.5 10.2L41-24.9zM225.9 160c.6 0 1.1 0 1.7 0 15.1 0 29.5 3.7 42.1 10.2 1.8 1.2 3.6 2.3 5.5 3.1 26.8 16.3 44.8 45.9 44.8 79.6 0 .4 0 .8 0 1.2L225.9 160zM346.2 416L192 261.8c1.2 84.6 69.6 152.9 154.1 154.1zM139.7 209.5l-45.3-45.3-48.6 48.6c-29.3 29.3-45.8 69.1-45.8 110.6 0 86.4 70 156.5 156.5 156.5 37.2 0 73.1-13.3 101.3-37.2-20.3-10.1-38.8-23.5-54.6-39.5-14 8.2-30.1 12.6-46.7 12.6-51.1 0-92.5-41.4-92.5-92.5 0-24.5 9.7-48 27.1-65.4l48.6-48.6z"]},_le={prefix:"fas",iconName:"arrow-rotate-right",icon:[512,512,[8635,"arrow-right-rotate","arrow-rotate-forward","redo"],"f01e","M436.7 74.7L448 85.4 448 32c0-17.7 14.3-32 32-32s32 14.3 32 32l0 128c0 17.7-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l47.9 0-7.6-7.2c-.2-.2-.4-.4-.6-.6-75-75-196.5-75-271.5 0s-75 196.5 0 271.5 196.5 75 271.5 0c8.2-8.2 15.5-16.9 21.9-26.1 10.1-14.5 30.1-18 44.6-7.9s18 30.1 7.9 44.6c-8.5 12.2-18.2 23.8-29.1 34.7-100 100-262.1 100-362 0S-25 175 75 75c99.9-99.9 261.7-100 361.7-.3z"]},D7={prefix:"fas",iconName:"eye-slash",icon:[576,512,[],"f070","M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-96.4-96.4c2.7-2.4 5.4-4.8 8-7.2 46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6-56.8 0-105.6 18.2-146 44.2L41-24.9zM204.5 138.7c23.5-16.8 52.4-26.7 83.5-26.7 79.5 0 144 64.5 144 144 0 31.1-9.9 59.9-26.7 83.5l-34.7-34.7c12.7-21.4 17-47.7 10.1-73.7-13.7-51.2-66.4-81.6-117.6-67.9-8.6 2.3-16.7 5.7-24 10l-34.7-34.7zM325.3 395.1c-11.9 3.2-24.4 4.9-37.3 4.9-79.5 0-144-64.5-144-144 0-12.9 1.7-25.4 4.9-37.3L69.4 139.2c-32.6 36.8-55 75.8-66.9 104.5-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6 37.3 0 71.2-7.9 101.5-20.6l-64.2-64.2z"]},zp={prefix:"fas",iconName:"arrow-rotate-left",icon:[512,512,[8634,"arrow-left-rotate","arrow-rotate-back","arrow-rotate-backward","undo"],"f0e2","M256 64c-56.8 0-107.9 24.7-143.1 64l47.1 0c17.7 0 32 14.3 32 32s-14.3 32-32 32L32 192c-17.7 0-32-14.3-32-32L0 32C0 14.3 14.3 0 32 0S64 14.3 64 32l0 54.7C110.9 33.6 179.5 0 256 0 397.4 0 512 114.6 512 256S397.4 512 256 512c-87 0-163.9-43.4-210.1-109.7-10.1-14.5-6.6-34.4 7.9-44.6s34.4-6.6 44.6 7.9c34.8 49.8 92.4 82.3 157.6 82.3 106 0 192-86 192-192S362 64 256 64z"]},Tle={prefix:"fas",iconName:"desktop",icon:[512,512,[128421,61704,"desktop-alt"],"f390","M64 32C28.7 32 0 60.7 0 96L0 352c0 35.3 28.7 64 64 64l144 0-16 48-72 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l272 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-72 0-16-48 144 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64L64 32zM96 96l320 0c17.7 0 32 14.3 32 32l0 160c0 17.7-14.3 32-32 32L96 320c-17.7 0-32-14.3-32-32l0-160c0-17.7 14.3-32 32-32z"]},Ele={prefix:"fas",iconName:"arrow-down",icon:[384,512,[8595],"f063","M169.4 502.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 402.7 224 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 370.7-105.4-105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]},Vm={prefix:"fas",iconName:"location-dot",icon:[384,512,["map-marker-alt"],"f3c5","M0 188.6C0 84.4 86 0 192 0S384 84.4 384 188.6c0 119.3-120.2 262.3-170.4 316.8-11.8 12.8-31.5 12.8-43.3 0-50.2-54.5-170.4-197.5-170.4-316.8zM192 256a64 64 0 1 0 0-128 64 64 0 1 0 0 128z"]},wx={prefix:"fas",iconName:"route",icon:[512,512,[],"f4d7","M512 96c0 50.2-59.1 125.1-84.6 155-3.8 4.4-9.4 6.1-14.5 5L320 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l96 0c53 0 96 43 96 96s-43 96-96 96l-276.4 0c8.7-9.9 19.3-22.6 30-36.8 6.3-8.4 12.8-17.6 19-27.2L416 448c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0c-53 0-96-43-96-96s43-96 96-96l39.8 0c-21-31.5-39.8-67.7-39.8-96 0-53 43-96 96-96s96 43 96 96zM117.1 489.1c-3.8 4.3-7.2 8.1-10.1 11.3l-1.8 2-.2-.2c-6 4.6-14.6 4-20-1.8-25.2-27.4-85-97.9-85-148.4 0-53 43-96 96-96s96 43 96 96c0 30-21.1 67-43.5 97.9-10.7 14.7-21.7 28-30.8 38.5l-.6 .7zM128 352a32 32 0 1 0 -64 0 32 32 0 1 0 64 0zM416 128a32 32 0 1 0 0-64 32 32 0 1 0 0 64z"]},Ale={prefix:"fas",iconName:"file-export",icon:[576,512,["arrow-right-from-file"],"f56e","M96.5 0c-35.3 0-64 28.7-64 64l0 384c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-96 78.1 0-31 31c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l72-72c9.4-9.4 9.4-24.6 0-33.9l-72-72c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l31 31-78.1 0 0-133.5c0-17-6.7-33.3-18.7-45.3L291.2 18.7C279.2 6.7 263 0 246 0L96.5 0zM358 176l-93.5 0c-13.3 0-24-10.7-24-24L240.5 58.5 358 176zM224.5 328c0-13.3 10.7-24 24-24l104 0 0 48-104 0c-13.3 0-24-10.7-24-24z"]},$le={prefix:"fas",iconName:"arrows-rotate",icon:[512,512,[128472,"refresh","sync"],"f021","M65.9 228.5c13.3-93 93.4-164.5 190.1-164.5 53 0 101 21.5 135.8 56.2 .2 .2 .4 .4 .6 .6l7.6 7.2-47.9 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l128 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 53.4-11.3-10.7C390.5 28.6 326.5 0 256 0 127 0 20.3 95.4 2.6 219.5 .1 237 12.2 253.2 29.7 255.7s33.7-9.7 36.2-27.1zm443.5 64c2.5-17.5-9.7-33.7-27.1-36.2s-33.7 9.7-36.2 27.1c-13.3 93-93.4 164.5-190.1 164.5-53 0-101-21.5-135.8-56.2-.2-.2-.4-.4-.6-.6l-7.6-7.2 47.9 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 320c-8.5 0-16.7 3.4-22.7 9.5S-.1 343.7 0 352.3l1 127c.1 17.7 14.6 31.9 32.3 31.7S65.2 496.4 65 478.7l-.4-51.5 10.7 10.1c46.3 46.1 110.2 74.7 180.7 74.7 129 0 235.7-95.4 253.4-219.5z"]},zle=$le;const $={bg:"#0a0a0a",card:"#1e1e1e",border:"#333333",text:"rgba(255,255,255,.87)",text2:"rgba(255,255,255,.6)",text3:"rgba(255,255,255,.4)",accent:"#7c3aed",accentLight:"#8b5cf6",secondary:"#22d3ee",success:"#4ade80",danger:"#ef4444",warning:"#f59e0b",info:"#3b82f6"};function It({children:e}){return s.jsx(se,{bg:$.bg,borderRadius:"24px",p:"14px",maxW:"380px",mx:"auto",boxShadow:"0 30px 60px -20px rgba(60,20,110,.45)",border:"1px solid",borderColor:"whiteAlpha.100",children:s.jsx(se,{bg:$.bg,borderRadius:"16px",p:"16px 14px 20px",minH:"220px",children:e})})}function bn({title:e,subtitle:t,action:n}){return s.jsxs(kt,{justify:"space-between",align:"flex-start",mb:4,children:[s.jsxs(se,{children:[s.jsx(Z,{color:$.text,fontSize:"1rem",fontWeight:"800",mb:0,children:e}),t&&s.jsx(Z,{color:$.text3,fontSize:"0.72rem",children:t})]}),n]})}function We({children:e,mb:t=2.5,onClick:n,active:r=!1}){return s.jsx(se,{bg:$.card,border:"1px solid",borderColor:r?$.accent:$.border,borderRadius:"12px",p:3,mb:t,cursor:n?"pointer":void 0,transition:"border-color .15s, transform .1s",onClick:n,_hover:n?{borderColor:$.accentLight}:void 0,_active:n?{transform:"scale(0.99)"}:void 0,children:e})}function Ke({icon:e,value:t,label:n,color:r=$.accentLight}){return s.jsxs(se,{bg:$.card,border:"1px solid",borderColor:$.border,borderRadius:"12px",p:2.5,children:[s.jsx(kt,{w:"26px",h:"26px",borderRadius:"full",align:"center",justify:"center",bg:`${r}30`,mb:2,children:s.jsx(Oe,{icon:e,style:{color:r,fontSize:"0.7rem"}})}),s.jsx(Z,{color:$.text,fontSize:"1.15rem",fontWeight:"800",lineHeight:"1",children:t}),s.jsx(Z,{color:$.text3,fontSize:"0.62rem",mt:1,textTransform:"uppercase",letterSpacing:"0.02em",children:n})]})}function Y({children:e,variant:t="primary",mono:n=!1,size:r}){const i={primary:$.text,secondary:$.text2,muted:$.text3,success:$.success,danger:$.danger};return s.jsx(Z,{color:i[t],fontSize:r??"0.78rem",fontFamily:n?"mono":void 0,as:"span",children:e})}function Ct({children:e}){return s.jsx(ge,{justify:"space-between",align:"center",children:e})}function Rle({value:e,color:t=$.accent}){return s.jsx(kp,{value:e,size:"xs",borderRadius:"full",mt:1,sx:{"& > div":{background:t,transition:"width .4s ease"},background:"#2a2a2a"}})}function ll({color:e,size:t="9px"}){return s.jsx(se,{as:"span",display:"inline-block",w:t,h:t,borderRadius:"full",bg:e,mr:1.5,flexShrink:0})}function O7({icon:e,color:t,size:n="0.75rem"}){return s.jsx(Oe,{icon:e,style:{color:t??$.text2,fontSize:n,marginRight:6}})}function je({children:e,tone:t="outline",icon:n,onClick:r,isActive:i=!1}){const o={accent:{bg:$.accent,color:"white",border:"none"},outline:{bg:"transparent",color:$.text2,border:`1px solid ${$.border}`},outlineDanger:{bg:"transparent",color:$.danger,border:`1px solid ${$.danger}`},success:{bg:$.success,color:"#0a0a0a",border:"none"}}[t];return s.jsxs(se,{as:"button",type:"button",display:"inline-flex",alignItems:"center",borderRadius:"8px",px:3,py:1.5,fontSize:"0.68rem",fontWeight:"700",cursor:r?"pointer":"default",transition:"filter .15s, transform .1s",opacity:i?1:.92,_hover:r?{filter:"brightness(1.15)"}:void 0,_active:r?{transform:"scale(0.96)"}:void 0,onClick:r,...o,children:[n&&s.jsx(Oe,{icon:n,style:{marginRight:6,fontSize:"0.68rem"}}),e]})}function kx({tabs:e,active:t,onChange:n}){return s.jsx(ge,{spacing:1.5,mb:3,flexWrap:"wrap",children:e.map(r=>{const i=r.key===t;return s.jsx(se,{as:"button",type:"button",onClick:()=>n(r.key),px:2.5,py:1,borderRadius:"999px",fontSize:"0.66rem",fontWeight:"700",cursor:"pointer",transition:"all .15s",bg:i?$.accent:"transparent",color:i?"white":$.text3,border:"1px solid",borderColor:i?$.accent:$.border,_hover:{borderColor:$.accentLight,color:i?"white":$.text2},children:r.label},r.key)})})}function Mle({value:e,onChange:t,placeholder:n}){return s.jsxs(se,{position:"relative",my:2,children:[s.jsx(Oe,{icon:sle,style:{position:"absolute",left:10,top:"50%",transform:"translateY(-50%)",color:$.text3,fontSize:"0.65rem"}}),s.jsx(se,{as:"input",value:e,onChange:r=>t(r.target.value),placeholder:n,w:"100%",bg:$.bg,border:"1px solid",borderColor:$.border,borderRadius:"8px",color:$.text,fontSize:"0.7rem",py:1.5,pl:"26px",pr:2,outline:"none"})]})}function Wm({children:e}){return s.jsx(se,{border:"1px dashed",borderColor:$.border,borderRadius:"10px",p:2.5,mt:2,children:s.jsx(Z,{color:$.text3,fontSize:"0.64rem",fontStyle:"italic",children:e})})}function Ile({isOn:e,onToggle:t}){return s.jsx(se,{as:"button",type:"button",onClick:t,w:"34px",h:"20px",borderRadius:"full",bg:e?$.accent:$.border,position:"relative",cursor:"pointer",transition:"background .2s",flexShrink:0,children:s.jsx(se,{position:"absolute",top:"2px",left:e?"16px":"2px",w:"16px",h:"16px",borderRadius:"full",bg:"white",transition:"left .2s"})})}function Lle(){const[e,t]=m.useState(!0);return s.jsxs(It,{children:[s.jsx(bn,{title:"Bonjour, Admin",subtitle:"Vue d'ensemble"}),s.jsxs(gn,{columns:2,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:L7,value:312,label:"Total commandes",color:$.accentLight}),s.jsx(Ke,{icon:qu,value:8,label:"En attente",color:$.warning}),s.jsx(Ke,{icon:z7,value:5,label:"En route",color:$.info}),s.jsx(Ke,{icon:Ta,value:299,label:"Terminées",color:$.success}),s.jsx(Ke,{icon:xx,value:184,label:"Clients",color:$.accentLight}),s.jsx(Ke,{icon:$7,value:6,label:"Livreurs",color:$.secondary})]}),s.jsxs(We,{mb:0,children:[s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(O7,{icon:yx,color:$.secondary}),"Notifications Telegram"]}),s.jsx(je,{tone:e?"outlineDanger":"accent",icon:e?N7:R7,onClick:()=>t(n=>!n),children:e?"Délier":"Lier Telegram"})]}),s.jsx(Y,{variant:"muted",size:"0.68rem",children:e?"Compte Telegram lié — alertes actives.":"Aucun compte lié — cliquez pour connecter."})]})]})}const J3=[{id:"#1042",client:"client_marie · 12 rue des Lilas",extra:"il y a 4 min",tone:"warning",label:"En attente",amount:"46,00 €"},{id:"#1041",client:"client_paul · Livreur: lucas_d",extra:"Net après parrainage",tone:"info",label:"En route",amount:"33,00 €"},{id:"#1040",client:"client_lea · 8 avenue Foch",extra:"en attente d’assignation",tone:"accent",label:"Livreur arrivé",amount:"58,50 €"}],ek=[{id:"#1038",client:"client_sam · 3 rue Victor Hugo",extra:"Terminée il y a 1 h",tone:"info",label:"Livrée",amount:"27,00 €"},{id:"#1036",client:"client_ana · 21 bd Voltaire",extra:"Terminée hier",tone:"info",label:"Livrée",amount:"41,00 €"},{id:"#1030",client:"client_marie · 5 rue de Rivoli",extra:"Terminée il y a 3 j",tone:"info",label:"Livrée",amount:"22,00 €"}],tk=[{id:"#1029",client:"client_theo · adresse introuvable",extra:"Annulée par le livreur",tone:"warning",label:"Annulée",amount:"19,00 €"}],nk={warning:$.warning,info:$.info,accent:$.accentLight};function rk({o:e,isOpen:t,onClick:n,children:r}){return s.jsxs(We,{active:t,onClick:n,children:[s.jsxs(Ct,{children:[s.jsx(Y,{mono:!0,children:e.id}),s.jsx("span",{style:{background:`${nk[e.tone]}26`,color:nk[e.tone],padding:"2px 9px",borderRadius:999,fontWeight:800,fontSize:"0.62rem"},children:e.label})]}),s.jsx(Y,{variant:"secondary",size:"0.7rem",children:e.client}),s.jsxs(Ct,{children:[s.jsx(Y,{variant:"muted",size:"0.65rem",children:e.extra}),s.jsx(Y,{variant:"primary",size:"0.75rem",children:e.amount})]}),r]})}function Nle(){const[e,t]=m.useState("#1040"),[n,r]=m.useState(null),[i,o]=m.useState(""),a=n==="approuvees"?ek:n==="annulees"?tk:[],l=m.useMemo(()=>a.filter(u=>u.client.toLowerCase().includes(i.toLowerCase())),[a,i]),c=u=>{r(d=>d===u?null:u),o("")};return s.jsxs(It,{children:[s.jsxs(Ct,{children:[s.jsx(je,{tone:"outline",icon:zle,children:"Actualiser"}),s.jsx(je,{tone:"outline",icon:Ale,children:"Export CSV"})]}),s.jsxs("div",{style:{display:"flex",gap:6,marginTop:10,marginBottom:6},children:[s.jsxs("div",{onClick:()=>c("approuvees"),style:{cursor:"pointer",flex:1,textAlign:"center",padding:"6px 4px",borderRadius:999,fontSize:"0.66rem",fontWeight:700,border:`1px solid ${n==="approuvees"?$.success:$.border}`,background:n==="approuvees"?`${$.success}22`:"transparent",color:n==="approuvees"?$.success:$.text3},children:["Approuvées (",ek.length,")"]}),s.jsxs("div",{onClick:()=>c("annulees"),style:{cursor:"pointer",flex:1,textAlign:"center",padding:"6px 4px",borderRadius:999,fontSize:"0.66rem",fontWeight:700,border:`1px solid ${n==="annulees"?$.danger:$.border}`,background:n==="annulees"?`${$.danger}22`:"transparent",color:n==="annulees"?$.danger:$.text3},children:["Annulées (",tk.length,")"]})]}),n&&s.jsxs("div",{style:{marginBottom:10},children:[s.jsx(Mle,{value:i,onChange:o,placeholder:"Rechercher par username..."}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:[l.length," résultat",l.length>1?"s":""]}),l.map(u=>s.jsx(rk,{o:u,isOpen:!1,onClick:()=>{}},u.id)),s.jsx("div",{style:{borderTop:`1px solid ${$.border}`,margin:"10px 0"}})]}),s.jsxs(Y,{size:"0.78rem",variant:"primary",children:["Commandes actives (",J3.length,")"]}),s.jsx("div",{style:{marginTop:8},children:J3.map(u=>{const d=e===u.id;return s.jsx(rk,{o:u,isOpen:d,onClick:()=>t(d?null:u.id),children:d&&s.jsxs("div",{style:{marginTop:10,paddingTop:10,borderTop:`1px solid ${$.border}`,display:"flex",gap:6,flexWrap:"wrap"},children:[s.jsx(je,{tone:"accent",icon:vx,children:"Assigner livreur"}),s.jsx(je,{tone:"outline",icon:Yv,children:"Passer en route"}),s.jsx(je,{tone:"outline",icon:_le,children:"Proposer adresse"})]})},u.id)})})]})}const ik=[{name:"lucas_d",status:"busy",queue:1,today:14,total:512,distance:"1,8 km",eta:"6 min"},{name:"emma_l",status:"available",queue:0,today:9,total:340,distance:"0,6 km",eta:"2 min"},{name:"yanis_b",status:"offline",queue:0,today:5,total:128,distance:"—",eta:"—"}],Ka={available:$.success,busy:$.warning,offline:$.text3},Dle={available:"Disponible",busy:"Occupé",offline:"Hors ligne"};function Ole(){const[e,t]=m.useState("lucas_d"),n=ik.find(r=>r.name===e);return s.jsxs(It,{children:[s.jsxs(gn,{columns:3,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:Vm,value:1,label:"Dispo",color:$.success}),s.jsx(Ke,{icon:qu,value:1,label:"Occupés",color:$.warning}),s.jsx(Ke,{icon:P7,value:1,label:"Hors ligne",color:$.text3})]}),s.jsxs(We,{children:[s.jsx("div",{style:{height:110,borderRadius:8,position:"relative",backgroundImage:"linear-gradient(135deg,#161022 25%,#1c1330 25%,#1c1330 50%,#161022 50%,#161022 75%,#1c1330 75%)",backgroundSize:"18px 18px",marginBottom:6},children:s.jsxs("span",{style:{position:"absolute",top:8,left:8,background:`${Ka[n.status]}26`,color:Ka[n.status],fontSize:"0.62rem",fontWeight:800,padding:"3px 9px",borderRadius:999},children:[s.jsx(ll,{color:Ka[n.status],size:"7px"}),n.name," — ",n.distance," · ",n.eta]})}),s.jsx(Y,{variant:"muted",size:"0.62rem",children:"Cliquez un livreur ci-dessous pour suivre son trajet en direct"})]}),ik.map(r=>{const i=r.name===e;return s.jsxs(We,{active:i,onClick:()=>t(r.name),children:[s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(ll,{color:Ka[r.status]}),r.name]}),s.jsx("span",{style:{background:`${Ka[r.status]}26`,color:Ka[r.status],fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:Dle[r.status]})]}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:[r.queue," en attente · ",r.today," aujourd'hui · ",r.total," total"]}),i&&s.jsxs("div",{style:{marginTop:8,display:"flex",gap:6},children:[s.jsx(je,{tone:"outline",icon:$p,children:"Avis"}),s.jsx(je,{tone:r.status!=="offline"?"accent":"outline",icon:wx,children:r.status!=="offline"?"Suivre l'itinéraire":"Indisponible"})]})]},r.name)})]})}const Fle=[{label:"1u",price:"12€",active:!0},{label:"3u",price:"30€",active:!0},{label:"5u",price:"45€",active:!1}];function Ble(){const[e,t]=m.useState(Fle),n=r=>{t(i=>i.map((o,a)=>a===r?{...o,active:!o.active}:o))};return s.jsxs(It,{children:[s.jsx(bn,{title:"Produits (48)",action:s.jsx(je,{tone:"accent",icon:Sx,children:"Créer"})}),s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsx(Y,{variant:"primary",size:"0.82rem",children:"Pack Découverte"}),s.jsx("span",{style:{background:`${$.accentLight}26`,color:$.accentLight,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:"Premium"})]}),s.jsxs(Y,{variant:"muted",size:"0.65rem",children:[s.jsx(Oe,{icon:gle,style:{marginRight:4}}),"3 images ·"," ",s.jsx(Oe,{icon:ple,style:{marginRight:4}}),"1 vidéo · Stock: 24 u"]}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"Cliquez un tarif pour l'activer / le désactiver"}),s.jsx("div",{style:{display:"flex",gap:6,marginTop:6,flexWrap:"wrap"},children:e.map((r,i)=>s.jsxs("div",{onClick:()=>n(i),style:{cursor:"pointer",display:"flex",alignItems:"center",gap:5,padding:"4px 9px",borderRadius:8,border:`1px solid ${$.border}`,opacity:r.active?1:.5,textDecoration:r.active?"none":"line-through"},children:[s.jsx(Oe,{icon:r.active?xle:hle,style:{color:r.active?$.success:$.danger,fontSize:"0.7rem"}}),s.jsxs("span",{style:{color:$.text,fontSize:"0.72rem"},children:[r.label," = ",r.price]})]},r.label))}),s.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[s.jsx(je,{tone:"outline",icon:Sle,children:"Modifier"}),s.jsx(je,{tone:"outlineDanger",icon:E7,children:"Supprimer"})]})]}),s.jsxs(We,{mb:0,children:[s.jsxs(Ct,{children:[s.jsx(Y,{variant:"primary",size:"0.82rem",children:"Édition Limitée"}),s.jsx("span",{style:{background:`${$.warning}26`,color:$.warning,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:"À venir"})]}),s.jsx(Y,{variant:"muted",size:"0.65rem",children:"Stock: 0 u — masqué du catalogue tant que le stock est vide"})]})]})}const Vle=[{id:"a",name:"Fleurs",color:"#10b981"},{id:"b",name:"Résines",color:"#9333ea"},{id:"c",name:"Comestibles",color:"#3dc2f7",soon:!0}];function Wle(){const[e,t]=m.useState(Vle),n=(r,i)=>{const o=r+i;o<0||o>=e.length||t(a=>{const l=[...a];return[l[r],l[o]]=[l[o],l[r]],l})};return s.jsxs(It,{children:[s.jsx(bn,{title:"Catégories",action:s.jsx(je,{tone:"accent",icon:Sx,children:"Ajouter"})}),e.map((r,i)=>s.jsx(We,{children:s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(ll,{color:r.color}),r.name,r.soon&&s.jsx("span",{style:{marginLeft:8,background:`${$.warning}26`,color:$.warning,fontSize:"0.58rem",fontWeight:800,padding:"2px 7px",borderRadius:999},children:"Prochainement"})]}),s.jsxs("div",{style:{display:"flex",gap:4},children:[s.jsx("button",{onClick:()=>n(i,-1),disabled:i===0,style:{background:"transparent",border:"none",cursor:i===0?"default":"pointer",color:i===0?$.border:$.text2,padding:4},"aria-label":"Monter",children:s.jsx(Oe,{icon:A7,style:{fontSize:"0.7rem"}})}),s.jsx("button",{onClick:()=>n(i,1),disabled:i===e.length-1,style:{background:"transparent",border:"none",cursor:i===e.length-1?"default":"pointer",color:i===e.length-1?$.border:$.text2,padding:4},"aria-label":"Descendre",children:s.jsx(Oe,{icon:I7,style:{fontSize:"0.7rem"}})})]})]})},r.id)),s.jsx(Y,{variant:"muted",size:"0.62rem",children:"Essayez les flèches ↑ / ↓ pour réordonner"})]})}function Bl({title:e,onReset:t,since:n,children:r}){return s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsx(Y,{variant:"secondary",size:"0.72rem",children:e}),t&&s.jsx(je,{tone:"outlineDanger",icon:zp,onClick:t,children:"Réinitialiser"})]}),n&&s.jsxs(Y,{variant:"muted",size:"0.58rem",children:["Depuis le ",n]}),s.jsx("div",{style:{marginTop:8},children:r})]})}function Oo({label:e,value:t,pct:n,color:r,highlight:i}){return s.jsxs("div",{style:{marginBottom:6},children:[s.jsxs(Ct,{children:[s.jsxs(Y,{variant:i?"primary":"muted",size:"0.64rem",children:[i&&s.jsx(Oe,{icon:fle,style:{color:$.warning,marginRight:4}}),e]}),s.jsx(Y,{variant:i?"primary":"muted",size:"0.64rem",children:t})]}),s.jsx(Rle,{value:n,color:i?$.warning:r})]})}const qa=["Mai 2026","Juin 2026","Juillet 2026","Août 2026"],Ule=[{day:"02/08",orders:14,revenue:"312€",best:!1},{day:"01/08",orders:22,revenue:"498€",best:!0},{day:"31/07",orders:9,revenue:"201€",best:!1}],Hle=[{key:"quantite",label:"Quantité"},{key:"commandes",label:"Commandes"},{key:"revenus",label:"Revenus"}],Gle={quantite:[{name:"Pack Découverte",value:210,display:"210"},{name:"Édition Standard",value:140,display:"140"},{name:"Format Duo",value:96,display:"96"}],commandes:[{name:"Pack Découverte",value:86,display:"86"},{name:"Édition Standard",value:54,display:"54"},{name:"Format Duo",value:41,display:"41"}],revenus:[{name:"Pack Découverte",value:1032,display:"1032€"},{name:"Édition Standard",value:648,display:"648€"},{name:"Format Duo",value:492,display:"492€"}]},$0=[{label:"10h",value:4},{label:"12h",value:18},{label:"14h",value:9},{label:"18h",value:22},{label:"20h",value:31},{label:"22h",value:12}],z0=[{label:"Lun",value:32},{label:"Mar",value:28},{label:"Mer",value:35},{label:"Jeu",value:41},{label:"Ven",value:58},{label:"Sam",value:71},{label:"Dim",value:47}],ok=[{label:"1g",value:40},{label:"3.5g",value:86},{label:"5g",value:22},{label:"10g",value:12}];function Kle(){const[e,t]=m.useState(qa.length-1),[n,r]=m.useState("revenus"),i=m.useMemo(()=>[...Gle[n]].sort((f,p)=>p.value-f.value),[n]),o=i[0].value,a=Math.max(...$0.map(f=>f.value)),l=$0.reduce((f,p)=>p.value>f.value?p:f),c=Math.max(...z0.map(f=>f.value)),u=z0.reduce((f,p)=>p.value>f.value?p:f),d=Math.max(...ok.map(f=>f.value));return s.jsxs(It,{children:[s.jsx(bn,{title:"Statistiques",subtitle:"Activité globale & produits"}),s.jsxs("div",{style:{maxHeight:560,overflowY:"auto",paddingRight:2},children:[s.jsxs(gn,{columns:2,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:cle,value:312,label:"Commandes totales",color:$.accentLight}),s.jsx(Ke,{icon:ole,value:"6,4k€",label:"Revenus (terminées)",color:$.success}),s.jsx(Ke,{icon:qu,value:"10,4",label:"Moy. commandes/jour",color:$.info}),s.jsx(Ke,{icon:Q3,value:"Samedi",label:"Jour de pointe",color:$.warning})]}),s.jsxs(We,{children:[s.jsx(Y,{variant:"secondary",size:"0.72rem",children:"Activité du jour"}),s.jsxs("div",{style:{display:"flex",gap:10,margin:"6px 0 8px"},children:[s.jsx(Y,{variant:"muted",size:"0.6rem",children:"18 commandes"}),s.jsx(Y,{variant:"muted",size:"0.6rem",children:"420g vendus"}),s.jsx(Y,{variant:"muted",size:"0.6rem",children:"312€"})]}),s.jsx(Oo,{label:"Fleurs — Pack Découverte",value:"86 · 1032€",pct:90,color:$.accent}),s.jsx(Oo,{label:"Résines — Format Duo",value:"41 · 492€",pct:45,color:$.info})]}),s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsx("button",{onClick:()=>t(f=>Math.max(0,f-1)),disabled:e===0,style:{background:"none",border:"none",cursor:e===0?"default":"pointer",color:e===0?$.border:$.text2},children:s.jsx(Oe,{icon:jle})}),s.jsx(Y,{variant:"primary",size:"0.72rem",children:qa[e]}),s.jsx("button",{onClick:()=>t(f=>Math.min(qa.length-1,f+1)),disabled:e===qa.length-1,style:{background:"none",border:"none",cursor:e===qa.length-1?"default":"pointer",color:e===qa.length-1?$.border:$.text2},children:s.jsx(Oe,{icon:dle})})]}),s.jsx(Y,{variant:"muted",size:"0.6rem",children:"Historique mensuel — cliquez les flèches"}),s.jsx("div",{style:{marginTop:8},children:Ule.map(f=>s.jsx(Oo,{label:f.day,value:`${f.orders} cmd · ${f.revenue}`,pct:f.orders/22*100,color:$.accent,highlight:f.best},f.day))})]}),s.jsx(Bl,{title:"30 derniers jours — commandes",onReset:()=>{},since:"15/07/2026",children:s.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:3,height:50},children:[4,8,6,10,7,12,9,14,6,11].map((f,p)=>s.jsx("div",{style:{flex:1,height:`${f/14*100}%`,background:$.accent,borderRadius:2}},p))})}),s.jsxs(Bl,{title:"Revenus par jour (30j)",onReset:()=>{},since:"15/07/2026",children:[s.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:3,height:50,marginBottom:6},children:[120,240,180,300,210,360,260,410,190,330].map((f,p)=>s.jsx("div",{style:{flex:1,height:`${f/410*100}%`,background:$.success,borderRadius:2}},p))}),s.jsxs(Y,{variant:"muted",size:"0.6rem",children:[s.jsx(Oe,{icon:Q3,style:{color:$.warning,marginRight:4}}),"Meilleure journée : 01/08 — 498€"]})]}),s.jsxs(Bl,{title:"Heures d'affluence",onReset:()=>{},since:"15/07/2026",children:[$0.map(f=>s.jsx(Oo,{label:f.label,value:String(f.value),pct:f.value/a*100,color:$.info,highlight:f.label===l.label},f.label)),s.jsxs(Y,{variant:"muted",size:"0.6rem",children:["Heure de pointe : ",l.label," (",l.value," commandes)"]})]}),s.jsxs(Bl,{title:"Jours d'affluence",onReset:()=>{},since:"15/07/2026",children:[z0.map(f=>s.jsx(Oo,{label:f.label,value:String(f.value),pct:f.value/c*100,color:$.accent,highlight:f.label===u.label},f.label)),s.jsxs(Y,{variant:"muted",size:"0.6rem",children:["Pic d'activité : ",u.label]})]}),s.jsx(Bl,{title:"Doses populaires — Pack Découverte",onReset:()=>{},since:"15/07/2026",children:ok.map(f=>s.jsx(Oo,{label:f.label,value:String(f.value),pct:f.value/d*100,color:$.secondary,highlight:f.value===d},f.label))}),s.jsxs(We,{mb:0,children:[s.jsxs(Ct,{children:[s.jsx(Y,{variant:"secondary",size:"0.72rem",children:"Top produits"}),s.jsx(je,{tone:"outlineDanger",icon:zp,onClick:()=>{},children:"Réinitialiser"})]}),s.jsx("div",{style:{marginTop:8},children:s.jsx(kx,{tabs:Hle,active:n,onChange:r})}),i.map((f,p)=>s.jsx(Oo,{label:f.name,value:f.display,pct:f.value/o*100,color:$.accent,highlight:p===0},f.name)),s.jsxs(Y,{variant:"muted",size:"0.6rem",children:["Moins vendu : ",i[i.length-1].name]})]})]})]})}const ak=[{name:"client_marie",role:"clients",icon:xx,tone:$.info,detail:"Cmd: 12 · Points: 340 · Parrain: +8€"},{name:"lucas_d",role:"livreurs",icon:M7,tone:$.success,detail:"512 livraisons · connecté aujourd’hui"},{name:"admin_yas",role:"admins",icon:Bm,tone:$.accentLight,detail:"Accès complet à la plateforme"}],qle=[{key:"tous",label:"Tous",icon:$7,count:3},{key:"clients",label:"Clients",icon:xx,count:1},{key:"livreurs",label:"Livreurs",icon:M7,count:1},{key:"admins",label:"Admins",icon:Bm,count:1}];function Xle(){const[e,t]=m.useState("tous"),n=e==="tous"?ak:ak.filter(r=>r.role===e);return s.jsxs(It,{children:[s.jsx(gn,{columns:4,spacing:1.5,mb:2.5,children:qle.map(r=>{const i=r.key===e;return s.jsxs("div",{onClick:()=>t(r.key),style:{cursor:"pointer",textAlign:"center",padding:"8px 2px",borderRadius:10,border:`1px solid ${i?$.accent:$.border}`,background:i?`${$.accent}22`:$.card},children:[s.jsx(Oe,{icon:r.icon,style:{color:i?$.accentLight:$.text3,fontSize:"0.75rem"}}),s.jsx("div",{style:{color:$.text,fontSize:"0.72rem",fontWeight:800,marginTop:4},children:r.count}),s.jsx("div",{style:{color:$.text3,fontSize:"0.55rem"},children:r.label})]},r.key)})}),n.map(r=>s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(Oe,{icon:r.icon,style:{color:r.tone,marginRight:6,fontSize:"0.72rem"}}),r.name]}),s.jsx("span",{style:{background:`${r.tone}26`,color:r.tone,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999,textTransform:"capitalize"},children:r.role==="clients"?"Client":r.role==="livreurs"?"Livreur":"Admin"})]}),s.jsx(Y,{variant:"muted",size:"0.65rem",children:r.detail})]},r.name))]})}const sk=[{id:"perso",icon:Z3,title:"Personnalisation",body:"Nom du shop affiché dans l’app · dégradé de couleur du titre (2 couleurs, aperçu en direct)."},{id:"amendes",icon:_7,title:"Amendes",body:"Barème par nombre d’annulations : 0 → 20€, 1 → 50€, 2 → 100€, 3 → 150€. Score affichable au client ou non.",hasSwitch:!0},{id:"parrainage",icon:vle,title:"Parrainage",body:"Active le solde de parrainage, utilisable directement au moment du paiement par le filleul.",hasSwitch:!0},{id:"points",icon:$p,title:"Système de points",body:"Créez vos propres types de points (nom + couleur), chacun avec son propre barème €→points.",hasSwitch:!0},{id:"attribution",icon:ble,title:"Attribution catégories → points",body:"Chaque catégorie de produit peut être reliée à un type de points précis, ou à aucun."},{id:"baremes",icon:$p,title:"Barème — Points Fidélité",body:"Paliers Min € / Max € / Points : ex. 0–20€ = 5 pts, 20–50€ = 15 pts, 50€+ = 40 pts."},{id:"recompense",icon:ile,title:"Récompenses par palier",body:"Seuil de points → produit offert ou à -50%. Récapitulatif généré automatiquement.",hasSwitch:!0},{id:"horaires",icon:Yv,title:"Horaires de livraison",body:"Lundi → Vendredi : 11h00–22h30 · Samedi : 12h00–23h00 · Dimanche : fermé."},{id:"zones",icon:ale,title:"Zones de livraison",body:"3 zones actives · minimum de commande et liste de codes postaux par zone, ajout en masse."},{id:"crypto",icon:Cle,title:"Paiement crypto",body:"BTC, ETH, LTC, USDT acceptés (NowPayments). Clé API et secret IPN masqués.",hasSwitch:!0},{id:"telegram",icon:ule,title:"Notifications Telegram",body:"Bot configuré — @votre_bot · authentification à deux facteurs activée.",hasSwitch:!0},{id:"mode-livraison",icon:Yv,title:"Mode de livraison",body:"« Par catégorie » : chaque livreur ne reçoit que les commandes des catégories qui lui sont assignées."},{id:"couleurs",icon:Z3,title:"Couleurs de l'interface",body:"Palette séparée pour l’espace admin et pour l’app client — 5 couleurs, restaurables en un clic."}];function Yle(){const[e,t]=m.useState("crypto"),[n,r]=m.useState(!0),[i,o]=m.useState(!0);return s.jsxs(It,{children:[s.jsx(bn,{title:"Paramètres",subtitle:`${sk.length} sections — cliquez pour ouvrir`}),s.jsx("div",{style:{maxHeight:480,overflowY:"auto",paddingRight:2},children:sk.map(a=>{const l=e===a.id,c=a.id==="crypto"?n:a.id==="telegram"?i:!0,u=a.id==="crypto"?r:o;return s.jsxs(We,{onClick:()=>t(l?null:a.id),children:[s.jsxs(Ct,{children:[s.jsxs(Y,{size:"0.72rem",children:[s.jsx(Oe,{icon:a.icon,style:{color:$.accentLight,marginRight:8,fontSize:"0.68rem"}}),a.title]}),s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[a.hasSwitch&&(a.id==="crypto"||a.id==="telegram")&&s.jsx("span",{onClick:d=>d.stopPropagation(),children:s.jsx(Ile,{isOn:c,onToggle:()=>u(d=>!d)})}),a.hasSwitch&&a.id!=="crypto"&&a.id!=="telegram"&&s.jsx(Oe,{icon:yx,style:{color:$.success,fontSize:"0.55rem"}}),s.jsx(Oe,{icon:l?A7:I7,style:{color:$.text3,fontSize:"0.6rem"}})]})]}),l&&s.jsx("div",{style:{marginTop:8,paddingTop:8,borderTop:`1px solid ${$.border}`},children:s.jsx(Y,{variant:"muted",size:"0.66rem",children:a.body})})]},a.id)})})]})}const Qle=[{id:"1",driver:"lucas_d",message:"Accès bloqué, portail fermé",time:"03/08/2026, 14:32",active:!0},{id:"2",driver:"emma_l",message:"Client injoignable",time:"02/08/2026, 19:05",active:!1}];function Zle(){const[e,t]=m.useState(Qle),n=r=>{t(i=>i.map(o=>o.id===r?{...o,active:!1}:o))};return s.jsxs(It,{children:[s.jsx(bn,{title:"Alertes",subtitle:"Cliquez « Résoudre » pour tester"}),e.map(r=>s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsxs(Y,{variant:r.active?"danger":"secondary",children:[s.jsx(Oe,{icon:Fm,style:{color:r.active?$.danger:$.text3,marginRight:6,fontSize:"0.72rem"}}),r.driver]}),s.jsx("span",{style:{background:r.active?`${$.danger}26`:`${$.success}26`,color:r.active?$.danger:$.success,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:r.active?"Active":"Terminée"})]}),r.active&&s.jsxs(Y,{variant:"danger",size:"0.7rem",children:['"',r.message,'"']}),s.jsxs(Ct,{children:[s.jsx(Y,{variant:"muted",size:"0.62rem",children:r.time}),r.active&&s.jsx(je,{tone:"success",icon:Ta,onClick:()=>n(r.id),children:"Résoudre"})]})]},r.id))]})}const Jle=[{id:"1",wrong:"10 rue de la paix",right:"10 Rue de la Paix, 75001 Paris"}];function ece(){const[e,t]=m.useState(Jle),[n,r]=m.useState(!1),[i,o]=m.useState(""),[a,l]=m.useState(""),c=()=>{!i.trim()||!a.trim()||(t(u=>[...u,{id:String(u.length+1),wrong:i,right:a}]),o(""),l(""),r(!1))};return s.jsxs(It,{children:[s.jsx(bn,{title:"Corrections d'adresses",action:s.jsx(je,{tone:"accent",icon:Sx,onClick:()=>r(u=>!u),children:n?"Fermer":"Ajouter"})}),n&&s.jsxs(We,{children:[s.jsx("input",{placeholder:"Adresse invalide (ex: 10 rue de la paix)",value:i,onChange:u=>o(u.target.value),style:{width:"100%",background:$.bg,border:`1px solid ${$.border}`,borderRadius:8,color:$.text,fontSize:"0.7rem",padding:"6px 8px",marginBottom:6,outline:"none"}}),s.jsx("input",{placeholder:"Adresse correcte (ex: 10 Rue de la Paix, 75001 Paris)",value:a,onChange:u=>l(u.target.value),style:{width:"100%",background:$.bg,border:`1px solid ${$.border}`,borderRadius:8,color:$.text,fontSize:"0.7rem",padding:"6px 8px",marginBottom:8,outline:"none"}}),s.jsx(je,{tone:"accent",onClick:c,children:"Ajouter la correction"})]}),e.map(u=>s.jsxs(We,{children:[s.jsx(Y,{variant:"danger",size:"0.72rem",children:u.wrong}),s.jsx("div",{style:{margin:"3px 0"},children:s.jsx(Oe,{icon:Ele,style:{color:$.text3,fontSize:"0.62rem"}})}),s.jsx(Y,{variant:"success",size:"0.72rem",children:u.right})]},u.id))]})}function tce(){const[e,t]=m.useState(!1);return s.jsxs(It,{children:[s.jsx(bn,{title:"Cabine — Nadia",subtitle:"Suivi des opérations"}),s.jsxs(gn,{columns:2,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:L7,value:11,label:"Commandes actives",color:$.info}),s.jsx(Ke,{icon:z7,value:4,label:"En route",color:$.warning}),s.jsx(Ke,{icon:qu,value:3,label:"En attente",color:$.accentLight}),s.jsx(Ke,{icon:vx,value:4,label:"Livreurs dispo",color:$.success}),s.jsx(Ke,{icon:bx,value:2,label:"Livreurs occupés",color:$.warning}),s.jsx(Ke,{icon:Ple,value:299,label:"Total terminées",color:$.success})]}),s.jsx(We,{mb:0,children:s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(O7,{icon:yx,color:$.secondary}),"Notifications Telegram"]}),s.jsx(je,{tone:e?"outlineDanger":"accent",icon:e?N7:R7,onClick:()=>t(n=>!n),children:e?"Délier":"Lier Telegram"})]})})]})}const nce=[{id:"#1042",client:"client_marie",address:"12 rue des Lilas",total:"46,00 €",label:"En attente",tone:$.warning},{id:"#1040",client:"client_lea",address:"8 avenue Foch",total:"58,50 €",label:"Livreur arrivé",tone:$.accentLight}];function rce(){const[e,t]=m.useState("#1042");return s.jsxs(It,{children:[s.jsx(bn,{title:"Commandes actives",subtitle:"Cliquez une commande"}),nce.map(n=>{const r=e===n.id;return s.jsxs(We,{active:r,onClick:()=>t(r?null:n.id),children:[s.jsxs(Ct,{children:[s.jsx(Y,{mono:!0,children:n.id}),s.jsx("span",{style:{background:`${n.tone}26`,color:n.tone,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:n.label})]}),s.jsxs(Y,{variant:"secondary",size:"0.7rem",children:[n.client," · ",n.address]}),s.jsx(Y,{variant:"primary",size:"0.75rem",children:n.total}),r&&s.jsxs("div",{style:{marginTop:10,paddingTop:10,borderTop:`1px solid ${$.border}`,display:"flex",gap:6,flexWrap:"wrap"},children:[s.jsx(je,{tone:"accent",icon:yle,children:"Le livreur est là"}),s.jsx(je,{tone:"outline",icon:vx,children:"Assigner livreur"}),s.jsx(je,{tone:"outline",icon:Vm,children:"Proposer adresse"}),s.jsx(je,{tone:"outlineDanger",icon:E7,children:"Supprimer"})]})]},n.id)}),s.jsx(Wm,{children:"Contrairement à l'espace admin, la cabine ne peut pas modifier le contenu d'une commande — seulement la faire avancer ou la supprimer."})]})}const ice=[{name:"lucas_d",status:"busy",queue:1,total:512},{name:"emma_l",status:"available",queue:0,total:340}],R0={available:$.success,busy:$.warning,offline:$.text3},oce={available:"Disponible",busy:"Occupé",offline:"Hors ligne"};function ace(){const[e,t]=m.useState("lucas_d");return s.jsxs(It,{children:[s.jsxs(gn,{columns:3,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:Vm,value:1,label:"Dispo",color:$.success}),s.jsx(Ke,{icon:bx,value:1,label:"Occupés",color:$.warning}),s.jsx(Ke,{icon:P7,value:0,label:"Offline",color:$.text3})]}),ice.map(n=>{const r=e===n.name;return s.jsxs(We,{active:r,children:[s.jsxs(Ct,{children:[s.jsxs(Y,{children:[s.jsx(ll,{color:R0[n.status]}),n.name]}),s.jsx("span",{style:{background:`${R0[n.status]}26`,color:R0[n.status],fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:oce[n.status]})]}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:["Queue: ",n.queue," · Total: ",n.total]}),s.jsx("div",{style:{marginTop:8},children:s.jsx(je,{tone:r?"accent":"outline",icon:wx,onClick:()=>t(r?null:n.name),children:r?"Arrêter le suivi":"Suivre"})})]},n.name)}),s.jsx(Wm,{children:"La cabine visualise et suit les livreurs en direct, mais l'assignation d'une commande se fait depuis l'écran Commandes."})]})}const lk=[{id:"1",driver:"lucas_d",message:"Accès bloqué, portail fermé",time:"14:32",active:!0},{id:"2",driver:"emma_l",message:"Client injoignable",time:"hier 19:05",active:!1}];function sce(){const[e,t]=m.useState("toutes"),n=e==="toutes"?lk:lk.filter(r=>r.active);return s.jsxs(It,{children:[s.jsx(bn,{title:"Alertes livreurs"}),s.jsx(kx,{tabs:[{key:"toutes",label:"Toutes"},{key:"actives",label:"Actives"}],active:e,onChange:t}),n.map(r=>s.jsxs(We,{children:[s.jsxs(Ct,{children:[s.jsxs(Y,{variant:r.active?"danger":"secondary",children:[s.jsx(Oe,{icon:Fm,style:{color:r.active?$.danger:$.text3,marginRight:6,fontSize:"0.72rem"}}),r.driver]}),s.jsx("span",{style:{background:r.active?`${$.danger}26`:`${$.success}26`,color:r.active?$.danger:$.success,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:r.active?"Active":"Terminée"})]}),r.active&&s.jsxs(Y,{variant:"danger",size:"0.7rem",children:['"',r.message,'"']}),s.jsx(Y,{variant:"muted",size:"0.62rem",children:r.time})]},r.id)),s.jsx(Wm,{children:"La résolution des alertes reste réservée à l'espace admin."})]})}function lce(){const[e,t]=m.useState("35 €"),[n,r]=m.useState(340);return s.jsxs(It,{children:[s.jsx(bn,{title:"Clients",subtitle:"Réinitialisations rapides"}),s.jsxs(We,{mb:0,children:[s.jsx(Y,{variant:"primary",size:"0.82rem",children:"client_marie"}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"Marie D. · 06 12 34 56 78"}),s.jsxs("div",{style:{display:"flex",gap:12,margin:"8px 0"},children:[s.jsx(Y,{variant:"danger",size:"0.68rem",children:"Annul.: 2"}),s.jsxs(Y,{variant:"secondary",size:"0.68rem",mono:!0,children:["Amende: ",e]}),s.jsxs(Y,{variant:"success",size:"0.68rem",mono:!0,children:["Points: ",n]})]}),s.jsxs("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[s.jsx(je,{tone:"outline",icon:zp,onClick:()=>t("0 €"),children:"Reset pénalités"}),s.jsx(je,{tone:"outline",icon:zp,onClick:()=>r(0),children:"Reset points"})]})]}),s.jsx(Wm,{children:"Pas de création, modification ni suppression de compte ici — uniquement des remises à zéro ponctuelles."})]})}const M0=["pending","in_progress","arrived","completed"],I0={pending:{label:"En attente",tone:$.info},in_progress:{label:"En cours",tone:$.warning},arrived:{label:"Arrivé",tone:$.accentLight},completed:{label:"Terminée",tone:$.success}},cce=[{key:"available",label:"Disponible",tone:$.success},{key:"busy",label:"Occupé",tone:$.warning},{key:"offline",label:"Hors ligne",tone:$.text3}];function uce(){const[e,t]=m.useState("available"),[n,r]=m.useState("in_progress"),i=()=>{const o=M0.indexOf(n);o{const a=e===o.key;return s.jsxs("div",{onClick:()=>t(o.key),style:{cursor:"pointer",display:"flex",alignItems:"center",padding:"5px 10px",borderRadius:999,fontSize:"0.65rem",fontWeight:700,border:`1px solid ${a?o.tone:$.border}`,background:a?`${o.tone}22`:"transparent",color:a?o.tone:$.text3},children:[s.jsx(ll,{color:o.tone,size:"7px"}),o.label]},o.key)})}),s.jsx(We,{children:s.jsx("div",{style:{height:96,borderRadius:8,position:"relative",backgroundImage:"linear-gradient(135deg,#161022 25%,#1c1330 25%,#1c1330 50%,#161022 50%,#161022 75%,#1c1330 75%)",backgroundSize:"18px 18px",marginBottom:6},children:s.jsxs("span",{style:{position:"absolute",top:8,left:8,background:`${$.success}26`,color:$.success,fontSize:"0.6rem",fontWeight:800,padding:"3px 9px",borderRadius:999},children:[s.jsx(ll,{color:$.success,size:"7px"}),"GPS actif — 48.85, 2.35"]})})}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"Mes livraisons (1) — cliquez « avancer » pour tester le cycle complet"}),s.jsxs(We,{mb:0,children:[s.jsxs(Ct,{children:[s.jsx(Y,{mono:!0,children:"Commande #1041"}),s.jsx("span",{style:{background:`${I0[n].tone}26`,color:I0[n].tone,fontSize:"0.6rem",fontWeight:800,padding:"2px 8px",borderRadius:999},children:I0[n].label})]}),s.jsx(Y,{variant:"secondary",size:"0.7rem",children:"client_paul · 12 rue des Lilas"}),s.jsxs("div",{style:{display:"flex",gap:6,marginTop:8,flexWrap:"wrap"},children:[s.jsx(je,{tone:"outline",icon:Vm,children:"Itinéraire"}),s.jsx(je,{tone:"outline",icon:wle,children:"Appeler"})]}),s.jsxs("div",{style:{marginTop:10,paddingTop:10,borderTop:`1px solid ${$.border}`,display:"flex",gap:6,flexWrap:"wrap"},children:[n==="pending"&&s.jsx(je,{tone:"success",icon:wx,onClick:i,children:"Démarrer la livraison"}),n==="in_progress"&&s.jsx(je,{tone:"accent",icon:bx,onClick:i,children:"J'arrive"}),n==="arrived"&&s.jsxs(s.Fragment,{children:[s.jsx(je,{tone:"accent",icon:Ta,onClick:i,children:"Terminer"}),s.jsx(je,{tone:"outlineDanger",icon:_7,children:"Annuler"})]}),n==="completed"&&s.jsxs(Y,{variant:"success",size:"0.7rem",children:[s.jsx(Oe,{icon:Ta,style:{marginRight:6}}),"Livraison terminée"]})]})]})]})}const Fo={police:{title:"Contrôle de police",icon:Bm,hint:"Restez calme, coopérez avec les forces de l’ordre. L’équipe est prévenue."},ambush:{title:"Guet-apens",icon:Fm,hint:"Éloignez-vous du danger si possible. L’équipe et les secours sont prévenus."}};function dce(){const[e,t]=m.useState("idle"),[n,r]=m.useState("police");return s.jsxs(It,{children:[s.jsx(bn,{title:"Alerte",subtitle:"Bouton d'urgence pour les livreurs"}),e==="idle"&&s.jsx(je,{tone:"outlineDanger",icon:Fm,onClick:()=>t("pick"),children:"Déclencher alerte police"}),e==="pick"&&s.jsxs(We,{mb:0,children:[s.jsx(Y,{size:"0.78rem",variant:"primary",children:"Type d'alerte"}),s.jsx(Y,{variant:"muted",size:"0.65rem",children:"Sélectionnez la raison de l'alerte."}),s.jsx("div",{style:{display:"flex",flexDirection:"column",gap:6,marginTop:8},children:Object.keys(Fo).map(i=>s.jsxs("div",{onClick:()=>{r(i),t("confirm")},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:8,padding:"8px 10px",borderRadius:8,border:`1px solid ${$.border}`},children:[s.jsx(Oe,{icon:Fo[i].icon,style:{color:$.danger,fontSize:"0.8rem"}}),s.jsx("span",{style:{color:$.text,fontSize:"0.74rem"},children:Fo[i].title})]},i))}),s.jsx("div",{style:{marginTop:10},children:s.jsx(je,{tone:"outline",onClick:()=>t("idle"),children:"Annuler"})})]}),e==="confirm"&&s.jsxs(We,{mb:0,children:[s.jsxs(Y,{size:"0.78rem",variant:"danger",children:[s.jsx(Oe,{icon:Fo[n].icon,style:{marginRight:6}}),"Alerte — ",Fo[n].title]}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:Fo[n].hint}),s.jsx(Y,{variant:"primary",size:"0.74rem",children:"Confirmez-vous le déclenchement ?"}),s.jsxs("div",{style:{display:"flex",gap:6,marginTop:10},children:[s.jsx(je,{tone:"outline",onClick:()=>t("idle"),children:"Annuler"}),s.jsx(je,{tone:"outlineDanger",onClick:()=>t("sent"),children:"Déclencher"})]})]}),e==="sent"&&s.jsxs(We,{mb:0,children:[s.jsx(Oe,{icon:Ta,style:{color:$.success,fontSize:"1.4rem",marginBottom:8}}),s.jsx(Y,{size:"0.8rem",variant:"success",children:"Alerte envoyée"}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"L'équipe admin a été notifiée immédiatement."}),s.jsx(Y,{variant:"secondary",size:"0.66rem",children:Fo[n].hint}),s.jsx("div",{style:{marginTop:10},children:s.jsx(je,{tone:"accent",onClick:()=>t("idle"),children:"Compris"})})]})]})}function ck({value:e}){return s.jsx("span",{children:[1,2,3,4,5].map(t=>s.jsx(Oe,{icon:$p,style:{color:t<=e?$.warning:$.border,fontSize:"0.7rem",marginRight:2}},t))})}const fce=[{client:"client_marie",order:"#1038",rating:5,comment:"Livraison rapide et sympa, merci !"},{client:"client_theo",order:"#1029",rating:4,comment:"Tout est arrivé nickel."}];function pce(){return s.jsxs(It,{children:[s.jsx(bn,{title:"Mes avis"}),s.jsxs(We,{children:[s.jsx(Y,{size:"1.5rem",variant:"primary",children:"4.7"}),s.jsx("div",{style:{marginTop:4},children:s.jsx(ck,{value:5})}),s.jsx(Y,{variant:"muted",size:"0.66rem",children:"38 avis clients"})]}),fce.map(e=>s.jsxs(We,{children:[s.jsx(Y,{size:"0.74rem",variant:"primary",children:e.client}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:["Commande ",e.order]}),s.jsx("div",{style:{margin:"4px 0"},children:s.jsx(ck,{value:e.rating})}),s.jsxs(Y,{variant:"secondary",size:"0.68rem",children:["« ",e.comment," »"]})]},e.order))]})}const mce={jour:[2,4,3,6,5,8,4],semaine:[18,24,21,27,15,30,22],mois:[80,92,76,101]},hce={jour:["L","M","M","J","V","S","D"],semaine:["S1","S2","S3","S4","S5","S6","S7"],mois:["Mai","Juin","Juil","Août"]};function gce(){const[e,t]=m.useState("semaine"),n=mce[e],r=hce[e],i=m.useMemo(()=>Math.max(...n),[n]);return s.jsxs(It,{children:[s.jsx(bn,{title:"Mes performances"}),s.jsxs(gn,{columns:2,spacing:2,mb:2.5,children:[s.jsx(Ke,{icon:lle,value:512,label:"Total livraisons",color:$.accentLight}),s.jsx(Ke,{icon:Ta,value:489,label:"Complétées",color:$.success}),s.jsx(Ke,{icon:qu,value:14,label:"Livraisons du jour",color:$.accentLight}),s.jsx(Ke,{icon:kle,value:3,label:"En attente",color:$.info})]}),s.jsxs(We,{mb:0,children:[s.jsx(Y,{variant:"secondary",size:"0.72rem",children:"Évolution"}),s.jsx("div",{style:{marginTop:8},children:s.jsx(kx,{tabs:[{key:"jour",label:"Jour"},{key:"semaine",label:"Semaine"},{key:"mois",label:"Mois"}],active:e,onChange:t})}),s.jsx("div",{style:{display:"flex",alignItems:"flex-end",gap:6,height:90,marginTop:6},children:n.map((o,a)=>s.jsxs("div",{style:{flex:1,textAlign:"center"},children:[s.jsx("div",{style:{height:`${o/i*70}px`,background:$.accent,borderRadius:4,transition:"height .3s ease"}}),s.jsx("div",{style:{color:$.text3,fontSize:"0.55rem",marginTop:4},children:r[a]})]},a))}),s.jsxs(Y,{variant:"muted",size:"0.62rem",children:[n.reduce((o,a)=>o+a,0)," livraisons sur la période"]})]})]})}const vce=[{id:"admin-dashboard",kicker:"Vue d'ensemble",title:"Toute votre activité en un coup d’œil",lead:"Dès l'ouverture, vous voyez l'essentiel : commandes en attente ou en route, clients et livreurs actifs — sans avoir à chercher l'information.",points:["Chiffres mis à jour en temps réel","Notifications Telegram liées à votre compte","Accès identique sur mobile et sur ordinateur"],mockup:s.jsx(Lle,{})},{id:"admin-commandes",kicker:"Suivi opérationnel",title:"Suivez chaque commande, de la validation à la livraison",lead:"Chaque commande apparaît avec son statut, son montant et le livreur assigné. Un menu d'actions par commande permet d'assigner un livreur ou de la finaliser en un geste.",points:["Archives des commandes approuvées et annulées, recherche instantanée","Export CSV pour votre comptabilité","Parrainage et fidélité pris en compte automatiquement dans le total"],mockup:s.jsx(Nle,{}),reverse:!0},{id:"admin-livraison",kicker:"Géolocalisation en direct",title:"Localisez vos livreurs en temps réel, sur la carte",lead:"La position de chaque livreur s'affiche en direct, avec la distance et le temps restant estimé. Vue d'ensemble de toute la flotte : disponible, occupée ou hors ligne.",points:["Distance et temps de trajet calculés automatiquement","Avis clients et historique de connexion par livreur",'Notification client en un tap : "le livreur est arrivé"'],mockup:s.jsx(Ole,{})},{id:"admin-produits",kicker:"Catalogue",title:"Un catalogue que vous gérez vous-même",lead:"Ajoutez, modifiez ou retirez un produit en quelques secondes : photos, vidéos, stock, description, et plusieurs tarifs par produit.",points:["Photos et vidéos multiples par produit","Plusieurs paliers de prix, activables indépendamment","Statut « à venir » pour annoncer un produit avant sa mise en vente"],mockup:s.jsx(Ble,{}),reverse:!0},{id:"admin-categories",kicker:"Organisation",title:"Organisez votre catalogue comme vous le souhaitez",lead:"Créez vos propres catégories, attribuez-leur une couleur, réordonnez-les en un clic. Une catégorie peut être marquée « prochainement » avant sa mise en ligne.",points:["Couleur personnalisée par catégorie","Réorganisation manuelle de l'ordre d'affichage","Aperçu immédiat du rendu côté client"],mockup:s.jsx(Wle,{})},{id:"admin-statistiques",kicker:"Pilotage",title:"Des chiffres clairs pour piloter votre activité",lead:"Chiffre d'affaires, produits les plus vendus, heures et jours d'affluence : tout est visualisé simplement, sans éplucher vos commandes une par une.",points:["Historique mensuel navigable, jour par jour","Classement des meilleurs produits (quantité, commandes ou revenus)","Repérage automatique du jour et de l'heure de pointe"],mockup:s.jsx(Kle,{}),reverse:!0},{id:"admin-utilisateurs",kicker:"Équipe & clients",title:"Clients, livreurs, équipe : tout au même endroit",lead:"Un seul espace pour gérer tous les comptes. Ajustez les points de fidélité, appliquez une pénalité ou consultez l'historique d'un client.",points:["Filtre par rôle et recherche instantanée","Gestion des points de fidélité et du parrainage","Suivi des annulations et de l'historique de connexion"],mockup:s.jsx(Xle,{})},{id:"admin-parametres",kicker:"Personnalisation",title:"Une plateforme qui s'adapte à votre activité",lead:"13 sections de réglages : fidélité, parrainage, pénalités, zones et horaires de livraison, paiement crypto, Telegram, couleurs de l’interface... Tout est configurable vous-même.",points:["Zones de livraison par code postal avec minimum de commande","Paiement crypto (NowPayments) et bot Telegram intégrés","Couleurs de l'espace admin et de l'app client personnalisables"],mockup:s.jsx(Yle,{}),reverse:!0},{id:"admin-alertes",kicker:"Réactivité",title:"Réagissez immédiatement en cas de problème",lead:"Si un livreur rencontre un souci sur le terrain, l'alerte remonte instantanément — avec son message et l'horodatage — jusqu'à ce qu'elle soit résolue.",points:["Distinction claire entre alerte active et résolue","Historique complet conservé"],mockup:s.jsx(Zle,{})},{id:"admin-adresses",kicker:"Fiabilité livraison",title:"Zéro commande perdue à cause d’une adresse mal saisie",lead:"Quand un client tape une adresse imprécise, corrigez-la une bonne fois pour toutes : les prochaines commandes utiliseront automatiquement la bonne adresse.",points:["Association simple « adresse saisie → adresse correcte »","Moins d’erreurs de livraison, moins d’allers-retours"],mockup:s.jsx(ece,{}),reverse:!0}],yce=[{id:"cabine-dashboard",kicker:"Opérations du jour",title:"Un espace dédié pour votre équipe en cuisine",lead:"Vos préparateurs voient uniquement ce qui les concerne : commandes en cours, livreurs disponibles — sans chiffre d'affaires ni réglages sensibles.",points:["Aucune donnée financière exposée","Notifications Telegram propres à chaque compte","Rafraîchissement en direct"],mockup:s.jsx(tce,{})},{id:"cabine-commandes",kicker:"Suivi des commandes",title:"Faire avancer une commande, en toute sécurité",lead:"La cabine assigne un livreur, prévient le client, propose une correction d’adresse — mais ne peut ni modifier ni voir les réglages de la commande.",points:["Actions limitées et guidées, pas de menu complexe","Confirmation demandée avant chaque action sensible","Zéro risque de modification accidentelle"],mockup:s.jsx(rce,{}),reverse:!0},{id:"cabine-livraison",kicker:"Suivi livreurs",title:"Suivre les livreurs en direct, sans les gérer",lead:"La cabine voit la carte, la disponibilité et la position de chaque livreur pour coordonner la préparation — la gestion des comptes reste réservée à l’admin.",points:["Carte et statuts en temps réel","Suivi d’itinéraire en un clic","Aucun accès à la création ou modification de compte"],mockup:s.jsx(ace,{})},{id:"cabine-alertes",kicker:"Information",title:"Rester informé, sans pouvoir de décision",lead:"Les alertes remontées par les livreurs sont visibles par la cabine pour garder tout le monde informé — seule l’équipe admin peut les résoudre.",points:['Filtre "Toutes" / "Actives"',"Lecture seule, aucune action destructrice possible"],mockup:s.jsx(sce,{}),reverse:!0},{id:"cabine-utilisateurs",kicker:"Service client",title:"Un geste commercial, sans accès aux comptes",lead:"Besoin d’annuler une pénalité ou d’offrir des points en guise de geste commercial ? La cabine peut le faire en un clic, sans jamais toucher au reste du compte client.",points:["Reset pénalités et points uniquement","Aucune création, édition ou suppression de compte"],mockup:s.jsx(lce,{})}],bce=[{id:"livreur-dashboard",kicker:"Terrain",title:"Le compagnon de route de vos livreurs",lead:"Statut en un tap (disponible / occupé / hors ligne), position GPS en direct, et un cycle de livraison guidé étape par étape jusqu’à la remise au client.",points:["Cycle complet : Démarrer → J’arrive → Terminer","Appel client et itinéraire en un tap","Gestion des cas « client absent » avec compte à rebours"],mockup:s.jsx(uce,{})},{id:"livreur-alertes",kicker:"Sécurité",title:"Un bouton d’urgence, toujours à portée de main",lead:"En cas de contrôle de police ou de situation dangereuse, le livreur alerte l’équipe admin en 2 taps — avec des consignes de sécurité affichées immédiatement.",points:["Deux types d’alerte : contrôle de police / guet-apens","Confirmation avant envoi pour éviter les fausses alertes","Consignes de sécurité affichées après envoi"],mockup:s.jsx(dce,{}),reverse:!0},{id:"livreur-avis",kicker:"Reconnaissance",title:"Chaque livreur voit ses propres avis clients",lead:"Note moyenne et commentaires clients, pour valoriser le travail de vos livreurs et repérer rapidement un souci de service.",points:["Note moyenne calculée automatiquement","Commentaires clients horodatés"],mockup:s.jsx(pce,{})},{id:"livreur-stats",kicker:"Performance",title:"Un livreur qui suit sa propre performance reste motivé",lead:"Nombre de livraisons, taux de complétion, évolution jour / semaine / mois : chaque livreur a une vision claire de son activité.",points:["Bascule Jour / Semaine / Mois","Totaux recalculés automatiquement"],mockup:s.jsx(gce,{}),reverse:!0}],uk=[{key:"admin",label:"Espace Admin",icon:Tle,features:vce,blurb:"Contrôle total de la plateforme."},{key:"cabine",label:"Espace Cabine",icon:mle,features:yce,blurb:"Équipe de préparation, accès restreint."},{key:"livreur",label:"Espace Livreur",icon:Bm,features:bce,blurb:"Application dédiée aux livreurs."}];function xce(){const[e,t]=m.useState("admin"),n=uk.find(r=>r.key===e);return s.jsxs(se,{children:[s.jsx(se,{bgGradient:"linear(to-b, blackAlpha.50, transparent)",py:{base:14,md:20},children:s.jsx(pn,{maxW:"container.lg",children:s.jsxs(Se,{spacing:5,textAlign:"center",align:"center",children:[s.jsxs(ge,{spacing:2,children:[s.jsx(se,{as:"span",px:3,py:1,borderRadius:"full",fontSize:"xs",fontWeight:"bold",bg:"primary.500",color:"white",children:"3 espaces, 1 seule plateforme"}),s.jsx(se,{as:"span",px:3,py:1,borderRadius:"full",fontSize:"xs",fontWeight:"bold",borderWidth:"1px",children:"Démo interactive"})]}),s.jsx(_t,{size:"2xl",children:"Admin, cabine, livreur : chacun son espace"}),s.jsx(Z,{fontSize:"lg",color:"gray.500",maxW:"2xl",children:"Chaque rôle a exactement les écrans dont il a besoin — rien de plus. Choisissez un espace ci-dessous et essayez les aperçus : ils sont interactifs, comme dans l'application réelle."})]})})}),s.jsx(se,{borderTopWidth:"1px",borderBottomWidth:"1px",bg:"chakra-subtle-bg",position:"sticky",top:0,zIndex:2,children:s.jsxs(pn,{maxW:"container.lg",py:3,children:[s.jsx(ge,{spacing:2,mb:2,overflowX:"auto",children:uk.map(r=>s.jsx(ve,{size:"sm",leftIcon:s.jsx(Oe,{icon:r.icon}),colorScheme:e===r.key?"primary":void 0,variant:e===r.key?"solid":"outline",onClick:()=>t(r.key),flexShrink:0,children:r.label},r.key))}),s.jsx(gT,{spacing:5,shouldWrapChildren:!0,children:n.features.map(r=>s.jsx(Bb,{children:s.jsx(Z,{as:"a",href:`#${r.id}`,fontSize:"sm",fontWeight:"semibold",color:"primary.500",whiteSpace:"nowrap",_hover:{textDecoration:"underline"},children:r.kicker})},r.id))})]})}),s.jsxs(pn,{maxW:"container.lg",children:[s.jsx(se,{py:6,children:s.jsx(Z,{color:"gray.500",fontSize:"sm",textAlign:"center",children:n.blurb})}),n.features.map(r=>s.jsxs(Se,{id:r.id,direction:{base:"column",md:r.reverse?"row-reverse":"row"},spacing:{base:10,md:16},align:"center",py:{base:14,md:20},borderBottomWidth:"1px",scrollMarginTop:"120px",children:[s.jsxs(se,{flex:"0.9",minW:0,children:[s.jsx(Z,{fontSize:"xs",fontWeight:"extrabold",letterSpacing:"wide",textTransform:"uppercase",color:"primary.500",mb:2,children:r.kicker}),s.jsx(_t,{size:"lg",mb:4,children:r.title}),s.jsx(Z,{color:"gray.500",mb:5,children:r.lead}),s.jsx(Nu,{spacing:2,children:r.points.map(i=>s.jsxs(_b,{fontSize:"sm",color:"gray.600",display:"flex",children:[s.jsx(O_,{as:()=>s.jsx(Oe,{icon:Ta}),color:"green.400",mt:1,mr:2}),s.jsx("span",{children:i})]},i))})]}),s.jsx(se,{flex:"1",minW:0,w:"full",children:r.mockup})]},r.id))]}),s.jsx(se,{bg:"gray.900",color:"white",py:20,textAlign:"center",children:s.jsxs(pn,{maxW:"container.md",children:[s.jsx(_t,{size:"xl",mb:4,children:"Prêt à essayer votre propre espace admin ?"}),s.jsx(Z,{color:"whiteAlpha.700",mb:8,children:"Une démo dédiée et isolée, prête en quelques minutes, pour tester la plateforme en conditions réelles."}),s.jsxs(gn,{columns:{base:1,sm:2},spacing:4,maxW:"sm",mx:"auto",children:[s.jsx(ve,{as:Yt,to:"/register",colorScheme:"primary",size:"lg",children:"Créer un compte"}),s.jsx(ve,{as:Yt,to:"/tarifs",variant:"outline",colorScheme:"whiteAlpha",size:"lg",children:"Voir les tarifs"})]})]})})]})}const Sce="http://localhost:8080",Cx="omnex.token";function Qv(){return localStorage.getItem(Cx)}function dk(e){localStorage.setItem(Cx,e)}function fk(){localStorage.removeItem(Cx)}class Je extends Error{constructor(n,r){super(r);Ux(this,"status");this.status=n}}async function ct(e,t,n){const r={"Content-Type":"application/json"},i=Qv();i&&(r.Authorization=`Bearer ${i}`);const o=await fetch(`${Sce}/api/v1${t}`,{method:e,headers:r,body:n?JSON.stringify(n):void 0});if(!o.ok){const a=await o.json().catch(()=>({error:`HTTP ${o.status}`}));throw new Je(o.status,a.error??`HTTP ${o.status}`)}return o.status===204?void 0:await o.json()}const Fe={login:(e,t,n)=>ct("POST","/auth/login",{username:e,password:t,role:n}),register:(e,t)=>ct("POST","/auth/register",{username:e,password:t}),me:()=>ct("GET","/auth/me"),logout:()=>ct("POST","/auth/logout"),listDemos:()=>ct("GET","/demos"),listMyDemos:()=>ct("GET","/demos/mine"),getDemo:e=>ct("GET",`/demos/${e}`),createDemo:e=>ct("POST","/demos",{username:e.username,...e.telegramBotUsername?{telegram_bot_username:e.telegramBotUsername}:{},...e.telegramBotToken?{telegram_bot_token:e.telegramBotToken}:{},...e.nowPaymentsApiKey?{nowpayments_api_key:e.nowPaymentsApiKey}:{},...e.nowPaymentsIpnSecret?{nowpayments_ipn_secret:e.nowPaymentsIpnSecret}:{},storage_driver:e.storageDriver,...e.storageDriver==="s3"?{s3_bucket:e.s3Bucket,s3_endpoint:e.s3Endpoint}:{},...e.tomtomApiKey?{tomtom_api_key:e.tomtomApiKey}:{},...e.tomtomApiKey1?{tomtom_api_key_1:e.tomtomApiKey1}:{},...e.tomtomApiKey2?{tomtom_api_key_2:e.tomtomApiKey2}:{},...e.tomtomApiKey3?{tomtom_api_key_3:e.tomtomApiKey3}:{},...e.lbBot1Username?{lb_bot1_username:e.lbBot1Username,lb_bot1_token:e.lbBot1Token}:{},...e.lbBot2Username?{lb_bot2_username:e.lbBot2Username,lb_bot2_token:e.lbBot2Token}:{},...e.lbStrategy?{lb_strategy:e.lbStrategy}:{},...e.lbJwtTtlSeconds?{lb_jwt_ttl_seconds:e.lbJwtTtlSeconds}:{},...e.lbHealthCheckInterval?{lb_health_check_interval:e.lbHealthCheckInterval}:{},admin_username:e.adminUsername,admin_password:e.adminPassword}),extendDemo:e=>ct("POST",`/demos/${e}/extend`),deleteDemo:e=>ct("DELETE",`/demos/${e}`),setDemoDomain:(e,t)=>ct("POST",`/demos/${e}/domain`,{domain:t}),listCodes:()=>ct("GET","/codes"),createCode:e=>ct("POST","/codes",{username:e}),addCode:e=>ct("POST","/subscription",{code_verif:e}),sendMessage:(e,t,n,r)=>ct("POST","/send/message",{username:e,telegram:t,sujet:n,message:r}),getMessage:()=>ct("GET","/messages"),getDemoDetails:e=>ct("POST","/demos/details",{namespace:e}),updateUsername:e=>ct("POST","/profile/username",{username:e}),updatePassword:e=>ct("POST","/profile/password",{password:e}),getTelegram:()=>ct("GET","/profile/telegram"),setTelegram:e=>ct("POST","/profile/telegram",{telegram:e}),getAlertSettings:()=>ct("GET","/profile/alerts"),setAlertSettings:e=>ct("POST","/profile/alerts",e)},F7=m.createContext(null);function wce({children:e}){const[t,n]=m.useState(Qv()),[r,i]=m.useState(null),[o,a]=m.useState(null),[l,c]=m.useState(!!Qv());m.useEffect(()=>{if(!t){c(!1);return}let v=!0;return Fe.me().then(y=>{v&&(i(y.role),a(y.type_abonnement))}).catch(()=>{v&&(fk(),n(null),i(null),a(null))}).finally(()=>{v&&c(!1)}),()=>{v=!1}},[]);const u=m.useCallback(async(v,y,x)=>{const b=await Fe.login(v,y,x);dk(b.token),n(b.token),i(b.role);const g=await Fe.me();a(g.type_abonnement)},[]),d=m.useCallback(async(v,y)=>{const x=await Fe.register(v,y);dk(x.token),n(x.token),i(x.role);const b=await Fe.me();a(b.type_abonnement)},[]),f=m.useCallback(async()=>{try{await Fe.logout()}finally{fk(),n(null),i(null),a(null)}},[]),p=m.useCallback(async()=>{const v=await Fe.me();a(v.type_abonnement)},[]),h=m.useMemo(()=>({isAuthenticated:!!t,isAdmin:r==="admin",isClient:r==="client",isPremium:o==="premium",role:r,typeAbo:o,initializing:l,login:u,register:d,logout:f,refreshAbo:p}),[t,r,o,l,u,d,f,p]);return s.jsx(F7.Provider,{value:h,children:e})}function $o(){const e=m.useContext(F7);if(!e)throw new Error("useAuth doit être utilisé dans ");return e}function Ea(e){const{toggleColorMode:t}=Tu(),n=Gg("Passer en mode sombre","Passer en mode clair");return s.jsx(On,{"aria-label":n,title:n,variant:"ghost",size:e.size??"sm",onClick:t,icon:Gg(s.jsx(Cce,{}),s.jsx(kce,{}))})}function kce(){return s.jsxs(Tt,{viewBox:"0 0 24 24",boxSize:5,fill:"none",stroke:"currentColor",strokeWidth:2,children:[s.jsx("circle",{cx:"12",cy:"12",r:"4"}),s.jsx("path",{strokeLinecap:"round",d:"M12 2v2m0 16v2M2 12h2m16 0h2M4.9 4.9l1.4 1.4m11.4 11.4l1.4 1.4M19.1 4.9l-1.4 1.4M6.3 17.7l-1.4 1.4"})]})}function Cce(){return s.jsx(Tt,{viewBox:"0 0 24 24",boxSize:5,fill:"currentColor",children:s.jsx("path",{d:"M21 12.8A9 9 0 1111.2 3a7 7 0 009.8 9.8z"})})}const un=m.forwardRef((e,t)=>{const[n,r]=m.useState(!1);return s.jsxs(jb,{children:[s.jsx(yt,{ref:t,type:n?"text":"password",...e}),s.jsx(Sm,{children:s.jsx(On,{"aria-label":n?"Masquer le mot de passe":"Afficher le mot de passe",icon:s.jsx(Oe,{icon:n?D7:T7}),size:"sm",variant:"ghost",tabIndex:-1,onClick:()=>r(i=>!i)})})]})});un.displayName="PasswordInput";function jce(){const{login:e}=$o(),t=Er(),n=Zr(),[r,i]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(!1),u=async d=>{d.preventDefault(),c(!0);try{await e(r.trim(),o,"client"),t("/app",{replace:!0})}catch(f){const p=f instanceof Je?f.message:"Connexion impossible";n({status:"error",title:"Échec de connexion",description:p})}finally{c(!1)}};return s.jsxs(pn,{maxW:"sm",py:20,position:"relative",children:[s.jsx(se,{position:"absolute",top:4,right:4,children:s.jsx(Ea,{})}),s.jsxs(Se,{spacing:6,children:[s.jsxs(se,{textAlign:"center",children:[s.jsx(_t,{size:"lg",children:"Espace client"}),s.jsx(Z,{color:"gray.500",children:"Connectez-vous pour gérer votre abonnement."})]}),s.jsx(sb,{children:s.jsx(lb,{children:s.jsx("form",{onSubmit:u,children:s.jsxs(Se,{spacing:4,children:[s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Nom d'utilisateur"}),s.jsx(yt,{value:r,onChange:d=>i(d.target.value),autoComplete:"username"})]}),s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Mot de passe"}),s.jsx(un,{value:o,onChange:d=>a(d.target.value),autoComplete:"current-password"})]}),s.jsx(ve,{type:"submit",colorScheme:"primary",isLoading:l,children:"Se connecter"})]})})})}),s.jsxs(ge,{justify:"center",spacing:1,children:[s.jsx(Z,{fontSize:"sm",color:"gray.500",children:"Pas encore de compte ?"}),s.jsx(ve,{as:Yt,to:"/register",variant:"link",size:"sm",children:"Créer un compte"})]}),s.jsx(ve,{as:Yt,to:"/",variant:"outline",size:"sm",children:"← Retour au site"})]})]})}function Pce(){const{login:e}=$o(),t=Er(),n=Zr(),[r,i]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(!1),u=async d=>{d.preventDefault(),c(!0);try{await e(r.trim(),o,"admin"),t("/app",{replace:!0})}catch(f){const p=f instanceof Je?f.message:"Connexion impossible";n({status:"error",title:"Échec de connexion",description:p})}finally{c(!1)}};return s.jsxs(pn,{maxW:"sm",py:20,position:"relative",children:[s.jsx(se,{position:"absolute",top:4,right:4,children:s.jsx(Ea,{})}),s.jsxs(Se,{spacing:6,children:[s.jsxs(se,{textAlign:"center",children:[s.jsx(_t,{size:"lg",children:"Espace admin"}),s.jsx(Z,{color:"gray.500",children:"Connectez-vous pour administrer la plateforme."})]}),s.jsx(sb,{children:s.jsx(lb,{children:s.jsx("form",{onSubmit:u,children:s.jsxs(Se,{spacing:4,children:[s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Nom d'utilisateur"}),s.jsx(yt,{value:r,onChange:d=>i(d.target.value),autoComplete:"username"})]}),s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Mot de passe"}),s.jsx(un,{value:o,onChange:d=>a(d.target.value),autoComplete:"current-password"})]}),s.jsx(ve,{type:"submit",colorScheme:"primary",isLoading:l,children:"Se connecter"})]})})})}),s.jsx(ve,{as:Yt,to:"/",variant:"outline",size:"sm",children:"← Retour au site"})]})]})}function _ce(){const{register:e}=$o(),t=Er(),n=Zr(),[r,i]=m.useState(""),[o,a]=m.useState(""),[l,c]=m.useState(""),[u,d]=m.useState(!1),f=/^[a-zA-Z0-9]{3,64}$/.test(r),p=o.length>=10,h=o===l,v=f&&p&&h,y=async x=>{if(x.preventDefault(),!!v){d(!0);try{await e(r.trim(),o),t("/app",{replace:!0})}catch(b){const g=b instanceof Je?b.message:"Inscription impossible";n({status:"error",title:"Échec de l’inscription",description:g})}finally{d(!1)}}};return s.jsxs(pn,{maxW:"sm",py:16,position:"relative",children:[s.jsx(se,{position:"absolute",top:4,right:4,children:s.jsx(Ea,{})}),s.jsxs(Se,{spacing:6,children:[s.jsxs(se,{textAlign:"center",children:[s.jsx(_t,{size:"lg",children:"Créer un compte"}),s.jsx(Z,{color:"gray.500",children:"Rejoignez l’espace commercial Omnex."})]}),s.jsx(sb,{children:s.jsx(lb,{children:s.jsx("form",{onSubmit:y,children:s.jsxs(Se,{spacing:4,children:[s.jsxs(be,{isRequired:!0,isInvalid:r.length>0&&!f,children:[s.jsx(xe,{children:"Nom d'utilisateur"}),s.jsx(yt,{value:r,onChange:x=>i(x.target.value),autoComplete:"username"}),s.jsx(au,{children:"3 à 64 caractères alphanumériques."})]}),s.jsxs(be,{isRequired:!0,isInvalid:o.length>0&&!p,children:[s.jsx(xe,{children:"Mot de passe"}),s.jsx(un,{value:o,onChange:x=>a(x.target.value),autoComplete:"new-password"}),s.jsx(au,{children:"10 caractères minimum."})]}),s.jsxs(be,{isRequired:!0,isInvalid:l.length>0&&!h,children:[s.jsx(xe,{children:"Confirmer le mot de passe"}),s.jsx(un,{value:l,onChange:x=>c(x.target.value),autoComplete:"new-password"})]}),s.jsx(ve,{type:"submit",colorScheme:"primary",isLoading:u,isDisabled:!v,children:"Créer mon compte"})]})})})}),s.jsxs(ge,{justify:"center",spacing:1,children:[s.jsx(Z,{fontSize:"sm",color:"gray.500",children:"Déjà un compte ?"}),s.jsx(ve,{as:Yt,to:"/login",variant:"link",size:"sm",children:"Se connecter"})]})]})]})}const Um=bm({displayName:"EditIcon",path:s.jsxs("g",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2",children:[s.jsx("path",{d:"M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),s.jsx("path",{d:"M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"})]})}),Tce=bm({displayName:"CloseIcon",d:"M.439,21.44a1.5,1.5,0,0,0,2.122,2.121L11.823,14.3a.25.25,0,0,1,.354,0l9.262,9.263a1.5,1.5,0,1,0,2.122-2.121L14.3,12.177a.25.25,0,0,1,0-.354l9.263-9.262A1.5,1.5,0,0,0,21.439.44L12.177,9.7a.25.25,0,0,1-.354,0L2.561.44A1.5,1.5,0,0,0,.439,2.561L9.7,11.823a.25.25,0,0,1,0,.354Z"}),Ece=bm({viewBox:"0 0 14 14",path:s.jsx("g",{fill:"currentColor",children:s.jsx("polygon",{points:"5.5 11.9993304 14 3.49933039 12.5 2 5.5 8.99933039 1.5 4.9968652 0 6.49933039"})})});function Hm(e){switch(e){case"ready":return"green";case"provisioning":case"pending":return"blue";case"expiring":return"orange";case"failed":return"red";case"expired":default:return"gray"}}function Gm(e){return{pending:"En attente",provisioning:"Déploiement…",ready:"Active",expiring:"Suppression…",expired:"Expirée",failed:"Échec"}[e]??e}function pk(e){switch(e){case"Running":return"green";case"Pending":return"yellow";case"Succeeded":return"blue";case"Failed":return"red";case"Unknown":case"":default:return"gray"}}function Ace(e){return{Running:"En ligne",Pending:"En attente",Succeeded:"Terminé",Failed:"Down",Unknown:"Inconnu"}[e]??"Introuvable"}function mk(e,t=Date.now()){const n=new Date(e).getTime()-t;if(n<=0)return"expirée";const r=Math.floor(n/864e5),i=Math.floor(n%864e5/36e5);if(r>0)return`${r} j ${i} h`;const o=Math.floor(n%36e5/6e4);return`${i} h ${o} min`}function $ce({isOpen:e,title:t,children:n,confirmLabel:r="Confirmer",cancelLabel:i="Annuler",confirmColorScheme:o="red",isLoading:a=!1,onConfirm:l,onClose:c}){const u=m.useRef(null);return s.jsx(TY,{isOpen:e,leastDestructiveRef:u,onClose:c,isCentered:!0,motionPreset:"slideInBottom",children:s.jsx(yl,{backdropFilter:"blur(2px)",children:s.jsxs(EY,{borderRadius:"xl",children:[s.jsx(vl,{fontSize:"lg",fontWeight:"bold",children:t}),s.jsx(gl,{color:"gray.600",children:n}),s.jsxs(jm,{gap:3,children:[s.jsx(ve,{ref:u,onClick:c,variant:"ghost",isDisabled:a,children:i}),s.jsx(ve,{colorScheme:o,onClick:l,isLoading:a,children:r})]})]})})})}function B7({isOpen:e,onClose:t,onCreated:n}){const r=Zr(),[i,o]=m.useState(""),[a,l]=m.useState("admin"),[c,u]=m.useState(""),[d,f]=m.useState(!1),[p,h]=m.useState(""),[v,y]=m.useState(""),[x,b]=m.useState(!1),[g,S]=m.useState(""),[w,k]=m.useState(""),[P,j]=m.useState(!1),[_,M]=m.useState(""),[T,O]=m.useState(""),[q,ne]=m.useState(""),[z,X]=m.useState(""),[V,I]=m.useState(!1),[D,R]=m.useState(""),[F,G]=m.useState(""),[K,ee]=m.useState(""),[Pe,we]=m.useState(""),[Te,Ge]=m.useState("failover"),[Ye,te]=m.useState(""),[re,$e]=m.useState(""),[me,it]=m.useState("local"),[pe,lt]=m.useState(""),[Be,Et]=m.useState(""),[ye,xn]=m.useState(!1),Lt=()=>{o(""),l("admin"),u(""),f(!1),h(""),y(""),b(!1),S(""),k(""),j(!1),M(""),O(""),ne(""),X(""),I(!1),R(""),G(""),ee(""),we(""),Ge("failover"),te(""),$e(""),it("local"),lt(""),Et("")},dr=()=>{ye||(Lt(),t())},Jr=async()=>{if(!i.trim()){r({status:"warning",title:"Username requis"});return}if(!a.trim()||c.trim().length<8){r({status:"warning",title:"Identifiants admin requis (mot de passe : 8 caractères min.)"});return}if(me==="s3"&&(!pe.trim()||!Be.trim())){r({status:"warning",title:"Bucket et endpoint S3 requis"});return}if(V&&!D.trim()&&!K.trim()){r({status:"warning",title:"Au moins un bot (username) requis pour le load-balancer"});return}if(P&&!_.trim()){r({status:"warning",title:"La clé API TomTom principale est requise"});return}const oe={username:i.trim(),adminUsername:a.trim(),adminPassword:c.trim(),telegramBotUsername:d&&p.trim()||void 0,telegramBotToken:d&&v.trim()||void 0,nowPaymentsApiKey:x&&g.trim()||void 0,nowPaymentsIpnSecret:x&&w.trim()||void 0,storageDriver:me,...me==="s3"?{s3Bucket:pe.trim(),s3Endpoint:Be.trim()}:{},...P?{tomtomApiKey:_.trim(),tomtomApiKey1:T.trim()||void 0,tomtomApiKey2:q.trim()||void 0,tomtomApiKey3:z.trim()||void 0}:{},...V?{lbBot1Username:D.trim()||void 0,lbBot1Token:F.trim()||void 0,lbBot2Username:K.trim()||void 0,lbBot2Token:Pe.trim()||void 0,lbStrategy:Te,lbJwtTtlSeconds:Ye.trim()||void 0,lbHealthCheckInterval:re.trim()||void 0}:{}};xn(!0);try{await Fe.createDemo(oe),r({status:"success",title:"Démo lancée",description:"Provisioning en cours."}),Lt(),n(),t()}catch(ei){const zo=ei instanceof Je?ei.message:"Erreur";r({status:"error",title:"Lancement impossible",description:zo})}finally{xn(!1)}};return s.jsxs(Fu,{isOpen:e,onClose:dr,size:"lg",closeOnOverlayClick:!ye,children:[s.jsx(yl,{}),s.jsxs(Cm,{children:[s.jsx(vl,{children:"Nouvelle démo"}),s.jsx(Bu,{isDisabled:ye}),s.jsx(gl,{children:s.jsxs(Se,{spacing:5,children:[s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{children:"Username"}),s.jsx(yt,{placeholder:"ex: acme-corp",value:i,onChange:oe=>o(oe.target.value)})]}),s.jsxs(Se,{spacing:3,p:3,borderWidth:"1px",borderRadius:"md",children:[s.jsx(Z,{fontSize:"sm",fontWeight:"semibold",children:"Compte admin de la démo"}),s.jsx(Z,{fontSize:"xs",color:"gray.500",children:"Créé une fois postgres/redis/backend/frontend démarrés — c'est ce que le client utilisera pour se connecter au backoffice de sa démo."}),s.jsxs(ge,{spacing:3,align:"start",children:[s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Username"}),s.jsx(yt,{value:a,onChange:oe=>l(oe.target.value)})]}),s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Mot de passe"}),s.jsx(un,{placeholder:"8 caractères min.",value:c,onChange:oe=>u(oe.target.value),autoComplete:"off"})]})]})]}),s.jsx(be,{isDisabled:ye,children:s.jsxs(ge,{justify:"space-between",children:[s.jsx(xe,{mb:0,children:"Bot Telegram"}),s.jsx(oc,{isChecked:d,onChange:oe=>f(oe.target.checked)})]})}),d&&s.jsxs(Se,{spacing:3,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Nom du bot (username)"}),s.jsx(yt,{placeholder:"mon_bot",value:p,onChange:oe=>h(oe.target.value)})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Token bot Telegram"}),s.jsx(un,{placeholder:"123456:ABC-DEF...",value:v,onChange:oe=>y(oe.target.value),autoComplete:"off"})]})]}),s.jsx(be,{isDisabled:ye,children:s.jsxs(ge,{justify:"space-between",children:[s.jsx(xe,{mb:0,children:"NowPayments (paiement crypto)"}),s.jsx(oc,{isChecked:x,onChange:oe=>b(oe.target.checked)})]})}),x&&s.jsxs(Se,{spacing:3,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API NowPayments"}),s.jsx(un,{placeholder:"clé API du compte marchand",value:g,onChange:oe=>S(oe.target.value),autoComplete:"off"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Secret IPN NowPayments"}),s.jsx(un,{placeholder:"secret configuré côté NowPayments",value:w,onChange:oe=>k(oe.target.value),autoComplete:"off"}),s.jsx(Z,{fontSize:"xs",color:"gray.500",mt:1,children:"Laissez vide pour garder celui pré-généré automatiquement."})]})]}),s.jsx(be,{isDisabled:ye,children:s.jsxs(ge,{justify:"space-between",children:[s.jsx(xe,{mb:0,children:"TomTom (GPS livreur)"}),s.jsx(oc,{isChecked:P,onChange:oe=>j(oe.target.checked)})]})}),P&&s.jsxs(Se,{spacing:3,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsx(Z,{fontSize:"xs",color:"gray.500",children:"Géocodage, itinéraire et ETA des livreurs. Jusqu'à 4 clés — le backend bascule automatiquement sur la suivante si une clé atteint son quota."}),s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API TomTom (principale)"}),s.jsx(un,{placeholder:"clé API TomTom",value:_,onChange:oe=>M(oe.target.value),autoComplete:"off"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API TomTom #2 (optionnelle)"}),s.jsx(un,{placeholder:"clé de secours",value:T,onChange:oe=>O(oe.target.value),autoComplete:"off"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API TomTom #3 (optionnelle)"}),s.jsx(un,{placeholder:"clé de secours",value:q,onChange:oe=>ne(oe.target.value),autoComplete:"off"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Clé API TomTom #4 (optionnelle)"}),s.jsx(un,{placeholder:"clé de secours",value:z,onChange:oe=>X(oe.target.value),autoComplete:"off"})]})]}),s.jsx(be,{isDisabled:ye,children:s.jsxs(ge,{justify:"space-between",children:[s.jsx(xe,{mb:0,children:"Load-balancer Telegram"}),s.jsx(oc,{isChecked:V,onChange:oe=>I(oe.target.checked)})]})}),V&&s.jsxs(Se,{spacing:4,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsx(Z,{fontSize:"xs",color:"gray.500",children:"Répartit le trafic entre plusieurs bots. Renseignez au moins le bot 1 ; le bot 2 est optionnel."}),s.jsxs(ge,{spacing:3,align:"start",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Bot 1 — username"}),s.jsx(yt,{placeholder:"mon_bot_1",value:D,onChange:oe=>R(oe.target.value)})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Bot 1 — token"}),s.jsx(un,{placeholder:"123456:ABC-DEF...",value:F,onChange:oe=>G(oe.target.value),autoComplete:"off"})]})]}),s.jsxs(ge,{spacing:3,align:"start",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Bot 2 — username (optionnel)"}),s.jsx(yt,{placeholder:"mon_bot_2",value:K,onChange:oe=>ee(oe.target.value)})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Bot 2 — token"}),s.jsx(un,{placeholder:"123456:ABC-DEF...",value:Pe,onChange:oe=>we(oe.target.value),autoComplete:"off"})]})]}),s.jsxs(ge,{spacing:3,align:"start",children:[s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Stratégie de répartition"}),s.jsxs(dT,{value:Te,onChange:oe=>Ge(oe.target.value),children:[s.jsx("option",{value:"failover",children:"Failover"}),s.jsx("option",{value:"roundrobin",children:"Round-robin"}),s.jsx("option",{value:"leastconn",children:"Moins de connexions"})]})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"TTL JWT (secondes)"}),s.jsx(yt,{placeholder:"300",value:Ye,onChange:oe=>te(oe.target.value),type:"number"})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Intervalle health-check (s)"}),s.jsx(yt,{placeholder:"30",value:re,onChange:oe=>$e(oe.target.value),type:"number"})]})]})]}),s.jsxs(be,{isDisabled:ye,children:[s.jsx(xe,{children:"Stockage des fichiers"}),s.jsx(cT,{value:me,onChange:oe=>it(oe),children:s.jsxs(Se,{direction:"row",spacing:6,children:[s.jsx(Cv,{value:"local",children:"Local (disque du cluster)"}),s.jsx(Cv,{value:"s3",children:"S3"})]})})]}),me==="s3"&&s.jsxs(Se,{spacing:4,pl:3,borderLeftWidth:"2px",borderColor:"primary.500",children:[s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Nom du bucket"}),s.jsx(yt,{placeholder:"mon-bucket-demo",value:pe,onChange:oe=>lt(oe.target.value)})]}),s.jsxs(be,{isRequired:!0,isDisabled:ye,children:[s.jsx(xe,{fontSize:"sm",children:"Endpoint S3"}),s.jsx(yt,{placeholder:"https://s3.exemple.com",value:Be,onChange:oe=>Et(oe.target.value)})]})]})]})}),s.jsxs(jm,{children:[s.jsx(ve,{variant:"ghost",mr:3,onClick:dr,isDisabled:ye,children:"Annuler"}),s.jsx(ve,{colorScheme:"primary",onClick:Jr,isLoading:ye,children:"Lancer la démo"})]})]})]})}function V7({demo:e,onClose:t,onSaved:n}){const r=Zr(),[i,o]=m.useState(""),[a,l]=m.useState(!1);m.useEffect(()=>{o((e==null?void 0:e.custom_domain)??"")},[e]);const c=()=>{a||t()},u=async()=>{if(e){l(!0);try{await Fe.setDemoDomain(e.id,i.trim()),r({status:"success",title:"Domaine mis à jour"}),n(),t()}catch(d){const f=d instanceof Je?d.message:"Erreur";r({status:"error",title:"Mise à jour impossible",description:f})}finally{l(!1)}}};return s.jsxs(Fu,{isOpen:!!e,onClose:c,closeOnOverlayClick:!a,children:[s.jsx(yl,{}),s.jsxs(Cm,{children:[s.jsx(vl,{children:"Domaine de la plateforme"}),s.jsx(Bu,{isDisabled:a}),s.jsx(gl,{children:s.jsxs(be,{children:[s.jsx(xe,{fontSize:"sm",children:"Domaine personnalisé"}),s.jsx(yt,{placeholder:"boutique.mon-domaine.com",value:i,onChange:d=>o(d.target.value),isDisabled:a,fontFamily:"mono"}),s.jsxs(au,{children:["Laissez vide pour revenir au domaine par défaut (",e==null?void 0:e.namespace,".). Le DNS du domaine choisi doit pointer vers le cluster, et un certificat TLS valide doit le couvrir — le certificat wildcard partagé ne couvre que le domaine par défaut."]})]})}),s.jsxs(jm,{children:[s.jsx(ve,{variant:"ghost",mr:3,onClick:c,isDisabled:a,children:"Annuler"}),s.jsx(ve,{colorScheme:"primary",onClick:u,isLoading:a,children:"Enregistrer"})]})]})]})}const L0=[{key:"api",label:"Backend"},{key:"web",label:"Frontend"},{key:"db",label:"PostgreSQL"},{key:"dbm",label:"Redis"}];function jx({state:e}){const t=L0.every(r=>e[r.key].phase==="Running"),n=L0.filter(r=>e[r.key].phase!=="Running").length;return s.jsxs(Se,{spacing:3,children:[s.jsxs(ge,{spacing:2,children:[s.jsx(se,{w:"8px",h:"8px",borderRadius:"full",bg:t?"green.400":"red.400",flexShrink:0}),s.jsx(Z,{fontSize:"sm",fontWeight:"medium",children:t?"Tous les services sont opérationnels":`${n} service${n>1?"s":""} indisponible${n>1?"s":""}`})]}),s.jsx(gn,{columns:{base:1,lg:4},spacing:3,children:L0.map(r=>s.jsx(zce,{title:r.label,cs:e[r.key]},r.key))})]})}function zce({title:e,cs:t}){const n=t.cpu_limit_milli>0?Math.min(100,Math.round(t.cpu_milli/t.cpu_limit_milli*100)):0,r=t.memory_limit_mi>0?Math.min(100,Math.round(t.memory_mi/t.memory_limit_mi*100)):0;return s.jsxs(se,{p:3,borderWidth:"1px",borderRadius:"lg",bg:"bg-surface",minW:0,children:[s.jsxs(ge,{justify:"space-between",mb:3,children:[s.jsx(Z,{fontSize:"sm",fontWeight:"semibold",noOfLines:1,children:e}),s.jsxs(ge,{spacing:1.5,children:[s.jsx(se,{w:"7px",h:"7px",borderRadius:"full",bg:`${pk(t.phase)}.400`,flexShrink:0}),s.jsx(Wn,{colorScheme:pk(t.phase),fontSize:"10px",children:Ace(t.phase)})]})]}),s.jsxs(Se,{spacing:2,children:[s.jsxs(se,{children:[s.jsxs(kt,{justify:"space-between",fontSize:"xs",color:"gray.500",mb:1,children:[s.jsx(Z,{children:"CPU"}),s.jsxs(Z,{fontFamily:"mono",children:[t.cpu_milli,"m / ",t.cpu_limit_milli,"m"]})]}),s.jsx(kp,{value:n,size:"xs",borderRadius:"full",colorScheme:n>85?"red":n>60?"orange":"primary"})]}),s.jsxs(se,{children:[s.jsxs(kt,{justify:"space-between",fontSize:"xs",color:"gray.500",mb:1,children:[s.jsx(Z,{children:"Mémoire"}),s.jsxs(Z,{fontFamily:"mono",children:[t.memory_mi,"Mi / ",t.memory_limit_mi,"Mi"]})]}),s.jsx(kp,{value:r,size:"xs",borderRadius:"full",colorScheme:r>85?"red":r>60?"orange":"primary"})]})]})]})}function Px(e){return s.jsx(Tt,{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:3,...e,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 18l6-6-6-6"})})}function W7({demo:e,isOpen:t,onToggle:n,detailsLoading:r,details:i,onEditDomain:o,expiresLabel:a,actions:l}){return s.jsxs(se,{borderWidth:"1px",borderRadius:"lg",overflow:"hidden",bg:"bg-surface",children:[s.jsxs(se,{p:4,cursor:"pointer",onClick:n,_active:{bg:"chakra-subtle-bg"},children:[s.jsxs(ge,{justify:"space-between",align:"start",children:[s.jsxs(ge,{spacing:2,minW:0,flex:"1",children:[s.jsx(Tt,{as:Px,boxSize:3,color:"gray.400",flexShrink:0,transform:t?"rotate(90deg)":void 0,transition:"transform 0.15s"}),s.jsx(Z,{fontFamily:"mono",fontSize:"sm",noOfLines:1,wordBreak:"break-all",minW:0,flex:"1",children:e.namespace})]}),s.jsx(Wn,{colorScheme:Hm(e.status),flexShrink:0,children:Gm(e.status)})]}),s.jsxs(Se,{spacing:1,mt:3,fontSize:"sm",children:[s.jsxs(ge,{justify:"space-between",children:[s.jsx(Z,{color:"gray.500",children:"Client"}),s.jsx(Z,{children:e.username||"—"})]}),s.jsxs(ge,{justify:"space-between",align:"start",children:[s.jsx(Z,{color:"gray.500",flexShrink:0,children:"URL"}),s.jsxs(ge,{spacing:1,minW:0,flex:"1",justify:"flex-end",children:[e.status==="ready"?s.jsx(_o,{href:e.url,color:"primary.500",isExternal:!0,noOfLines:1,wordBreak:"break-all",minW:0,flex:"1",onClick:c=>c.stopPropagation(),children:e.url}):s.jsx(Z,{color:"gray.400",children:"—"}),s.jsx(On,{"aria-label":"Modifier le domaine",icon:s.jsx(Um,{}),size:"xs",variant:"ghost",flexShrink:0,onClick:c=>{c.stopPropagation(),o()}})]})]}),a&&s.jsxs(ge,{justify:"space-between",children:[s.jsx(Z,{color:"gray.500",children:"Expire dans"}),s.jsx(Z,{children:a})]})]}),l&&s.jsx(ge,{mt:3,spacing:2,flexWrap:"wrap",rowGap:2,onClick:c=>c.stopPropagation(),children:l})]}),s.jsx(Mu,{in:t,unmountOnExit:!0,animateOpacity:!0,children:s.jsx(se,{p:4,bg:"chakra-subtle-bg",borderTopWidth:"1px",children:r&&!i?s.jsx(ge,{justify:"center",py:2,children:s.jsx(Vn,{size:"sm"})}):i?s.jsx(jx,{state:i.state}):s.jsx(Z,{color:"gray.500",fontSize:"sm",children:"Aucune donnée."})})})]})}const Rce=5e3,Mce=5e3;function Ice(){const e=Zr(),t=Er(),[n,r]=m.useState([]),[i,o]=m.useState(!0),[a,l]=m.useState(null),[c,u]=m.useState(null),[d,f]=m.useState(!1),[p,h]=m.useState(null),[v,y]=m.useState(null),[x,b]=m.useState(null),[g,S]=m.useState(!1),w=m.useCallback(async()=>{try{const T=await Fe.listDemos();r((T.items??[]).filter(O=>O.type_abonnement!=="premium"))}catch(T){T instanceof Je&&T.status===401?t("/admin/login"):e({status:"error",title:"Chargement des démos impossible"})}finally{o(!1)}},[t,e]);m.useEffect(()=>{w();const T=setInterval(()=>void w(),Rce);return()=>clearInterval(T)},[w]);const k=async T=>{l(T.id);try{await Fe.extendDemo(T.id),e({status:"success",title:"Démo prolongée de 30 jours"}),await w()}catch(O){const q=O instanceof Je?O.message:"Erreur";e({status:"error",title:"Prolongation impossible",description:q})}finally{l(null)}},P=async()=>{if(!c)return;const T=c;l(T.id);try{await Fe.deleteDemo(T.id),e({status:"success",title:"Démo détruite"}),u(null),await w()}catch(O){const q=O instanceof Je?O.message:"Erreur";e({status:"error",title:"Destruction impossible",description:q})}finally{l(null)}},j=async T=>{if(v===T.id){y(null),b(null);return}y(T.id),b(null),S(!0);try{const O=await Fe.getDemoDetails(T.namespace);b(O)}catch(O){const q=O instanceof Je?O.message:"Erreur";e({status:"error",title:"État des pods indisponible",description:q}),y(null)}finally{S(!1)}};m.useEffect(()=>{const T=n.find(ne=>ne.id===v);if(!T)return;const O=T.namespace,q=setInterval(()=>{Fe.getDemoDetails(O).then(b).catch(()=>{})},Mce);return()=>clearInterval(q)},[v]);const _=T=>T!=="expired"&&T!=="failed",M=T=>s.jsxs(s.Fragment,{children:[s.jsx(ve,{size:"sm",variant:"outline",isDisabled:!_(T.status)||a===T.id,onClick:O=>{O.stopPropagation(),k(T)},children:"+30 j"}),s.jsx(ve,{size:"sm",colorScheme:"red",variant:"outline",isDisabled:!_(T.status),onClick:O=>{O.stopPropagation(),u(T)},children:"Détruire"})]});return s.jsxs(s.Fragment,{children:[s.jsxs(kt,{mb:6,align:"center",gap:4,wrap:"wrap",children:[s.jsx(_t,{size:"md",mr:4,children:"Démos"}),s.jsx(ja,{}),s.jsx(ve,{colorScheme:"primary",onClick:()=>f(!0),children:"Nouvelle démo"})]}),s.jsx(B7,{isOpen:d,onClose:()=>f(!1),onCreated:()=>void w()}),i?s.jsx(Vn,{}):n.length===0?s.jsx(Z,{color:"gray.500",children:"Aucune démo active. Lancez-en une avec le bouton ci-dessus."}):s.jsxs(s.Fragment,{children:[s.jsx(Nb,{borderWidth:"1px",borderRadius:"lg",display:{base:"none",md:"block"},children:s.jsxs(Pm,{children:[s.jsx(Ob,{children:s.jsxs(fo,{children:[s.jsx(fn,{children:"Namespace"}),s.jsx(fn,{children:"Client"}),s.jsx(fn,{children:"Statut"}),s.jsx(fn,{children:"URL"}),s.jsx(fn,{children:"Expire dans"}),s.jsx(fn,{})]})}),s.jsx(Db,{children:n.map(T=>{const O=v===T.id;return s.jsxs(m.Fragment,{children:[s.jsxs(fo,{cursor:"pointer",bg:O?"chakra-subtle-bg":void 0,_hover:{bg:"chakra-subtle-bg"},onClick:()=>j(T),children:[s.jsx(qt,{fontFamily:"mono",children:s.jsxs(ge,{spacing:2,children:[s.jsx(Tt,{as:Px,boxSize:3,color:"gray.400",transform:O?"rotate(90deg)":void 0,transition:"transform 0.15s"}),s.jsx(Z,{children:T.namespace})]})}),s.jsx(qt,{children:T.username?s.jsx(Z,{children:T.username}):s.jsx(Z,{color:"gray.400",children:"—"})}),s.jsx(qt,{children:s.jsx(Wn,{colorScheme:Hm(T.status),children:Gm(T.status)})}),s.jsx(qt,{children:s.jsxs(ge,{spacing:1,children:[T.status==="ready"?s.jsx(_o,{href:T.url,color:"primary.500",isExternal:!0,onClick:q=>q.stopPropagation(),children:T.url}):s.jsx(Z,{color:"gray.400",children:"—"}),s.jsx(On,{"aria-label":"Modifier le domaine",icon:s.jsx(Um,{}),size:"xs",variant:"ghost",onClick:q=>{q.stopPropagation(),h(T)}})]})}),s.jsx(qt,{children:_(T.status)?mk(T.expires_at):"—"}),s.jsx(qt,{textAlign:"right",children:s.jsx(ge,{justify:"flex-end",children:M(T)})})]}),s.jsx(fo,{children:s.jsx(qt,{p:0,border:O?void 0:"none",colSpan:6,children:s.jsx(Mu,{in:O,unmountOnExit:!0,animateOpacity:!0,children:s.jsx(se,{p:4,bg:"chakra-subtle-bg",borderTopWidth:"1px",children:g&&!x?s.jsx(kt,{justify:"center",py:4,children:s.jsx(Vn,{size:"sm"})}):x?s.jsx(jx,{state:x.state}):s.jsx(Z,{color:"gray.500",fontSize:"sm",children:"Aucune donnée."})})})})})]},T.id)})})]})}),s.jsx(Se,{spacing:3,display:{base:"flex",md:"none"},children:n.map(T=>s.jsx(W7,{demo:T,isOpen:v===T.id,onToggle:()=>j(T),detailsLoading:g,details:v===T.id?x:null,onEditDomain:()=>h(T),expiresLabel:_(T.status)?mk(T.expires_at):"—",actions:M(T)},T.id))})]}),s.jsxs($ce,{isOpen:!!c,title:"Détruire la démo ?",confirmLabel:"Détruire",isLoading:!!c&&a===c.id,onConfirm:P,onClose:()=>u(null),children:["La démo"," ",s.jsx(Z,{as:"span",fontFamily:"mono",fontWeight:"semibold",children:c==null?void 0:c.namespace})," ","et toutes ses données seront supprimées définitivement. Les ressources du pool seront libérées. Cette action est irréversible."]}),s.jsx(V7,{demo:p,onClose:()=>h(null),onSaved:()=>void w()})]})}const Lce=5e3,Nce=5e3;function Dce(){const e=Zr(),t=Er(),[n,r]=m.useState([]),[i,o]=m.useState(!0),[a,l]=m.useState(!1),[c,u]=m.useState(null),[d,f]=m.useState(null),[p,h]=m.useState(null),[v,y]=m.useState(!1),x=m.useCallback(async()=>{try{const g=await Fe.listDemos();r((g.items??[]).filter(S=>S.type_abonnement==="premium"))}catch(g){g instanceof Je&&g.status===401?t("/admin/login"):e({status:"error",title:"Chargement des démos impossible"})}finally{o(!1)}},[t,e]);m.useEffect(()=>{x();const g=setInterval(()=>void x(),Lce);return()=>clearInterval(g)},[x]);const b=async g=>{if(d===g.id){f(null),h(null);return}f(g.id),h(null),y(!0);try{const S=await Fe.getDemoDetails(g.namespace);h(S)}catch(S){const w=S instanceof Je?S.message:"Erreur";e({status:"error",title:"État des pods indisponible",description:w}),f(null)}finally{y(!1)}};return m.useEffect(()=>{const g=n.find(k=>k.id===d);if(!g)return;const S=g.namespace,w=setInterval(()=>{Fe.getDemoDetails(S).then(h).catch(()=>{})},Nce);return()=>clearInterval(w)},[d]),s.jsxs(s.Fragment,{children:[s.jsxs(kt,{mb:2,align:"center",gap:4,wrap:"wrap",children:[s.jsx(_t,{size:"md",mr:4,children:"Démos Premium"}),s.jsx(ja,{}),s.jsx(ve,{colorScheme:"primary",onClick:()=>l(!0),children:"Déployer une plateforme"})]}),s.jsx(Z,{color:"gray.500",mb:6,fontSize:"sm",children:"Démos rattachées à un client passé en abonnement payant — stockage persistant, n'expirent plus."}),s.jsx(B7,{isOpen:a,onClose:()=>l(!1),onCreated:()=>void x()}),i?s.jsx(Vn,{}):n.length===0?s.jsx(Z,{color:"gray.500",children:"Aucune démo premium pour le moment."}):s.jsxs(s.Fragment,{children:[s.jsx(Nb,{borderWidth:"1px",borderRadius:"lg",display:{base:"none",md:"block"},children:s.jsxs(Pm,{children:[s.jsx(Ob,{children:s.jsxs(fo,{children:[s.jsx(fn,{children:"Namespace"}),s.jsx(fn,{children:"Client"}),s.jsx(fn,{children:"Statut"}),s.jsx(fn,{children:"URL"})]})}),s.jsx(Db,{children:n.map(g=>{const S=d===g.id;return s.jsxs(m.Fragment,{children:[s.jsxs(fo,{cursor:"pointer",bg:S?"chakra-subtle-bg":void 0,_hover:{bg:"chakra-subtle-bg"},onClick:()=>b(g),children:[s.jsx(qt,{fontFamily:"mono",children:s.jsxs(ge,{spacing:2,children:[s.jsx(Tt,{as:Px,boxSize:3,color:"gray.400",transform:S?"rotate(90deg)":void 0,transition:"transform 0.15s"}),s.jsx(Z,{children:g.namespace})]})}),s.jsx(qt,{children:g.username||s.jsx(Z,{color:"gray.400",children:"—"})}),s.jsx(qt,{children:s.jsx(Wn,{colorScheme:Hm(g.status),children:Gm(g.status)})}),s.jsx(qt,{children:s.jsxs(ge,{spacing:1,children:[g.status==="ready"?s.jsx(_o,{href:g.url,color:"primary.500",isExternal:!0,onClick:w=>w.stopPropagation(),children:g.url}):s.jsx(Z,{color:"gray.400",children:"—"}),s.jsx(On,{"aria-label":"Modifier le domaine",icon:s.jsx(Um,{}),size:"xs",variant:"ghost",onClick:w=>{w.stopPropagation(),u(g)}})]})})]}),s.jsx(fo,{children:s.jsx(qt,{p:0,border:S?void 0:"none",colSpan:4,children:s.jsx(Mu,{in:S,unmountOnExit:!0,animateOpacity:!0,children:s.jsx(se,{p:4,bg:"chakra-subtle-bg",borderTopWidth:"1px",children:v&&!p?s.jsx(Vn,{size:"sm"}):p?s.jsx(jx,{state:p.state}):s.jsx(Z,{color:"gray.500",fontSize:"sm",children:"Aucune donnée."})})})})})]},g.id)})})]})}),s.jsx(Se,{spacing:3,display:{base:"flex",md:"none"},children:n.map(g=>s.jsx(W7,{demo:g,isOpen:d===g.id,onToggle:()=>b(g),detailsLoading:v,details:d===g.id?p:null,onEditDomain:()=>u(g)},g.id))})]}),s.jsx(V7,{demo:c,onClose:()=>u(null),onSaved:()=>void x()})]})}const Oce=1e4;function Fce(){const e=Zr(),t=Er(),[n,r]=m.useState([]),[i,o]=m.useState(!0),[a,l]=m.useState(null),[c,u]=m.useState(""),[d,f]=m.useState(null),p=m.useCallback(async()=>{try{const y=await Fe.listCodes();r(y.items??[])}catch(y){y instanceof Je&&y.status===401?t("/admin/login"):e({status:"error",title:"Chargement des codes impossible"})}finally{o(!1)}},[t,e]);m.useEffect(()=>{p();const y=setInterval(()=>void p(),Oce);return()=>clearInterval(y)},[p]);const h=async y=>{if(y.preventDefault(),!c.trim()){e({status:"error",title:"Veuillez entrer un nom d'utilisateur"});return}l("generate");try{const x=await Fe.createCode(c.trim());f(x.code),u(""),e({status:"success",title:"Code généré avec succès !"}),await p()}catch(x){const b=x instanceof Je?x.message:"Erreur";e({status:"error",title:"Génération impossible",description:b})}finally{l(null)}},v=async y=>{try{await navigator.clipboard.writeText(y),e({status:"success",title:"Code copié dans le presse-papiers !"})}catch{const b=document.createElement("textarea");b.value=y,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select();const g=document.execCommand("copy");document.body.removeChild(b),e(g?{status:"success",title:"Code copié dans le presse-papiers !"}:{status:"error",title:"Impossible de copier. Essayez manuellement."})}};return s.jsxs(s.Fragment,{children:[s.jsxs(kt,{mb:6,align:"center",children:[s.jsx(_t,{size:"md",children:"Gestion des codes de souscription"}),s.jsx(ja,{})]}),s.jsx(se,{mb:8,p:6,borderWidth:"1px",borderRadius:"lg",bg:"bg-surface",children:s.jsx("form",{onSubmit:h,children:s.jsxs(Cp,{spacing:4,align:"stretch",children:[s.jsxs(Se,{direction:{base:"column",sm:"row"},align:{base:"stretch",sm:"center"},gap:4,children:[s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:"Nom d\\'utilisateur"}),s.jsx(yt,{type:"text",value:c,onChange:y=>u(y.target.value),placeholder:"Entrez le nom d'utilisateur",isDisabled:a==="generate",maxLength:64})]}),s.jsx(ve,{colorScheme:"primary",type:"submit",isLoading:a==="generate",mt:{base:0,sm:6},h:"40px",flexShrink:0,w:{base:"full",sm:"auto"},children:"Générer un code"})]}),d&&s.jsxs(se,{p:4,bg:"gray.900",borderRadius:"md",borderWidth:"1px",borderColor:"whiteAlpha.200",children:[s.jsxs(Z,{fontSize:"sm",color:"gray.400",mb:2,children:["Code généré pour ",s.jsx("strong",{children:c})," :"]}),s.jsxs(ge,{children:[s.jsx(Z,{fontFamily:"mono",fontSize:"xl",fontWeight:"bold",letterSpacing:"widest",children:d}),s.jsx(ve,{size:"sm",variant:"outline",onClick:()=>v(d),children:"Copier"})]})]})]})})}),i?s.jsx(Vn,{}):n.length===0?s.jsx(Z,{color:"gray.500",children:"Aucun code de souscription généré."}):s.jsx(Nb,{borderWidth:"1px",borderRadius:"lg",children:s.jsxs(Pm,{children:[s.jsx(Ob,{children:s.jsxs(fo,{children:[s.jsx(fn,{children:"ID"}),s.jsx(fn,{children:"Utilisateur"}),s.jsx(fn,{children:"Code"}),s.jsx(fn,{children:"Date de création"}),s.jsx(fn,{})]})}),s.jsx(Db,{children:n.map(y=>s.jsxs(fo,{children:[s.jsxs(qt,{fontFamily:"mono",fontSize:"sm",children:[y.id.slice(0,8),"..."]}),s.jsx(qt,{children:s.jsx(Wn,{colorScheme:"gray",px:2,py:1,children:y.username})}),s.jsx(qt,{fontFamily:"mono",letterSpacing:"wide",children:y.code_verif}),s.jsx(qt,{fontSize:"sm",color:"gray.400",children:new Date(y.created_at).toLocaleString("fr-FR")}),s.jsx(qt,{textAlign:"right",children:s.jsx(ve,{size:"sm",variant:"outline",onClick:()=>v(y.code_verif),children:"Copier"})})]},y.id))})]})})]})}function Bce(){const e=Zr(),t=Er(),[n,r]=m.useState(null),[i,o]=m.useState(null),[a,l]=m.useState(!0),[c,u]=m.useState(!1),[d,f]=m.useState(""),[p,h]=m.useState(!1),[v,y]=m.useState([]),[x,b]=m.useState(!0),g=m.useCallback(async()=>{try{const _=await Fe.me();r(_.type_abonnement??null),o(_.expired_at?new Date(_.expired_at):null)}catch(_){_ instanceof Je&&_.status===401?t("/login"):e({status:"error",title:"Chargement de l'abonnement impossible"})}finally{l(!1)}},[t,e]),S=m.useCallback(async()=>{try{const _=await Fe.listMyDemos();y(_.items??[])}catch{}finally{b(!1)}},[]);m.useEffect(()=>{g(),S()},[g,S]);const w=async _=>{if(_.preventDefault(),!d.trim()){e({status:"error",title:"Veuillez entrer un code"});return}u(!0);try{await Fe.addCode(d.trim()),e({status:"success",title:"Abonnement premium activé !"}),f(""),h(!1),await g()}catch(M){const T=M instanceof Je?M.message:"Erreur";e({status:"error",title:"Code invalide",description:T})}finally{u(!1)}},k=n==="premium",P=!k||p,j=i?Math.ceil((i.getTime()-Date.now())/(1e3*60*60*24)):null;return s.jsxs(s.Fragment,{children:[s.jsxs(kt,{mb:6,align:"center",children:[s.jsx(_t,{size:"md",children:k?"Ma plateforme":"Ma démo"}),s.jsx(ja,{})]}),s.jsx(se,{mb:8,p:6,borderWidth:"1px",borderRadius:"lg",bg:"bg-surface",children:x?s.jsx(Vn,{size:"sm"}):v.length===0?s.jsx(Z,{color:"gray.500",children:k?"Aucune plateforme pour le moment.":"Aucune démo pour le moment."}):s.jsx(Cp,{align:"stretch",spacing:3,children:v.map(_=>s.jsxs(ge,{justify:"space-between",flexWrap:"wrap",rowGap:2,children:[_.status==="ready"?s.jsx(_o,{href:_.url,color:"primary.500",isExternal:!0,fontFamily:"mono",children:_.url}):s.jsx(Z,{color:"gray.400",fontFamily:"mono",children:_.url||"—"}),s.jsx(Wn,{colorScheme:Hm(_.status),children:Gm(_.status)})]},_.id))})}),s.jsxs(kt,{mb:6,align:"center",children:[s.jsx(_t,{size:"md",children:"Mon abonnement"}),s.jsx(ja,{})]}),s.jsx(se,{mb:8,p:6,borderWidth:"1px",borderRadius:"lg",bg:"bg-surface",children:a?s.jsx(Vn,{}):s.jsxs(Cp,{align:"stretch",spacing:4,children:[s.jsxs(ge,{flexWrap:"wrap",rowGap:2,children:[s.jsx(Z,{color:"gray.400",children:"Statut actuel :"}),s.jsx(Wn,{colorScheme:k?"purple":"gray",px:2,py:1,children:k?"Premium":"Demo"}),k&&!p&&s.jsx(ve,{size:"sm",variant:"link",ml:2,whiteSpace:"normal",textAlign:"left",onClick:()=>h(!0),children:"Renouveler avec un nouveau code"})]}),k&&i&&s.jsx(Z,{fontSize:"sm",color:j!==null&&j<=5?"orange.400":"gray.400",children:j!==null&&j>0?`Expire dans ${j} jour${j>1?"s":""} (le ${i.toLocaleDateString("fr-FR")})`:`Expiré depuis le ${i.toLocaleDateString("fr-FR")}`}),P&&s.jsx("form",{onSubmit:w,children:s.jsxs(Se,{direction:{base:"column",sm:"row"},align:{base:"stretch",sm:"center"},gap:4,children:[s.jsxs(be,{isRequired:!0,children:[s.jsx(xe,{children:k?"Nouveau code de renouvellement":"Code de souscription"}),s.jsx(yt,{type:"text",value:d,onChange:_=>f(_.target.value.toUpperCase()),placeholder:"XXXX-XXXX-XXXX-XXXX",isDisabled:c,fontFamily:"mono",letterSpacing:"wide"})]}),s.jsxs(ge,{flexShrink:0,children:[s.jsx(ve,{colorScheme:"primary",type:"submit",isLoading:c,mt:{base:0,sm:6},h:"40px",flexShrink:0,w:{base:"full",sm:"auto"},children:k?"Renouveler":"Activer"}),k&&s.jsx(ve,{variant:"ghost",mt:{base:0,sm:6},h:"40px",flexShrink:0,w:{base:"full",sm:"auto"},onClick:()=>{h(!1),f("")},isDisabled:c,children:"Annuler"})]})]})})]})})]})}function hk(e){return e==="admin"?"Administrateur":"Client"}function Vce(e){return e==="admin"?"purple":"blue"}function Wce(e){const t=(e==null?void 0:e.toLowerCase())??"";return t.includes("premium")||t.includes("pro")?"green":t.includes("expired")||t===""?"red":"gray"}function Uce(e){if(!e)return"—";const t=new Date(e);return Number.isNaN(t.getTime())?"—":t.toLocaleDateString("fr-FR",{day:"2-digit",month:"long",year:"numeric"})}function Xd(){const{isEditing:e,getSubmitButtonProps:t,getCancelButtonProps:n,getEditButtonProps:r}=AG();return e?s.jsxs(ab,{size:"sm",spacing:1,children:[s.jsx(On,{"aria-label":"Enregistrer",icon:s.jsx(Ece,{}),...t()}),s.jsx(On,{"aria-label":"Annuler",icon:s.jsx(Tce,{}),...n()})]}):s.jsx(On,{"aria-label":"Modifier le nom d'utilisateur",size:"sm",variant:"ghost",icon:s.jsx(Um,{}),...r()})}function Hce(){const e=Zr(),t=Er(),{logout:n}=$o(),[r,i]=m.useState(null),[o,a]=m.useState(!0),[l,c]=m.useState(!1),[u,d]=m.useState(!1),[f,p]=m.useState(!1),[h,v]=m.useState(0),[y,x]=m.useState(!1),[b,g]=m.useState(""),[S,w]=m.useState(!1),[k,P]=m.useState(!1),[j,_]=m.useState(""),[M,T]=m.useState(""),[O,q]=m.useState(""),[ne,z]=m.useState(!1);m.useEffect(()=>{let F=!1;return(async()=>{try{const[G,K]=await Promise.all([Fe.me(),Fe.getTelegram()]);if(F)return;if(i(G),g(K.telegram??""),G.role==="admin"){const ee=await Fe.getAlertSettings();if(F)return;_(ee.discord_webhook_url),T(ee.telegram_bot_token),q(ee.telegram_chat_id)}}catch(G){if(G instanceof Je&&G.status===401){t("/login");return}e({status:"error",title:"Impossible de charger le profil"})}finally{F||a(!1)}})(),()=>{F=!0}},[t,e]);const X=async()=>{z(!0);try{const F=await Fe.setAlertSettings({discord_webhook_url:j.trim(),telegram_bot_token:M.trim(),telegram_chat_id:O.trim()});_(F.discord_webhook_url),T(F.telegram_bot_token),q(F.telegram_chat_id),e({status:"success",title:"Alertes enregistrées"})}catch(F){if(F instanceof Je&&F.status===401){t("/login");return}e({status:"error",title:"Impossible d'enregistrer les alertes",description:F instanceof Je?F.message:void 0})}finally{z(!1)}},V=async F=>{const G=F.trim();if(!(!r||!G||G===r.username)){d(!0);try{const K=await Fe.updateUsername(G);i({...r,username:K.username}),e({status:"success",title:"Nom d'utilisateur mis à jour"})}catch(K){if(K instanceof Je&&K.status===401){t("/login");return}e({status:"error",title:"Impossible de mettre à jour le nom d'utilisateur",description:K instanceof Je?K.message:void 0})}finally{d(!1)}}},I=async F=>{const G=F.trim();if(!r||G.length<8){G.length>0&&e({status:"warning",title:"Le mot de passe doit contenir au moins 8 caractères"}),v(K=>K+1);return}p(!0);try{await Fe.updatePassword(G),e({status:"success",title:"Mot de passe mis à jour"})}catch(K){if(K instanceof Je&&K.status===401){t("/login");return}e({status:"error",title:"Impossible de mettre à jour le mot de passe",description:K instanceof Je?K.message:void 0})}finally{p(!1),v(K=>K+1)}},D=async F=>{const G=F.trim();if(!G){P(!1);return}w(!0);try{const K=await Fe.setTelegram(G);g(K.telegram),P(!1),e({status:"success",title:"Telegram enregistré"})}catch(K){if(K instanceof Je&&K.status===401){t("/login");return}e({status:"error",title:"Impossible d'enregistrer le Telegram",description:K instanceof Je?K.message:void 0})}finally{w(!1)}},R=async()=>{c(!0);try{await Fe.logout(),n==null||n(),t("/login")}catch{e({status:"error",title:"Déconnexion impossible"})}finally{c(!1)}};return s.jsx(se,{bg:"chakra-subtle-bg",py:{base:10,md:14},minH:"100%",children:s.jsxs(pn,{maxW:"container.md",children:[s.jsxs(Se,{spacing:3,mb:8,children:[s.jsx(_t,{size:"lg",children:"Mon profil"}),s.jsx(Z,{color:"gray.400",fontSize:"md",children:"Informations de votre compte et de votre abonnement."})]}),s.jsx(se,{bg:"bg-surface",borderWidth:"1px",borderColor:"chakra-border-color",borderRadius:"xl",p:{base:6,md:10},boxShadow:"lg",children:o?s.jsx(kt,{justify:"center",py:10,children:s.jsx(Vn,{})}):r?s.jsxs(Se,{spacing:8,children:[s.jsxs(kt,{align:"center",gap:5,wrap:"wrap",children:[s.jsx(ob,{name:r.username,size:"xl"}),s.jsxs(se,{children:[s.jsx(tc,{defaultValue:r.username,onSubmit:V,isDisabled:u,submitOnBlur:!1,children:s.jsxs(ge,{spacing:2,children:[s.jsx(rc,{as:_t,size:"md",fontFamily:"mono"}),s.jsx(nc,{fontFamily:"mono",fontSize:"md",fontWeight:"bold"}),s.jsx(Xd,{})]})},r.username),s.jsxs(ge,{mt:2,spacing:2,children:[s.jsx(Wn,{colorScheme:Vce(r.role),children:hk(r.role)}),r.type_abonnement&&s.jsx(Wn,{colorScheme:Wce(r.type_abonnement),children:r.type_abonnement})]})]})]}),s.jsx(ua,{borderColor:"chakra-border-color"}),s.jsxs(gn,{columns:{base:1,sm:2},spacing:6,children:[s.jsxs(Ho,{children:[s.jsx(Go,{children:"Identifiant"}),s.jsx(Fi,{fontSize:"md",fontFamily:"mono",children:r.user_id})]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Rôle"}),s.jsx(Fi,{fontSize:"md",children:hk(r.role)})]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Type d'abonnement"}),s.jsx(Fi,{fontSize:"md",children:r.type_abonnement||"—"})]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Mot de passe"}),s.jsx(tc,{defaultValue:"",placeholder:"••••••••",onSubmit:I,isDisabled:f,submitOnBlur:!1,children:s.jsxs(ge,{spacing:2,children:[s.jsx(rc,{as:Fi,fontSize:"md",fontFamily:"mono"}),s.jsx(nc,{type:y?"text":"password",fontSize:"md",fontFamily:"mono"}),s.jsx(On,{"aria-label":y?"Masquer le mot de passe":"Afficher le mot de passe",icon:s.jsx(Oe,{icon:y?D7:T7}),size:"sm",variant:"ghost",tabIndex:-1,onClick:()=>x(F=>!F)}),s.jsx(Xd,{})]})},h)]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Telegram"}),b?s.jsx(tc,{defaultValue:b,onSubmit:D,isDisabled:S,submitOnBlur:!1,children:s.jsxs(ge,{spacing:2,children:[s.jsx(rc,{as:Fi,fontSize:"md",fontFamily:"mono"}),s.jsx(nc,{fontSize:"md",fontFamily:"mono"}),s.jsx(Xd,{})]})},b):k?s.jsx(tc,{defaultValue:"",placeholder:"@monpseudo",startWithEditView:!0,onSubmit:D,onCancel:()=>P(!1),isDisabled:S,submitOnBlur:!1,children:s.jsxs(ge,{spacing:2,children:[s.jsx(rc,{as:Fi,fontSize:"md",fontFamily:"mono"}),s.jsx(nc,{fontSize:"md",fontFamily:"mono"}),s.jsx(Xd,{})]})}):s.jsx(ve,{size:"sm",variant:"outline",onClick:()=>P(!0),children:"Ajouter mon Telegram"})]}),s.jsxs(Ho,{children:[s.jsx(Go,{children:"Expire le"}),s.jsx(Fi,{fontSize:"md",children:Uce(r.expired_at)})]})]}),r.role==="admin"&&s.jsxs(s.Fragment,{children:[s.jsx(ua,{borderColor:"chakra-border-color"}),s.jsxs(Se,{spacing:4,children:[s.jsxs(se,{children:[s.jsx(_t,{size:"sm",children:"Alertes monitoring"}),s.jsx(Z,{color:"gray.500",fontSize:"sm",children:"Recevez une notification quand un pod d'une démo tombe en erreur (ou se rétablit). Réglages propres à votre compte."})]}),s.jsxs(be,{children:[s.jsx(xe,{fontSize:"sm",children:"Webhook Discord"}),s.jsx(yt,{fontFamily:"mono",fontSize:"sm",placeholder:"https://discord.com/api/webhooks/...",value:j,onChange:F=>_(F.target.value),isDisabled:ne})]}),s.jsxs(gn,{columns:{base:1,sm:2},spacing:4,children:[s.jsxs(be,{children:[s.jsx(xe,{fontSize:"sm",children:"Bot Telegram (token)"}),s.jsx(yt,{fontFamily:"mono",fontSize:"sm",placeholder:"123456789:AAExemple...",value:M,onChange:F=>T(F.target.value),isDisabled:ne})]}),s.jsxs(be,{children:[s.jsx(xe,{fontSize:"sm",children:"Telegram (chat ID)"}),s.jsx(yt,{fontFamily:"mono",fontSize:"sm",placeholder:"-100123456789",value:O,onChange:F=>q(F.target.value),isDisabled:ne}),s.jsx(au,{children:"Envoyez un message au bot puis récupérez le chat_id via son API."})]})]}),s.jsx(kt,{justify:"flex-end",children:s.jsx(ve,{size:"sm",colorScheme:"primary",isLoading:ne,onClick:X,children:"Enregistrer les alertes"})})]})]}),s.jsx(ua,{borderColor:"chakra-border-color"}),s.jsx(kt,{justify:"flex-end",children:s.jsx(ve,{colorScheme:"red",variant:"outline",isLoading:l,onClick:R,children:"Se déconnecter"})})]}):s.jsx(Z,{color:"gray.500",children:"Aucune information disponible."})})]})})}const gk=[{to:"/",label:"Accueil",end:!0},{to:"/tarifs",label:"Tarifs",end:!1},{to:"/documentation",label:"Documentation",end:!1},{to:"/contact",label:"Contact",end:!1}],Gce=()=>s.jsx(se,{as:"svg",w:"24px",h:"24px",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx(se,{as:"path",d:"M3 12h18M3 6h18M3 18h18"})});function Kce(){const{isOpen:e,onOpen:t,onClose:n}=Cu();return s.jsxs(se,{as:"header",position:"sticky",top:0,zIndex:"sticky",bg:"chakra-body-bg",borderBottomWidth:"1px",backdropFilter:"saturate(180%) blur(6px)",children:[s.jsx(pn,{maxW:"container.lg",children:s.jsxs(kt,{h:16,align:"center",justify:"space-between",children:[s.jsxs(ge,{spacing:8,children:[s.jsx(se,{as:Yt,to:"/",fontWeight:"bold",fontSize:"xl",letterSpacing:"tight",children:"Omnex"}),s.jsx(ge,{as:"nav",spacing:1,display:{base:"none",md:"flex"},children:gk.map(r=>s.jsx(vk,{to:r.to,end:r.end,children:r.label},r.to))})]}),s.jsxs(ge,{spacing:2,display:{base:"none",md:"flex"},children:[s.jsx(Ea,{}),s.jsx(ve,{as:Yt,to:"/login",variant:"ghost",size:"sm",children:"Espace client"}),s.jsx(ve,{as:Yt,to:"/register",colorScheme:"primary",size:"sm",children:"Créer un compte"})]}),s.jsxs(ge,{spacing:1,display:{base:"flex",md:"none"},children:[s.jsx(Ea,{}),s.jsx(On,{"aria-label":"Ouvrir le menu",variant:"ghost",onClick:t,icon:s.jsx(Gce,{})})]})]})}),s.jsxs(aT,{isOpen:e,placement:"right",onClose:n,size:"xs",children:[s.jsx(yl,{}),s.jsxs(Lb,{bg:"chakra-body-bg",children:[s.jsx(Bu,{size:"lg"}),s.jsx(vl,{borderBottomWidth:"1px",fontWeight:"bold",fontSize:"xl",children:"Omnex"}),s.jsxs(gl,{py:6,children:[s.jsx(Se,{as:"nav",spacing:1,children:gk.map(r=>s.jsx(vk,{to:r.to,end:r.end,onClick:n,mobile:!0,children:r.label},r.to))}),s.jsx(ua,{my:6}),s.jsxs(Se,{spacing:3,children:[s.jsx(ve,{as:Yt,to:"/login",variant:"outline",justifyContent:"flex-start",onClick:n,children:"Espace client"}),s.jsx(ve,{as:Yt,to:"/register",colorScheme:"primary",justifyContent:"flex-start",onClick:n,children:"Créer un compte"})]})]})]})]})]})}function vk({to:e,end:t,children:n,onClick:r,mobile:i=!1}){return s.jsx(ve,{as:p8,to:e,end:t,size:i?"lg":"sm",variant:"ghost",justifyContent:i?"flex-start":"center",onClick:r,_activeLink:{fontWeight:"bold",color:"primary.500"},children:n})}function qce(){return s.jsx(se,{as:"footer",borderTopWidth:"1px",mt:20,bg:"chakra-subtle-bg",children:s.jsxs(pn,{maxW:"container.lg",py:12,children:[s.jsxs(gn,{columns:{base:1,md:4},spacing:8,children:[s.jsxs(Se,{spacing:3,children:[s.jsx(Z,{fontWeight:"bold",fontSize:"lg",children:"Omnex"}),s.jsx(Z,{fontSize:"sm",color:"gray.500",children:"Plateforme de gestion de commandes & livraison, déployable en démo isolée en un clic."})]}),s.jsxs(Xce,{title:"Produit",children:[s.jsx(Yd,{to:"/",children:"Présentation"}),s.jsx(Yd,{to:"/tarifs",children:"Tarifs"}),s.jsx(Yd,{to:"/register",children:"Créer un compte"}),s.jsx(Yd,{to:"/documentation",children:"Documentation"})]})]}),s.jsx(ua,{my:8}),s.jsxs(ge,{justify:"space-between",flexWrap:"wrap",spacing:4,children:[s.jsxs(Z,{fontSize:"sm",color:"gray.500",children:["© ",new Date().getFullYear()," Omnex. Tous droits réservés."]}),s.jsxs(ge,{spacing:6,fontSize:"sm",color:"gray.500",children:[s.jsx(yk,{href:"#",children:"Mentions légales"}),s.jsx(yk,{href:"#",children:"Confidentialité"})]})]})]})})}function Xce({title:e,children:t}){return s.jsxs(Se,{spacing:2,children:[s.jsx(Z,{fontWeight:"semibold",fontSize:"sm",textTransform:"uppercase",color:"gray.500",children:e}),t]})}function Yd({to:e,children:t}){return s.jsx(_o,{as:Yt,to:e,fontSize:"sm",color:"gray.600",_hover:{color:"primary.500"},children:t})}function yk({href:e,children:t}){return s.jsx(_o,{href:e,fontSize:"sm",color:"gray.600",_hover:{color:"primary.500"},children:t})}function Yce(){return s.jsxs(kt,{direction:"column",minH:"100vh",children:[s.jsx(Kce,{}),s.jsx(se,{as:"main",flex:"1",children:s.jsx(d8,{})}),s.jsx(qce,{})]})}const Qce=()=>s.jsx(se,{as:"svg",w:"20px",h:"20px",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx(se,{as:"path",d:"M3 12h18M3 6h18M3 18h18"})}),bk="https://t.me/OMNEX_CORP";function Zce(){const{logout:e,isAdmin:t,isClient:n}=$o(),r=Er(),{isOpen:i,onOpen:o,onClose:a}=Cu(),l=async()=>{const d=t?"/admin/login":"/login";await e(),r(d,{replace:!0})},c=t?"Admin":n?"Client":"Utilisateur",u=t?"purple":"gray";return s.jsxs(se,{minH:"100vh",bg:"chakra-subtle-bg",overflowX:"hidden",children:[s.jsxs(kt,{as:"header",px:6,py:3,borderBottomWidth:"1px",align:"center",gap:6,children:[s.jsxs(_t,{size:"sm",as:Yt,to:"/app",children:["Omnex · ",t?"Espace admin":"Espace client"]}),s.jsxs(ge,{spacing:1,display:{base:"none",md:"flex"},children:[n&&s.jsx(Mr,{to:"/app/subscription",children:"Abonnement"}),(t||n)&&s.jsx(Mr,{to:"/app/profile",children:"Profile"}),t&&s.jsx(Mr,{to:"/app/demos",children:"Démos"}),t&&s.jsx(Mr,{to:"/app/premium",children:"Premium"}),t&&s.jsx(Mr,{to:"/app/codes",children:"Codes"})]}),s.jsx(ja,{}),s.jsxs(ge,{spacing:2,display:{base:"none",md:"flex"},children:[s.jsx(Wn,{colorScheme:u,children:c}),s.jsx(ve,{as:"a",href:bk,target:"_blank",rel:"noopener noreferrer",size:"sm",variant:"outline",children:"Support"}),s.jsx(Ea,{}),s.jsx(ve,{size:"sm",variant:"outline",onClick:l,children:"Déconnexion"})]}),s.jsxs(ge,{spacing:1,display:{base:"flex",md:"none"},children:[s.jsx(Wn,{colorScheme:u,children:c}),s.jsx(Ea,{}),s.jsx(On,{"aria-label":"Ouvrir le menu",variant:"ghost",onClick:o,icon:s.jsx(Qce,{})})]})]}),s.jsxs(aT,{isOpen:i,placement:"right",onClose:a,size:"xs",children:[s.jsx(yl,{}),s.jsxs(Lb,{bg:"chakra-body-bg",children:[s.jsx(Bu,{size:"lg"}),s.jsxs(vl,{borderBottomWidth:"1px",fontWeight:"bold",fontSize:"xl",children:["Omnex · ",t?"Espace admin":"Espace client"]}),s.jsxs(gl,{py:6,children:[s.jsxs(Se,{as:"nav",spacing:1,children:[n&&s.jsx(Mr,{to:"/app/subscription",onClick:a,mobile:!0,children:"Abonnement"}),t&&s.jsx(Mr,{to:"/app/demos",onClick:a,mobile:!0,children:"Démos"}),t&&s.jsx(Mr,{to:"/app/premium",onClick:a,mobile:!0,children:"Premium"}),t&&s.jsx(Mr,{to:"/app/codes",onClick:a,mobile:!0,children:"Codes"}),(t||n)&&s.jsx(Mr,{to:"/app/profile",onClick:a,mobile:!0,children:"Profile"})]}),s.jsx(ua,{my:6}),s.jsxs(Se,{spacing:3,children:[s.jsx(ve,{as:"a",href:bk,target:"_blank",rel:"noopener noreferrer",variant:"outline",justifyContent:"flex-start",onClick:a,children:"Support"}),s.jsx(ve,{variant:"outline",justifyContent:"flex-start",onClick:l,children:"Déconnexion"})]})]})]})]}),s.jsx(pn,{maxW:"container.xl",py:8,children:s.jsx(d8,{})})]})}function Mr({to:e,children:t,onClick:n,mobile:r=!1}){return s.jsx(ve,{as:p8,to:e,size:r?"lg":"sm",variant:"ghost",onClick:n,_activeLink:{fontWeight:"bold",color:"primary.500"},justifyContent:"flex-start",children:t})}const Jce=["/app/demos","/app/premium","/app/codes"];function eue({children:e}){const{isAuthenticated:t,initializing:n}=$o(),r=Ia();if(n)return s.jsx(qP,{h:"100vh",children:s.jsx(Vn,{})});if(t)return e;const i=Jce.some(o=>r.pathname.startsWith(o));return s.jsx(vu,{to:i?"/admin/login":"/login",replace:!0})}function N0({children:e}){const{isAdmin:t}=$o();return t?e:s.jsx(vu,{to:"/app/subscription",replace:!0})}function tue(){const{role:e}=$o();switch(e){case"admin":return s.jsx(vu,{to:"/app/demos",replace:!0});default:return s.jsx(vu,{to:"/app/subscription",replace:!0})}}function nue(){return s.jsxs(Fre,{children:[s.jsxs(rn,{element:s.jsx(Yce,{}),children:[s.jsx(rn,{path:"/",element:s.jsx(tie,{})}),s.jsx(rn,{path:"/tarifs",element:s.jsx(rie,{})}),s.jsx(rn,{path:"/documentation",element:s.jsx(xce,{})})]}),s.jsx(rn,{path:"/login",element:s.jsx(jce,{})}),s.jsx(rn,{path:"/admin/login",element:s.jsx(Pce,{})}),s.jsx(rn,{path:"/register",element:s.jsx(_ce,{})}),s.jsxs(rn,{path:"/app",element:s.jsx(eue,{children:s.jsx(Zce,{})}),children:[s.jsx(rn,{index:!0,element:s.jsx(tue,{})}),s.jsx(rn,{path:"demos",element:s.jsx(N0,{children:s.jsx(Ice,{})})}),s.jsx(rn,{path:"codes",element:s.jsx(N0,{children:s.jsx(Fce,{})})}),s.jsx(rn,{path:"premium",element:s.jsx(N0,{children:s.jsx(Dce,{})})}),s.jsx(rn,{path:"subscription",element:s.jsx(Bce,{})}),s.jsx(rn,{path:"profile",element:s.jsx(Hce,{})})]}),s.jsx(rn,{path:"*",element:s.jsx(vu,{to:"/",replace:!0})})]})}const rue={initialColorMode:"system",useSystemColorMode:!1},xk=db({config:rue,colors:{black:"#000000",gray:{50:"#f7f7f8",100:"#e8e8ea",200:"#c5c5c9",300:"#a2a2a9",400:"#7f7f88",500:"#5c5c66",600:"#43434c",700:"#2a2a33",800:"#15151b",900:"#0a0a0f"},midnight:{50:"#e9ebf5",100:"#c7cce6",200:"#a3abd6",300:"#7f8ac6",400:"#5b69b6",500:"#2d3a7d",600:"#232e63",700:"#1a2249",800:"#11172f",900:"#080b16"}},semanticTokens:{colors:{"chakra-body-bg":{_light:"white",_dark:"#000000"},"chakra-subtle-bg":{_light:"gray.50",_dark:"#050508"},"bg-surface":{_light:"white",_dark:"#08080c"},"chakra-body-text":{_light:"gray.800",_dark:"#f5f5f7"},"chakra-border-color":{_light:"gray.200",_dark:"whiteAlpha.100"},"primary.50":{default:"purple.50",_dark:"midnight.50"},"primary.100":{default:"purple.100",_dark:"midnight.100"},"primary.200":{default:"purple.200",_dark:"midnight.200"},"primary.300":{default:"purple.300",_dark:"midnight.300"},"primary.400":{default:"purple.400",_dark:"midnight.400"},"primary.500":{default:"purple.500",_dark:"midnight.500"},"primary.600":{default:"purple.600",_dark:"midnight.600"},"primary.700":{default:"purple.700",_dark:"midnight.700"},"primary.800":{default:"purple.800",_dark:"midnight.800"},"primary.900":{default:"purple.900",_dark:"midnight.900"}}},styles:{global:{body:{bg:"chakra-body-bg",color:"chakra-body-text"}}},components:{Card:{baseStyle:{container:{bg:"bg-surface",borderColor:"whiteAlpha.50"}}},Button:{baseStyle:{_dark:{bg:"gray.800",_hover:{bg:"gray.700"}}}},Input:{baseStyle:{field:{_dark:{bg:"gray.900",borderColor:"whiteAlpha.200",_focus:{borderColor:"whiteAlpha.400"}}}}},Select:{baseStyle:{field:{_dark:{bg:"gray.900",borderColor:"whiteAlpha.200"}}}},Textarea:{baseStyle:{_dark:{bg:"gray.900",borderColor:"whiteAlpha.200"}}},Modal:{baseStyle:{overlay:{_dark:{bg:"blackAlpha.800"}},content:{_dark:{bg:"#08080c"}}}}}},ET);O0.createRoot(document.getElementById("root")).render(s.jsxs(Gt.StrictMode,{children:[s.jsx(PG,{initialColorMode:xk.config.initialColorMode}),s.jsx(Tte,{theme:xk,children:s.jsx(wce,{children:s.jsx(qre,{children:s.jsx(nue,{})})})})]})); diff --git a/web/dist/index.html b/web/dist/index.html index 33d4dc0..f7fddb4 100644 --- a/web/dist/index.html +++ b/web/dist/index.html @@ -5,7 +5,7 @@ Omnex — Plateforme de gestion de commandes & livraison - +
diff --git a/web/src/components/Footer.tsx b/web/src/components/Footer.tsx index 3fffc83..0c1dd69 100644 --- a/web/src/components/Footer.tsx +++ b/web/src/components/Footer.tsx @@ -11,7 +11,7 @@ export function Footer() { Omnex - Plateforme de gestion de commandes & livraison, déployable en démo isolée en un clic. + Plateforme de gestion de commandes & livraison. diff --git a/web/src/theme.ts b/web/src/theme.ts index 1808d40..500f3ff 100644 --- a/web/src/theme.ts +++ b/web/src/theme.ts @@ -26,6 +26,20 @@ export const theme = extendTheme( 800: '#15151b', 900: '#0a0a0f', }, + // Bleu nuit : remplace le violet (colors.purple, palette "primary" de + // Saas UI) en dark mode uniquement — voir semanticTokens ci-dessous. + midnight: { + 50: '#e9ebf5', + 100: '#c7cce6', + 200: '#a3abd6', + 300: '#7f8ac6', + 400: '#5b69b6', + 500: '#2d3a7d', + 600: '#232e63', + 700: '#1a2249', + 800: '#11172f', + 900: '#080b16', + }, }, semanticTokens: { colors: { @@ -39,6 +53,23 @@ export const theme = extendTheme( 'chakra-body-text': { _light: 'gray.800', _dark: '#f5f5f7' }, // Bordures : très discrètes, presque invisibles 'chakra-border-color': { _light: 'gray.200', _dark: 'whiteAlpha.100' }, + + // "primary" (colorScheme des boutons/badges principaux du site) est + // violet (purple) par défaut via Saas UI — en dark mode, on le + // remplace par le bleu nuit défini ci-dessus. Chaque nuance est + // interceptée individuellement : tout ce qui utilise colorScheme= + // "primary" (Button, Badge...) ou une couleur littérale "primary.500" + // bascule automatiquement, sans toucher au reste du code. + 'primary.50': { default: 'purple.50', _dark: 'midnight.50' }, + 'primary.100': { default: 'purple.100', _dark: 'midnight.100' }, + 'primary.200': { default: 'purple.200', _dark: 'midnight.200' }, + 'primary.300': { default: 'purple.300', _dark: 'midnight.300' }, + 'primary.400': { default: 'purple.400', _dark: 'midnight.400' }, + 'primary.500': { default: 'purple.500', _dark: 'midnight.500' }, + 'primary.600': { default: 'purple.600', _dark: 'midnight.600' }, + 'primary.700': { default: 'purple.700', _dark: 'midnight.700' }, + 'primary.800': { default: 'purple.800', _dark: 'midnight.800' }, + 'primary.900': { default: 'purple.900', _dark: 'midnight.900' }, }, }, styles: {