@airporting/tech-app 0.0.127 → 0.0.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mf/1.js +1 -0
- package/dist/mf/1659.js +1 -0
- package/dist/mf/{1330.1484499663.js → 2014.js} +3 -3
- package/dist/mf/{3235.0c4841ef2f.js → 2436.js} +3 -3
- package/dist/mf/{3711.906c609c43.js → 2588.js} +3 -3
- package/dist/mf/2880.js +1 -0
- package/dist/mf/3080.js +1 -0
- package/dist/mf/3364.js +14 -0
- package/dist/mf/3429.js +33 -0
- package/dist/mf/3724.js +1 -0
- package/dist/mf/5178.js +1 -0
- package/dist/mf/{5616.daffd848ee.js → 5732.js} +3 -3
- package/dist/mf/5772.js +10 -0
- package/dist/mf/6110.js +18 -0
- package/dist/mf/6548.js +10 -0
- package/dist/mf/7364.js +1 -0
- package/dist/mf/7378.js +10 -0
- package/dist/mf/7380.js +1 -0
- package/dist/mf/7541.js +1 -0
- package/dist/mf/7832.js +10 -0
- package/dist/mf/7906.js +1 -0
- package/dist/mf/8119.js +1 -0
- package/dist/mf/9186.js +1 -0
- package/dist/mf/9260.js +1 -0
- package/dist/mf/{409.46a4910f4b.js → 9439.js} +3 -3
- package/dist/mf/9669.js +10 -0
- package/dist/mf/__federation_expose_amex.js +10 -0
- package/dist/mf/__federation_expose_bnpp.js +10 -0
- package/dist/mf/__federation_expose_credmut.js +10 -0
- package/dist/mf/__federation_expose_dashboard.js +1 -0
- package/dist/mf/__federation_expose_etat_saisie.js +1 -0
- package/dist/mf/__federation_expose_finance_jobs.js +1 -0
- package/dist/mf/__federation_expose_github.js +1 -0
- package/dist/mf/__federation_expose_mcp_access.js +1 -0
- package/dist/mf/__federation_expose_payfit.js +10 -0
- package/dist/mf/__federation_expose_pipeline.js +1 -0
- package/dist/mf/__federation_expose_sales.js +1 -0
- package/dist/mf/__federation_expose_scrapers.js +1 -0
- package/dist/mf/__federation_expose_spendesk.js +10 -0
- package/dist/mf/__federation_expose_spreadsheet.js +1 -0
- package/dist/mf/__federation_expose_synchro.js +1 -0
- package/dist/mf/__federation_expose_usage.js +1 -0
- package/dist/mf/__federation_expose_wise.js +10 -0
- package/dist/mf/{9698.7298203f5a.css → index.css} +77 -105
- package/dist/mf/index.js +30 -0
- package/dist/mf/mf-manifest.json +228 -263
- package/dist/mf/mf-stats.json +232 -285
- package/dist/mf/tech_app.js +5 -0
- package/package.json +6 -6
- package/dist/mf/1558.e66a54e73d.js +0 -1
- package/dist/mf/2338.94e69795ff.js +0 -1
- package/dist/mf/2538.1c194a4bcd.js +0 -1
- package/dist/mf/2717.8f7084b540.js +0 -10
- package/dist/mf/2717.8f7084b540.js.LICENSE.txt +0 -9
- package/dist/mf/3548.a2ac3faf5f.js +0 -1
- package/dist/mf/3887.b05f65635e.js +0 -33
- package/dist/mf/5098.4ad55bcb49.js +0 -10
- package/dist/mf/5098.4ad55bcb49.js.LICENSE.txt +0 -9
- package/dist/mf/5105.2a1806dc50.js +0 -1
- package/dist/mf/537.b7edba1af9.js +0 -14
- package/dist/mf/5429.f4bca5be4b.js +0 -1
- package/dist/mf/5564.042f491bc7.js +0 -1
- package/dist/mf/6237.60683e513e.js +0 -10
- package/dist/mf/6237.60683e513e.js.LICENSE.txt +0 -9
- package/dist/mf/668.a271d6c3a3.js +0 -1
- package/dist/mf/6755.d44651735b.js +0 -1
- package/dist/mf/690.0d77cae419.js +0 -1
- package/dist/mf/7486.84364f2d01.js +0 -10
- package/dist/mf/758.f1fe1bef41.js +0 -10
- package/dist/mf/7770.9beba1af8b.js +0 -1
- package/dist/mf/7883.45585213d9.js +0 -1
- package/dist/mf/8083.a86dc5cbbe.js +0 -1
- package/dist/mf/8473.91f080bae1.js +0 -10
- package/dist/mf/854.1a1d1ce0ec.js +0 -10
- package/dist/mf/8853.20c1b87755.js +0 -18
- package/dist/mf/8949.3f7e30e10c.js +0 -10
- package/dist/mf/9415.f2a6811f8c.js +0 -1
- package/dist/mf/9698.34be02ab76.js +0 -26
- package/dist/mf/__federation_expose_amex.9b5f7a13cf.js +0 -10
- package/dist/mf/__federation_expose_bnpp.9e26515b6b.js +0 -10
- package/dist/mf/__federation_expose_credmut.e8f19cfe8a.js +0 -10
- package/dist/mf/__federation_expose_dashboard.be190d6c02.js +0 -10
- package/dist/mf/__federation_expose_etat_saisie.645bdc16bc.js +0 -10
- package/dist/mf/__federation_expose_finance_jobs.944394079e.js +0 -1
- package/dist/mf/__federation_expose_github.707a6236f7.js +0 -10
- package/dist/mf/__federation_expose_mcp_access.82a422dded.js +0 -10
- package/dist/mf/__federation_expose_mcp_access.82a422dded.js.LICENSE.txt +0 -9
- package/dist/mf/__federation_expose_payfit.515eac3595.js +0 -10
- package/dist/mf/__federation_expose_payfit.515eac3595.js.LICENSE.txt +0 -9
- package/dist/mf/__federation_expose_pipeline.48dbe478c4.js +0 -10
- package/dist/mf/__federation_expose_pipeline.48dbe478c4.js.LICENSE.txt +0 -9
- package/dist/mf/__federation_expose_sales.dfbee2c4e2.js +0 -10
- package/dist/mf/__federation_expose_sales.dfbee2c4e2.js.LICENSE.txt +0 -9
- package/dist/mf/__federation_expose_scrapers.ec2bebbb38.js +0 -10
- package/dist/mf/__federation_expose_scrapers.ec2bebbb38.js.LICENSE.txt +0 -9
- package/dist/mf/__federation_expose_spendesk.f36a6189d1.js +0 -10
- package/dist/mf/__federation_expose_spendesk.f36a6189d1.js.LICENSE.txt +0 -9
- package/dist/mf/__federation_expose_spreadsheet.552786fca7.js +0 -1
- package/dist/mf/__federation_expose_synchro.090ad23824.js +0 -10
- package/dist/mf/__federation_expose_synchro.090ad23824.js.LICENSE.txt +0 -9
- package/dist/mf/__federation_expose_usage.be52f862ad.js +0 -10
- package/dist/mf/__federation_expose_usage.be52f862ad.js.LICENSE.txt +0 -9
- package/dist/mf/__federation_expose_wise.b31a4dcd88.js +0 -10
- package/dist/mf/__federation_expose_wise.b31a4dcd88.js.LICENSE.txt +0 -9
- package/dist/mf/index.118cfb08b9.js +0 -6
- package/dist/mf/index.71e639cd3c.css +0 -2
- package/dist/mf/tech_app.e57897e310.js +0 -6
- /package/dist/mf/{1330.1484499663.js.LICENSE.txt → 2014.js.LICENSE.txt} +0 -0
- /package/dist/mf/{3235.0c4841ef2f.js.LICENSE.txt → 2436.js.LICENSE.txt} +0 -0
- /package/dist/mf/{3711.906c609c43.js.LICENSE.txt → 2588.js.LICENSE.txt} +0 -0
- /package/dist/mf/{3887.b05f65635e.js.LICENSE.txt → 3429.js.LICENSE.txt} +0 -0
- /package/dist/mf/{5616.daffd848ee.js.LICENSE.txt → 5732.js.LICENSE.txt} +0 -0
- /package/dist/mf/{7486.84364f2d01.js.LICENSE.txt → 5772.js.LICENSE.txt} +0 -0
- /package/dist/mf/{8853.20c1b87755.js.LICENSE.txt → 6110.js.LICENSE.txt} +0 -0
- /package/dist/mf/{758.f1fe1bef41.js.LICENSE.txt → 6548.js.LICENSE.txt} +0 -0
- /package/dist/mf/{8473.91f080bae1.js.LICENSE.txt → 7378.js.LICENSE.txt} +0 -0
- /package/dist/mf/{854.1a1d1ce0ec.js.LICENSE.txt → 7832.js.LICENSE.txt} +0 -0
- /package/dist/mf/{409.46a4910f4b.js.LICENSE.txt → 9439.js.LICENSE.txt} +0 -0
- /package/dist/mf/{8949.3f7e30e10c.js.LICENSE.txt → 9669.js.LICENSE.txt} +0 -0
- /package/dist/mf/{__federation_expose_amex.9b5f7a13cf.js.LICENSE.txt → __federation_expose_amex.js.LICENSE.txt} +0 -0
- /package/dist/mf/{__federation_expose_bnpp.9e26515b6b.js.LICENSE.txt → __federation_expose_bnpp.js.LICENSE.txt} +0 -0
- /package/dist/mf/{__federation_expose_credmut.e8f19cfe8a.js.LICENSE.txt → __federation_expose_credmut.js.LICENSE.txt} +0 -0
- /package/dist/mf/{__federation_expose_dashboard.be190d6c02.js.LICENSE.txt → __federation_expose_payfit.js.LICENSE.txt} +0 -0
- /package/dist/mf/{__federation_expose_etat_saisie.645bdc16bc.js.LICENSE.txt → __federation_expose_spendesk.js.LICENSE.txt} +0 -0
- /package/dist/mf/{__federation_expose_github.707a6236f7.js.LICENSE.txt → __federation_expose_wise.js.LICENSE.txt} +0 -0
- /package/dist/mf/{9698.34be02ab76.js.LICENSE.txt → index.js.LICENSE.txt} +0 -0
- /package/dist/mf/static/font/{HostGrotesk-VariableFont_wght.5248a50f8f.ttf → HostGrotesk-VariableFont_wght.ttf} +0 -0
- /package/dist/mf/static/font/{IBMPlexSans-VariableFont_wdth,wght.b9dbc346df.ttf → IBMPlexSans-VariableFont_wdth,wght.ttf} +0 -0
- /package/dist/mf/static/svg/{ad.b565cad3b9.svg → ad.svg} +0 -0
- /package/dist/mf/static/svg/{af.c6050ccd88.svg → af.svg} +0 -0
- /package/dist/mf/static/svg/{arab.979580f271.svg → arab.svg} +0 -0
- /package/dist/mf/static/svg/{as.01647fade1.svg → as.svg} +0 -0
- /package/dist/mf/static/svg/{aw.38f249536e.svg → aw.svg} +0 -0
- /package/dist/mf/static/svg/{bm.a27098d2f0.svg → bm.svg} +0 -0
- /package/dist/mf/static/svg/{bn.c13ab93d4e.svg → bn.svg} +0 -0
- /package/dist/mf/static/svg/{bo.9eafaa771a.svg → bo.svg} +0 -0
- /package/dist/mf/static/svg/{br.67a6502fcc.svg → br.svg} +0 -0
- /package/dist/mf/static/svg/{bt.1a35bb5790.svg → bt.svg} +0 -0
- /package/dist/mf/static/svg/{bz.07b1393a39.svg → bz.svg} +0 -0
- /package/dist/mf/static/svg/{cy.239da48548.svg → cy.svg} +0 -0
- /package/dist/mf/static/svg/{dg.2de1a54797.svg → dg.svg} +0 -0
- /package/dist/mf/static/svg/{dm.c3205e29a5.svg → dm.svg} +0 -0
- /package/dist/mf/static/svg/{do.5dff1c5f2d.svg → do.svg} +0 -0
- /package/dist/mf/static/svg/{eac.8d4776f547.svg → eac.svg} +0 -0
- /package/dist/mf/static/svg/{ec.fe749fb472.svg → ec.svg} +0 -0
- /package/dist/mf/static/svg/{eg.047d5d7822.svg → eg.svg} +0 -0
- /package/dist/mf/static/svg/{es-ga.13ecfea239.svg → es-ga.svg} +0 -0
- /package/dist/mf/static/svg/{es.b74b736606.svg → es.svg} +0 -0
- /package/dist/mf/static/svg/{fj.a7cdc5d921.svg → fj.svg} +0 -0
- /package/dist/mf/static/svg/{fk.2fa702939b.svg → fk.svg} +0 -0
- /package/dist/mf/static/svg/{gb-nir.8ec547f4f5.svg → gb-nir.svg} +0 -0
- /package/dist/mf/static/svg/{gb-wls.1cf3d9cc10.svg → gb-wls.svg} +0 -0
- /package/dist/mf/static/svg/{gq.c572f675c8.svg → gq.svg} +0 -0
- /package/dist/mf/static/svg/{gs.fe3374bb83.svg → gs.svg} +0 -0
- /package/dist/mf/static/svg/{gt.097451fc17.svg → gt.svg} +0 -0
- /package/dist/mf/static/svg/{gu.b033e7a688.svg → gu.svg} +0 -0
- /package/dist/mf/static/svg/{hr.f0c84cca2a.svg → hr.svg} +0 -0
- /package/dist/mf/static/svg/{ht.9f91507754.svg → ht.svg} +0 -0
- /package/dist/mf/static/svg/{im.479ad3e9b6.svg → im.svg} +0 -0
- /package/dist/mf/static/svg/{io.fc7eebc158.svg → io.svg} +0 -0
- /package/dist/mf/static/svg/{ir.801fbb847c.svg → ir.svg} +0 -0
- /package/dist/mf/static/svg/{je.2b7a276f75.svg → je.svg} +0 -0
- /package/dist/mf/static/svg/{kg.994fed1d50.svg → kg.svg} +0 -0
- /package/dist/mf/static/svg/{kh.e67aa6fd5c.svg → kh.svg} +0 -0
- /package/dist/mf/static/svg/{ki.9e4e595c2f.svg → ki.svg} +0 -0
- /package/dist/mf/static/svg/{ky.c6d5a8d576.svg → ky.svg} +0 -0
- /package/dist/mf/static/svg/{kz.07b60b89d0.svg → kz.svg} +0 -0
- /package/dist/mf/static/svg/{li.5cded3252c.svg → li.svg} +0 -0
- /package/dist/mf/static/svg/{lk.23166e8c77.svg → lk.svg} +0 -0
- /package/dist/mf/static/svg/{md.dba4c7fc54.svg → md.svg} +0 -0
- /package/dist/mf/static/svg/{me.7e20b942ca.svg → me.svg} +0 -0
- /package/dist/mf/static/svg/{mp.8842d0ea8c.svg → mp.svg} +0 -0
- /package/dist/mf/static/svg/{ms.2e19586bd0.svg → ms.svg} +0 -0
- /package/dist/mf/static/svg/{mt.b8ab0ef5e2.svg → mt.svg} +0 -0
- /package/dist/mf/static/svg/{mx.bc25957663.svg → mx.svg} +0 -0
- /package/dist/mf/static/svg/{nf.407d2ab842.svg → nf.svg} +0 -0
- /package/dist/mf/static/svg/{ni.bf7fcea52d.svg → ni.svg} +0 -0
- /package/dist/mf/static/svg/{om.449f75b209.svg → om.svg} +0 -0
- /package/dist/mf/static/svg/{pn.b4e1ab6aa7.svg → pn.svg} +0 -0
- /package/dist/mf/static/svg/{pt.acd403c018.svg → pt.svg} +0 -0
- /package/dist/mf/static/svg/{py.6523d7909b.svg → py.svg} +0 -0
- /package/dist/mf/static/svg/{rs.0f45ed27ff.svg → rs.svg} +0 -0
- /package/dist/mf/static/svg/{sa.9a769000dc.svg → sa.svg} +0 -0
- /package/dist/mf/static/svg/{sh-ac.103f8fd9a6.svg → sh-ac.svg} +0 -0
- /package/dist/mf/static/svg/{sh-hl.664afc561d.svg → sh-hl.svg} +0 -0
- /package/dist/mf/static/svg/{sh-ta.9e06bc08e4.svg → sh-ta.svg} +0 -0
- /package/dist/mf/static/svg/{sm.9f3be35f44.svg → sm.svg} +0 -0
- /package/dist/mf/static/svg/{sv.4a7ef34153.svg → sv.svg} +0 -0
- /package/dist/mf/static/svg/{sx.ba3ea51fe1.svg → sx.svg} +0 -0
- /package/dist/mf/static/svg/{sz.61ba2742e1.svg → sz.svg} +0 -0
- /package/dist/mf/static/svg/{tc.1d40ce70d6.svg → tc.svg} +0 -0
- /package/dist/mf/static/svg/{tm.6a8ec56b96.svg → tm.svg} +0 -0
- /package/dist/mf/static/svg/{un.98053442eb.svg → un.svg} +0 -0
- /package/dist/mf/static/svg/{va.959875d92d.svg → va.svg} +0 -0
- /package/dist/mf/static/svg/{vg.56b7d72255.svg → vg.svg} +0 -0
- /package/dist/mf/static/svg/{vi.aaeab1462a.svg → vi.svg} +0 -0
- /package/dist/mf/static/svg/{xk.961776b909.svg → xk.svg} +0 -0
- /package/dist/mf/static/svg/{zm.ef3a9aef9f.svg → zm.svg} +0 -0
- /package/dist/mf/static/svg/{zw.3e71d5a4d2.svg → zw.svg} +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*! LICENSE: __federation_expose_sales.dfbee2c4e2.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis["chunk_tech_app "]||=[]).push([[5761],{9698(__unused_rspack_module,exports){/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848(module,__unused_rspack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},6032(__unused_rspack_module,__webpack_exports__,__webpack_require__){var _tanstack_react_query__rspack_import_0=__webpack_require__(3411);var _useApi_ts__rspack_import_1=__webpack_require__(4691);function useSalesLeads(status){const api=(0,_useApi_ts__rspack_import_1.g)();return(0,_tanstack_react_query__rspack_import_0.useQuery)({queryKey:["tech","sales","leads",status],queryFn:async()=>(await api.sales.listLeadsV1({status})).data,refetchOnWindowFocus:true})}__webpack_require__.d(__webpack_exports__,{p:()=>useSalesLeads})},7510(__unused_rspack_module,__webpack_exports__,__webpack_require__){const TEMPERATURE_META={burning:{emoji:"🔥🔥",label:"Brûlant",order:5},hot:{emoji:"🔥",label:"Chaud",order:4},warm:{emoji:"🌡️",label:"Tiède",order:3},cold:{emoji:"❄️",label:"Froid",order:2},frozen:{emoji:"🧊",label:"Gelé",order:1}};const TEMPERATURE_ORDER=["burning","hot","warm","cold","frozen"];__webpack_require__.d(__webpack_exports__,{},{E:TEMPERATURE_ORDER,z:TEMPERATURE_META})},1239(__unused_rspack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__rspack_import_0=__webpack_require__(4848);var _mantine_core__rspack_import_1=__webpack_require__(4618);var _src_components_logoDev_ts__rspack_import_2=__webpack_require__(2137);function BrandLogo({domain,alt,size=24}){return/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_core__rspack_import_1.Image,{src:(0,_src_components_logoDev_ts__rspack_import_2.w)(domain),alt:alt,title:alt,w:size,h:size,fit:"contain",radius:"sm",style:{aspectRatio:1}})}__webpack_require__.d(__webpack_exports__,{F:()=>BrandLogo})},2137(__unused_rspack_module,__webpack_exports__,__webpack_require__){const LOGO_DEV_TOKEN="pk_BVN4OQv0Qs-bnqjdIgTppg";function logoDevUrl(domain){return`https://img.logo.dev/${domain}?token=${LOGO_DEV_TOKEN}`}__webpack_require__.d(__webpack_exports__,{w:()=>logoDevUrl})},721(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Sales});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(814);var providers=__webpack_require__(9528);var index_mjs_=__webpack_require__(4618);var esm_index_mjs_=__webpack_require__(1810);var leadsQuery=__webpack_require__(6032);var modern_index_js_=__webpack_require__(3411);var notifications_esm_index_mjs_=__webpack_require__(7250);var useApi=__webpack_require__(4691);function useSalesRescan(){const api=(0,useApi.g)();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async()=>(await api.sales.rescanV1()).data,onSuccess:data=>{notifications_esm_index_mjs_.notifications.show({title:"Re-scan",message:data?.message??"Re-scan lancé",color:data?.ok?"green":"orange"});queryClient.invalidateQueries({queryKey:["tech","sales"]})},onError:err=>{notifications_esm_index_mjs_.notifications.show({title:"Re-scan",message:err?.error?.error??err?.message??"Échec du re-scan",color:"red"})}})}function useSalesSyncState(){const api=(0,useApi.g)();return(0,modern_index_js_.useQuery)({queryKey:["tech","sales","sync-state"],queryFn:async()=>(await api.sales.syncStateV1()).data,refetchOnWindowFocus:true})}function useSalesScanSummary(){const api=(0,useApi.g)();return(0,modern_index_js_.useQuery)({queryKey:["tech","sales","scan-summary"],queryFn:async()=>(await api.sales.scanRunSummaryV1()).data,refetchOnWindowFocus:true})}const dateFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:"Europe/Paris",day:"2-digit",month:"2-digit"});const dateTimeFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:"Europe/Paris",day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"});function parisDayKey(date){return dateFormatter.format(date)}function formatRelativeParis(iso){if(null===iso)return"jamais";const date=new Date(iso);if(Number.isNaN(date.getTime()))return"jamais";const now=new Date;const diffMs=now.getTime()-date.getTime();if(diffMs<0)return`le ${dateFormatter.format(date)}`;const diffMinutes=Math.floor(diffMs/6e4);if(diffMinutes<1)return"à l'instant";if(diffMinutes<60)return`il y a ${diffMinutes} min`;const diffHours=Math.floor(diffMinutes/60);if(diffHours<24)return`il y a ${diffHours} h`;const todayKey=parisDayKey(now);const yesterday=new Date(now.getTime()-864e5);const yesterdayKey=parisDayKey(yesterday);const dateKey=parisDayKey(date);if(dateKey===yesterdayKey&&dateKey!==todayKey)return"hier";return`le ${dateFormatter.format(date)}`}function formatDateParis(iso){if(null===iso)return"";const date=new Date(iso);if(Number.isNaN(date.getTime()))return"";return dateTimeFormatter.format(date)}var sales_temperature=__webpack_require__(7510);function dueLabel(value){if(!value)return"Pas de date fixée";return new Date(value).toLocaleDateString("fr-FR",{timeZone:"Europe/Paris"})}function compare(a,b,key,desc){let av;let bv;if("temperature"===key){av=sales_temperature.z[a.temperature].order;bv=sales_temperature.z[b.temperature].order}else{av=a[key]?new Date(a[key]).getTime():0;bv=b[key]?new Date(b[key]).getTime():0}if(desc)return bv-av;return av-bv}function matchesSearch(lead,query){const q=query.trim().toLowerCase();if(!q)return true;const haystack=[lead.first_name,lead.last_name,lead.company,lead.email,lead.phone,lead.linkedin_url].filter(Boolean).join(" ").toLowerCase();return haystack.includes(q)}function LeadsTable({leads,temperatureFilter,search,onRowClick}){const[sortKey,setSortKey]=(0,index_js_.useState)("last_contact_at");const[desc,setDesc]=(0,index_js_.useState)(true);function toggleSort(key){if(key===sortKey)setDesc(d=>!d);else{setSortKey(key);setDesc(true)}}const rows=(0,index_js_.useMemo)(()=>{const filtered=leads.filter(l=>{if(temperatureFilter&&l.temperature!==temperatureFilter)return false;return matchesSearch(l,search)});return[...filtered].sort((a,b)=>compare(a,b,sortKey,desc))},[leads,temperatureFilter,search,sortKey,desc]);return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.ScrollContainer,{minWidth:1250,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{highlightOnHover:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.UnstyledButton,{onClick:()=>toggleSort("temperature"),children:"Température"})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Prénom"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Nom"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Entreprise"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Email"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Téléphone"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"LinkedIn"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.UnstyledButton,{onClick:()=>toggleSort("last_contact_at"),children:"Dernier contact"})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Prochaine action"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.UnstyledButton,{onClick:()=>toggleSort("next_action_due_at"),children:"Échéance"})})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:rows.map(l=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{style:{cursor:"pointer"},onClick:()=>onRowClick(l.id),children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:sales_temperature.z[l.temperature].emoji}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:l.first_name??""}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:l.last_name??""}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:l.company??""}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:l.email??"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:l.phone??"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:l.linkedin_url?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{href:l.linkedin_url,target:"_blank",rel:"noreferrer",onClick:event=>event.stopPropagation(),children:"Profil"}):"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:l.last_contact_at?new Date(l.last_contact_at).toLocaleDateString("fr-FR",{timeZone:"Europe/Paris"}):"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:l.next_action??"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",c:l.next_action_due_at?void 0:"dimmed",children:dueLabel(l.next_action_due_at)})})]},l.id))})]})})}var dates_esm_index_mjs_=__webpack_require__(2506);var tabler_icons_react_mjs_=__webpack_require__(2638);function useSalesLead(id){const api=(0,useApi.g)();return(0,modern_index_js_.useQuery)({queryKey:["tech","sales","lead",id],enabled:null!==id,queryFn:async()=>(await api.sales.getLeadV1({id})).data})}function useUpdateLead(id){const api=(0,useApi.g)();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async payload=>(await api.sales.updateLeadV1({id},payload)).data,onSuccess:()=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:"Modifications enregistrées",color:"green"});queryClient.invalidateQueries({queryKey:["tech","sales"]})},onError:err=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:err?.error?.error??err?.message??"Échec de la mise à jour",color:"red"})}})}function useDeleteLead(){const api=(0,useApi.g)();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async id=>(await api.sales.deleteLeadV1({id})).data,onSuccess:()=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:"Lead supprimé",color:"green"});queryClient.invalidateQueries({queryKey:["tech","sales"]})},onError:err=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:err?.error?.error??err?.message??"Échec de la suppression",color:"red"})}})}function useSetLifecycle(id){const api=(0,useApi.g)();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async status=>(await api.sales.setLifecycleV1({id},{status})).data,onSuccess:()=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:"Statut mis à jour",color:"green"});queryClient.invalidateQueries({queryKey:["tech","sales"]})},onError:err=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:err?.error?.error??err?.message??"Échec",color:"red"})}})}function useAddComment(id){const api=(0,useApi.g)();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async text=>(await api.sales.addCommentV1({id},{text})).data,onSuccess:()=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:"Commentaire ajouté",color:"green"});queryClient.invalidateQueries({queryKey:["tech","sales","lead",id]})},onError:err=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:err?.error?.error??err?.message??"Échec",color:"red"})}})}function useReconstructLead(id){const api=(0,useApi.g)();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async()=>(await api.sales.reconstructV1({id})).data,onSuccess:()=>{notifications_esm_index_mjs_.notifications.show({title:"Scan approfondi",message:"Scan demandé — traité à la prochaine session agent",color:"green"});queryClient.invalidateQueries({queryKey:["tech","sales"]})},onError:err=>{notifications_esm_index_mjs_.notifications.show({title:"Scan approfondi",message:err?.error?.error??err?.message??"Échec",color:"red"})}})}function useEnrichLead(id){const api=(0,useApi.g)();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async kind=>(await api.sales.enrichLeadV1({id,kind})).data,onSuccess:()=>{queryClient.invalidateQueries({queryKey:["tech","sales"]})}})}var BrandLogo=__webpack_require__(1239);const SOURCE_DOMAIN={pipedrive:"pipedrive.com",gmail:"google.com",claap:"claap.io",granola:"granola.ai",lemlist:"lemlist.com",linkedin:"linkedin.com",imessage:"apple.com",whatsapp:"whatsapp.com",slack:"slack.com",calendar:"google.com",pennylane:"pennylane.com",yousign:"yousign.com",notion:"notion.so"};function SourceLogo({source,size=18}){if("manual"===source)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ThemeIcon,{size:size,variant:"light",color:"gray",title:"Note",children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconNote,{size:size-4})});const domain=SOURCE_DOMAIN[source];if(!domain)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{size:"xs",variant:"light",color:"gray",title:source,children:source.slice(0,2).toUpperCase()});return/*#__PURE__*/(0,jsx_runtime.jsx)(BrandLogo.F,{domain:domain,alt:source,size:size})}function directionLabel(direction){if("internal"===direction)return"📝 Note";if("inbound"===direction)return"↘ Entrant";return"↗ Sortant"}function LeadTimeline({items}){if(0===items.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",children:"Aucun échange."});return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Timeline,{active:items.length,bulletSize:14,lineWidth:2,children:items.map(it=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Timeline.Item,{title:it.summary??"(sans résumé)",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",mb:4,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SourceLogo,{source:it.source}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",fw:500,tt:"capitalize",children:it.source}),it.channel?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{size:"xs",variant:"outline",children:it.channel}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:directionLabel(it.direction)})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:2,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:new Date(it.occurred_at).toLocaleString("fr-FR",{timeZone:"Europe/Paris"})}),it.external_url?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Anchor,{href:it.external_url,target:"_blank",size:"xs",children:"Ouvrir la source"}):null]})]},it.id))})}const eurFormatter=new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"});function scanCostLabel(lead){const{runs,tokens,cost_eur,last_ran_at}=lead.scan_cost;return`${runs} scan(s) approfondi(s) \xb7 ~${Math.round(tokens/1e3)} k tokens ≈ ${eurFormatter.format(cost_eur)} (dernier : ${formatDateParis(last_ran_at)})`}function scanStatusLabel(lead){if("requested"===lead.reconstruction_status)return`Scan demand\xe9 le ${formatDateParis(lead.reconstruction_requested_at)}`;if("done"===lead.reconstruction_status)return`Reconstruit le ${formatDateParis(lead.reconstruction_done_at)}`;return"Jamais reconstruit"}function LeadDetailDrawer({leadId,onClose}){const detail=useSalesLead(leadId);const update=useUpdateLead(leadId??0);const remove=useDeleteLead();const setLifecycle=useSetLifecycle(leadId??0);const addComment=useAddComment(leadId??0);const reconstruct=useReconstructLead(leadId??0);const enrich=useEnrichLead(leadId??0);const[firstName,setFirstName]=(0,index_js_.useState)("");const[lastName,setLastName]=(0,index_js_.useState)("");const[company,setCompany]=(0,index_js_.useState)("");const[email,setEmail]=(0,index_js_.useState)("");const[phone,setPhone]=(0,index_js_.useState)("");const[linkedinUrl,setLinkedinUrl]=(0,index_js_.useState)("");const[temperature,setTemperature]=(0,index_js_.useState)(null);const[nextAction,setNextAction]=(0,index_js_.useState)("");const[dueAt,setDueAt]=(0,index_js_.useState)("");const[comment,setComment]=(0,index_js_.useState)("");(0,index_js_.useEffect)(()=>{if(detail.data){setFirstName(detail.data.first_name??"");setLastName(detail.data.last_name??"");setCompany(detail.data.company??"");setEmail(detail.data.identities?.find(i=>"email"===i.type)?.value??"");setPhone(detail.data.identities?.find(i=>"phone"===i.type)?.value??"");setLinkedinUrl(detail.data.identities?.find(i=>"linkedin_url"===i.type)?.value??"");setTemperature(detail.data.temperature);setNextAction(detail.data.next_action??"");setDueAt(detail.data.next_action_due_at??"")}},[detail.data]);function save(){update.mutate({first_name:""===firstName?null:firstName,last_name:""===lastName?null:lastName,company:""===company?null:company,emails:email?[email]:[],phones:phone?[phone]:[],linkedin_url:linkedinUrl||null,temperature:temperature??void 0,next_action:""===nextAction?null:nextAction,next_action_due_at:""===dueAt?null:dueAt})}function handleDelete(){if(null===leadId)return;remove.mutate(leadId,{onSuccess:onClose})}return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Drawer,{opened:null!==leadId,onClose:onClose,position:"right",size:"lg",title:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:4,children:"Lead"}),children:[detail.isLoading?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Loader,{}):null,detail.data?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{grow:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Prénom",value:firstName,onChange:e=>setFirstName(e.currentTarget.value)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Nom",value:lastName,onChange:e=>setLastName(e.currentTarget.value)})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Entreprise",value:company,onChange:e=>setCompany(e.currentTarget.value)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"URL LinkedIn",placeholder:"https://www.linkedin.com/in/...",value:linkedinUrl,onChange:e=>setLinkedinUrl(e.currentTarget.value)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{grow:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Email",value:email,onChange:e=>setEmail(e.currentTarget.value)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Téléphone",value:phone,onChange:e=>setPhone(e.currentTarget.value)})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"flex-end",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"light",leftSection:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconAt,{size:16}),loading:enrich.isPending&&"email"===enrich.variables,disabled:enrich.isPending||Boolean(email),onClick:()=>{enrich.mutate("email",{onSuccess:result=>{const value=result.found.emails[0];if(value)setEmail(value);if(result.added>0)notifications_esm_index_mjs_.notifications.show({title:"Email trouvé",message:`${value}${result.provider?` \xb7 ${result.provider}`:""}`,color:"green"});else notifications_esm_index_mjs_.notifications.show({title:"Email",message:"Aucun email trouvé",color:"gray"})},onError:err=>{notifications_esm_index_mjs_.notifications.show({title:"Email",message:err?.error?.error??err?.message??"Échec",color:"red"})}})},children:"Obtenir email"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"light",leftSection:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconPhone,{size:16}),loading:enrich.isPending&&"phone"===enrich.variables,disabled:enrich.isPending||Boolean(phone),onClick:()=>{enrich.mutate("phone",{onSuccess:result=>{const value=result.found.phones[0];if(value)setPhone(value);notifications_esm_index_mjs_.notifications.show({title:result.added>0?"Téléphone trouvé":"Téléphone",message:result.added>0?`${value}${result.provider?` \xb7 ${result.provider}`:""}`:"Aucun téléphone trouvé",color:result.added>0?"green":"gray"})},onError:err=>{notifications_esm_index_mjs_.notifications.show({title:"Téléphone",message:err?.error?.error??err?.message??"Échec",color:"red"})}})},children:"Obtenir téléphone"})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Prochaine action",value:nextAction,onChange:e=>setNextAction(e.currentTarget.value),flex:1}),/*#__PURE__*/(0,jsx_runtime.jsx)(dates_esm_index_mjs_.DateInput,{label:"Échéance",placeholder:"Pas de date fixée",clearable:true,valueFormat:"DD/MM/YYYY",value:dueAt?new Date(dueAt):null,onChange:v=>setDueAt(v?new Date(v).toISOString():"")})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Select,{label:"Température",data:sales_temperature.E.map(t=>({value:t,label:`${sales_temperature.z[t].emoji} ${sales_temperature.z[t].label}`})),value:temperature,onChange:setTemperature}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Select,{label:"Déplacer vers",data:[{value:"active",label:"Actif"},{value:"won",label:"Gagné"},{value:"lost",label:"Perdu"}],value:detail.data.lifecycle_status,onChange:v=>{if(v)setLifecycle.mutate(v)}}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{color:"red",variant:"light",onClick:handleDelete,children:"Supprimer"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{loading:update.isPending,onClick:save,children:"Enregistrer"})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Textarea,{label:"Ajouter un commentaire",value:comment,onChange:e=>setComment(e.currentTarget.value),autosize:true,minRows:2}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{justify:"flex-end",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{disabled:!comment,loading:addComment.isPending,onClick:()=>{addComment.mutate(comment,{onSuccess:()=>setComment("")})},children:"Commenter"})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Divider,{mt:"md"}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:5,children:"Scan"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",c:"dimmed",children:scanStatusLabel(detail.data)}),detail.data.scan_cost.runs>0?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",c:"dimmed",children:scanCostLabel(detail.data)}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Group,{justify:"flex-end",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"light",loading:reconstruct.isPending,disabled:"requested"===detail.data.reconstruction_status,onClick:()=>reconstruct.mutate(),children:"Demander un scan approfondi"})})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:5,mt:"md",children:"Historique"}),/*#__PURE__*/(0,jsx_runtime.jsx)(LeadTimeline,{items:detail.data.interactions})]}):null]})}var form_esm_index_mjs_=__webpack_require__(6220);function useCreateLead(){const api=(0,useApi.g)();const queryClient=(0,modern_index_js_.useQueryClient)();return(0,modern_index_js_.useMutation)({mutationFn:async payload=>(await api.sales.createLeadV1(payload)).data,onSuccess:data=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:data?.attached?"Coordonnée déjà connue — rattaché au lead existant":"Lead créé",color:"green"});queryClient.invalidateQueries({queryKey:["tech","sales"]})},onError:err=>{notifications_esm_index_mjs_.notifications.show({title:"Lead",message:err?.error?.error??err?.message??"Échec de la création",color:"red"})}})}function NewLeadModal({opened,onClose}){const create=useCreateLead();const form=(0,form_esm_index_mjs_.useForm)({initialValues:{first_name:"",last_name:"",company:"",email:"",phone:"",linkedin_url:"",note:"",next_action_due_at:null,request_reconstruction:true}});function submit(values){const hasAny=Boolean(values.first_name)||Boolean(values.last_name)||Boolean(values.company)||Boolean(values.email)||Boolean(values.phone)||Boolean(values.linkedin_url);if(!hasAny)return void notifications_esm_index_mjs_.notifications.show({title:"Lead",message:"Renseignez au moins un nom, une entreprise ou une coordonnée",color:"orange"});create.mutate({first_name:values.first_name||null,last_name:values.last_name||null,company:values.company||null,emails:values.email?[values.email]:[],phones:values.phone?[values.phone]:[],linkedin_url:values.linkedin_url||null,note:values.note||null,next_action_due_at:values.next_action_due_at?new Date(values.next_action_due_at).toISOString():null,request_reconstruction:values.request_reconstruction},{onSuccess:()=>{form.reset();onClose()}})}return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Modal,{opened:opened,onClose:onClose,title:"Nouveau lead",children:/*#__PURE__*/(0,jsx_runtime.jsx)("form",{onSubmit:form.onSubmit(submit),children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"sm",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{grow:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Prénom",...form.getInputProps("first_name")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Nom",...form.getInputProps("last_name")})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Entreprise",...form.getInputProps("company")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"URL LinkedIn",placeholder:"https://www.linkedin.com/in/...",...form.getInputProps("linkedin_url")}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{grow:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Email",...form.getInputProps("email")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Téléphone",...form.getInputProps("phone")})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Textarea,{label:"Note / prochaine action",...form.getInputProps("note")}),/*#__PURE__*/(0,jsx_runtime.jsx)(dates_esm_index_mjs_.DateInput,{label:"Relancer le",placeholder:"Pas de date fixée",clearable:true,valueFormat:"DD/MM/YYYY",...form.getInputProps("next_action_due_at")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Checkbox,{label:"Reconstruire l'historique (recherche multi-sources)",...form.getInputProps("request_reconstruction",{type:"checkbox"})}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"flex-end",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"default",onClick:onClose,children:"Annuler"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{type:"submit",loading:create.isPending,children:"Créer"})]})]})})})}const BRAND_COLOR={pipedrive:"#017737",gmail:"#EA4335",pennylane:"#4B4BF5",claap:"#6C5CE7",granola:"#F26B3A",slack:"#4A154B",calendar:"#4285F4",imessage:"#0B93F6",whatsapp:"#25D366",linkedin:"#0A66C2",notion:"#111111",lemlist:"#4B4BF5"};function Tile({size,color,children}){return/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",role:"img","aria-hidden":"true",style:{display:"block",flex:"none"},children:[/*#__PURE__*/(0,jsx_runtime.jsx)("rect",{x:"0",y:"0",width:"24",height:"24",rx:"5",fill:color}),children]})}function LetterGlyph({letter}){return/*#__PURE__*/(0,jsx_runtime.jsx)("text",{x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",fontFamily:"system-ui, sans-serif",fontSize:"13",fontWeight:"700",fill:"#fff",children:letter})}function bubbleGlyph(){return/*#__PURE__*/(0,jsx_runtime.jsx)("path",{d:"M12 5.5c-3.9 0-7 2.4-7 5.4 0 1.6.9 3.1 2.3 4.1-.1 1-.6 1.9-1 2.5 1.1-.2 2.2-.6 3-1.2.8.2 1.6.3 2.7.3 3.9 0 7-2.4 7-5.4s-3.1-5.7-7-5.7z",fill:"#fff"})}function glyphFor(source){if("gmail"===source)return/*#__PURE__*/(0,jsx_runtime.jsxs)("g",{stroke:"#fff",strokeWidth:"1.6",fill:"none",strokeLinejoin:"round",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("rect",{x:"5",y:"8",width:"14",height:"9",rx:"1"}),/*#__PURE__*/(0,jsx_runtime.jsx)("path",{d:"M5.5 8.5 12 13l6.5-4.5"})]});if("calendar"===source)return/*#__PURE__*/(0,jsx_runtime.jsxs)("g",{stroke:"#fff",strokeWidth:"1.6",fill:"none",strokeLinecap:"round",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("rect",{x:"5",y:"6.5",width:"14",height:"12.5",rx:"1.5"}),/*#__PURE__*/(0,jsx_runtime.jsx)("path",{d:"M5 10.5h14"}),/*#__PURE__*/(0,jsx_runtime.jsx)("path",{d:"M9 4.5v3.5M15 4.5v3.5"})]});if("slack"===source)return/*#__PURE__*/(0,jsx_runtime.jsx)("g",{stroke:"#fff",strokeWidth:"1.7",strokeLinecap:"round",children:/*#__PURE__*/(0,jsx_runtime.jsx)("path",{d:"M9.7 6 8.5 18M15.5 6l-1.2 12M6 9.7h12M5.5 14.3h12"})});if("whatsapp"===source||"imessage"===source)return bubbleGlyph();if("claap"===source)return/*#__PURE__*/(0,jsx_runtime.jsxs)("g",{fill:"none",stroke:"#fff",strokeWidth:"1.6",strokeLinejoin:"round",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("circle",{cx:"12",cy:"12",r:"7"}),/*#__PURE__*/(0,jsx_runtime.jsx)("path",{d:"M10.5 9.2 15 12l-4.5 2.8z",fill:"#fff",stroke:"none"})]});if("granola"===source)return/*#__PURE__*/(0,jsx_runtime.jsxs)("g",{fill:"none",stroke:"#fff",strokeWidth:"1.5",strokeLinecap:"round",children:[/*#__PURE__*/(0,jsx_runtime.jsx)("rect",{x:"6.5",y:"5",width:"11",height:"14",rx:"1.5",strokeWidth:"1.6"}),/*#__PURE__*/(0,jsx_runtime.jsx)("path",{d:"M9 9h6M9 12h6M9 15h4"})]});if("pipedrive"===source)return/*#__PURE__*/(0,jsx_runtime.jsx)("path",{d:"M6 7h12l-4.5 5.2V18l-3-1.5v-4.3z",fill:"#fff"});if("lemlist"===source)return/*#__PURE__*/(0,jsx_runtime.jsx)("path",{d:"M5 12 19 6l-6 13-2.4-5.4z",fill:"#fff"});if("linkedin"===source)return/*#__PURE__*/(0,jsx_runtime.jsx)(LetterGlyph,{letter:"in"});if("notion"===source)return/*#__PURE__*/(0,jsx_runtime.jsx)(LetterGlyph,{letter:"N"});if("pennylane"===source)return/*#__PURE__*/(0,jsx_runtime.jsx)(LetterGlyph,{letter:"P"});return null}function SourceIcon({source,size=16}){const color=BRAND_COLOR[source];const glyph=glyphFor(source);if(color&&glyph)return/*#__PURE__*/(0,jsx_runtime.jsx)(Tile,{size:size,color:color,children:glyph});const initial=source.length>0?source.charAt(0).toUpperCase():"?";return/*#__PURE__*/(0,jsx_runtime.jsxs)("svg",{width:size,height:size,viewBox:"0 0 24 24",role:"img","aria-hidden":"true",style:{display:"block",flex:"none"},children:[/*#__PURE__*/(0,jsx_runtime.jsx)("circle",{cx:"12",cy:"12",r:"12",fill:"#868e96"}),/*#__PURE__*/(0,jsx_runtime.jsx)(LetterGlyph,{letter:initial})]})}const sales_app_eurFormatter=new Intl.NumberFormat("fr-FR",{style:"currency",currency:"EUR"});function sourceLabel(source){if(0===source.length)return source;return source.charAt(0).toUpperCase()+source.slice(1)}function SalesApp(){const[status,setStatus]=(0,index_js_.useState)("active");const leads=(0,leadsQuery.p)(status);const rescan=useSalesRescan();const syncState=useSalesSyncState();const scanSummary=useSalesScanSummary();const[selectedId,setSelectedId]=(0,index_js_.useState)(null);const[temperatureFilter,setTemperatureFilter]=(0,index_js_.useState)(null);const[search,setSearch]=(0,index_js_.useState)("");const[newLeadOpened,newLead]=(0,esm_index_mjs_.useDisclosure)(false);return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Container,{fluid:true,my:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",mb:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:2,children:"Leads"}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{placeholder:"Rechercher (nom, entreprise)",value:search,onChange:e=>setSearch(e.currentTarget.value),w:260}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Select,{placeholder:"Toutes températures",clearable:true,data:sales_temperature.E.map(t=>({value:t,label:`${sales_temperature.z[t].emoji} ${sales_temperature.z[t].label}`})),value:temperatureFilter,onChange:v=>setTemperatureFilter(v)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{onClick:newLead.open,children:"+ Nouveau lead"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{loading:rescan.isPending,onClick:()=>rescan.mutate(),variant:"light",children:"Re-scanner"})]})]}),syncState.data&&syncState.data.sources.length>0||scanSummary.data&&scanSummary.data.total_runs>0?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",mb:"md",children:[syncState.data?syncState.data.sources.map(s=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{variant:"light",color:"gray",leftSection:/*#__PURE__*/(0,jsx_runtime.jsx)(SourceIcon,{source:s.source,size:14}),children:`${sourceLabel(s.source)} \xb7 ${formatRelativeParis(s.last_sync_at)}`},s.source)):null,scanSummary.data&&scanSummary.data.total_runs>0?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{variant:"light",color:"blue",children:`Scans agent ce mois : ${scanSummary.data.month_runs} \xb7 ~${Math.round(scanSummary.data.month_tokens/1e3)} k tokens ≈ ${sales_app_eurFormatter.format(scanSummary.data.month_cost_eur)}`}):null]}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:status,onChange:setStatus,mb:"md",data:[{label:"Actifs",value:"active"},{label:"Gagnés",value:"won"},{label:"Perdus",value:"lost"}]}),leads.isLoading?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Loader,{}):null,leads.data?/*#__PURE__*/(0,jsx_runtime.jsx)(LeadsTable,{leads:leads.data.leads,temperatureFilter:temperatureFilter,search:search,onRowClick:setSelectedId}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(NewLeadModal,{opened:newLeadOpened,onClose:newLead.close}),/*#__PURE__*/(0,jsx_runtime.jsx)(LeadDetailDrawer,{leadId:selectedId,onClose:()=>setSelectedId(null)})]})}function Sales(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.b,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(SalesApp,{})})})}}}]);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*! LICENSE: __federation_expose_scrapers.ec2bebbb38.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis["chunk_tech_app "]||=[]).push([[7958],{9698(__unused_rspack_module,exports){/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848(module,__unused_rspack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},3692(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);var react_jsx_runtime__rspack_import_0=__webpack_require__(4848);var react__rspack_import_1=__webpack_require__(814);var _providers_tsx__rspack_import_2=__webpack_require__(9528);var _src_apps_scrapers_app_tsx__rspack_import_3=__webpack_require__(6217);function Scrapers(props){return/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(react__rspack_import_1.StrictMode,{children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_providers_tsx__rspack_import_2.b,{...props,children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_src_apps_scrapers_app_tsx__rspack_import_3.D,{})})})}__webpack_require__.d(__webpack_exports__,{default:()=>Scrapers})}}]);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*! LICENSE: __federation_expose_spendesk.f36a6189d1.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis["chunk_tech_app "]||=[]).push([[3556],{9698(__unused_rspack_module,exports){/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848(module,__unused_rspack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},7785(__unused_rspack_module,__webpack_exports__,__webpack_require__){var react__rspack_import_0=__webpack_require__(814);const AppConfigCtx=(0,react__rspack_import_0.createContext)(null);const AppConfigProvider=AppConfigCtx.Provider;function useAppConfig(){const config=(0,react__rspack_import_0.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigProvider />`");return config}__webpack_require__.d(__webpack_exports__,{r:()=>useAppConfig},{X:AppConfigProvider})},9528(__unused_rspack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__rspack_import_0=__webpack_require__(4848);var _airporting_app_front__rspack_import_1=__webpack_require__(5456);var _mantine_core__rspack_import_2=__webpack_require__(4618);var _mantine_modals__rspack_import_3=__webpack_require__(3536);var _mantine_notifications__rspack_import_4=__webpack_require__(7250);var _tanstack_react_query__rspack_import_5=__webpack_require__(3411);var radash__rspack_import_6=__webpack_require__(5551);var _hooks_useAppConfig__rspack_import_7=__webpack_require__(7785);const theme=(0,_mantine_core__rspack_import_2.createTheme)((0,radash__rspack_import_6.assign)(_airporting_app_front__rspack_import_1.theme,{components:{}}));const cssVarResolver=x=>(0,radash__rspack_import_6.assign)(_airporting_app_front__rspack_import_1.cssVarResolver(x),{dark:{},light:{},variables:{}});function Providers(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_hooks_useAppConfig__rspack_import_7.X,{value:config,children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_tanstack_react_query__rspack_import_5.QueryClientProvider,{client:tanstack?.queryClient??new _tanstack_react_query__rspack_import_5.QueryClient,children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_core__rspack_import_2.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsxs)(_mantine_modals__rspack_import_3.ModalsProvider,{children:[/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_notifications__rspack_import_4.Notifications,{}),children]})})})})}__webpack_require__.d(__webpack_exports__,{b:()=>Providers})},9579(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Spendesk});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(814);var providers=__webpack_require__(9528);var index_mjs_=__webpack_require__(4618);function SpendeskApp(){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Container,{my:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:2,my:"md",children:"Spendesk - soon"})})}function Spendesk(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.b,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(SpendeskApp,{})})})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(globalThis["chunk_tech_app "]||=[]).push([[9243],{4754(__unused_rspack_module,__webpack_exports__,__webpack_require__){var _tanstack_react_query__rspack_import_0=__webpack_require__(3411);var _useApi__rspack_import_1=__webpack_require__(4691);function useGsheetStock(filters={}){const api=(0,_useApi__rspack_import_1.g)();const query={...filters.period&&{period:filters.period}};return(0,_tanstack_react_query__rspack_import_0.useQuery)({queryKey:["tech","gsheet","stock",filters],queryFn:async()=>(await api.gsheet.getStockV1({query})).data,refetchInterval:3e4,refetchIntervalInBackground:false,refetchOnWindowFocus:true})}__webpack_require__.d(__webpack_exports__,{s:()=>useGsheetStock})},1239(__unused_rspack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__rspack_import_0=__webpack_require__(4848);var _mantine_core__rspack_import_1=__webpack_require__(4618);var _src_components_logoDev_ts__rspack_import_2=__webpack_require__(2137);function BrandLogo({domain,alt,size=24}){return/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_core__rspack_import_1.Image,{src:(0,_src_components_logoDev_ts__rspack_import_2.w)(domain),alt:alt,title:alt,w:size,h:size,fit:"contain",radius:"sm",style:{aspectRatio:1}})}__webpack_require__.d(__webpack_exports__,{F:()=>BrandLogo})},2137(__unused_rspack_module,__webpack_exports__,__webpack_require__){const LOGO_DEV_TOKEN="pk_BVN4OQv0Qs-bnqjdIgTppg";function logoDevUrl(domain){return`https://img.logo.dev/${domain}?token=${LOGO_DEV_TOKEN}`}__webpack_require__.d(__webpack_exports__,{w:()=>logoDevUrl})},9871(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Spreadsheet});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(814);var providers=__webpack_require__(9528);var QueueDashboard=__webpack_require__(5029);var index_mjs_=__webpack_require__(4618);var tabler_icons_react_mjs_=__webpack_require__(2638);var gsheetStockQuery=__webpack_require__(4754);var modern_index_js_=__webpack_require__(3411);var useApi=__webpack_require__(4691);function useGsheetTasks(filters){const api=(0,useApi.g)();const service=filters.service?.toLowerCase()==="all"?void 0:filters.service;const owner=filters.owner?.toLowerCase()==="all"?void 0:filters.owner;const query={...service&&{service},...owner&&{owner},...filters.state&&{state:filters.state},...filters.period&&{period:filters.period},...void 0!==filters.take&&{take:String(filters.take)},...void 0!==filters.skip&&{skip:String(filters.skip)}};return(0,modern_index_js_.useQuery)({queryKey:["tech","gsheet","tasks",filters],queryFn:async()=>(await api.gsheet.listTasksV1(query)).data,refetchOnWindowFocus:false})}function useInvalidate(){const queryClient=(0,modern_index_js_.useQueryClient)();return()=>queryClient.invalidateQueries({queryKey:["tech","gsheet"]})}function useUnstickTask(){const api=(0,useApi.g)();const invalidate=useInvalidate();return(0,modern_index_js_.useMutation)({mutationFn:async id=>(await api.gsheet.unstickV1({id:String(id)})).data,onSuccess:invalidate})}function useDiscardTask(){const api=(0,useApi.g)();const invalidate=useInvalidate();return(0,modern_index_js_.useMutation)({mutationFn:async id=>(await api.gsheet.discardV1({id:String(id)})).data,onSuccess:invalidate})}function useSetTaskOwner(){const api=(0,useApi.g)();const invalidate=useInvalidate();return(0,modern_index_js_.useMutation)({mutationFn:async({id,owner})=>(await api.gsheet.setOwnerV1({id:String(id)},{owner})).data,onSuccess:invalidate})}function useDeleteRedisLock(){const api=(0,useApi.g)();const invalidate=useInvalidate();return(0,modern_index_js_.useMutation)({mutationFn:async id=>(await api.gsheet.deleteRedisLockV1({id:String(id)})).data,onSuccess:invalidate})}var jobLogsContext=__webpack_require__(7495);var esm_index_mjs_=__webpack_require__(7250);function grafanaUrl(traceId){return`https://airporting.grafana.net/d/beegyy3vsp8n4c/recipes?var-trace=${encodeURIComponent(traceId)}&orgId=1&from=now-7d&to=now&timezone=browser&showCategory=Logs&refresh=7d`}function notify(title,message,color){esm_index_mjs_.notifications.show({title,message,color})}function RowActions({taskId,currentOwner,service,spreadsheet,worksheet,githubJob,traceId,onShowLogs}){const[confirm,setConfirm]=(0,index_js_.useState)(null);const[ownerModalOpen,setOwnerModalOpen]=(0,index_js_.useState)(false);const[ownerInput,setOwnerInput]=(0,index_js_.useState)(currentOwner??"");const unstick=useUnstickTask();const discard=useDiscardTask();const setOwner=useSetTaskOwner();const deleteLock=useDeleteRedisLock();const runUnstick=()=>unstick.mutate(taskId,{onSuccess:()=>notify("Unstuck",`Task #${taskId} reset`,"green"),onError:e=>notify("Failed",e?.message??"Unstick failed","red")});const runDiscard=()=>{setConfirm(null);discard.mutate(taskId,{onSuccess:()=>notify("Discarded",`Task #${taskId} marked done`,"green"),onError:e=>notify("Failed",e?.message??"Discard failed","red")})};const runSetOwner=()=>{setOwnerModalOpen(false);setOwner.mutate({id:taskId,owner:ownerInput},{onSuccess:()=>notify("Owner updated",`Task #${taskId} → ${ownerInput}`,"green"),onError:e=>notify("Failed",e?.message??"Set owner failed","red")})};const runDeleteLock=()=>{setConfirm(null);deleteLock.mutate(taskId,{onSuccess:data=>notify("Redis lock",data.existed?`Deleted ${data.key}`:`No lock found (${data.key})`,"green"),onError:e=>notify("Failed",e?.message??"Redis delete failed","red")})};const getWorksheetUrl=()=>{if(!spreadsheet)return null;return"excel"===service?`https://airporting.sharepoint.com/:x:/g/personal/airporting_com/ER${spreadsheet}`:`https://docs.google.com/spreadsheets/d/${spreadsheet}/edit`};const worksheetUrl=getWorksheetUrl();return/*#__PURE__*/(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",children:[worksheetUrl&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:"Ouvrir le tableur",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{component:"a",href:worksheetUrl,target:"_blank",rel:"noopener noreferrer",variant:"subtle","aria-label":"Ouvrir le tableur",children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconFileSpreadsheet,{size:16})})}),githubJob&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:"GitHub Actions logs",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"subtle",onClick:()=>onShowLogs(githubJob),"aria-label":"GitHub Actions logs",children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconTerminal,{size:16})})}),traceId&&/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:"Grafana Loki logs",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{component:"a",href:grafanaUrl(traceId),target:"_blank",rel:"noopener noreferrer",variant:"subtle","aria-label":"Grafana Loki logs",children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconFileText,{size:16})})}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Menu,{position:"bottom-end",withArrow:true,shadow:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Target,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"default","aria-label":"Actions",children:"⋮"})}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Menu.Dropdown,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Item,{onClick:runUnstick,children:"Unstick"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Item,{onClick:()=>{setOwnerInput(currentOwner??"");setOwnerModalOpen(true)},children:"Set owner…"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Item,{onClick:()=>setConfirm("redis"),children:"Delete Redis lock"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Divider,{}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Menu.Item,{color:"red",onClick:()=>setConfirm("discard"),children:"Discard"})]})]})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Modal,{opened:"discard"===confirm,onClose:()=>setConfirm(null),title:"Discard task",children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",style:{wordBreak:"break-all"},children:["Mark task #",taskId," (",spreadsheet,worksheet?`:${worksheet}`:"",") as ",/*#__PURE__*/(0,jsx_runtime.jsx)("b",{children:"done"})," with step=",/*#__PURE__*/(0,jsx_runtime.jsx)("code",{children:"discarded"}),". The task will not be processed by the runner."]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"flex-end",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"default",onClick:()=>setConfirm(null),children:"Cancel"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{color:"red",onClick:runDiscard,loading:discard.isPending,children:"Discard"})]})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Modal,{opened:"redis"===confirm,onClose:()=>setConfirm(null),title:"Delete Redis lock",children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",style:{wordBreak:"break-all"},children:["Delete the Redis running-lock for ",spreadsheet,worksheet?`:${worksheet}`:"",". The runner will be able to pick up the worksheet again on the next iteration."]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"flex-end",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"default",onClick:()=>setConfirm(null),children:"Cancel"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{color:"orange",onClick:runDeleteLock,loading:deleteLock.isPending,children:"Delete lock"})]})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Modal,{opened:ownerModalOpen,onClose:()=>setOwnerModalOpen(false),title:`Set owner for task #${taskId}`,children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.TextInput,{label:"Owner email",value:ownerInput,onChange:e=>setOwnerInput(e.currentTarget.value),placeholder:"bob@airporting.com"}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"flex-end",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"default",onClick:()=>setOwnerModalOpen(false),children:"Cancel"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{onClick:runSetOwner,loading:setOwner.isPending,disabled:!ownerInput.trim(),children:"Save"})]})]})})]})}var BrandLogo=__webpack_require__(1239);const SERVICE_DOMAIN={gsheet:"google.com",excel:"microsoft.com"};const SERVICE_LABEL={gsheet:"Google Sheets",excel:"Excel"};function ServiceLogo({service,size=18}){const domain=SERVICE_DOMAIN[service];const label=SERVICE_LABEL[service]??service;if(!domain)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{size:"xs",variant:"light",color:"gray",title:service,children:service.slice(0,2).toUpperCase()});return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,wrap:"nowrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(BrandLogo.F,{domain:domain,alt:label,size:size}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:label})]})}const STATE_COLORS={pending:"gray",running:"blue",stuck:"orange",errored:"red",done:"green"};const STATE_LABELS={pending:"En attente",running:"En cours",stuck:"Bloquée",errored:"En erreur",done:"Terminée"};function fmt(d){return d?new Date(d).toLocaleString("fr-FR"):"—"}function GsheetRowActions({item}){const openLogs=(0,jobLogsContext.c)();return/*#__PURE__*/(0,jsx_runtime.jsx)(RowActions,{taskId:item.id,currentOwner:item.owner,service:item.service,spreadsheet:item.spreadsheet,worksheet:item.worksheet,githubJob:item.github_job,traceId:item.trace_id,onShowLogs:openLogs})}async function runBulk(ids,fn){const results=await Promise.allSettled(ids.map(fn));const ok=results.filter(r=>"fulfilled"===r.status).length;return{ok,failed:results.length-ok}}function useGsheetConfig(){const unstick=useUnstickTask();const discard=useDiscardTask();const setOwner=useSetTaskOwner();const deleteLock=useDeleteRedisLock();return(0,index_js_.useMemo)(()=>({title:"Worksheets : état des lieux des copies sur tableurs",source:{useStock:({period})=>(0,gsheetStockQuery.s)({period:period??void 0}),useTasks:({service,owner,state,period},pagination)=>useGsheetTasks({service:service??void 0,owner:owner??void 0,state,period:period??void 0,skip:pagination.skip,take:pagination.take})},initialFilters:{service:null,owner:null,state:"pending",period:"today",search:""},kpis:[{key:"pending",label:"En attente",value:s=>s?.pending??0,filter:{state:"pending"}},{key:"running",label:"En cours",value:s=>s?.running??0,filter:{state:"running"}},{key:"stuck",label:"Bloquées",value:s=>s?.stuck??0,tone:s=>(s?.stuck??0)>0?"warn":"neutral",filter:{state:"stuck"}},{key:"errored",label:"En erreur",value:s=>s?.errored??0,tone:s=>(s?.errored??0)>0?"bad":"neutral",filter:{state:"errored"}},{key:"done_today",label:"Terminées",value:s=>s?.done_today??0,filter:{state:"done"}},{key:"oldest",label:"Plus ancienne en attente",value:s=>s?.oldest?`${s.oldest.ageHours}h`:"—"}],filters:[{kind:"select",key:"service",label:"Service",options:()=>["all","gsheet","excel"],width:240},{kind:"select",key:"owner",label:"Propriétaire",options:s=>["all",...(s?.byOwner??[]).map(e=>e.key)],width:240},{kind:"select",key:"state",label:"État",options:()=>["pending","running","stuck","errored","done","all"],clearable:false,width:140},{kind:"select",key:"period",label:"Période",options:()=>[{value:"today",label:"Aujourd'hui"},{value:"7d",label:"7 jours"},{value:"30d",label:"30 jours"},{value:"all",label:"Tout"}],clearable:false,width:130},{kind:"search",key:"search",label:"Recherche",placeholder:"id, owner, spreadsheet…",width:240}],columns:[{key:"service",label:"Service",render:t=>/*#__PURE__*/(0,jsx_runtime.jsx)(ServiceLogo,{service:t.service})},{key:"spreadsheet",label:"ID tableur",render:t=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",style:{wordBreak:"break-all"},children:t.spreadsheet})},{key:"worksheet",label:"Onglet",render:t=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",style:{wordBreak:"break-all"},children:t.worksheet??"—"})},{key:"company_display_name",label:"Entreprise",render:t=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:t.company_display_name??"—"})},{key:"trigger_source",label:"Type",render:t=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",wrap:"nowrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ThemeIcon,{variant:"transparent",color:"gray",size:"sm",children:"manual"===t.trigger_source?/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconUser,{size:16,stroke:1.5}):/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconRobot,{size:16,stroke:1.5})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"manual"===t.trigger_source?t.owner??"Manuel":"Planifié"})]})},{key:"state",label:"État",render:t=>{const badge=/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Badge,{color:STATE_COLORS[t.state],children:STATE_LABELS[t.state]});return t.error?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:t.error,multiline:true,maw:420,withArrow:true,children:badge}):badge}},{key:"created",label:"Créée",render:t=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:fmt(t.created)})},{key:"started",label:"Démarrée",render:t=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:fmt(t.started)})},{key:"finished_at",label:"Terminée",render:t=>/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:fmt(t.finished_at)})}],rowActions:[{key:"actions",render:item=>/*#__PURE__*/(0,jsx_runtime.jsx)(GsheetRowActions,{item:item})}],bulkActions:[{key:"unstick",label:"Débloquer",run:ids=>runBulk(ids,id=>unstick.mutateAsync(id))},{key:"set-owner",label:"Changer le propriétaire…",prompt:{label:"E-mail du propriétaire",placeholder:"bob@airporting.com"},run:(ids,owner)=>{if(!owner)return Promise.resolve({ok:0,failed:ids.length});return runBulk(ids,id=>setOwner.mutateAsync({id,owner}))}},{key:"delete-lock",label:"Supprimer le verrou Redis",color:"orange",confirm:{title:"Supprimer le verrou Redis pour {count} tâche(s)",body:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:"fm-task-node-<id>",disabled:true,children:/*#__PURE__*/(0,jsx_runtime.jsxs)("span",{children:["Suppression du verrou Redis pour ","{count}"," tâche(s)."]})})},run:ids=>runBulk(ids,id=>deleteLock.mutateAsync(id))},{key:"discard",label:"Abandonner",color:"red",confirm:{title:"Abandonner {count} tâche(s)",body:"Les tâches seront marquées comme terminées/abandonnées."},run:ids=>runBulk(ids,id=>discard.mutateAsync(id))}],getRowId:t=>t.id,searchMatches:(t,q)=>String(t.id).includes(q)||(t.owner??"").toLowerCase().includes(q)||(t.spreadsheet??"").toLowerCase().includes(q)||(t.worksheet??"").toLowerCase().includes(q)||(t.service??"").toLowerCase().includes(q)||(t.company_display_name??"").toLowerCase().includes(q)}),[unstick,discard,setOwner,deleteLock])}function SpreadsheetApp(){const config=useGsheetConfig();return/*#__PURE__*/(0,jsx_runtime.jsx)(QueueDashboard.M,{config:config})}function Spreadsheet(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.b,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(SpreadsheetApp,{})})})}}}]);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*! LICENSE: __federation_expose_synchro.090ad23824.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis["chunk_tech_app "]||=[]).push([[403],{9698(__unused_rspack_module,exports){/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848(module,__unused_rspack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},4394(__unused_rspack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__rspack_import_0=__webpack_require__(4848);function IconGithub({color="currentColor",size=20,marker,...props}){return/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)("svg",{width:size,height:size,viewBox:"0 0 24 24",fill:color,xmlns:"http://www.w3.org/2000/svg",...props,children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)("path",{d:"M12 0.297C5.373 0.297 0 5.67 0 12.297c0 5.292 3.438 9.787 8.205 11.387.6.111.82-.261.82-.58\n 0-.287-.011-1.244-.016-2.255-3.338.726-4.042-1.609-4.042-1.609-.546-1.389-1.333-1.759-1.333-1.759-1.089-.745.083-.73.083-.73\n 1.205.085 1.84 1.236 1.84 1.236 1.07 1.834 2.807 1.304 3.492.997.107-.775.419-1.305.762-1.605-2.665-.304-5.466-1.332-5.466-5.931\n 0-1.311.469-2.381 1.236-3.221-.124-.303-.536-1.524.116-3.176 0 0 1.008-.322 3.301 1.23a11.51 11.51 0 0 1 3.004-.404\n c1.019.005 2.047.138 3.004.404 2.291-1.552 3.297-1.23 3.297-1.23.655 1.652.243 2.873.119 3.176.77.84\n 1.235 1.91 1.235 3.221 0 4.61-2.805 5.624-5.476 5.921.43.372.823 1.104.823 2.223\n 0 1.606-.015 2.896-.015 3.293 0 .321.216.697.825.578C20.565 22.08 24 17.585 24 12.297\n 24 5.67 18.627.297 12 .297z"})})}__webpack_require__.d(__webpack_exports__,{Z:()=>IconGithub})},1441(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Synchro});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(814);var providers=__webpack_require__(9528);var index_mjs_=__webpack_require__(4618);var esm_index_mjs_=__webpack_require__(2506);var modern_index_js_=__webpack_require__(3411);var useApi=__webpack_require__(4691);function useSynchroStatsQuery(){const api=(0,useApi.g)();const query=(0,modern_index_js_.useQuery)({queryKey:["tech","synchro","stats"],queryFn:async()=>await api.synchro.getRunStatsV1().then(x=>x.data),refetchInterval:6e4,refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true});return query}var tabler_icons_react_mjs_=__webpack_require__(2638);var notifications_esm_index_mjs_=__webpack_require__(7250);function useResetStatsMutation(){const api=(0,useApi.g)();const query=(0,modern_index_js_.useMutation)({mutationFn:async values=>await api.synchro.resetOwnerStatsV1(values).then(x=>x.data),onSuccess:()=>{notifications_esm_index_mjs_.notifications.show({title:"Cible remise à niveau",message:"C'est reparti comme en 40"})},onError:(error,variables,context)=>{console.error(error,variables,context);notifications_esm_index_mjs_.notifications.show({color:"red",title:"Erreur !",message:"Nous rencontrons un soucis technique. Veuillez réessayer plus tard."})}});return query}function useSynchroTasks({gas,dateRange,companies,jobs}){const api=(0,useApi.g)();return(0,modern_index_js_.useQuery)({queryKey:["tech","synchro","tasks","list",{gas,dateRange,companies,jobs}],queryFn:async()=>await api.synchro.getTasksV1({...gas&&{gas},...dateRange&&{dateStart:dateRange[0]??void 0,dateEnd:dateRange[1]??void 0,companyIds:companies?.map(x=>+x),jobNames:jobs}}).then(x=>x.data),refetchInterval:6e4,refetchIntervalInBackground:false,refetchOnWindowFocus:true,refetchOnReconnect:true})}var IconGithub=__webpack_require__(4394);var dist_index_js_=__webpack_require__(5456);var date_fns_index_js_=__webpack_require__(8680);function useCompaniesQuery(){const api=(0,useApi.g)();const query=(0,modern_index_js_.useQuery)({queryKey:["tech","companies"],queryFn:async()=>await api.getCompanies().then(x=>x.data)});return query}function useJobsDefaultQuery(){const api=(0,useApi.g)();const query=(0,modern_index_js_.useQuery)({queryKey:["tech","jobs","defaults"],queryFn:async()=>await api.synchro.getJobsDefaultsV1().then(x=>x.data)});return query}function SynchroApp(){const[gasOnly,setGasOnly]=(0,index_js_.useState)("nodejs");const[dateRange,setDateRange]=(0,index_js_.useState)([(0,date_fns_index_js_.formatISO)((0,date_fns_index_js_.startOfDay)(new Date)),(0,date_fns_index_js_.formatISO)((0,date_fns_index_js_.endOfDay)(new Date))]);const[companies,setCompanies]=(0,index_js_.useState)([]);const[jobs,setJobs]=(0,index_js_.useState)([]);const companiesResult=useCompaniesQuery();const companiesList=(companiesResult.data?.list??[]).map(company=>({value:company.id.toString(),label:company.display_name??company.id.toString()}));const jobsDefaultResult=useJobsDefaultQuery();const jobsDefaultList=(jobsDefaultResult.data?.list??[]).map(jobDefault=>jobDefault.task);const statsResult=useSynchroStatsQuery();const stats=statsResult.data;const tasksListResult=useSynchroTasks({gas:gasOnly,dateRange,companies,jobs});const tasksList=tasksListResult.data;const resetFn=useResetStatsMutation();function resolveStatus(element){if(!element.ready)return"en attente";if(element.need_gas)return element.gas_started?"GAS en cours":"GAS en attente";return element.finished?"fini":"en cours"}const rows=(tasksList?.tasks??[]).map(element=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:element.id}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Td,{children:[element.need_gas?/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconOld,{title:"papi GAS"}):/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconBolt,{title:"fougueux nodejs"})," ",element.job_name,/*#__PURE__*/(0,jsx_runtime.jsx)("br",{}),/*#__PURE__*/(0,jsx_runtime.jsx)("small",{children:element.job_name_fr})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:(0,date_fns_index_js_.format)(element.created,"dd/MM/yyyy HH:mm:ss")}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:element.startedAt?(0,date_fns_index_js_.format)(element.startedAt,"dd/MM/yyyy HH:mm:ss"):""}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:resolveStatus(element)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:element.owner}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:element.main_company?.display_name}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Th,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.AirButton,{variant:"subtle",color:"gray",href:element.github_job,title:"Github runner",children:/*#__PURE__*/(0,jsx_runtime.jsx)(IconGithub.Z,{size:20})}),/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.AirButton,{variant:"subtle",color:"gray",href:`https://airporting.grafana.net/d/beegyy3vsp8n4c/recipes?var-trace=${element.recipe_uuid}-${element.id}&orgId=1&from=now-7d&to=now&timezone=browser&showCategory=Logs&refresh=7d`,children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconFileText,{title:"Logs",size:20})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"subtle",color:"gray",size:"compact-sm",onClick:()=>console.log(`coucou ${element.id}`),children:"log"}),element.finished?/*#__PURE__*/(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{}):/*#__PURE__*/(0,jsx_runtime.jsx)(dist_index_js_.AirButton,{variant:"subtle",color:"gray",onClick:async()=>{console.log("stop",element.id)},children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconHandStop,{title:"Stop",size:20})})]})]},element.id));return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Container,{my:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:2,my:"md",children:"Synchro"}),/*#__PURE__*/(0,jsx_runtime.jsx)("ul",{children:stats&&Object.entries(stats.currentJobsCounters).map(([key,value])=>/*#__PURE__*/(0,jsx_runtime.jsxs)("li",{children:[key,": ",value.db," db, ",value.redis," redis",/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"subtle",color:value.db!=value.redis?"red":"green",onClick:async()=>{await resetFn.mutateAsync({owner:key,value:(value.db??0).toString()});await statsResult.refetch()},children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconRefreshDot,{size:20})})]},key))}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Stack,{gap:"sm",my:"md",children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{align:"flex-end",wrap:"wrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Select,{label:"GAS et/ou nodejs",data:[{value:"all",label:"Toutes"},{value:"nodejs",label:"nodejs seulement"},{value:"gas",label:"GAS seulement"}],value:gasOnly,onChange:v=>setGasOnly(v??"nodejs"),w:140}),/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.DatePickerInput,{leftSection:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconCalendar,{size:18}),type:"range",label:"Date de création",placeholder:"Sélectionner une plage",value:dateRange,onChange:setDateRange,clearable:true,allowSingleDateInRange:true,w:260}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.MultiSelect,{label:"Client",placeholder:"Sélectionner un ou plusieurs clients",data:companiesList,onChange:setCompanies,searchable:true,clearable:true}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.MultiSelect,{label:"Fonction",placeholder:"Sélectionner une ou plusieurs fonctions",data:jobsDefaultList,onChange:setJobs,searchable:true,clearable:true})]})}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{stickyHeader:true,striped:true,highlightOnHover:true,withTableBorder:true,withColumnBorders:true,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"ID"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Fonction"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Demandée"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Démarée"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Statut"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Owner"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Client"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Liens"})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:rows})]})]})}function Synchro(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.b,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(SynchroApp,{})})})}}}]);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*! LICENSE: __federation_expose_usage.be52f862ad.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis["chunk_tech_app "]||=[]).push([[3270],{9698(__unused_rspack_module,exports){/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848(module,__unused_rspack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},7483(__unused_rspack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__rspack_import_0=__webpack_require__(4848);var _mantine_core__rspack_import_1=__webpack_require__(4618);var _tabler_icons_react__rspack_import_2=__webpack_require__(2638);var react__rspack_import_3=__webpack_require__(814);function formatRelative(now,then){const seconds=Math.max(0,Math.floor((now-then)/1e3));if(seconds<5)return"à l’instant";if(seconds<60)return`il y a ${seconds}s`;const minutes=Math.floor(seconds/60);if(minutes<60)return`il y a ${minutes} min`;const hours=Math.floor(minutes/60);return`il y a ${hours} h`}function PageHeader({title,leading,badge,updatedAt,isFetching,isError,onRefresh,actions}){const[now,setNow]=(0,react__rspack_import_3.useState)(()=>Date.now());(0,react__rspack_import_3.useEffect)(()=>{if(!updatedAt)return;const id=window.setInterval(()=>setNow(Date.now()),1e3);return()=>window.clearInterval(id)},[updatedAt]);const relative=updatedAt?formatRelative(now,updatedAt):null;const color=isError?"orange":isFetching?"teal":"dimmed";return/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsxs)(_mantine_core__rspack_import_1.Group,{justify:"space-between",align:"center",mih:48,mb:"md",children:[/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsxs)(_mantine_core__rspack_import_1.Group,{gap:"sm",align:"center",children:[leading,/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_core__rspack_import_1.Title,{order:2,children:title}),badge]}),/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsxs)(_mantine_core__rspack_import_1.Group,{gap:"sm",align:"center",children:[relative&&/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_core__rspack_import_1.Text,{size:"xs",c:color,fw:isFetching?600:400,"data-testid":"page-header-freshness",children:isError?"échec maj":isFetching?"maj…":relative}),onRefresh&&/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_core__rspack_import_1.Tooltip,{label:"Rafraîchir",children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_core__rspack_import_1.ActionIcon,{variant:"default",size:"md",onClick:onRefresh,loading:isFetching,"aria-label":"Refresh",children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_tabler_icons_react__rspack_import_2.IconRefresh,{size:16})})}),actions]})]})}__webpack_require__.d(__webpack_exports__,{z:()=>PageHeader})},6066(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Usage});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(814);var providers=__webpack_require__(9528);var index_mjs_=__webpack_require__(4618);var tabler_icons_react_mjs_=__webpack_require__(2638);var modern_index_js_=__webpack_require__(3411);var useApi=__webpack_require__(4691);const STALE_MS=6e4;const DAY_REFETCH_MS=3e5;function chargeKey(view,trigger,at){return["tech","usage","charge",view,trigger,at??null]}function chargeParams(view,trigger,at){return{view,..."all"===trigger?{}:{trigger},...at?{at}:{}}}function useUsageCharge(view,trigger,at){const api=(0,useApi.g)();return(0,modern_index_js_.useQuery)({queryKey:chargeKey(view,trigger,at),queryFn:async()=>{const response=await api.http.request({path:"/v1/usage/charge",method:"GET",query:chargeParams(view,trigger,at),format:"json"});return response.data},placeholderData:modern_index_js_.keepPreviousData,staleTime:STALE_MS,refetchInterval:"day"===view?DAY_REFETCH_MS:false,refetchOnWindowFocus:false})}function useUsageChargePrefetch(){const api=(0,useApi.g)();const queryClient=(0,modern_index_js_.useQueryClient)();return(view,trigger,at)=>{queryClient.prefetchQuery({queryKey:chargeKey(view,trigger,at),queryFn:async()=>{const response=await api.http.request({path:"/v1/usage/charge",method:"GET",query:chargeParams(view,trigger,at),format:"json"});return response.data},staleTime:STALE_MS})}}var PageHeader=__webpack_require__(7483);const OPTIONS=[{value:"all",label:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"Tout"})},{value:"auto",label:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,wrap:"nowrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconRobot,{size:16,stroke:1.5}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"Robots"})]})},{value:"human",label:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,wrap:"nowrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconUser,{size:16,stroke:1.5}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",children:"Humains"})]})}];const HINT="Robots = planificateur et crons dédiés. Humains = run lancé depuis l’app ; c’est un plancher, les runs passés par l’ancienne API sont comptés comme planifiés.";function TriggerFilter(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:HINT,multiline:true,w:320,withArrow:true,position:"bottom",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:props.value,onChange:next=>props.onChange(next),data:OPTIONS,size:"xs"})})}const USAGE_COLORS={productive:"#3987e5",errored:"#d03b3b",noop:"#fab219"};const AXIS_INK="#898781";function formatHours(hours){if(hours>=100)return`${Math.round(hours)} h`;return`${hours.toFixed(1).replace(".",",")} h`}function formatCount(value){return new Intl.NumberFormat("fr-FR").format(value)}function formatCompactCount(value){return new Intl.NumberFormat("fr-FR",{notation:"compact",maximumFractionDigits:1}).format(value)}function servicePercent(under,measured){if(measured<=0)return 0;return Math.round(under/measured*100)}function wastePercent(kpis){if(kpis.computeHours<=0)return 0;return Math.round((kpis.erroredHours+kpis.noopHours)/kpis.computeHours*100)}function UsageKpiRow(props){const{kpis}=props;const tiles=[{key:"compute",label:"Compute",value:formatHours(kpis.computeHours),hint:`${formatCount(kpis.tasks)} t\xe2ches, dont ${formatCount(kpis.worksheetTasks)} worksheets`},{key:"companies",label:"Entreprises actives",value:formatCount(kpis.companies),hint:`${formatCount(kpis.distinctJobs)} connecteurs distincts`},{key:"waste",label:"Compute non productif",value:`${formatHours(kpis.erroredHours+kpis.noopHours)} \xb7 ${wastePercent(kpis)} %`,hint:`${formatHours(kpis.erroredHours)} en erreur (${formatCount(kpis.erroredTasks)} t\xe2ches), ${formatHours(kpis.noopHours)} sans r\xe9sultat`,accent:USAGE_COLORS.errored},{key:"concurrency",label:"Concurrence max",value:null===kpis.maxConcurrent?"—":`${formatCount(kpis.maxConcurrent)} t\xe2ches`,hint:null===kpis.maxConcurrent?"Non calculé sur 12 mois : trop coûteux à recouvrir":"Pic de tâches simultanées, durée bornée à 110 min"},{key:"service",label:"Démarrage < 15 min",value:kpis.waitMeasured>0?`${servicePercent(kpis.waitLe15,kpis.waitMeasured)} %`:"—",hint:kpis.waitMeasured>0?`${servicePercent(kpis.waitLe30,kpis.waitMeasured)} % sous 30 min, ${servicePercent(kpis.waitLe60,kpis.waitMeasured)} % sous 1 h, ${servicePercent(kpis.waitLe240,kpis.waitMeasured)} % sous 4 h — sur ${formatCount(kpis.waitMeasured)} t\xe2ches r\xe9ellement ex\xe9cut\xe9es`:"Aucune tâche exécutée sur la période"},{key:"abandoned",label:"Synchros perdues",value:formatCount(kpis.abandonedTasks),hint:0===kpis.abandonedTasks?"Aucune synchro abandonnée sur la période":`Abandonn\xe9es apr\xe8s 3 d\xe9blocages, sans jamais avoir tourn\xe9. ${formatHours(kpis.abandonedFabricatedHours)} de dur\xe9e fictive exclues du compute.`,accent:kpis.abandonedTasks>0?USAGE_COLORS.errored:void 0},{key:"rows",label:"Lignes synchronisées",value:formatCompactCount(kpis.rowsSynced),hint:"Somme des compteurs renvoyés par les jobs — proxy de tendance"}];return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SimpleGrid,{cols:{base:1,sm:2,md:3,lg:4,xl:7},spacing:"md",children:tiles.map(tile=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:6,align:"center",mb:6,children:[tile.accent?/*#__PURE__*/(0,jsx_runtime.jsx)("span",{"aria-hidden":true,style:{width:8,height:8,borderRadius:2,background:tile.accent,display:"inline-block"}}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",tt:"uppercase",fw:700,children:tile.label})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{label:tile.hint,withArrow:true,multiline:true,w:260,children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fz:26,fw:600,lh:1.1,children:tile.value})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",mt:6,lineClamp:2,children:tile.hint})]},tile.key))})}var esm_index_mjs_=__webpack_require__(7194);const PARIS_TZ="Europe/Paris";const minuteFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,hour:"2-digit",minute:"2-digit"});const weekDayFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,weekday:"short",day:"numeric"});const monthFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,month:"short",year:"2-digit"});const fullDayFormatter=new Intl.DateTimeFormat("fr-FR",{timeZone:PARIS_TZ,weekday:"long",day:"numeric",month:"long"});function bucketDate(t){if(7===t.length)return new Date(`${t}-15T12:00:00Z`);return new Date(`${t}T12:00:00Z`)}function formatMinuteTick(iso){return minuteFormatter.format(new Date(iso))}function formatBucketTick(t,view){if("year"===view)return monthFormatter.format(bucketDate(t));if("month"===view)return String(bucketDate(t).getUTCDate());return weekDayFormatter.format(bucketDate(t))}function formatBucketLong(t,view){if("year"===view)return monthFormatter.format(bucketDate(t));return fullDayFormatter.format(bucketDate(t))}function formatWindow(from,to,view){if("day"===view)return fullDayFormatter.format(new Date(from));if("year"===view){const start=monthFormatter.format(new Date(from));const end=monthFormatter.format(new Date(new Date(to).getTime()-1));return`${start} → ${end}`}const start=fullDayFormatter.format(new Date(from));const end=fullDayFormatter.format(new Date(new Date(to).getTime()-1));return`${start} → ${end}`}function ConcurrencyTooltip({payload}){const point=payload?.[0]?.payload;if(!point)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatMinuteTick(point.t)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[point.concurrent," tâche",point.concurrent>1?"s":""," en cours"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:[point.started," démarrage",point.started>1?"s":""]}),point.errored>0?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:USAGE_COLORS.errored,children:[point.errored," en erreur"]}):null]})}function ConcurrencyChart(props){const{data}=props;if(0===data.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",children:"Aucune tâche sur la journée."});return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.AreaChart,{h:260,data:data,dataKey:"t",withDots:false,strokeWidth:2,curveType:"linear",gridAxis:"y",tickLine:"none",series:[{name:"concurrent",label:"Tâches en cours",color:USAGE_COLORS.productive}],xAxisProps:{tickFormatter:formatMinuteTick,minTickGap:48,stroke:AXIS_INK},yAxisProps:{allowDecimals:false,stroke:AXIS_INK,width:32},tooltipProps:{content:ConcurrencyTooltip},tooltipAnimationDuration:0})}const SURFACE="var(--mantine-color-body)";const SERIES=[{name:"productiveHours",label:"Productif",color:USAGE_COLORS.productive},{name:"noopHours",label:"Sans résultat",color:USAGE_COLORS.noop},{name:"erroredHours",label:"En erreur",color:USAGE_COLORS.errored}];const TOP_SERIES=SERIES[SERIES.length-1].name;function makeTooltip(view){return function({payload}){const bucket=payload?.[0]?.payload;if(!bucket)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatBucketLong(bucket.t,view)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[formatHours(bucket.computeHours)," de compute"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:USAGE_COLORS.errored,children:["dont ",formatHours(bucket.erroredHours)," en erreur (",formatCount(bucket.erroredTasks)," tâches)"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:["dont ",formatHours(bucket.noopHours)," sans résultat"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",mt:4,children:[formatCount(bucket.tasks)," tâches ·"," ",formatCount(bucket.worksheetTasks)," worksheets"]}),bucket.waitMaxMinutes?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:["attente max ",Math.round(bucket.waitMaxMinutes)," min"]}):null]})}}function ChargeStack(props){const{buckets,view}=props;if(0===buckets.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",children:"Aucune tâche sur la période."});return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.BarChart,{h:300,data:buckets,dataKey:"t",type:"stacked",withLegend:true,legendProps:{verticalAlign:"top",height:32},gridAxis:"y",tickLine:"none",unit:" h",series:SERIES,barProps:item=>({stroke:SURFACE,strokeWidth:1.5,strokeOpacity:1,radius:item.name===TOP_SERIES?[4,4,0,0]:0}),xAxisProps:{tickFormatter:t=>formatBucketTick(t,view),stroke:AXIS_INK,minTickGap:4},yAxisProps:{stroke:AXIS_INK,width:44},tooltipProps:{content:makeTooltip(view)},tooltipAnimationDuration:0})}function AbandonedChart_makeTooltip(view){return function({payload}){const bucket=payload?.[0]?.payload;if(!bucket)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatBucketLong(bucket.t,view)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:USAGE_COLORS.errored,children:[formatCount(bucket.abandonedTasks)," synchro",bucket.abandonedTasks>1?"s":""," perdue",bucket.abandonedTasks>1?"s":""]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:["sur ",formatCount(bucket.tasks)," tâches créées"]})]})}}function AbandonedChart(props){const{buckets,view}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.BarChart,{h:180,data:buckets,dataKey:"t",gridAxis:"y",tickLine:"none",series:[{name:"abandonedTasks",label:"Synchros perdues",color:USAGE_COLORS.errored}],barProps:{radius:[4,4,0,0]},xAxisProps:{tickFormatter:t=>formatBucketTick(t,view),stroke:AXIS_INK,minTickGap:4},yAxisProps:{stroke:AXIS_INK,width:44,allowDecimals:false},tooltipProps:{content:AbandonedChart_makeTooltip(view)},tooltipAnimationDuration:0})}function toPoints(buckets){return buckets.map(b=>({t:b.t,service:servicePercent(b.waitLe15,b.waitMeasured),under30:servicePercent(b.waitLe30,b.waitMeasured),under60:servicePercent(b.waitLe60,b.waitMeasured),measured:b.waitMeasured}))}function ServiceLevelChart_makeTooltip(view){return function({payload}){const point=payload?.[0]?.payload;if(!point)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatBucketLong(point.t,view)}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:USAGE_COLORS.productive,children:[point.service," % démarrées sous ",15," min"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",children:[point.under30," % sous 30 min · ",point.under60," % sous 1 h"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",c:"dimmed",mt:4,children:["sur ",formatCount(point.measured)," tâches exécutées"]})]})}}function ServiceLevelChart(props){const{buckets,view}=props;return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.LineChart,{h:180,data:toPoints(buckets),dataKey:"t",gridAxis:"y",tickLine:"none",unit:" %",withDots:buckets.length<=40,series:[{name:"service",label:"Démarrées sous 15 min",color:USAGE_COLORS.productive}],xAxisProps:{tickFormatter:t=>formatBucketTick(t,view),stroke:AXIS_INK,minTickGap:4},yAxisProps:{stroke:AXIS_INK,width:48,domain:[0,100],allowDecimals:false},tooltipProps:{content:ServiceLevelChart_makeTooltip(view)},tooltipAnimationDuration:0})}const TRACTION_SERIES=[{name:"companies",label:"Entreprises actives",color:"#3987e5"},{name:"distinctJobs",label:"Connecteurs distincts",color:"#d95926"}];function TractionTooltip({payload}){const bucket=payload?.[0]?.payload;if(!bucket)return null;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{px:"md",py:"sm",withBorder:true,shadow:"md",radius:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{fw:600,mb:4,children:formatBucketLong(bucket.t,"year")}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[bucket.companies??0," entreprises actives"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"sm",children:[bucket.distinctJobs??0," connecteurs distincts"]})]})}function TractionChart(props){const{buckets}=props;if(0===buckets.length)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{c:"dimmed",size:"sm",children:"Pas d'historique sur la période."});return/*#__PURE__*/(0,jsx_runtime.jsx)(esm_index_mjs_.LineChart,{h:240,data:buckets,dataKey:"t",withLegend:true,legendProps:{verticalAlign:"top",height:32},strokeWidth:2,dotProps:{r:4},activeDotProps:{r:6},gridAxis:"y",tickLine:"none",series:TRACTION_SERIES,xAxisProps:{tickFormatter:t=>formatBucketTick(t,"year"),stroke:AXIS_INK},yAxisProps:{allowDecimals:false,stroke:AXIS_INK,width:40},tooltipProps:{content:TractionTooltip},tooltipAnimationDuration:0})}function ShareBar(props){const{hours,erroredHours,max}=props;if(max<=0)return null;const total=hours/max*100;const errored=Math.min(erroredHours,hours)/max*100;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Progress.Root,{size:"md",w:140,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Progress.Section,{value:Math.max(total-errored,0),color:USAGE_COLORS.productive}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Progress.Section,{value:errored,color:USAGE_COLORS.errored})]})}function LostCell(props){if(0===props.count)return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",children:"—"});return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",style:{fontVariantNumeric:"tabular-nums",color:USAGE_COLORS.errored,fontWeight:600},children:formatCount(props.count)})}function TopCompaniesTable(props){const{rows,totalHours}=props;const max=rows.length>0?rows[0].computeHours:0;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{highlightOnHover:true,striped:false,verticalSpacing:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:32,children:"#"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Entreprise"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:150,children:"Part"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:90,ta:"right",children:"Compute"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:70,ta:"right",children:"% total"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:100,ta:"right",children:"Tâches"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:80,ta:"right",children:"Perdues"})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:rows.map((row,index)=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{c:"dimmed",children:index+1}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Td,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",fw:500,children:row.displayName??row.slug??`#${row.companyId}`}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:row.slug??`company ${row.companyId}`})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{withArrow:true,label:`${formatHours(row.erroredHours)} en erreur sur ${formatHours(row.computeHours)}`,children:/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ShareBar,{hours:row.computeHours,erroredHours:row.erroredHours,max:max})})})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",style:{fontVariantNumeric:"tabular-nums"},children:formatHours(row.computeHours)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:totalHours>0?`${Math.round(row.computeHours/totalHours*100)} %`:"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:formatCount(row.tasks)}),/*#__PURE__*/(0,jsx_runtime.jsx)(LostCell,{count:row.abandonedTasks})]},row.companyId))})]})}function TopJobsTable(props){const{rows,totalHours}=props;const max=rows.length>0?rows[0].computeHours:0;return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table,{highlightOnHover:true,verticalSpacing:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Thead,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:32,children:"#"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{children:"Connecteur"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:150,children:"Part"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:90,ta:"right",children:"Compute"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:70,ta:"right",children:"% total"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:110,ta:"right",children:"h / entreprise"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Th,{w:80,ta:"right",children:"Perdues"})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Tbody,{children:rows.map((row,index)=>/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Tr,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{c:"dimmed",children:index+1}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Table.Td,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",fw:500,children:row.jobName}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Text,{size:"xs",c:"dimmed",children:[formatCount(row.companies)," entreprise",row.companies>1?"s":""," · ",formatCount(row.tasks)," tâches"]})]}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Tooltip,{withArrow:true,label:`${formatHours(row.erroredHours)} en erreur sur ${formatHours(row.computeHours)}`,children:/*#__PURE__*/(0,jsx_runtime.jsx)("div",{children:/*#__PURE__*/(0,jsx_runtime.jsx)(ShareBar,{hours:row.computeHours,erroredHours:row.erroredHours,max:max})})})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",style:{fontVariantNumeric:"tabular-nums"},children:formatHours(row.computeHours)}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:totalHours>0?`${Math.round(row.computeHours/totalHours*100)} %`:"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Table.Td,{ta:"right",c:"dimmed",style:{fontVariantNumeric:"tabular-nums"},children:row.companies>0?formatHours(row.computeHours/row.companies):"—"}),/*#__PURE__*/(0,jsx_runtime.jsx)(LostCell,{count:row.abandonedTasks})]},row.jobName))})]})}var date_fns_index_js_=__webpack_require__(8680);function shiftPeriod(view,at,direction){if("week"===view)return(0,date_fns_index_js_.addWeeks)(at,direction);if("month"===view)return(0,date_fns_index_js_.addMonths)(at,direction);if("year"===view)return(0,date_fns_index_js_.addMonths)(at,12*direction);return(0,date_fns_index_js_.addDays)(at,direction)}function canGoForward(view,at,now){return shiftPeriod(view,at,1).getTime()<=now.getTime()}const RESET_LABEL={day:"Aujourd'hui",week:"Cette semaine",month:"Ce mois",year:"12 derniers mois"};const VIEW_OPTIONS=[{value:"day",label:"Jour"},{value:"week",label:"Semaine"},{value:"month",label:"Mois"},{value:"year",label:"12 mois"}];const CHART_TITLES={day:"Tâches simultanées, minute par minute",week:"Compute par jour (lundi → dimanche)",month:"Compute par jour du mois",year:"Compute par mois"};function SectionTitle(props){return/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"baseline",mb:"xs",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",fw:600,children:props.children}),props.hint?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"xs",c:"dimmed",children:props.hint}):null]})}function UsageApp(){const[view,setView]=(0,index_js_.useState)("day");const[at,setAt]=(0,index_js_.useState)(null);const[trigger,setTrigger]=(0,index_js_.useState)("all");const charge=useUsageCharge(view,trigger,at?at.toISOString():void 0);const prefetch=useUsageChargePrefetch();const data=charge.data;const reference=at??new Date;const forwardDisabled=null===at||!canGoForward(view,reference,new Date);(0,index_js_.useEffect)(()=>{if(charge.isFetching)return;const previous=shiftPeriod(view,at??new Date,-1);prefetch(view,trigger,previous.toISOString())},[view,at,trigger,charge.isFetching]);const goto=direction=>{const next=shiftPeriod(view,reference,direction);setAt(next)};const changeView=next=>{setView(next);setAt(null)};return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Container,{fluid:true,my:"md",children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"lg",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(PageHeader.z,{title:"Usage & charge",updatedAt:charge.dataUpdatedAt,isFetching:charge.isFetching,isError:charge.isError,onRefresh:()=>charge.refetch()}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{justify:"space-between",align:"center",wrap:"wrap",children:[/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"md",align:"center",wrap:"wrap",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.SegmentedControl,{value:view,onChange:value=>changeView(value),data:VIEW_OPTIONS}),/*#__PURE__*/(0,jsx_runtime.jsx)(TriggerFilter,{value:trigger,onChange:setTrigger})]}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Group,{gap:"xs",align:"center",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"default",size:"lg","aria-label":"Période précédente",onClick:()=>goto(-1),children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronLeft,{size:18})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Text,{size:"sm",c:"dimmed",ta:"center",miw:280,children:data?`${formatWindow(data.from,data.to,data.view)} \xb7 heure de Paris`:"…"}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.ActionIcon,{variant:"default",size:"lg","aria-label":"Période suivante",disabled:forwardDisabled,onClick:()=>goto(1),children:/*#__PURE__*/(0,jsx_runtime.jsx)(tabler_icons_react_mjs_.IconChevronRight,{size:18})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Button,{variant:"subtle",color:"gray",size:"xs",disabled:null===at,onClick:()=>setAt(null),children:RESET_LABEL[view]})]})]}),charge.isError?/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Alert,{color:"red",title:"Impossible de charger la charge",children:String(charge.error)}):null,data?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"lg",style:{opacity:charge.isPlaceholderData?.45:1,transition:"opacity 150ms ease",pointerEvents:charge.isPlaceholderData?"none":void 0},children:[/*#__PURE__*/(0,jsx_runtime.jsx)(UsageKpiRow,{kpis:data.kpis}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"day"===view?"durée bornée à 110 min — au-delà, une tâche est perdue, pas en cours":"heures de compute, décomposées par issue",children:CHART_TITLES[view]}),"day"===view?/*#__PURE__*/(0,jsx_runtime.jsx)(ConcurrencyChart,{data:data.concurrency}):/*#__PURE__*/(0,jsx_runtime.jsx)(ChargeStack,{buckets:data.buckets,view:data.view})]}),"year"===view?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"deux dénombrements, un seul axe",children:"Traction — entreprises actives et connecteurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(TractionChart,{buckets:data.buckets})]}):null,"day"===view&&data.buckets.length>0?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"décomposition du compute de la journée",children:"Compute de la journée"}),/*#__PURE__*/(0,jsx_runtime.jsx)(ChargeStack,{buckets:data.buckets,view:data.view})]}):null,data.buckets.length>1?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"création → exécution, sur les tâches réellement exécutées",children:"Délai de mise en route"}),/*#__PURE__*/(0,jsx_runtime.jsx)(ServiceLevelChart,{buckets:data.buckets,view:data.view})]}):null,data.kpis.abandonedTasks>0?/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"abandonnées après 3 déblocages, sans jamais avoir tourné",children:"Synchros perdues"}),/*#__PURE__*/(0,jsx_runtime.jsx)(AbandonedChart,{buckets:data.buckets,view:data.view})]}):null,/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Divider,{}),/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Grid,{children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:6},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",h:"100%",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"classement, pas de moyenne",children:"Top consommateurs"}),/*#__PURE__*/(0,jsx_runtime.jsx)(TopCompaniesTable,{rows:data.topCompanies,totalHours:data.kpis.computeHours})]})}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Grid.Col,{span:{base:12,lg:6},children:/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Paper,{withBorder:true,radius:"md",p:"md",h:"100%",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(SectionTitle,{hint:"brique de tarification du free",children:"Coût par connecteur"}),/*#__PURE__*/(0,jsx_runtime.jsx)(TopJobsTable,{rows:data.topJobs,totalHours:data.kpis.computeHours})]})})]})]}):/*#__PURE__*/(0,jsx_runtime.jsxs)(index_mjs_.Stack,{gap:"md",children:[/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:96}),/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Skeleton,{height:300})]})]})})}function Usage(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.b,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(UsageApp,{})})})}}}]);
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/*! LICENSE: __federation_expose_wise.b31a4dcd88.js.LICENSE.txt */
|
|
2
|
-
"use strict";(globalThis["chunk_tech_app "]||=[]).push([[7193],{9698(__unused_rspack_module,exports){/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");function jsxProd(type,config,maybeKey){var key=null;void 0!==maybeKey&&(key=""+maybeKey);void 0!==config.key&&(key=""+config.key);if("key"in config){maybeKey={};for(var propName in config)"key"!==propName&&(maybeKey[propName]=config[propName])}else maybeKey=config;config=maybeKey.ref;return{$$typeof:REACT_ELEMENT_TYPE,type:type,key:key,ref:void 0!==config?config:null,props:maybeKey}}exports.Fragment=REACT_FRAGMENT_TYPE;exports.jsx=jsxProd;exports.jsxs=jsxProd},4848(module,__unused_rspack_exports,__webpack_require__){module.exports=__webpack_require__(9698)},7785(__unused_rspack_module,__webpack_exports__,__webpack_require__){var react__rspack_import_0=__webpack_require__(814);const AppConfigCtx=(0,react__rspack_import_0.createContext)(null);const AppConfigProvider=AppConfigCtx.Provider;function useAppConfig(){const config=(0,react__rspack_import_0.useContext)(AppConfigCtx);if(!config)throw new Error("Called `useAppConfig` outside a `<AppConfigProvider />`");return config}__webpack_require__.d(__webpack_exports__,{r:()=>useAppConfig},{X:AppConfigProvider})},9528(__unused_rspack_module,__webpack_exports__,__webpack_require__){var react_jsx_runtime__rspack_import_0=__webpack_require__(4848);var _airporting_app_front__rspack_import_1=__webpack_require__(5456);var _mantine_core__rspack_import_2=__webpack_require__(4618);var _mantine_modals__rspack_import_3=__webpack_require__(3536);var _mantine_notifications__rspack_import_4=__webpack_require__(7250);var _tanstack_react_query__rspack_import_5=__webpack_require__(3411);var radash__rspack_import_6=__webpack_require__(5551);var _hooks_useAppConfig__rspack_import_7=__webpack_require__(7785);const theme=(0,_mantine_core__rspack_import_2.createTheme)((0,radash__rspack_import_6.assign)(_airporting_app_front__rspack_import_1.theme,{components:{}}));const cssVarResolver=x=>(0,radash__rspack_import_6.assign)(_airporting_app_front__rspack_import_1.cssVarResolver(x),{dark:{},light:{},variables:{}});function Providers(props){const{children,config,mantine,tanstack}=props;return/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_hooks_useAppConfig__rspack_import_7.X,{value:config,children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_tanstack_react_query__rspack_import_5.QueryClientProvider,{client:tanstack?.queryClient??new _tanstack_react_query__rspack_import_5.QueryClient,children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_core__rspack_import_2.MantineProvider,{theme:theme,cssVariablesResolver:cssVarResolver,defaultColorScheme:mantine?.defaultColorScheme,forceColorScheme:mantine?.forceColorScheme,children:/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsxs)(_mantine_modals__rspack_import_3.ModalsProvider,{children:[/*#__PURE__*/(0,react_jsx_runtime__rspack_import_0.jsx)(_mantine_notifications__rspack_import_4.Notifications,{}),children]})})})})}__webpack_require__.d(__webpack_exports__,{b:()=>Providers})},8635(__unused_rspack_module,__webpack_exports__,__webpack_require__){__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{default:()=>Wise});var jsx_runtime=__webpack_require__(4848);var index_js_=__webpack_require__(814);var providers=__webpack_require__(9528);var index_mjs_=__webpack_require__(4618);function WiseApp(){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Container,{my:"md",children:/*#__PURE__*/(0,jsx_runtime.jsx)(index_mjs_.Title,{order:2,my:"md",children:"Wise - soon"})})}function Wise(props){return/*#__PURE__*/(0,jsx_runtime.jsx)(index_js_.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(providers.b,{...props,children:/*#__PURE__*/(0,jsx_runtime.jsx)(WiseApp,{})})})}}}]);
|