@alfadocs/ui-kit 0.72.2 → 0.75.0
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/_chunks/actions-cell-renderer-DLrcSTK_.js +1546 -0
- package/dist/_chunks/{agenda-tray-loL2A3Cx.js → agenda-tray-CVf-jfWU.js} +3 -3
- package/dist/_chunks/{ai-consent-banner-Bke9m8VS.js → ai-consent-banner-DUhr1yNj.js} +2 -2
- package/dist/_chunks/{ai-prompt-input-TVI95hJD.js → ai-prompt-input-DziJCGLe.js} +3 -3
- package/dist/_chunks/{alia-sidebar-BV5lBSFR.js → alia-sidebar-w6B0TEx7.js} +8 -8
- package/dist/_chunks/{anamnesis-card-CWO4Ui9c.js → anamnesis-card-CJ5MNbkc.js} +2 -2
- package/dist/_chunks/{antenatal-schedule-timeline-CY-VsLok.js → antenatal-schedule-timeline-BzJZqS-8.js} +3 -3
- package/dist/_chunks/{appointment-card-Cy4FOkGP.js → appointment-card-DgKI5QKD.js} +2 -2
- package/dist/_chunks/{appointment-timeline-BWAPPk8F.js → appointment-timeline-DQTG0btW.js} +6 -6
- package/dist/_chunks/{appointment-tray-D3mk04TT.js → appointment-tray-ezyCZN8v.js} +4 -4
- package/dist/_chunks/{ar-BOqyIfoY.js → ar-B1GhtlBP.js} +2 -2
- package/dist/_chunks/{columns-2-8lq4-b8e.js → arrow-up-right-C2v_MKsK.js} +5 -5
- package/dist/_chunks/{audio-recorder-BbjG55dP.js → audio-recorder-Cc3KuL9y.js} +4 -4
- package/dist/_chunks/{benefit-card-Xnxj4Gmo.js → benefit-card-DB1Kdrmc.js} +4 -2
- package/dist/_chunks/{bishop-score-C6eoak_j.js → bishop-score-DDW5-gb9.js} +3 -3
- package/dist/_chunks/{bmi-calculator-BmQfoEGP.js → bmi-calculator-Bk2GAju7.js} +2 -2
- package/dist/_chunks/{booking-B62CMY5k.js → booking-B1Qkcl3c.js} +9 -9
- package/dist/_chunks/{button-DD_0Xdmr.js → button-CPGiR_bH.js} +56 -35
- package/dist/_chunks/button-group-DzV5wgnx.js +289 -0
- package/dist/_chunks/camera-VSklPDCv.js +21 -0
- package/dist/_chunks/{care-plan-card-DhXbfGzE.js → care-plan-card-BrwhyIJI.js} +3 -3
- package/dist/_chunks/{care-plan-entry-card-D3YGD6rj.js → care-plan-entry-card-DWEdCQM3.js} +3 -3
- package/dist/_chunks/{care-plan-header-DtQxyfOb.js → care-plan-header-BXvRpGG8.js} +2 -2
- package/dist/_chunks/{carousel.agent-j7hWxJWr.js → carousel.agent-CtAAdsAd.js} +2 -2
- package/dist/_chunks/{chat-container-BVCoN06N.js → chat-container-HlFnoEIl.js} +4 -2
- package/dist/_chunks/{chat-input-Btq_uuMZ.js → chat-input-BTCDqUDX.js} +2 -2
- package/dist/_chunks/{chat-message-DXjjM8z9.js → chat-message-CdjWqZjo.js} +3 -3
- package/dist/_chunks/{code-block-Cwi7e3HM.js → code-block-BwanBjRh.js} +2 -2
- package/dist/_chunks/{connection-status-0HajXMXM.js → connection-status-oEUyrvev.js} +3 -3
- package/dist/_chunks/{contact-profile-card-IggiUVpN.js → contact-profile-card-veMV3W4J.js} +2 -2
- package/dist/_chunks/{control-room-rail-DaGcsdZ6.js → control-room-rail-CdfrZ6Vr.js} +3 -3
- package/dist/_chunks/{copy-field-PAp0-Wr5.js → copy-field-DBc9QquW.js} +2 -2
- package/dist/_chunks/{cycle-calculator-BNILyVas.js → cycle-calculator-OQp8Ik5U.js} +4 -4
- package/dist/_chunks/data-table-tabs-BEUXiRlu.js +710 -0
- package/dist/_chunks/{date-picker-CVkD_lOi.js → date-picker-DzQS8mvt.js} +2 -2
- package/dist/_chunks/{date-picker-variants-DLg-ZrIo.js → date-picker-variants-CYQAm1Gk.js} +116 -115
- package/dist/_chunks/{date-range-picker-Dw12DgV8.js → date-range-picker-Cbz1SKhm.js} +3 -3
- package/dist/_chunks/{date-time-picker-Cd_OJtOy.js → date-time-picker-B5IpU-nd.js} +2 -2
- package/dist/_chunks/{de-DFLsUxeV.js → de-DETDHQ0o.js} +2 -2
- package/dist/_chunks/{description-list-CmBVxIF5.js → description-list-ClNLdRMy.js} +2 -2
- package/dist/_chunks/document-preview-CGSM_au9.js +181 -0
- package/dist/_chunks/{document-scanner-B23j4w7X.js → document-scanner-B6h1Ir56.js} +198 -230
- package/dist/_chunks/{due-date-calculator-CmdAl_JO.js → due-date-calculator-DASNRgnH.js} +4 -4
- package/dist/_chunks/{editable-currency-cell-renderer-z9fJFw6Z.js → editable-currency-cell-renderer-GwfA9tTR.js} +3 -3
- package/dist/_chunks/{editor-overlay-BIOzr8v7.js → editor-overlay-DE3esyio.js} +2 -2
- package/dist/_chunks/{el-OVjBKytp.js → el-HV3jOI0z.js} +2 -2
- package/dist/_chunks/{empty-state-BLy7tigq.js → empty-state-CrLsi0XI.js} +2 -2
- package/dist/_chunks/{entity-summary-DpGziDv5.js → entity-summary--vP698Jn.js} +3 -3
- package/dist/_chunks/eraser-CHOGQfVv.js +21 -0
- package/dist/_chunks/{es-DKDNrHXG.js → es-Dpo7Olwo.js} +2 -2
- package/dist/_chunks/face-scheme-C0rk21gg.js +3146 -0
- package/dist/_chunks/{fetal-weight-CVAH8sJ3.js → fetal-weight-1F9N4IMx.js} +2 -2
- package/dist/_chunks/{field-array-CDzc3hTM.js → field-array-DH3Mb1i8.js} +3 -3
- package/dist/_chunks/{field-value-Dj3i52H2.js → field-value-DHG6gEKS.js} +5 -5
- package/dist/_chunks/file-Cwe9VC1A.js +40 -0
- package/dist/_chunks/file-manager-UF8dkQF1.js +1776 -0
- package/dist/_chunks/{file-upload-Kw1rdvFw.js → file-upload-DENvuhfs.js} +101 -139
- package/dist/_chunks/{finished-terminal-Di4gtZ50.js → finished-terminal-C0_mefrf.js} +11 -11
- package/dist/_chunks/{fiscal-code-input-DKNXFXs3.js → fiscal-code-input-DWA6C8x8.js} +2 -2
- package/dist/_chunks/{fr-BfMvQh-v.js → fr-CgD4Jvtq.js} +2 -2
- package/dist/_chunks/{freemium-paywall-DFoeedwh.js → freemium-paywall-CmV642PA.js} +7 -3
- package/dist/_chunks/{gestational-age-calculator-BwCBPAGX.js → gestational-age-calculator-BpYw-WF-.js} +7 -7
- package/dist/_chunks/{hcg-doubling-CSsWxEJc.js → hcg-doubling-Dqj-EqMT.js} +3 -3
- package/dist/_chunks/{header-DaXWDw0M.js → header-CjwasYnn.js} +88 -79
- package/dist/_chunks/{header-settings-B0G_u-wV.js → header-settings-4cwQzeFc.js} +4 -4
- package/dist/_chunks/{hi-C0GEMwlD.js → hi-Bf8CAP6b.js} +2 -2
- package/dist/_chunks/highlighter-DSkckT2Q.js +15 -0
- package/dist/_chunks/{icon-button-LqoiKcUN.js → icon-button-C_kbcd7I.js} +2 -2
- package/dist/_chunks/icon-button-group-C_lqXTAj.js +391 -0
- package/dist/_chunks/{icon-picker-Di6uYDG-.js → icon-picker-CM9ubkew.js} +3 -3
- package/dist/_chunks/{image-cropper-CdmWFrMC.js → image-cropper-DKe4AORY.js} +2 -2
- package/dist/_chunks/{insert-result-C7xSDb8q.js → insert-result-D074GtHX.js} +58 -68
- package/dist/_chunks/{isSameWeek-HddDAyJG.js → isSameWeek-BYl5poz_.js} +2 -2
- package/dist/_chunks/{it-5f4hiT2e.js → it-mt1V2DFS.js} +3 -3
- package/dist/_chunks/{ja-U0_2inl_.js → ja-CbOHn2TO.js} +2 -2
- package/dist/_chunks/{key-value-pair-Byyyc_9J.js → key-value-pair-LHKfDT_9.js} +2 -2
- package/dist/_chunks/link-cell-renderer-BQGUs45d.js +711 -0
- package/dist/_chunks/{locale-picker-DzF7Q5Y8.js → locale-picker-GNF3lo8K.js} +3 -3
- package/dist/_chunks/{map-view-ByPvWG_9.js → map-view-CsaHfoo6.js} +2 -2
- package/dist/_chunks/{marketplace-app-shell-BCYiOvKZ.js → marketplace-app-shell-D_1tF4La.js} +6 -6
- package/dist/_chunks/{message-card-BZnnffyB.js → message-card-ievotOFa.js} +3 -3
- package/dist/_chunks/{message-tray-cUHOCdU0.js → message-tray-BFlu8clI.js} +4 -4
- package/dist/_chunks/{muscle-scheme-B9MIkuj0.js → muscle-scheme-CFBE2dme.js} +6 -14
- package/dist/_chunks/{nl-CDVnnx1U.js → nl-C6Y0QXnm.js} +2 -2
- package/dist/_chunks/{notes-panel-CMyjUXD4.js → notes-panel-Cvdp818a.js} +3 -3
- package/dist/_chunks/{notification-card-BHJ07FkH.js → notification-card-D29_sVA1.js} +3 -3
- package/dist/_chunks/{notification-tray-Dzm1c3Wy.js → notification-tray-CzIzz3bX.js} +4 -4
- package/dist/_chunks/optical-prescription-BEjYQjiO.js +1260 -0
- package/dist/_chunks/{patient-details-pU_E5xM2.js → patient-details-DP4wKyq4.js} +7 -7
- package/dist/_chunks/{patient-search-X9SUZGpy.js → patient-search-BaUJ_Y-N.js} +47 -45
- package/dist/_chunks/{patient-summary-card--t3BjTdU.js → patient-summary-card-D6kgdTNn.js} +4 -4
- package/dist/_chunks/{patient-table-BgWgNIMf.js → patient-table-DweKjiXg.js} +122 -118
- package/dist/_chunks/{payment-request-card-2ts7ITxd.js → payment-request-card-C0fqlKqO.js} +25 -24
- package/dist/_chunks/pen-line-D0De5zdl.js +21 -0
- package/dist/_chunks/periodontal-chart-D8hOFmde.js +1173 -0
- package/dist/_chunks/{periodontal-chart-card-6c6Lt4ws.js → periodontal-chart-card-WVjJAheq.js} +2 -2
- package/dist/_chunks/periodontal-diagnosis-cco40xTa.js +345 -0
- package/dist/_chunks/periodontal-risk-chart-bUGkMwDg.js +334 -0
- package/dist/_chunks/{pl-BWNumNrg.js → pl-BdazJAOp.js} +3 -3
- package/dist/_chunks/{popover-uJ6BvEU3.js → popover-Cc0a69sw.js} +32 -29
- package/dist/_chunks/{practice-results-CSEHTH2V.js → practice-results-BCr7jMt1.js} +5 -5
- package/dist/_chunks/{pregnancy-dating-CxVAA6_4.js → pregnancy-dating-msMl_6wz.js} +7 -7
- package/dist/_chunks/{pregnancy-weight-gain-C7zyrwow.js → pregnancy-weight-gain-B-CkVYnU.js} +2 -2
- package/dist/_chunks/{privacy-lock-DrRmK8C7.js → privacy-lock-YYBiI_bY.js} +3 -3
- package/dist/_chunks/{product-hub-panel-CaZqttvm.js → product-hub-panel-CTld1r5V.js} +3 -3
- package/dist/_chunks/{pt-zqdQuryr.js → pt-B3UKvhHp.js} +2 -2
- package/dist/_chunks/{public-header.agent-C-opZaOw.js → public-header.agent-rX_VA6hd.js} +107 -103
- package/dist/_chunks/{radiograph-panel.agent-D1x33moc.js → radiograph-panel.agent-CxF9pVxd.js} +40 -57
- package/dist/_chunks/{reviews-panel-liUj6OPX.js → reviews-panel-DmOjvmyH.js} +4 -4
- package/dist/_chunks/{rich-text-editor-DUgznqOf.js → rich-text-editor-CCWjNkbx.js} +26 -26
- package/dist/_chunks/{ro-CornQr64.js → ro-DVTEQpPK.js} +2 -2
- package/dist/_chunks/{ru-CKAXNYVD.js → ru-C-Mp40SC.js} +3 -3
- package/dist/_chunks/{select-BmCbJMJS.js → select-BW5ecXlX.js} +13 -13
- package/dist/_chunks/{session-countdown-qr8EO5QY.js → session-countdown-C8AsE072.js} +2 -2
- package/dist/_chunks/{sheet-B_X54aZo.js → sheet-D5K0LB3q.js} +2 -2
- package/dist/_chunks/{sidebar-B0OBmJrC.js → sidebar-C0PbwJBc.js} +375 -335
- package/dist/_chunks/{sign-document-nK03S73h.js → sign-document-Bfk0WpWV.js} +2 -2
- package/dist/_chunks/{sign-in-with-alfadocs-button-LppxjlFt.js → sign-in-with-alfadocs-button-UlYefZpI.js} +2 -2
- package/dist/_chunks/{signature-capture-Ct_4Md4e.js → signature-capture-DN52VNKL.js} +206 -189
- package/dist/_chunks/{signature-field-jgwYgUhO.js → signature-field-0rFODJlW.js} +47 -41
- package/dist/_chunks/signature-request-C-mskXwi.js +318 -0
- package/dist/_chunks/{slot-grid-FsqumOaS.js → slot-grid-CQSULZjd.js} +4 -4
- package/dist/_chunks/{sq-CIIvqXZv.js → sq-DierVlw-.js} +2 -2
- package/dist/_chunks/{streaming-text-Cedc05ya.js → streaming-text-C5bYz7LL.js} +2 -2
- package/dist/_chunks/subDays-DIKRViZm.js +8 -0
- package/dist/_chunks/{sv-Kpk1pzjz.js → sv-gQWo_19z.js} +2 -2
- package/dist/_chunks/{tabs-DVQ941Sj.js → tabs-CVTukWRD.js} +2 -2
- package/dist/_chunks/{task-tray-DP5A3Qnc.js → task-tray-Br3vc0O1.js} +3 -3
- package/dist/_chunks/{tasks-panel-BuxaYtEF.js → tasks-panel-CjGAhIN8.js} +6 -6
- package/dist/_chunks/{theme-toggle-dtdy5EaL.js → theme-toggle-BJCz_UOi.js} +3 -3
- package/dist/_chunks/{toast.agent-BSxl057x.js → toast.agent-uV8CeAy6.js} +2 -2
- package/dist/_chunks/{token-insert-menu-Pok4nExI.js → token-insert-menu-BYv6yoZI.js} +2 -2
- package/dist/_chunks/{tool-rail-BZx0-yIr.js → tool-rail-AaTqxkIM.js} +2 -2
- package/dist/_chunks/tooth-data-BwuoKFf4.js +660 -0
- package/dist/_chunks/tooth-scheme-BzJ6rcte.js +1483 -0
- package/dist/_chunks/{tr-DHaeLFxG.js → tr-Btm6M3Km.js} +2 -2
- package/dist/_chunks/{transaction-chip-B6iWoVmU.js → transaction-chip-DJCstquX.js} +41 -51
- package/dist/_chunks/type-ggmfVs23.js +16 -0
- package/dist/_chunks/{unit-converter-fEqluT8b.js → unit-converter-CSLWFDQh.js} +3 -3
- package/dist/_chunks/upload-BfT2hzMg.js +16 -0
- package/dist/_chunks/use-priority-overflow-c9SjxZkZ.js +101 -0
- package/dist/_chunks/use-visual-viewport-pin-ChurOsHM.js +31 -0
- package/dist/_chunks/{warning-stack-BaMI7-n7.js → warning-stack-BlG_Ujy3.js} +3 -3
- package/dist/_chunks/{workflow-map-qWsgCldq.js → workflow-map-C643Q43h.js} +5 -5
- package/dist/_chunks/{zh-CN-BncsTBwM.js → zh-CN-DkVN4vsB.js} +3 -3
- package/dist/agent-catalog.json +4081 -3201
- package/dist/agent-i18n/en.json +121 -69
- package/dist/brand/product-lockup/product-lockup.d.ts +1 -1
- package/dist/components/_shared/entity-card/entity-card.d.ts +1 -1
- package/dist/components/agenda-tray/index.js +1 -1
- package/dist/components/ai-consent-banner/index.js +1 -1
- package/dist/components/ai-prompt-input/index.js +1 -1
- package/dist/components/anamnesis-card/anamnesis-card.d.ts +1 -1
- package/dist/components/anamnesis-card/index.js +1 -1
- package/dist/components/appointment-card/appointment-card.d.ts +1 -1
- package/dist/components/appointment-card/index.js +2 -2
- package/dist/components/appointment-timeline/index.js +1 -1
- package/dist/components/audio-recorder/index.js +1 -1
- package/dist/components/benefit-card/index.js +1 -1
- package/dist/components/bishop-score/index.js +1 -1
- package/dist/components/bmi-calculator/index.js +1 -1
- package/dist/components/booking/index.js +1 -1
- package/dist/components/button/button.d.ts +8 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/button-group/button-group.d.ts +16 -0
- package/dist/components/button-group/index.js +1 -1
- package/dist/components/card/card.d.ts +1 -1
- package/dist/components/care-plan-card/index.js +1 -1
- package/dist/components/care-plan-entry-card/index.js +1 -1
- package/dist/components/care-plan-header/index.js +1 -1
- package/dist/components/carousel/index.js +1 -1
- package/dist/components/chat-container/index.js +1 -1
- package/dist/components/chat-input/index.js +1 -1
- package/dist/components/chat-message/index.js +1 -1
- package/dist/components/clinical-note-card/clinical-note-card.d.ts +1 -1
- package/dist/components/connection-status/index.js +1 -1
- package/dist/components/contact-profile-card/contact-profile-card.d.ts +1 -1
- package/dist/components/contact-profile-card/index.js +1 -1
- package/dist/components/control-room-rail/index.js +1 -1
- package/dist/components/copy-field/index.js +1 -1
- package/dist/components/counter/counter.d.ts +1 -1
- package/dist/components/cycle-calculator/index.js +1 -1
- package/dist/components/data-table/data-table.d.ts +2 -8
- package/dist/components/data-table/index.js +35 -34
- package/dist/components/data-table/toolbar.d.ts +5 -11
- package/dist/components/data-table-tabs/data-table-tabs.agent.d.ts +4 -0
- package/dist/components/data-table-tabs/data-table-tabs.d.ts +93 -0
- package/dist/components/data-table-tabs/index.d.ts +5 -0
- package/dist/components/data-table-tabs/index.js +8 -0
- package/dist/components/data-table-tabs/use-data-table-filter-tabs.d.ts +63 -0
- package/dist/components/date-picker/index.js +1 -1
- package/dist/components/date-range-picker/index.js +1 -1
- package/dist/components/date-time-picker/index.js +1 -1
- package/dist/components/description-list/index.js +1 -1
- package/dist/components/document-preview/document-preview.agent.d.ts +4 -0
- package/dist/components/document-preview/document-preview.d.ts +41 -0
- package/dist/components/document-preview/index.d.ts +4 -0
- package/dist/components/document-preview/index.js +6 -0
- package/dist/components/document-scanner/index.js +1 -1
- package/dist/components/due-date-calculator/index.js +2 -2
- package/dist/components/editor-overlay/index.js +1 -1
- package/dist/components/empty-state/index.js +1 -1
- package/dist/components/entity-summary/index.js +1 -1
- package/dist/components/face-scheme/face-scheme-data.d.ts +167 -0
- package/dist/components/face-scheme/face-scheme.d.ts +112 -2
- package/dist/components/face-scheme/index.d.ts +2 -2
- package/dist/components/face-scheme/index.js +25 -14
- package/dist/components/fetal-weight/index.js +1 -1
- package/dist/components/field-array/index.js +1 -1
- package/dist/components/file-manager/dialogs.d.ts +48 -0
- package/dist/components/file-manager/file-manager.agent.d.ts +4 -0
- package/dist/components/file-manager/file-manager.d.ts +82 -0
- package/dist/components/file-manager/folder-tree.d.ts +12 -0
- package/dist/components/file-manager/index.d.ts +5 -0
- package/dist/components/file-manager/index.js +6 -0
- package/dist/components/file-manager/list-view.d.ts +49 -0
- package/dist/components/file-manager/toolbar.d.ts +15 -0
- package/dist/components/file-manager/types.d.ts +167 -0
- package/dist/components/file-manager/utils.d.ts +34 -0
- package/dist/components/file-upload/file-upload.d.ts +1 -0
- package/dist/components/file-upload/index.d.ts +1 -1
- package/dist/components/file-upload/index.js +4 -3
- package/dist/components/finished-terminal/index.js +1 -1
- package/dist/components/fiscal-code-input/index.js +1 -1
- package/dist/components/flag/flag.d.ts +1 -1
- package/dist/components/freemium-paywall/index.js +1 -1
- package/dist/components/gestational-age-calculator/index.js +1 -1
- package/dist/components/hcg-doubling/index.js +1 -1
- package/dist/components/header/index.js +1 -1
- package/dist/components/header-settings/index.js +1 -1
- package/dist/components/icon-button/index.js +1 -1
- package/dist/components/icon-button-group/icon-button-group.d.ts +6 -0
- package/dist/components/icon-button-group/index.js +1 -1
- package/dist/components/icon-picker/index.js +1 -1
- package/dist/components/image-cropper/index.js +1 -1
- package/dist/components/index.d.ts +7 -1
- package/dist/components/key-value-pair/index.js +1 -1
- package/dist/components/link/link.d.ts +1 -1
- package/dist/components/locale-picker/index.js +1 -1
- package/dist/components/map-view/index.js +1 -1
- package/dist/components/matrix-rain/matrix-rain.d.ts +1 -1
- package/dist/components/message-card/index.js +1 -1
- package/dist/components/message-card/message-card.d.ts +1 -1
- package/dist/components/message-tray/index.js +1 -1
- package/dist/components/muscle-scheme/index.js +1 -1
- package/dist/components/notes-panel/index.js +1 -1
- package/dist/components/notification-card/index.js +1 -1
- package/dist/components/notification-card/notification-card.d.ts +1 -1
- package/dist/components/notification-tray/index.js +1 -1
- package/dist/components/operator-hero/operator-hero.d.ts +1 -1
- package/dist/components/optical-prescription/index.d.ts +4 -2
- package/dist/components/optical-prescription/index.js +29 -26
- package/dist/components/optical-prescription/optical-prescription-charts.d.ts +78 -0
- package/dist/components/optical-prescription/optical-prescription-data.d.ts +29 -0
- package/dist/components/optical-prescription/optical-prescription.d.ts +9 -0
- package/dist/components/patient-details/index.js +1 -1
- package/dist/components/patient-search/index.js +1 -1
- package/dist/components/patient-summary-card/index.js +1 -1
- package/dist/components/patient-summary-card/patient-summary-card.d.ts +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/payment-card/index.js +1 -1
- package/dist/components/payment-card/payment-card.d.ts +1 -1
- package/dist/components/payment-card/payment-request-card.d.ts +1 -1
- package/dist/components/periodontal-chart/index.d.ts +6 -0
- package/dist/components/periodontal-chart/index.js +22 -0
- package/dist/components/periodontal-chart/periodontal-chart-data.d.ts +119 -0
- package/dist/components/periodontal-chart/periodontal-chart.agent.d.ts +4 -0
- package/dist/components/periodontal-chart/periodontal-chart.d.ts +69 -0
- package/dist/components/periodontal-chart-card/index.js +1 -1
- package/dist/components/periodontal-chart-card/periodontal-chart-card.d.ts +1 -1
- package/dist/components/periodontal-diagnosis/index.d.ts +6 -0
- package/dist/components/periodontal-diagnosis/index.js +13 -0
- package/dist/components/periodontal-diagnosis/periodontal-diagnosis-data.d.ts +30 -0
- package/dist/components/periodontal-diagnosis/periodontal-diagnosis.agent.d.ts +4 -0
- package/dist/components/periodontal-diagnosis/periodontal-diagnosis.d.ts +44 -0
- package/dist/components/periodontal-risk-chart/index.d.ts +6 -0
- package/dist/components/periodontal-risk-chart/index.js +9 -0
- package/dist/components/periodontal-risk-chart/periodontal-risk-chart.agent.d.ts +4 -0
- package/dist/components/periodontal-risk-chart/periodontal-risk-chart.d.ts +28 -0
- package/dist/components/periodontal-risk-chart/periodontal-risk-data.d.ts +47 -0
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/popover.d.ts +1 -0
- package/dist/components/practice-results/index.js +1 -1
- package/dist/components/pregnancy-dating/index.js +1 -1
- package/dist/components/pregnancy-weight-gain/index.js +1 -1
- package/dist/components/privacy-lock/index.js +1 -1
- package/dist/components/product-hub-tray/index.js +1 -1
- package/dist/components/product-hub-tray/product-hub-panel.d.ts +1 -1
- package/dist/components/public-header/index.js +1 -1
- package/dist/components/public-header/public-header.d.ts +1 -1
- package/dist/components/radiograph-panel/index.js +1 -1
- package/dist/components/radiograph-panel/radiograph-panel.d.ts +2 -2
- package/dist/components/reviews-panel/index.js +1 -1
- package/dist/components/rich-text-editor/index.js +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/session-countdown/index.js +1 -1
- package/dist/components/sheet/index.js +1 -1
- package/dist/components/sidebar/index.js +1 -1
- package/dist/components/sidebar/sidebar.d.ts +9 -0
- package/dist/components/sign-document/index.js +1 -1
- package/dist/components/sign-in-with-alfadocs-button/index.js +1 -1
- package/dist/components/signature-capture/index.js +1 -1
- package/dist/components/signature-field/index.js +1 -1
- package/dist/components/signature-field/signature-field.d.ts +7 -0
- package/dist/components/skeleton-scheme/index.js +1186 -0
- package/dist/components/slot-grid/index.js +1 -1
- package/dist/components/stat/stat.d.ts +1 -1
- package/dist/components/streaming-text/index.js +1 -1
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/task-tray/index.js +1 -1
- package/dist/components/tasks-panel/index.js +1 -1
- package/dist/components/theme-toggle/index.js +1 -1
- package/dist/components/toast/index.js +1 -1
- package/dist/components/token-insert-menu/index.js +1 -1
- package/dist/components/tool-rail/index.js +1 -1
- package/dist/components/tooth-scheme/index.js +29 -28
- package/dist/components/transaction-chip/index.js +1 -1
- package/dist/components/unit-converter/index.js +1 -1
- package/dist/components/warning-stack/index.js +1 -1
- package/dist/components/workflow/index.js +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +40 -35
- package/dist/hooks/use-priority-overflow.d.ts +63 -0
- package/dist/hooks/use-visual-viewport-pin.d.ts +32 -0
- package/dist/i18n/locales/ar.d.ts +490 -9
- package/dist/i18n/locales/ar.js +493 -12
- package/dist/i18n/locales/de.d.ts +490 -9
- package/dist/i18n/locales/de.js +493 -12
- package/dist/i18n/locales/el.d.ts +490 -9
- package/dist/i18n/locales/el.js +493 -12
- package/dist/i18n/locales/en.d.ts +490 -9
- package/dist/i18n/locales/en.js +493 -12
- package/dist/i18n/locales/es.d.ts +490 -9
- package/dist/i18n/locales/es.js +493 -12
- package/dist/i18n/locales/fr.d.ts +490 -9
- package/dist/i18n/locales/fr.js +493 -12
- package/dist/i18n/locales/hi.d.ts +490 -9
- package/dist/i18n/locales/hi.js +493 -12
- package/dist/i18n/locales/it.d.ts +490 -9
- package/dist/i18n/locales/it.js +493 -12
- package/dist/i18n/locales/ja.d.ts +490 -9
- package/dist/i18n/locales/ja.js +493 -12
- package/dist/i18n/locales/nl.d.ts +490 -9
- package/dist/i18n/locales/nl.js +493 -12
- package/dist/i18n/locales/pl.d.ts +490 -9
- package/dist/i18n/locales/pl.js +493 -12
- package/dist/i18n/locales/pt.d.ts +490 -9
- package/dist/i18n/locales/pt.js +493 -12
- package/dist/i18n/locales/ro.d.ts +490 -9
- package/dist/i18n/locales/ro.js +493 -12
- package/dist/i18n/locales/ru.d.ts +490 -9
- package/dist/i18n/locales/ru.js +493 -12
- package/dist/i18n/locales/sq.d.ts +490 -9
- package/dist/i18n/locales/sq.js +493 -12
- package/dist/i18n/locales/sv.d.ts +490 -9
- package/dist/i18n/locales/sv.js +493 -12
- package/dist/i18n/locales/tr.d.ts +490 -9
- package/dist/i18n/locales/tr.js +493 -12
- package/dist/i18n/locales/zh.d.ts +490 -9
- package/dist/i18n/locales/zh.js +493 -12
- package/dist/index.js +872 -809
- package/dist/locales/ar.json +493 -12
- package/dist/locales/de.json +493 -12
- package/dist/locales/el.json +493 -12
- package/dist/locales/en.json +493 -12
- package/dist/locales/es.json +493 -12
- package/dist/locales/fr.json +493 -12
- package/dist/locales/hi.json +493 -12
- package/dist/locales/it.json +493 -12
- package/dist/locales/ja.json +493 -12
- package/dist/locales/nl.json +493 -12
- package/dist/locales/pl.json +493 -12
- package/dist/locales/pt.json +493 -12
- package/dist/locales/ro.json +493 -12
- package/dist/locales/ru.json +493 -12
- package/dist/locales/sq.json +493 -12
- package/dist/locales/sv.json +493 -12
- package/dist/locales/tr.json +493 -12
- package/dist/locales/zh.json +493 -12
- package/dist/patterns/alia-assistant/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/index.js +1 -1
- package/dist/patterns/marketplace-app-shell/marketplace-app-shell.d.ts +1 -1
- package/dist/patterns/signature-request/index.d.ts +3 -0
- package/dist/patterns/signature-request/index.js +5 -0
- package/dist/patterns/signature-request/signature-request.d.ts +81 -0
- package/dist/tokens.css +2 -2
- package/package.json +32 -4
- package/dist/_chunks/button-group-CvEnVzY7.js +0 -119
- package/dist/_chunks/face-scheme-BT9_KdL0.js +0 -1450
- package/dist/_chunks/icon-button-group-C48khLE0.js +0 -206
- package/dist/_chunks/link-cell-renderer-BCppbMec.js +0 -2185
- package/dist/_chunks/optical-prescription-Bmlbuopi.js +0 -653
- package/dist/_chunks/patient-shell-oiIRqEAl.js +0 -162
- package/dist/_chunks/subDays-DGSOp9d9.js +0 -8
- package/dist/_chunks/tooth-scheme-D_rso4uu.js +0 -2133
- package/dist/patterns/patient-shell/index.d.ts +0 -12
- package/dist/patterns/patient-shell/index.js +0 -5
- package/dist/patterns/patient-shell/patient-shell.d.ts +0 -62
|
@@ -0,0 +1,3146 @@
|
|
|
1
|
+
import { jsx as a, jsxs as C, Fragment as Ir } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Vi, useId as Ui, useRef as N, useState as T, useCallback as g, useMemo as xn, useEffect as ne, useImperativeHandle as Yi } from "react";
|
|
3
|
+
import * as Ke from "@radix-ui/react-tooltip";
|
|
4
|
+
import { c as Xi } from "./index-D2ZczOXr.js";
|
|
5
|
+
import { useTranslation as qi } from "react-i18next";
|
|
6
|
+
import { u as Gi } from "./registry-DvAUVLHh.js";
|
|
7
|
+
import { m as tt, M as Ji, A as Qi } from "./annotation-marker-qt5R9WZX.js";
|
|
8
|
+
import { B as P } from "./button-CPGiR_bH.js";
|
|
9
|
+
import { I as Ze } from "./icon-button-C_kbcd7I.js";
|
|
10
|
+
import { B as es } from "./button-group-DzV5wgnx.js";
|
|
11
|
+
import { C as ts } from "./combobox-DiMLItyu.js";
|
|
12
|
+
import { I as vn } from "./icon-button-group-C_lqXTAj.js";
|
|
13
|
+
import { T as Ar } from "./text-input-CUvCb6ST.js";
|
|
14
|
+
import { C as Oe } from "./card-DPmk26CL.js";
|
|
15
|
+
import { S as Tt } from "./separator-CYU_bGFn.js";
|
|
16
|
+
import { S as ns } from "./slider-DN1CWkKB.js";
|
|
17
|
+
import { S as rs } from "./switch-OILsBLWo.js";
|
|
18
|
+
import { c as be } from "./createLucideIcon-DhHxpK9K.js";
|
|
19
|
+
import { T as is } from "./type-ggmfVs23.js";
|
|
20
|
+
import { C as ss } from "./circle-j7oZoouK.js";
|
|
21
|
+
import { S as os } from "./square-DASBRZ0U.js";
|
|
22
|
+
import { A as as } from "./arrow-up-right-C2v_MKsK.js";
|
|
23
|
+
import { H as cs } from "./highlighter-DSkckT2Q.js";
|
|
24
|
+
import { M as ls } from "./map-pin-BaY37-Km.js";
|
|
25
|
+
import { E as ds } from "./eraser-CHOGQfVv.js";
|
|
26
|
+
import { T as us } from "./trash-2-uumy3fy1.js";
|
|
27
|
+
import { C as fs } from "./camera-VSklPDCv.js";
|
|
28
|
+
import { U as hs } from "./upload-BfT2hzMg.js";
|
|
29
|
+
import { Z as ms, a as ps } from "./zoom-out-Dnif4kJx.js";
|
|
30
|
+
import { M as gs } from "./maximize-2-BYd2Kti7.js";
|
|
31
|
+
/**
|
|
32
|
+
* @license lucide-react v1.22.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/
|
|
37
|
+
const ys = [
|
|
38
|
+
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
|
|
39
|
+
["path", { d: "M9 3v18", key: "fh3hqa" }],
|
|
40
|
+
["path", { d: "M15 3v18", key: "14nvp0" }]
|
|
41
|
+
], xs = be("columns-3", ys);
|
|
42
|
+
/**
|
|
43
|
+
* @license lucide-react v1.22.0 - ISC
|
|
44
|
+
*
|
|
45
|
+
* This source code is licensed under the ISC license.
|
|
46
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
47
|
+
*/
|
|
48
|
+
const vs = [["path", { d: "M5 12h14", key: "1ays0h" }]], ws = be("minus", vs);
|
|
49
|
+
/**
|
|
50
|
+
* @license lucide-react v1.22.0 - ISC
|
|
51
|
+
*
|
|
52
|
+
* This source code is licensed under the ISC license.
|
|
53
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
54
|
+
*/
|
|
55
|
+
const ks = [
|
|
56
|
+
[
|
|
57
|
+
"path",
|
|
58
|
+
{
|
|
59
|
+
d: "M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z",
|
|
60
|
+
key: "edeuup"
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
], bs = be("mouse-pointer-2", ks);
|
|
64
|
+
/**
|
|
65
|
+
* @license lucide-react v1.22.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/
|
|
70
|
+
const Cs = [
|
|
71
|
+
[
|
|
72
|
+
"path",
|
|
73
|
+
{
|
|
74
|
+
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
75
|
+
key: "1a8usu"
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
], Ss = be("pen", Cs);
|
|
79
|
+
/**
|
|
80
|
+
* @license lucide-react v1.22.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/
|
|
85
|
+
const Ms = [
|
|
86
|
+
[
|
|
87
|
+
"path",
|
|
88
|
+
{ d: "M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13", key: "orapub" }
|
|
89
|
+
],
|
|
90
|
+
["path", { d: "m8 6 2-2", key: "115y1s" }],
|
|
91
|
+
["path", { d: "m18 16 2-2", key: "ee94s4" }],
|
|
92
|
+
[
|
|
93
|
+
"path",
|
|
94
|
+
{
|
|
95
|
+
d: "m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",
|
|
96
|
+
key: "cfq27r"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
[
|
|
100
|
+
"path",
|
|
101
|
+
{
|
|
102
|
+
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
103
|
+
key: "1a8usu"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
["path", { d: "m15 5 4 4", key: "1mk7zo" }]
|
|
107
|
+
], Ns = be("pencil-ruler", Ms);
|
|
108
|
+
/**
|
|
109
|
+
* @license lucide-react v1.22.0 - ISC
|
|
110
|
+
*
|
|
111
|
+
* This source code is licensed under the ISC license.
|
|
112
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
113
|
+
*/
|
|
114
|
+
const Is = [
|
|
115
|
+
["path", { d: "M9 14 4 9l5-5", key: "102s5s" }],
|
|
116
|
+
["path", { d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11", key: "f3b9sd" }]
|
|
117
|
+
], As = be("undo-2", Is);
|
|
118
|
+
/**
|
|
119
|
+
* @license lucide-react v1.22.0 - ISC
|
|
120
|
+
*
|
|
121
|
+
* This source code is licensed under the ISC license.
|
|
122
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
123
|
+
*/
|
|
124
|
+
const Ts = [
|
|
125
|
+
["path", { d: "m19 16-3 3", key: "lp3y45" }],
|
|
126
|
+
["path", { d: "M2 21a8 8 0 0 1 12.664-6.5", key: "1ap0vn" }],
|
|
127
|
+
["path", { d: "M22 19h-6l3 3", key: "13fjle" }],
|
|
128
|
+
["circle", { cx: "10", cy: "8", r: "5", key: "o932ke" }]
|
|
129
|
+
], Tr = be("user-round-arrow-left", Ts);
|
|
130
|
+
/**
|
|
131
|
+
* @license lucide-react v1.22.0 - ISC
|
|
132
|
+
*
|
|
133
|
+
* This source code is licensed under the ISC license.
|
|
134
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
+
*/
|
|
136
|
+
const _s = [
|
|
137
|
+
["circle", { cx: "12", cy: "8", r: "5", key: "1hypcn" }],
|
|
138
|
+
["path", { d: "M20 21a8 8 0 0 0-16 0", key: "rfgkzh" }]
|
|
139
|
+
], Es = be("user-round", _s), zs = {
|
|
140
|
+
type: "string",
|
|
141
|
+
enum: [
|
|
142
|
+
"none",
|
|
143
|
+
"marker",
|
|
144
|
+
"pen",
|
|
145
|
+
"highlighter",
|
|
146
|
+
"arrow",
|
|
147
|
+
"line",
|
|
148
|
+
"rect",
|
|
149
|
+
"ellipse",
|
|
150
|
+
"text"
|
|
151
|
+
],
|
|
152
|
+
description: "Drawing tool: 'none' (off), 'marker', 'pen', 'highlighter', 'arrow', 'line', 'rect', 'ellipse', or 'text'."
|
|
153
|
+
}, ke = {
|
|
154
|
+
type: "string",
|
|
155
|
+
description: "Face-zone id (e.g. 'glabella', 'nasolabialFold', 'forehead', 'mandibularAngleLeft' on the front view; 'cheekbone', 'masseter', 'chin' on a profile view)."
|
|
156
|
+
}, Ls = {
|
|
157
|
+
type: "string",
|
|
158
|
+
enum: ["front", "profile-left", "profile-right"],
|
|
159
|
+
description: "Active view id: 'front', 'profile-left', or 'profile-right'."
|
|
160
|
+
}, nt = {
|
|
161
|
+
enum: ["observation", "treatment", "concern", "note"]
|
|
162
|
+
}, Rs = {
|
|
163
|
+
id: "face-scheme",
|
|
164
|
+
// pick — focus a zone (transient); set_value / edit_inline — record / clear
|
|
165
|
+
// findings on a zone; view_change — switch the active view (front / left /
|
|
166
|
+
// right profile), since each view renders a different zone set. Registration
|
|
167
|
+
// (the photo fit) is exposed only as the auto-align action.
|
|
168
|
+
capabilities: ["pick", "set_value", "edit_inline", "view_change"],
|
|
169
|
+
state: {
|
|
170
|
+
activeView: {
|
|
171
|
+
// Which view is mounted — it determines which zones are in the DOM, so an
|
|
172
|
+
// agent must read this before focus_zone on a profile-only zone.
|
|
173
|
+
type: "string",
|
|
174
|
+
descriptionKey: "ui.agent.faceScheme.state.activeView",
|
|
175
|
+
description: "Id of the currently displayed view (front / profile-left / profile-right).",
|
|
176
|
+
read: (n) => n.getView()
|
|
177
|
+
},
|
|
178
|
+
zoom: {
|
|
179
|
+
type: "number",
|
|
180
|
+
descriptionKey: "ui.agent.faceScheme.state.zoom",
|
|
181
|
+
description: "Current figure zoom factor (1 = the base framing; up to 8). Only meaningful when the surface enables `zoomable`.",
|
|
182
|
+
read: (n) => n.getZoom()
|
|
183
|
+
},
|
|
184
|
+
chart: {
|
|
185
|
+
// A9: identifiers + finding ENUMS only — never the free-text finding
|
|
186
|
+
// `note` (PHI) and never the patient-photo `src`. Notes are written but
|
|
187
|
+
// never read back through the snapshot.
|
|
188
|
+
type: "Record<string, string[]>",
|
|
189
|
+
descriptionKey: "ui.agent.faceScheme.state.chart",
|
|
190
|
+
description: "Current face chart — the finding types recorded on each zone, keyed by zone id. Free-text notes and the patient photo are not exposed here.",
|
|
191
|
+
read: (n) => Object.fromEntries(
|
|
192
|
+
Object.entries(n.getChart()).map(([r, o]) => [
|
|
193
|
+
r,
|
|
194
|
+
o.map((l) => l.type)
|
|
195
|
+
])
|
|
196
|
+
)
|
|
197
|
+
},
|
|
198
|
+
markedZones: {
|
|
199
|
+
type: "string[]",
|
|
200
|
+
descriptionKey: "ui.agent.faceScheme.state.markedZones",
|
|
201
|
+
description: "Zone ids carrying at least one finding.",
|
|
202
|
+
read: (n) => Object.keys(n.getChart())
|
|
203
|
+
},
|
|
204
|
+
activeTool: {
|
|
205
|
+
type: "string | null",
|
|
206
|
+
descriptionKey: "ui.agent.faceScheme.state.activeTool",
|
|
207
|
+
description: "The active free-form drawing tool (marker / pen / highlighter / arrow / line / rect / ellipse / text), or null when none is selected.",
|
|
208
|
+
read: (n) => n.getTool()
|
|
209
|
+
},
|
|
210
|
+
annotationCounts: {
|
|
211
|
+
// PHI-safe: counts by kind only — never the coordinates, and never the
|
|
212
|
+
// free-text of a `text` callout.
|
|
213
|
+
type: "Record<string, number>",
|
|
214
|
+
descriptionKey: "ui.agent.faceScheme.state.annotationCounts",
|
|
215
|
+
description: "Count of free-form annotations on the active view, keyed by kind (marker / pen / highlighter / arrow / line / rect / ellipse / text). Never includes coordinates or the free-text of a text callout.",
|
|
216
|
+
read: (n) => n.getAnnotations().reduce((r, o) => (r[o.kind] = (r[o.kind] ?? 0) + 1, r), {})
|
|
217
|
+
},
|
|
218
|
+
selectedAnnotation: {
|
|
219
|
+
// PHI-safe: id + kind only — never the coordinates, and never the
|
|
220
|
+
// free-text of a `text` callout.
|
|
221
|
+
type: "{ id: string; kind: string } | null",
|
|
222
|
+
descriptionKey: "ui.agent.faceScheme.state.selectedAnnotation",
|
|
223
|
+
description: "The selected free-form annotation on the active view (id + kind), or null when nothing is selected. Never includes coordinates or the free-text of a text callout.",
|
|
224
|
+
read: (n) => n.getSelectedAnnotation()
|
|
225
|
+
},
|
|
226
|
+
selectedZones: {
|
|
227
|
+
// PHI-safe: zone ids only — selection is UI state, findings stay in
|
|
228
|
+
// `chart`.
|
|
229
|
+
type: "string[]",
|
|
230
|
+
descriptionKey: "ui.agent.faceScheme.state.selectedZones",
|
|
231
|
+
description: 'Zone ids in the multi-selection (zoneSelect="multi") — the set a bulk finding apply targets. Empty when the mode is off or nothing is selected.',
|
|
232
|
+
read: (n) => n.getSelectedZones()
|
|
233
|
+
},
|
|
234
|
+
annotationZones: {
|
|
235
|
+
// PHI-safe: counts per linked zone only — never the coordinates, and
|
|
236
|
+
// never the free-text of a `text` callout.
|
|
237
|
+
type: "Record<string, number>",
|
|
238
|
+
descriptionKey: "ui.agent.faceScheme.state.annotationZones",
|
|
239
|
+
description: "Count of free-form annotations on the active view keyed by their linked zone id ('unassigned' = outside every zone or not yet assessed). Counts only — never coordinates or text.",
|
|
240
|
+
read: (n) => n.getAnnotations().reduce((r, o) => {
|
|
241
|
+
const l = o.zoneId ?? "unassigned";
|
|
242
|
+
return r[l] = (r[l] ?? 0) + 1, r;
|
|
243
|
+
}, {})
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
actions: {
|
|
247
|
+
focus_zone: {
|
|
248
|
+
safety: "read",
|
|
249
|
+
argsType: "{ id: string }",
|
|
250
|
+
argsSchema: {
|
|
251
|
+
type: "object",
|
|
252
|
+
properties: { id: ke },
|
|
253
|
+
required: ["id"]
|
|
254
|
+
},
|
|
255
|
+
idempotent: !0,
|
|
256
|
+
descriptionKey: "ui.agent.faceScheme.actions.focusZone",
|
|
257
|
+
description: "Move focus to a specific face zone by id.",
|
|
258
|
+
invoke: (n, r) => {
|
|
259
|
+
n.focusZone(r.id);
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
get_zone: {
|
|
263
|
+
safety: "read",
|
|
264
|
+
argsType: "{ id: string }",
|
|
265
|
+
argsSchema: {
|
|
266
|
+
type: "object",
|
|
267
|
+
properties: { id: ke },
|
|
268
|
+
required: ["id"]
|
|
269
|
+
},
|
|
270
|
+
returns: "string[]",
|
|
271
|
+
returnsSchema: { type: "array", items: nt },
|
|
272
|
+
idempotent: !0,
|
|
273
|
+
descriptionKey: "ui.agent.faceScheme.actions.getZone",
|
|
274
|
+
description: "Read the finding types recorded on one zone (notes are not returned).",
|
|
275
|
+
invoke: (n, r) => n.getZone(r.id).map((o) => o.type)
|
|
276
|
+
},
|
|
277
|
+
zones_with: {
|
|
278
|
+
safety: "read",
|
|
279
|
+
argsType: "{ finding: FaceFindingType }",
|
|
280
|
+
argsSchema: {
|
|
281
|
+
type: "object",
|
|
282
|
+
properties: { finding: nt },
|
|
283
|
+
required: ["finding"]
|
|
284
|
+
},
|
|
285
|
+
returns: "string[]",
|
|
286
|
+
returnsSchema: { type: "array", items: ke },
|
|
287
|
+
idempotent: !0,
|
|
288
|
+
descriptionKey: "ui.agent.faceScheme.actions.zonesWith",
|
|
289
|
+
description: "List the zone ids carrying a given finding type.",
|
|
290
|
+
invoke: (n, r) => n.zonesWith(r.finding)
|
|
291
|
+
},
|
|
292
|
+
set_finding: {
|
|
293
|
+
safety: "write",
|
|
294
|
+
argsType: "{ id: string; finding: FaceFindingType; note?: string }",
|
|
295
|
+
argsSchema: {
|
|
296
|
+
type: "object",
|
|
297
|
+
properties: {
|
|
298
|
+
id: ke,
|
|
299
|
+
finding: nt,
|
|
300
|
+
note: { type: "string" }
|
|
301
|
+
},
|
|
302
|
+
required: ["id", "finding"]
|
|
303
|
+
},
|
|
304
|
+
idempotent: !0,
|
|
305
|
+
descriptionKey: "ui.agent.faceScheme.actions.setFinding",
|
|
306
|
+
description: "Record a finding on a zone, with an optional free-text note.",
|
|
307
|
+
invoke: (n, r) => {
|
|
308
|
+
n.setFinding(r.id, r.finding, r.note);
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
remove_finding: {
|
|
312
|
+
safety: "write",
|
|
313
|
+
argsType: "{ id: string; finding: FaceFindingType }",
|
|
314
|
+
argsSchema: {
|
|
315
|
+
type: "object",
|
|
316
|
+
properties: { id: ke, finding: nt },
|
|
317
|
+
required: ["id", "finding"]
|
|
318
|
+
},
|
|
319
|
+
idempotent: !0,
|
|
320
|
+
descriptionKey: "ui.agent.faceScheme.actions.removeFinding",
|
|
321
|
+
description: "Remove a single finding from a zone.",
|
|
322
|
+
invoke: (n, r) => {
|
|
323
|
+
n.removeFinding(r.id, r.finding);
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
clear_zone: {
|
|
327
|
+
safety: "destructive",
|
|
328
|
+
argsType: "{ id: string }",
|
|
329
|
+
argsSchema: {
|
|
330
|
+
type: "object",
|
|
331
|
+
properties: { id: ke },
|
|
332
|
+
required: ["id"]
|
|
333
|
+
},
|
|
334
|
+
idempotent: !0,
|
|
335
|
+
descriptionKey: "ui.agent.faceScheme.actions.clearZone",
|
|
336
|
+
description: "Clear every finding from a zone.",
|
|
337
|
+
invoke: (n, r) => {
|
|
338
|
+
n.clearZone(r.id);
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
auto_align: {
|
|
342
|
+
safety: "write",
|
|
343
|
+
argsType: "{}",
|
|
344
|
+
argsSchema: { type: "object", properties: {} },
|
|
345
|
+
idempotent: !0,
|
|
346
|
+
descriptionKey: "ui.agent.faceScheme.actions.autoAlign",
|
|
347
|
+
description: "Run the on-device detector to align the zone overlay to the patient photo (works on the active view — front or profile). No-op if detection is disabled or no face is found.",
|
|
348
|
+
invoke: (n) => {
|
|
349
|
+
n.detect();
|
|
350
|
+
}
|
|
351
|
+
},
|
|
352
|
+
set_view: {
|
|
353
|
+
safety: "write",
|
|
354
|
+
argsType: "{ view: FaceViewId }",
|
|
355
|
+
argsSchema: {
|
|
356
|
+
type: "object",
|
|
357
|
+
properties: { view: Ls },
|
|
358
|
+
required: ["view"]
|
|
359
|
+
},
|
|
360
|
+
idempotent: !0,
|
|
361
|
+
descriptionKey: "ui.agent.faceScheme.actions.setView",
|
|
362
|
+
description: "Switch the active view ('front' / 'profile-left' / 'profile-right'). Each view renders a different zone set, so switch before focusing a zone that belongs to another view.",
|
|
363
|
+
invoke: (n, r) => {
|
|
364
|
+
n.setView(r.view);
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
set_zoom: {
|
|
368
|
+
safety: "write",
|
|
369
|
+
argsType: "{ factor: number }",
|
|
370
|
+
argsSchema: {
|
|
371
|
+
type: "object",
|
|
372
|
+
properties: {
|
|
373
|
+
factor: { type: "number", minimum: 1, maximum: 8 }
|
|
374
|
+
},
|
|
375
|
+
required: ["factor"]
|
|
376
|
+
},
|
|
377
|
+
idempotent: !0,
|
|
378
|
+
descriptionKey: "ui.agent.faceScheme.actions.setZoom",
|
|
379
|
+
description: "Set the figure zoom factor (1 = reset to the base framing, clamped to 1–8), anchored on the window centre. No-op unless the surface enables `zoomable`.",
|
|
380
|
+
invoke: (n, r) => {
|
|
381
|
+
n.setZoom(r.factor);
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
set_tool: {
|
|
385
|
+
safety: "write",
|
|
386
|
+
argsType: "{ tool: FaceAnnotationTool | 'none' }",
|
|
387
|
+
argsSchema: {
|
|
388
|
+
type: "object",
|
|
389
|
+
properties: { tool: zs },
|
|
390
|
+
required: ["tool"]
|
|
391
|
+
},
|
|
392
|
+
idempotent: !0,
|
|
393
|
+
descriptionKey: "ui.agent.faceScheme.actions.setTool",
|
|
394
|
+
description: "Select the active free-form drawing tool ('none' turns drawing off; pointer then falls through to zone selection).",
|
|
395
|
+
invoke: (n, r) => {
|
|
396
|
+
n.setTool(
|
|
397
|
+
r.tool === "none" ? null : r.tool
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
undo_annotation: {
|
|
402
|
+
safety: "write",
|
|
403
|
+
argsType: "{}",
|
|
404
|
+
argsSchema: { type: "object", properties: {} },
|
|
405
|
+
descriptionKey: "ui.agent.faceScheme.actions.undoAnnotation",
|
|
406
|
+
description: "Remove the most-recently-added free-form annotation from the active view.",
|
|
407
|
+
invoke: (n) => {
|
|
408
|
+
n.undoAnnotation();
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
select_annotation: {
|
|
412
|
+
safety: "read",
|
|
413
|
+
argsType: "{ id: string | null }",
|
|
414
|
+
argsSchema: {
|
|
415
|
+
type: "object",
|
|
416
|
+
properties: {
|
|
417
|
+
id: {
|
|
418
|
+
type: ["string", "null"],
|
|
419
|
+
description: "Annotation id on the active view (null clears the selection). Unknown ids are ignored."
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
required: ["id"]
|
|
423
|
+
},
|
|
424
|
+
idempotent: !0,
|
|
425
|
+
descriptionKey: "ui.agent.faceScheme.actions.selectAnnotation",
|
|
426
|
+
description: "Select a free-form annotation on the active view by id (null clears). Selection reveals the mark and enables its panel affordances (delete / recolour).",
|
|
427
|
+
invoke: (n, r) => {
|
|
428
|
+
n.selectAnnotation(r.id);
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
set_annotation_zone: {
|
|
432
|
+
safety: "write",
|
|
433
|
+
argsType: "{ id: string; zone: string | null }",
|
|
434
|
+
argsSchema: {
|
|
435
|
+
type: "object",
|
|
436
|
+
properties: {
|
|
437
|
+
id: {
|
|
438
|
+
type: "string",
|
|
439
|
+
description: "Annotation id on the active view."
|
|
440
|
+
},
|
|
441
|
+
zone: {
|
|
442
|
+
type: ["string", "null"],
|
|
443
|
+
description: "Zone id to link, or null to unlink ('no zone')."
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
required: ["id", "zone"]
|
|
447
|
+
},
|
|
448
|
+
idempotent: !0,
|
|
449
|
+
descriptionKey: "ui.agent.faceScheme.actions.setAnnotationZone",
|
|
450
|
+
description: "Link a free-form annotation to a face zone by id (null unlinks it). Unknown annotation ids are ignored. New drawings are auto-linked to the zone under them; this re-assigns marks drawn outside every zone.",
|
|
451
|
+
invoke: (n, r) => {
|
|
452
|
+
n.setAnnotationZone(r.id, r.zone);
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
select_zones: {
|
|
456
|
+
safety: "read",
|
|
457
|
+
argsType: "{ ids: string[] }",
|
|
458
|
+
argsSchema: {
|
|
459
|
+
type: "object",
|
|
460
|
+
properties: {
|
|
461
|
+
ids: {
|
|
462
|
+
type: "array",
|
|
463
|
+
items: ke,
|
|
464
|
+
description: "Zone ids to select (replaces the current selection; [] clears)."
|
|
465
|
+
}
|
|
466
|
+
},
|
|
467
|
+
required: ["ids"]
|
|
468
|
+
},
|
|
469
|
+
idempotent: !0,
|
|
470
|
+
descriptionKey: "ui.agent.faceScheme.actions.selectZones",
|
|
471
|
+
description: 'Replace the zone multi-selection (zoneSelect="multi"). Selection is UI state only — pair with set_finding_bulk to record a finding on the selected zones, or pass ids straight to set_finding_bulk instead.',
|
|
472
|
+
invoke: (n, r) => {
|
|
473
|
+
n.setSelectedZones(r.ids);
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
set_finding_bulk: {
|
|
477
|
+
safety: "write",
|
|
478
|
+
argsType: "{ ids: string[]; finding: FaceFindingType; note?: string }",
|
|
479
|
+
argsSchema: {
|
|
480
|
+
type: "object",
|
|
481
|
+
properties: {
|
|
482
|
+
ids: {
|
|
483
|
+
type: "array",
|
|
484
|
+
items: ke,
|
|
485
|
+
description: "Zone ids to record the finding on."
|
|
486
|
+
},
|
|
487
|
+
finding: nt,
|
|
488
|
+
note: { type: "string" }
|
|
489
|
+
},
|
|
490
|
+
required: ["ids", "finding"]
|
|
491
|
+
},
|
|
492
|
+
idempotent: !0,
|
|
493
|
+
descriptionKey: "ui.agent.faceScheme.actions.setFindingBulk",
|
|
494
|
+
description: "Record one finding on several zones in a single chart commit (the multi-zone diagnosis path). Zones already carrying the finding are left as they are; the optional note lands only where the finding is newly added.",
|
|
495
|
+
invoke: (n, r) => {
|
|
496
|
+
n.setFindingBulk(r.ids, r.finding, r.note);
|
|
497
|
+
}
|
|
498
|
+
},
|
|
499
|
+
clear_annotations: {
|
|
500
|
+
safety: "destructive",
|
|
501
|
+
argsType: "{}",
|
|
502
|
+
argsSchema: { type: "object", properties: {} },
|
|
503
|
+
idempotent: !0,
|
|
504
|
+
descriptionKey: "ui.agent.faceScheme.actions.clearAnnotations",
|
|
505
|
+
description: "Clear every free-form annotation from the active view. Zone findings are untouched.",
|
|
506
|
+
invoke: (n) => {
|
|
507
|
+
n.clearAnnotations();
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
domHooks: {
|
|
512
|
+
root: { attr: "data-component", value: "face-scheme" },
|
|
513
|
+
instanceId: {
|
|
514
|
+
attr: "data-component-id",
|
|
515
|
+
sourceProp: "id",
|
|
516
|
+
description: "Sourced from the id prop."
|
|
517
|
+
},
|
|
518
|
+
item: {
|
|
519
|
+
attr: "data-zone",
|
|
520
|
+
description: 'Each clickable zone `<g>` carries its zone id as `data-zone` (plus `data-side` for the anatomical side, and `data-zone-selected="true"` while in the multi-selection). Each free-form annotation `<g>` carries `data-annotation` (its id), `data-annotation-kind`, `data-annotation-zone` (its linked zone id, when linked), and `data-selected="true"` while selected. The root `<div>` carries the active view id as `data-view` — only the zones for the active view are in the DOM.'
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}, $s = "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.18/vision_bundle.mjs", Fs = "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.18/wasm", Ks = "https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task", Zs = {
|
|
524
|
+
"right-eye": [33, 133],
|
|
525
|
+
// subject's right eye, outer + inner corners
|
|
526
|
+
"left-eye": [263, 362],
|
|
527
|
+
// subject's left eye, outer + inner corners
|
|
528
|
+
"nose-tip": [1],
|
|
529
|
+
chin: [152],
|
|
530
|
+
// Midline cephalometric points — the profile views fit on these (the detector
|
|
531
|
+
// tracks them on a side profile even though the contralateral side is
|
|
532
|
+
// occluded). The front view ignores ids it has no landmark for.
|
|
533
|
+
nasion: [168],
|
|
534
|
+
// bridge of the nose, between the brows
|
|
535
|
+
subnasale: [2]
|
|
536
|
+
// base of the nose / top of the philtrum
|
|
537
|
+
}, wn = /* @__PURE__ */ new Map();
|
|
538
|
+
function Os(n, r, o, l) {
|
|
539
|
+
const d = `${n}|${r}|${o}`, c = wn.get(d);
|
|
540
|
+
if (c) return c;
|
|
541
|
+
l == null || l("loading");
|
|
542
|
+
const m = (async () => {
|
|
543
|
+
const h = await import(
|
|
544
|
+
/* @vite-ignore */
|
|
545
|
+
n
|
|
546
|
+
), p = await h.FilesetResolver.forVisionTasks(r);
|
|
547
|
+
return h.FaceLandmarker.createFromOptions(p, {
|
|
548
|
+
baseOptions: { modelAssetPath: o, delegate: "GPU" },
|
|
549
|
+
runningMode: "IMAGE",
|
|
550
|
+
numFaces: 1
|
|
551
|
+
});
|
|
552
|
+
})();
|
|
553
|
+
return wn.set(d, m), m.catch(() => wn.delete(d)), m;
|
|
554
|
+
}
|
|
555
|
+
function Ps(n) {
|
|
556
|
+
const r = new Image();
|
|
557
|
+
return r.crossOrigin = "anonymous", r.src = n, r.decode().then(() => r);
|
|
558
|
+
}
|
|
559
|
+
async function Ds(n, r) {
|
|
560
|
+
if (typeof window > "u" || typeof Image > "u")
|
|
561
|
+
throw new Error("detectFaceLandmarks runs in the browser only.");
|
|
562
|
+
const {
|
|
563
|
+
viewWidth: o,
|
|
564
|
+
viewHeight: l,
|
|
565
|
+
visionModuleUrl: d = $s,
|
|
566
|
+
wasmBaseUrl: c = Fs,
|
|
567
|
+
modelAssetPath: m = Ks,
|
|
568
|
+
onStage: h
|
|
569
|
+
} = r, [p, y] = await Promise.all([
|
|
570
|
+
Ps(n),
|
|
571
|
+
Os(d, c, m, h)
|
|
572
|
+
]);
|
|
573
|
+
h == null || h("detecting");
|
|
574
|
+
const b = y.detect(p).faceLandmarks[0];
|
|
575
|
+
if (!b || b.length === 0) return null;
|
|
576
|
+
const v = p.naturalWidth || p.width, k = p.naturalHeight || p.height, w = Math.max(o / v, l / k), L = (o - v * w) / 2, X = (l - k * w) / 2, $ = (R) => ({
|
|
577
|
+
x: L + R.x * v * w,
|
|
578
|
+
y: X + R.y * k * w
|
|
579
|
+
}), I = [];
|
|
580
|
+
for (const [R, H] of Object.entries(Zs)) {
|
|
581
|
+
let q = 0, pe = 0, re = 0;
|
|
582
|
+
for (const Ce of H) {
|
|
583
|
+
const le = b[Ce];
|
|
584
|
+
if (!le) continue;
|
|
585
|
+
const ge = $(le);
|
|
586
|
+
q += ge.x, pe += ge.y, re++;
|
|
587
|
+
}
|
|
588
|
+
re > 0 && I.push({ id: R, photo: { x: q / re, y: pe / re } });
|
|
589
|
+
}
|
|
590
|
+
return I.length >= 3 ? I : null;
|
|
591
|
+
}
|
|
592
|
+
const Bs = "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.2/dist/ort.min.mjs", js = "https://cdn.jsdelivr.net/npm/onnxruntime-web@1.19.2/dist/", F = 640, Ws = [8, 16, 32], Hs = [
|
|
593
|
+
"right-eye",
|
|
594
|
+
"left-eye",
|
|
595
|
+
"nose-tip",
|
|
596
|
+
"mouth-right",
|
|
597
|
+
"mouth-left"
|
|
598
|
+
], kn = /* @__PURE__ */ new Map();
|
|
599
|
+
async function Vs(n, r, o, l) {
|
|
600
|
+
const d = `${n}|${r}|${o}`, c = kn.get(d);
|
|
601
|
+
if (c) return c;
|
|
602
|
+
l == null || l("loading");
|
|
603
|
+
const m = (async () => {
|
|
604
|
+
const h = await import(
|
|
605
|
+
/* @vite-ignore */
|
|
606
|
+
n
|
|
607
|
+
);
|
|
608
|
+
h.env.wasm.wasmPaths = r, h.env.wasm.numThreads = 1, h.env.logLevel = "error";
|
|
609
|
+
const p = new Uint8Array(await (await fetch(o)).arrayBuffer()), y = await h.InferenceSession.create(p, {
|
|
610
|
+
executionProviders: ["wasm"]
|
|
611
|
+
});
|
|
612
|
+
return { ort: h, session: y };
|
|
613
|
+
})();
|
|
614
|
+
return kn.set(d, m), m.catch(() => kn.delete(d)), m;
|
|
615
|
+
}
|
|
616
|
+
function Us(n) {
|
|
617
|
+
const r = new Image();
|
|
618
|
+
return r.crossOrigin = "anonymous", r.src = n, r.decode().then(() => r);
|
|
619
|
+
}
|
|
620
|
+
async function Ys() {
|
|
621
|
+
return (await import("./face_detection_yunet_2023mar-BnsRs4bD.js")).default;
|
|
622
|
+
}
|
|
623
|
+
function Xs(n, r) {
|
|
624
|
+
const o = r.naturalWidth || r.width, l = r.naturalHeight || r.height, d = Math.min(F / o, F / l), c = Math.round(o * d), m = Math.round(l * d), h = Math.floor((F - c) / 2), p = Math.floor((F - m) / 2), y = document.createElement("canvas");
|
|
625
|
+
y.width = F, y.height = F;
|
|
626
|
+
const S = y.getContext("2d");
|
|
627
|
+
if (!S) throw new Error("2D canvas context unavailable.");
|
|
628
|
+
S.fillRect(0, 0, F, F), S.drawImage(r, h, p, c, m);
|
|
629
|
+
const { data: b } = S.getImageData(0, 0, F, F), v = F * F, k = new Float32Array(3 * v);
|
|
630
|
+
for (let w = 0; w < v; w++)
|
|
631
|
+
k[w] = b[w * 4 + 2], k[v + w] = b[w * 4 + 1], k[2 * v + w] = b[w * 4];
|
|
632
|
+
return {
|
|
633
|
+
tensor: new n("float32", k, [1, 3, F, F]),
|
|
634
|
+
scale: d,
|
|
635
|
+
padX: h,
|
|
636
|
+
padY: p
|
|
637
|
+
};
|
|
638
|
+
}
|
|
639
|
+
const _r = (n) => 1 / (1 + Math.exp(-n));
|
|
640
|
+
function qs(n, r) {
|
|
641
|
+
let o = !1;
|
|
642
|
+
const l = n.cls_8.data;
|
|
643
|
+
for (let c = 0; c < Math.min(l.length, 256); c++)
|
|
644
|
+
if (l[c] < 0 || l[c] > 1) {
|
|
645
|
+
o = !0;
|
|
646
|
+
break;
|
|
647
|
+
}
|
|
648
|
+
let d = null;
|
|
649
|
+
for (const c of Ws) {
|
|
650
|
+
const m = n[`cls_${c}`].data, h = n[`obj_${c}`].data, p = n[`kps_${c}`].data, y = F / c, S = F / c, b = y * S;
|
|
651
|
+
for (let v = 0; v < b; v++) {
|
|
652
|
+
let k = m[v], w = h[v];
|
|
653
|
+
o && (k = _r(k), w = _r(w)), k = Math.min(Math.max(k, 0), 1), w = Math.min(Math.max(w, 0), 1);
|
|
654
|
+
const L = Math.sqrt(k * w);
|
|
655
|
+
if (L < r || d && L <= d.score) continue;
|
|
656
|
+
const X = v % y, $ = Math.floor(v / y), I = [];
|
|
657
|
+
for (let R = 0; R < 5; R++)
|
|
658
|
+
I.push([
|
|
659
|
+
(X + p[v * 10 + 2 * R]) * c,
|
|
660
|
+
($ + p[v * 10 + 2 * R + 1]) * c
|
|
661
|
+
]);
|
|
662
|
+
d = { score: L, keypoints: I };
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
return d;
|
|
666
|
+
}
|
|
667
|
+
async function Gs(n, r) {
|
|
668
|
+
if (typeof window > "u" || typeof Image > "u")
|
|
669
|
+
throw new Error("detectFaceYuNet runs in the browser only.");
|
|
670
|
+
const {
|
|
671
|
+
viewWidth: o,
|
|
672
|
+
viewHeight: l,
|
|
673
|
+
ortModuleUrl: d = Bs,
|
|
674
|
+
ortWasmBaseUrl: c = js,
|
|
675
|
+
modelUrl: m = await Ys(),
|
|
676
|
+
scoreThreshold: h = 0.6,
|
|
677
|
+
onStage: p
|
|
678
|
+
} = r, [y, { ort: S, session: b }] = await Promise.all([
|
|
679
|
+
Us(n),
|
|
680
|
+
Vs(d, c, m, p)
|
|
681
|
+
]);
|
|
682
|
+
p == null || p("detecting");
|
|
683
|
+
const { tensor: v, scale: k, padX: w, padY: L } = Xs(S.Tensor, y), X = await b.run({ [b.inputNames[0]]: v }), $ = qs(X, h);
|
|
684
|
+
if (!$) return null;
|
|
685
|
+
const I = y.naturalWidth || y.width, R = y.naturalHeight || y.height, H = Math.max(o / I, l / R), q = (o - I * H) / 2, pe = (l - R * H) / 2;
|
|
686
|
+
return $.keypoints.map(([re, Ce], le) => {
|
|
687
|
+
const ge = (re - w) / k, ye = (Ce - L) / k;
|
|
688
|
+
return {
|
|
689
|
+
id: Hs[le],
|
|
690
|
+
photo: {
|
|
691
|
+
x: q + ge * H,
|
|
692
|
+
y: pe + ye * H
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
const bn = "0 0 808 944", Cn = { x: 404, y: 472 }, jr = {
|
|
698
|
+
id: "faceContour",
|
|
699
|
+
labelKey: "faceContour",
|
|
700
|
+
d: "M688.38,439.4c-9.78,0-15.37,4.04-17.86,6.47,1.31-10.99,2.5-20.62,3.49-28.2,7.55-57.89,5.03-94.39,5.03-94.39-15.15-165.92-111.73-221.46-186.21-239.39h0s-.1-.02-.1-.02c-6.18-1.49-12.21-2.72-18.02-3.73l-.96-.2c-46.02-9.51-93.5-9.51-139.52,0l-.95.2c-5.82,1.01-11.85,2.24-18.04,3.73l-.08.02h0c-74.48,17.94-171.06,73.48-186.21,239.39,0,0-2.52,36.5,5.03,94.39,1,7.68,2.2,17.45,3.53,28.61-2.25-2.35-7.91-6.88-18.26-6.88-13.97,0-29.06,16.21-20.12,63.71,8.94,47.5,17.3,80.48,18.43,97.24,1.11,16.47,24.08,47.91,41.43,38.23.9,8.33,1.42,13.17,1.42,13.17,0,0,8.81,59.15,56.63,104.46,12.62,11.95,25.84,23.46,38.49,33.94,7.14-4.56,24-16.96,29.06-35.21.9-3.24,1.73-6.33,2.52-9.29,2.46-9.17,4.59-17.1,7.4-24.46,3.44-9.01,7.62-16.28,13.25-23.04-47.54-46.57-49.82-89.3-48.75-104.93-21.75-2.47-38.06-19.4-47.37-49.37-7.27-23.39-7.77-46.39-7.79-47.36-.02-1.34.43-2.57,1.21-3.54-.47-2.21-.65-3.58-.67-3.77-.28-2.23.97-4.38,3.05-5.24.34-.14.69-.23,1.04-.29.47-3.26,2.23-10.86,8.8-18.21,10.82-12.11,28.95-17.92,53.93-17.22,41.5,1.13,55.11,17.49,59.58,28.15,1.45.85,2.49,2.34,2.68,4.14,0,.05.02.21.05.45.22.48.36,1,.42,1.56.04.41.34,3.71.16,8.68.17,6.11.1,14.39-.75,23.68-.27,2.9-.6,5.73-.98,8.49,4.1-9.94,7.68-20.29,11.15-30.32l.31-.89-10.84-54.18c-2.15-3.39-8.76-12.5-21.75-19.51-21.63-11.68-51.16-12.3-85.4-1.8-2.58.79-5.32-.61-6.19-3.16l-53.03-154.45c-.88-1.09-1.31-2.52-1.05-4.01.26-1.43,6.68-35.35,39.46-69.52,19.15-19.96,43.37-35.84,72.01-47.21,35.3-14.02,77.45-21.18,125.28-21.27h0s.98,0,.98,0c47.83.1,89.98,7.25,125.28,21.27,28.63,11.37,52.86,27.26,72.01,47.21,30.62,31.92,38.24,63.61,39.32,68.82.29.8.42,1.35.47,1.59.17.87.11,1.77-.17,2.61l-53.21,154.96c-.88,2.55-3.62,3.95-6.19,3.16-34.24-10.5-63.77-9.88-85.4,1.8-11.42,6.17-17.92,13.96-20.78,18.06l-11.25,56.25.04.11c2.95,8.52,5.98,17.28,9.34,25.81-.14-1.26-.28-2.53-.4-3.82-.53-5.79-.75-11.19-.81-15.92-1.11-9.09-.51-15.85-.45-16.44.11-1.1.59-2.08,1.3-2.85.19-.72.52-1.37.96-1.94,3.86-10.54,16.77-28.3,60.04-29.48,24.93-.69,43.04,5.1,53.85,17.2,6.53,7.3,8.3,14.85,8.78,18.13.53.04,1.05.16,1.56.37,2.08.86,3.32,3.01,3.05,5.24-.02.14-.12.93-.37,2.25,1.7.96,2.84,2.8,2.8,4.89-.02.97-.52,23.97-7.79,47.36-8.99,28.91-24.49,45.69-45.11,49.05,1.16,15.29-.68,58.78-49.42,106.1,5.35,6.56,9.36,13.63,12.68,22.33,2.81,7.36,4.94,15.28,7.4,24.45.79,2.96,1.62,6.05,2.52,9.29,5.07,18.28,21.97,30.69,29.09,35.23,12.65-10.48,25.88-21.99,38.5-33.95,47.82-45.31,56.63-104.46,56.63-104.46,0,0,.51-4.77,1.4-13,17.31,9.1,39.99-22.04,41.09-38.41,1.13-16.77,9.49-49.74,18.43-97.24,8.94-47.5-6.15-63.71-20.12-63.71Z"
|
|
701
|
+
}, Js = [
|
|
702
|
+
{
|
|
703
|
+
id: "lateralNeckRight",
|
|
704
|
+
labelKey: "lateralNeckRight",
|
|
705
|
+
d: "M234.37,783.6s32.84,133.08,163.93,137.04v-48.41s-103.52,3.15-163.93-88.63Z",
|
|
706
|
+
cx: 316,
|
|
707
|
+
cy: 852,
|
|
708
|
+
side: "right"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
id: "lateralNeckLeft",
|
|
712
|
+
labelKey: "lateralNeckLeft",
|
|
713
|
+
d: "M572.98,783.6s-32.84,133.08-163.93,137.04v-48.41s103.52,3.15,163.93-88.63Z",
|
|
714
|
+
cx: 491,
|
|
715
|
+
cy: 852,
|
|
716
|
+
side: "left"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
id: "forehead",
|
|
720
|
+
labelKey: "forehead",
|
|
721
|
+
d: "M404,206.87s-.1,0-.14,0h-1.06s-.09,0-.14,0c-193.61.2-222.63,42.82-226.18,50.14l51.08,148.75c44.34-12.51,72.83-4.7,89.09,4.28,11.9,6.57,19.12,14.63,22.86,19.75,9.12-6.42,21.26-11.05,36.17-13.79,13.2-2.43,24.31-2.56,27.4-2.54.05,0,.1,0,.16,0h.04s.07,0,.11,0h.04c.2,0,.4,0,.64,0,3.65,0,14.33.22,26.92,2.54,14.91,2.74,27.05,7.37,36.17,13.79,3.74-5.12,10.96-13.18,22.86-19.75,16.26-8.98,44.75-16.79,89.09-4.28l51.08-148.75c-3.54-7.32-32.57-49.94-226.18-50.14Z",
|
|
722
|
+
cx: 403,
|
|
723
|
+
cy: 318,
|
|
724
|
+
side: "midline"
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
id: "glabella",
|
|
728
|
+
labelKey: "glabella",
|
|
729
|
+
d: "M403.28,472.75s.03,0,.04,0c.11,0,.22,0,.34,0,.11,0,.22,0,.34,0,.02,0,.03,0,.04,0,28.06.09,43.26,5.62,51.09,10.26l8.65-43.23c-19.58-15.79-54.78-16.31-59.89-16.33-.13,0-.27,0-.4,0h-.16s-.16,0-.16,0c-.13,0-.27,0-.4,0-5.09-.02-39.63.51-59.32,15.85l8.74,43.71c7.83-4.64,23.03-10.17,51.09-10.26Z",
|
|
730
|
+
cx: 404,
|
|
731
|
+
cy: 453,
|
|
732
|
+
side: "midline"
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
id: "nasalBase",
|
|
736
|
+
labelKey: "nasalBase",
|
|
737
|
+
d: "M403.9,608.63c-.19.02-.38.06-.58.06-34.25,0-47.76,9.72-52.65,15.19-.02.21-.05.42-.1.62,10.07,8.84,28.11,13.48,52.75,13.48.15,0,.29.03.43.04.15-.01.29-.04.43-.04,24.98,0,43.18-4.76,53.17-13.83-4.69-5.41-18.09-15.46-52.89-15.46-.2,0-.38-.04-.58-.06Z",
|
|
738
|
+
cx: 404,
|
|
739
|
+
cy: 623,
|
|
740
|
+
side: "midline"
|
|
741
|
+
},
|
|
742
|
+
{
|
|
743
|
+
id: "nasolabialFold",
|
|
744
|
+
labelKey: "nasolabialFold",
|
|
745
|
+
d: "M347.77,580.98c-2.28,3.78-4.09,6.76-5.04,9.96-1.38,4.58-3.68,15.46,1.36,25.35,7.25-7.51,23.63-17.61,59.24-17.61.2,0,.38.04.58.06.19-.02.38-.06.58-.06,35.31,0,51.71,9.93,59.05,17.42,4.92-9.84,2.63-20.61,1.27-25.17-.96-3.19-2.76-6.18-5.04-9.96-5.23-8.65-12.39-20.5-14.97-45.03-2.34-22.26,2.15-36.18,6.11-43.75-5.65-3.61-19.1-9.4-47.23-9.45-27.9.05-41.36,5.75-47.09,9.36,3.98,7.55,8.51,21.49,6.16,43.84-2.58,24.53-9.74,36.38-14.97,45.03Z",
|
|
746
|
+
cx: 404,
|
|
747
|
+
cy: 550,
|
|
748
|
+
side: "midline"
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
id: "medialCheekboneRight",
|
|
752
|
+
labelKey: "medialCheekboneRight",
|
|
753
|
+
d: "M310.99,528.29c6.75-7.41,10.08-16.87,11.7-25.19-.55.67-1.13,1.34-1.73,2.02-11.93,13.41-27.69,20.63-45.58,20.88-24.57.33-43.87-10.86-55.92-20.57,6.83,15.71,22.29,36.28,56.41,36.28,15.2,0,27.02-4.51,35.12-13.42Z",
|
|
754
|
+
cx: 271,
|
|
755
|
+
cy: 522,
|
|
756
|
+
side: "right"
|
|
757
|
+
},
|
|
758
|
+
{
|
|
759
|
+
id: "medialCheekboneLeft",
|
|
760
|
+
labelKey: "medialCheekboneLeft",
|
|
761
|
+
d: "M529.65,526c-17.89-.25-33.66-7.47-45.58-20.88-.48-.54-.94-1.08-1.39-1.62.02.49.04.99.06,1.49,1.74,7.84,5.06,16.45,11.3,23.3,8.11,8.9,19.92,13.42,35.12,13.42,34.11,0,49.57-20.57,56.41-36.28-12.05,9.71-31.35,20.9-55.92,20.57Z",
|
|
762
|
+
cx: 534,
|
|
763
|
+
cy: 523,
|
|
764
|
+
side: "left"
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
id: "lateralCheekLeft",
|
|
768
|
+
labelKey: "lateralCheekLeft",
|
|
769
|
+
d: "M540.15,593.37c-18.18-.45-32.31-6.73-43.63-16.5-1.18-.24-2.29-.88-3.12-1.88-1.11-1.34-2.16-2.75-3.18-4.2-15.93-17.11-25.66-41.5-33.74-64.38-1.86,6.64-3.07,15.9-1.75,28.49,2.35,22.31,8.58,32.62,13.58,40.91,2.44,4.04,4.74,7.85,6.06,12.26,1.9,6.35,5.16,22.19-4,36.16,7.6,9.08,23.47,31.53,26.94,63.94,25.78-26.28,36.07-50.77,40.13-67.19,3.11-12.6,3.1-22.36,2.72-27.61Z",
|
|
770
|
+
cx: 497,
|
|
771
|
+
cy: 597,
|
|
772
|
+
side: "left"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
id: "lateralCheekRight",
|
|
776
|
+
labelKey: "lateralCheekRight",
|
|
777
|
+
d: "M350.8,505.59c-14.12,40.11-33.1,85.3-81.73,87.86-.37,5.26-.37,15,2.72,27.53,4.02,16.29,14.18,40.52,39.5,66.55,3.52-31.28,18.56-53.18,26.31-62.61-9.73-14.13-6.4-30.4-4.46-36.85,1.32-4.41,3.62-8.22,6.06-12.26,5-8.29,11.23-18.6,13.58-40.91,1.38-13.12,0-22.63-1.99-29.32Z",
|
|
778
|
+
cx: 311,
|
|
779
|
+
cy: 597,
|
|
780
|
+
side: "right"
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
id: "zygomaticArchRight",
|
|
784
|
+
labelKey: "zygomaticArchRight",
|
|
785
|
+
d: "M319.21,534.06c-.26.3-.51.61-.78.91-10.08,11.1-24.4,16.73-42.56,16.73-30.94,0-48.47-15.12-58-28.84,4.69,25.35,16.61,59.69,46.82,59.69,16.21,0,28.81-5.46,38.96-14.31.06-.09.11-.18.18-.26,7.83-9.48,12.57-21.69,15.39-33.93Z",
|
|
786
|
+
cx: 269,
|
|
787
|
+
cy: 553,
|
|
788
|
+
side: "right"
|
|
789
|
+
},
|
|
790
|
+
{
|
|
791
|
+
id: "zygomaticArchLeft",
|
|
792
|
+
labelKey: "zygomaticArchLeft",
|
|
793
|
+
d: "M542.24,582.4c31.74,0,43.29-37.91,47.48-63.47-.28.46-.57.93-.86,1.4-9.09,14.32-26.82,31.38-59.69,31.38-18.08,0-32.36-5.59-42.43-16.6,2.41,10.07,6.15,20.06,11.85,28.48,10.9,11.46,24.85,18.81,43.65,18.81Z",
|
|
794
|
+
cx: 538,
|
|
795
|
+
cy: 551,
|
|
796
|
+
side: "left"
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
id: "upperForehead",
|
|
800
|
+
labelKey: "upperForehead",
|
|
801
|
+
d: "M524.46,147.46c-34.16-13.49-75.08-20.35-121.64-20.4-46.56.05-87.49,6.91-121.64,20.4-27.26,10.76-50.3,25.76-68.48,44.56-15.39,15.91-24.67,31.94-30.13,44.09,4.92-3.6,11.3-7.4,19.61-11.17,40.86-18.52,108.25-27.96,200.32-28.07.05,0,.11,0,.16,0h.68s.68,0,.68,0c.05,0,.11,0,.16,0,92.07.1,159.46,9.55,200.32,28.07,7.48,3.39,13.39,6.81,18.08,10.08-5.52-12-14.69-27.55-29.63-43-18.18-18.8-41.22-33.79-68.48-44.56Z",
|
|
802
|
+
cx: 403,
|
|
803
|
+
cy: 182,
|
|
804
|
+
side: "midline"
|
|
805
|
+
},
|
|
806
|
+
{
|
|
807
|
+
id: "marionetteLines",
|
|
808
|
+
labelKey: "marionetteLines",
|
|
809
|
+
d: "M344.66,676.82c23.78-8.45,44.18-6.91,59.31,4.4,15.13-11.32,35.54-12.87,59.33-4.41,9.61,3.41,17.99,7.81,23.93,11.32-3.32-27.6-16.56-47.44-23.55-56.2-11.99,10.66-31.94,16.05-59.49,16.05-.15,0-.29-.03-.43-.04-.15.01-.29.04-.43.04-27.09,0-46.83-5.21-58.88-15.52-7.05,8.98-19.76,28.44-23.08,55.31,5.9-3.44,14.03-7.65,23.29-10.94Z",
|
|
810
|
+
cx: 404,
|
|
811
|
+
cy: 660,
|
|
812
|
+
side: "midline"
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
id: "lowerLip",
|
|
816
|
+
labelKey: "lowerLip",
|
|
817
|
+
d: "M487.84,709.63c-4.92,5.03-11.64,11.3-19.65,17.27-17.67,13.18-35.13,19.92-51.28,19.92-4.52,0-8.94-.53-13.23-1.6-4.29,1.06-8.71,1.6-13.23,1.6-16.15,0-33.61-6.74-51.28-19.92-7.36-5.49-13.63-11.23-18.42-16.03,1.76,38.11,15.57,71.15,82.56,71.15.33,0,.64.04.95.1.31-.06.62-.1.95-.1,67.72,0,81.09-33.76,82.62-72.39Z",
|
|
818
|
+
cx: 404,
|
|
819
|
+
cy: 746,
|
|
820
|
+
side: "midline"
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
id: "lipCommissures",
|
|
824
|
+
labelKey: "lipCommissures",
|
|
825
|
+
d: "M407.45,691.27c-.9.8-2.02,1.19-3.13,1.23-1.34.13-2.72-.26-3.8-1.22-22.23-19.67-55.63-5.3-72.53,4.24,11.5,1.38,25.87,2.57,31.61,1.13,6.72-1.68,12.32.35,18.25,2.5,6.08,2.2,13.64,4.94,25.48,4.98,11.85-.04,19.41-2.78,25.48-4.98,5.93-2.15,11.53-4.18,18.25-2.5,5.93,1.48,21.03.17,32.69-1.26-16.96-9.54-50.17-23.72-72.31-4.13Z",
|
|
826
|
+
cx: 404,
|
|
827
|
+
cy: 688,
|
|
828
|
+
side: "midline"
|
|
829
|
+
},
|
|
830
|
+
{
|
|
831
|
+
id: "upperLip",
|
|
832
|
+
labelKey: "upperLip",
|
|
833
|
+
d: "M444.65,706.36c-3.59-.9-6.73.14-12.42,2.2-6.4,2.32-15.13,5.47-28.52,5.57-.03,0-.06,0-.09,0-.09,0-.18,0-.28,0-.09,0-.18,0-.28,0-.03,0-.06,0-.09,0-13.39-.1-22.12-3.25-28.52-5.57-5.69-2.06-8.83-3.1-12.42-2.2-6.87,1.72-20.85.72-32.07-.53,15.47,14.96,44.16,37.13,72.34,29.42.46-.13.93-.16,1.39-.15.46,0,.93.03,1.4.15,28.22,7.72,56.98-14.55,72.43-29.5-11.35,1.29-25.82,2.37-32.86.61Z",
|
|
834
|
+
cx: 404,
|
|
835
|
+
cy: 724,
|
|
836
|
+
side: "midline"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
id: "submental",
|
|
840
|
+
labelKey: "submental",
|
|
841
|
+
d: "M402.47,796.81c-31.67.12-55.93,8.97-72.11,26.31-5.47,5.87-9.06,11.79-11.35,16.53.85.63,1.68,1.27,2.5,1.95,4.99,4.16,26.68,19.07,81.31,19.07s76.32-14.91,81.31-19.07c.65-.54,1.31-1.06,1.98-1.57-2.28-4.8-5.91-10.88-11.53-16.91-16.17-17.35-40.44-26.19-72.11-26.31Z",
|
|
842
|
+
cx: 403,
|
|
843
|
+
cy: 829,
|
|
844
|
+
side: "midline"
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
id: "mandibularAngleLeft",
|
|
848
|
+
labelKey: "mandibularAngleLeft",
|
|
849
|
+
d: "M514.03,757.42c-.91-3.27-1.74-6.39-2.54-9.37-2.39-8.91-4.46-16.6-7.08-23.48-1.84-4.83-3.93-9.07-6.37-12.99-1.26,23.6-6.85,40.74-17.31,53.43-10.17,12.33-24.87,20.32-44.53,24.16,17.13,3.95,34.7,11.85,48.39,26.79,5.59,6.1,9.46,12.22,12.09,17.4,10.43-7.53,28.1-20.6,47.98-36.72-9.19-6.29-25.19-19.64-30.61-39.21Z",
|
|
850
|
+
cx: 490,
|
|
851
|
+
cy: 772,
|
|
852
|
+
side: "left"
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
id: "mandibularAngleRight",
|
|
856
|
+
labelKey: "mandibularAngleRight",
|
|
857
|
+
d: "M372.3,789.03c-19.33-3.89-33.81-11.84-43.86-24.02-10.59-12.83-16.18-30.24-17.35-54.26-2.69,4.15-4.95,8.66-6.92,13.84-2.63,6.88-4.69,14.57-7.08,23.48-.8,2.98-1.64,6.1-2.54,9.37-5.42,19.55-21.39,32.89-30.58,39.19,19.56,15.86,36.98,28.78,47.47,36.36,2.63-5.1,6.44-11.07,11.9-17.03,13.85-15.11,31.67-23.02,48.98-26.92Z",
|
|
858
|
+
cx: 318,
|
|
859
|
+
cy: 772,
|
|
860
|
+
side: "right"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
id: "eyelidRight",
|
|
864
|
+
labelKey: "eyelidRight",
|
|
865
|
+
d: "M270.93,458.23c-50.38-1.36-52.57,26.33-52.64,27.51-.08,1.39-.72,2.61-1.69,3.46,7.87,8.21,29.3,27.23,58.63,26.79,29.72-.41,43.34-22.6,47.54-31.28-.03-.39-.05-.75-.07-1.07-1.34-6.07-8.94-24.24-51.76-25.41Z",
|
|
866
|
+
cx: 270,
|
|
867
|
+
cy: 487,
|
|
868
|
+
side: "right"
|
|
869
|
+
},
|
|
870
|
+
{
|
|
871
|
+
id: "eyelidLeft",
|
|
872
|
+
labelKey: "eyelidLeft",
|
|
873
|
+
d: "M586.21,485.71c-.08-1.27-2.3-28.82-52.55-27.45-36.35.99-47.27,14.25-50.55,21.95.08.48.1.98.05,1.49-.01.11-.16,1.63-.31,4.22,4.82,9.37,18.52,29.69,46.94,30.08,29.04.43,50.34-18.21,58.4-26.55-1.13-.87-1.91-2.2-1.98-3.73Z",
|
|
874
|
+
cx: 536,
|
|
875
|
+
cy: 487,
|
|
876
|
+
side: "left"
|
|
877
|
+
}
|
|
878
|
+
], Qs = [
|
|
879
|
+
{ id: "right-eye", labelKey: "rightEye", x: 268, y: 487 },
|
|
880
|
+
{ id: "left-eye", labelKey: "leftEye", x: 535, y: 487 },
|
|
881
|
+
{ id: "nose-tip", labelKey: "noseTip", x: 403, y: 620 },
|
|
882
|
+
{ id: "chin", labelKey: "chin", x: 404, y: 858 }
|
|
883
|
+
], Wr = [
|
|
884
|
+
{
|
|
885
|
+
id: "cheekbone",
|
|
886
|
+
labelKey: "cheekbone",
|
|
887
|
+
d: "M587.86 415.87C586.01 408.8 583.79 409.02 576.91 410.15C573.08 410.38 567.86 410.32 561.24 408.36C547.07 403.39 488.66 358.5 465.97 345.98C436.12 334.42 407.31 328.09 390.38 326.48C395.19 331.07 399.27 338.58 388.69 345.72C397.48 346.49 408.73 348.34 421.39 351.61C467.3 374.36 523.12 420.78 541.55 435.68C550.62 443.21 555.39 449.39 559.11 454.28C564.66 461.73 567.89 466.16 579.26 467.46C583.31 467.67 586.22 465.29 588.19 460.34C591.18 452.28 592.1 431.43 587.86 415.88Z",
|
|
888
|
+
cx: 490,
|
|
889
|
+
cy: 397
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
id: "profileContour",
|
|
893
|
+
labelKey: "profileContour",
|
|
894
|
+
d: "M657.04 427.15C645.32 417.42 612.92 377.67 608.47 342.76C610.05 315.91 614.77 299.37 606.91 241.79C600.19 175.54 556.62 116.74 420.63 130.08C253.44 160.79 152.79 273.93 132.98 380.57C116.36 516.03 182.43 589.12 182.43 589.12L226.57 641.41C234.86 650.15 249.78 644.43 261.09 627.35L321.54 525.13C328.57 512.58 325.7 495.54 318.17 493.61C294.63 488.83 257.86 468.83 262.84 409.94C267.69 380.06 284 357.04 302.38 340.78C330.2 319.79 367.62 311.97 382.74 320.74C382.87 320.84 382.94 320.94 382.99 321.04C388.82 321.28 405.44 322.73 426.75 326.43C424.09 323.46 422.53 319.98 422.13 315.98C421.41 309.9 423.49 304.51 423.88 303.54C426.23 284.75 477.87 242.7 506.61 211.31L506.84 210.99C508.32 208.89 511.62 207.65 515.45 207.77C519.23 207.92 522.88 209.42 524.98 211.72L567.11 326.31C568.13 330.65 567.2 335.05 564.76 336.69C563.35 337.54 561.24 339.5 558.91 342.14C559.06 342.41 559.15 342.57 559.15 342.57L573.97 372.38C575.71 369.67 578.22 365.84 581.33 362.37C585.49 356.14 590.79 348.98 597.61 352.24C598.15 352.43 598.76 354.7 598.84 357.08C598.91 358.84 598.59 359.88 598.14 359.69C597.37 359.38 596.65 359.2 595.96 359.12C597.33 369.53 600.96 398.18 595.38 398C588.92 397.38 587.72 374.56 588.46 362.31C586.69 363.79 584.85 365.85 582.96 368.5C580.04 371.85 577.73 375.59 576.26 377.97L577.27 380.55C577.56 381.29 577.66 382.22 577.55 383.11C577.43 384 577.11 384.76 576.66 385.24L553.04 396.96C558.13 400.5 560.86 401.88 562.35 402.34C568.32 404.04 572.97 404.02 576.7 403.74C583.09 402.53 587.8 400.9 590.94 412.75C594.16 424.28 596.78 449.29 591.87 464.27C589.18 471.56 584.78 475.46 579.05 475.22C575.99 474.97 573.36 474.4 571.04 473.57C567.75 472.35 565.15 470.69 562.9 468.71C562.88 472.1 562.76 476.4 562.38 481.46C567.8 483.15 578.56 487.63 584.78 500.94C588.58 509.77 589.68 521.45 587.53 535.74C590.03 539.27 597.49 548.85 608.32 547.11C615.16 544.28 621.37 543.88 625.6 545.18C627.13 536.84 628.35 525.82 627.96 516.71C626.08 501.81 623.74 494.92 625.48 485.82C627.82 477.03 640.49 466.24 651.72 451.57C662.37 438.81 663.39 438.52 657.07 427.15Z",
|
|
895
|
+
cx: 390,
|
|
896
|
+
cy: 383
|
|
897
|
+
},
|
|
898
|
+
{
|
|
899
|
+
id: "temple",
|
|
900
|
+
labelKey: "temple",
|
|
901
|
+
d: "M551.29 339.27C551.73 338.72 552.17 338.34 552.62 338.11C556.19 334.28 559.65 331.21 562.14 329.85C562.68 329.54 562.9 328.65 562.67 327.75L518.07 213.95C517.55 213.37 516.78 213.26 516.36 213.24C515.95 213.22 515.19 213.27 514.81 213.81L514.57 214.13C507.63 223.01 490.31 241.35 473.08 259.55C456.86 274.15 435.38 293.06 434.06 303.22L434.04 303.36L433.97 303.51C433.88 303.72 424.42 324.26 448.09 332.54C448.37 332.66 448.62 332.79 448.84 332.93C456.22 335.74 463.82 338.97 471.46 342.54C502.66 360.75 523.25 375.04 536.66 384.85C535.73 382.31 534.95 379.47 534.57 376.45C533.66 370.15 534.7 364.78 536.86 360.11C539.61 349.89 545.41 345.33 549.41 341.41C549.46 341.36 549.51 341.3 549.56 341.25C550.19 340.57 550.77 339.92 551.29 339.26Z",
|
|
902
|
+
cx: 494,
|
|
903
|
+
cy: 299
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
id: "preauricularArea",
|
|
907
|
+
labelKey: "preauricularArea",
|
|
908
|
+
d: "M399.04 423.47C400.19 426.46 399.28 429.83 397.03 431.07L421.24 493.26C429.33 496.6 440.56 504.27 451.47 519.28C455.98 526.45 460.47 535.45 464.49 546.37C473.34 527.06 479.06 492.31 479.5 447.01C480.52 417.95 479.02 394.87 478.75 390.28C457.75 375.55 435.02 362.96 415.32 355.59C403.76 352.86 393.4 351.38 385.05 350.82C383.53 355.04 382.54 362.85 384.93 378.19C389.1 396.84 398.92 423.16 399.04 423.46Z",
|
|
909
|
+
cx: 432,
|
|
910
|
+
cy: 449
|
|
911
|
+
},
|
|
912
|
+
{
|
|
913
|
+
id: "mandibularBody",
|
|
914
|
+
labelKey: "mandibularBody",
|
|
915
|
+
d: "M448.9 529.33C441.36 518.39 433.39 511.79 426.69 508.14L444.05 565.22L444.11 565.55C444.61 568.53 446.18 612.75 465.58 621.58C467.31 622.11 469.2 622.59 471.21 623.04C472.27 587.41 463.32 555.13 448.9 529.33Z",
|
|
916
|
+
cx: 449,
|
|
917
|
+
cy: 566
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
id: "submentalProfile",
|
|
921
|
+
labelKey: "submentalProfile",
|
|
922
|
+
d: "M499.51 624.48C500.22 624.28 501.01 624.05 501.85 623.78C506.95 622.1 508.34 617.25 499.33 608.72C499.3 608.71 499.28 608.69 499.25 608.67C498.87 608.43 498.48 608.2 498.08 607.95C489.61 603.09 481.6 597.71 477.16 594.66C477.83 603.57 477.42 613.28 475.61 623.94C494.7 628.41 483.66 636.08 483.66 636.08C483.66 636.08 476.69 649.28 527.7 627.3C518.99 627.63 510.52 627.34 503.56 626.55C496.4 626.16 495.89 625.71 499.5 624.48Z",
|
|
923
|
+
cx: 502,
|
|
924
|
+
cy: 622
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
id: "masseter",
|
|
928
|
+
labelKey: "masseter",
|
|
929
|
+
d: "M554.71 459.19C550.92 454.22 546.49 448.51 537.91 441.39C528.42 433.63 510.52 417.13 488.4 397.93C489.3 421.03 491.75 514.66 467.63 555.34C470.6 563.87 473.34 573.19 475.46 583.39C476.18 582.97 476.93 582.94 477.54 583.4C477.77 583.56 487.55 590.84 499.76 598.04C530.58 563.84 546.09 529.73 552.28 505.65C557.13 483.51 556.81 466.48 556.58 461.68C555.96 460.87 555.34 460.04 554.7 459.2Z",
|
|
930
|
+
cx: 512,
|
|
931
|
+
cy: 498
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
id: "cheek",
|
|
935
|
+
labelKey: "cheek",
|
|
936
|
+
d: "M503.7 600.29L503.69 600.76C506.68 599.48 519.15 594.49 532.76 586.74C551.63 579.2 568.84 567.08 579.23 546.08C584.39 529.37 584.46 515.84 580.48 506.25C575.46 495.21 566.3 491.13 561.55 489.57C560.86 495.06 559.83 501.15 558.34 507.68C551.78 532.36 535.25 566.52 503.69 600.3Z",
|
|
937
|
+
cx: 544,
|
|
938
|
+
cy: 545
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
id: "chin",
|
|
942
|
+
labelKey: "chin",
|
|
943
|
+
d: "M622.37 557.72C618.53 556.38 613.08 555.94 606.76 557.59C595.83 558.3 588.65 550.46 584.99 545.44C584.69 546.34 584.38 547.24 584.03 548.15C571.22 572.11 550.01 585.32 530.6 593C522.53 597.65 514.89 601.46 509.24 604.26C515.21 610.11 514.33 615.81 510.02 618.18C502.34 623.58 523.79 624.61 543.95 623.09C547.34 622.17 550.83 621.19 554.45 620.12L594.99 602.7L595.21 602.54C596.13 601.8 602.57 595.37 608.29 593.49C613.07 590.42 621.01 568.35 622.15 559.26C622.19 558.76 622.27 558.26 622.36 557.75Z",
|
|
944
|
+
cx: 562,
|
|
945
|
+
cy: 585
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
id: "browTail",
|
|
949
|
+
labelKey: "browTail",
|
|
950
|
+
d: "M555.64 346.57C555.64 346.57 530.25 360.36 547.29 391.38L572.95 381.28L555.64 346.57Z",
|
|
951
|
+
cx: 552,
|
|
952
|
+
cy: 369
|
|
953
|
+
}
|
|
954
|
+
], Er = Wr.find((n) => n.id === "profileContour") ?? jr, zr = Wr.filter(
|
|
955
|
+
(n) => n.id !== "profileContour"
|
|
956
|
+
).map((n) => ({
|
|
957
|
+
id: n.id,
|
|
958
|
+
labelKey: n.labelKey,
|
|
959
|
+
d: n.d,
|
|
960
|
+
cx: n.cx ?? 0,
|
|
961
|
+
cy: n.cy ?? 0,
|
|
962
|
+
side: n.side ?? "midline"
|
|
963
|
+
})), Lr = [
|
|
964
|
+
{ id: "eye", labelKey: "eye", x: 561, y: 374 },
|
|
965
|
+
{ id: "nose-tip", labelKey: "noseTip", x: 668, y: 432 },
|
|
966
|
+
{ id: "mouth", labelKey: "mouth", x: 592, y: 532 }
|
|
967
|
+
], Sn = {
|
|
968
|
+
front: {
|
|
969
|
+
id: "front",
|
|
970
|
+
labelKey: "front",
|
|
971
|
+
viewBox: bn,
|
|
972
|
+
schematicViewBox: "152 103 502 842",
|
|
973
|
+
meshContentBox: { x: 176, y: 127, width: 454, height: 794 },
|
|
974
|
+
pivot: Cn,
|
|
975
|
+
contour: jr,
|
|
976
|
+
// The generator guarantees every clickable zone carries cx/cy/side.
|
|
977
|
+
zones: Js,
|
|
978
|
+
landmarks: Qs
|
|
979
|
+
},
|
|
980
|
+
// The reshaped profile zones face +x; the right profile is the same mesh
|
|
981
|
+
// mirrored. Both fit on the eye/nose-tip/mouth anchors — auto-detect and manual
|
|
982
|
+
// drag/sliders all work; the right profile mirrors the fit at render time.
|
|
983
|
+
"profile-left": {
|
|
984
|
+
id: "profile-left",
|
|
985
|
+
labelKey: "profileLeft",
|
|
986
|
+
viewBox: bn,
|
|
987
|
+
schematicViewBox: "359 189 287 475",
|
|
988
|
+
meshContentBox: { x: 383, y: 213, width: 239, height: 427 },
|
|
989
|
+
pivot: Cn,
|
|
990
|
+
contour: Er,
|
|
991
|
+
zones: zr,
|
|
992
|
+
landmarks: Lr
|
|
993
|
+
},
|
|
994
|
+
"profile-right": {
|
|
995
|
+
id: "profile-right",
|
|
996
|
+
labelKey: "profileRight",
|
|
997
|
+
viewBox: bn,
|
|
998
|
+
schematicViewBox: "162 189 287 475",
|
|
999
|
+
meshContentBox: { x: 383, y: 213, width: 239, height: 427 },
|
|
1000
|
+
pivot: Cn,
|
|
1001
|
+
contour: Er,
|
|
1002
|
+
zones: zr,
|
|
1003
|
+
landmarks: Lr,
|
|
1004
|
+
mirror: !0
|
|
1005
|
+
}
|
|
1006
|
+
}, eo = [
|
|
1007
|
+
"front",
|
|
1008
|
+
"profile-left",
|
|
1009
|
+
"profile-right"
|
|
1010
|
+
], Rr = [
|
|
1011
|
+
"observation",
|
|
1012
|
+
"treatment",
|
|
1013
|
+
"concern",
|
|
1014
|
+
"note"
|
|
1015
|
+
], _t = {
|
|
1016
|
+
observation: { shape: "circle", tone: "info" },
|
|
1017
|
+
treatment: { shape: "square", tone: "success" },
|
|
1018
|
+
concern: { shape: "triangle", tone: "warning" },
|
|
1019
|
+
note: { shape: "diamond", tone: "neutral" }
|
|
1020
|
+
}, to = [
|
|
1021
|
+
"marker",
|
|
1022
|
+
"pen",
|
|
1023
|
+
"highlighter",
|
|
1024
|
+
"arrow",
|
|
1025
|
+
"line",
|
|
1026
|
+
"rect",
|
|
1027
|
+
"ellipse",
|
|
1028
|
+
"text"
|
|
1029
|
+
], sa = {
|
|
1030
|
+
marker: "marker",
|
|
1031
|
+
pen: "pen",
|
|
1032
|
+
highlighter: "highlighter",
|
|
1033
|
+
arrow: "arrow",
|
|
1034
|
+
line: "line",
|
|
1035
|
+
rect: "rect",
|
|
1036
|
+
ellipse: "ellipse",
|
|
1037
|
+
text: "text"
|
|
1038
|
+
};
|
|
1039
|
+
function oa(n) {
|
|
1040
|
+
return n === "arrow" || n === "line" || n === "rect" || n === "ellipse";
|
|
1041
|
+
}
|
|
1042
|
+
function aa(n) {
|
|
1043
|
+
return n === "pen" || n === "highlighter";
|
|
1044
|
+
}
|
|
1045
|
+
function ca(n) {
|
|
1046
|
+
return n === "marker" || n === "text";
|
|
1047
|
+
}
|
|
1048
|
+
function Hr(n) {
|
|
1049
|
+
if (n.length === 0) return "";
|
|
1050
|
+
const r = n[0];
|
|
1051
|
+
if (n.length === 1)
|
|
1052
|
+
return `M ${r.x} ${r.y} L ${r.x + 0.01} ${r.y}`;
|
|
1053
|
+
let o = `M ${r.x} ${r.y}`;
|
|
1054
|
+
for (let l = 1; l < n.length; l++) {
|
|
1055
|
+
const d = n[l];
|
|
1056
|
+
o += ` L ${d.x} ${d.y}`;
|
|
1057
|
+
}
|
|
1058
|
+
return o;
|
|
1059
|
+
}
|
|
1060
|
+
function Nn(n, r, o) {
|
|
1061
|
+
switch (n) {
|
|
1062
|
+
case "line":
|
|
1063
|
+
case "arrow":
|
|
1064
|
+
return `M ${r.x} ${r.y} L ${o.x} ${o.y}`;
|
|
1065
|
+
case "rect": {
|
|
1066
|
+
const l = Math.min(r.x, o.x), d = Math.min(r.y, o.y), c = Math.abs(o.x - r.x), m = Math.abs(o.y - r.y);
|
|
1067
|
+
return `M ${l} ${d} h ${c} v ${m} h ${-c} Z`;
|
|
1068
|
+
}
|
|
1069
|
+
case "ellipse": {
|
|
1070
|
+
const l = (r.x + o.x) / 2, d = (r.y + o.y) / 2, c = Math.abs(o.x - r.x) / 2, m = Math.abs(o.y - r.y) / 2;
|
|
1071
|
+
return c === 0 || m === 0 ? `M ${r.x} ${r.y} L ${o.x} ${o.y}` : `M ${l - c} ${d} a ${c} ${m} 0 1 0 ${2 * c} 0 a ${c} ${m} 0 1 0 ${-2 * c} 0 Z`;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
}
|
|
1075
|
+
function no(n, r, o = 16) {
|
|
1076
|
+
const l = r.x - n.x, d = r.y - n.y, c = Math.hypot(l, d) || 1, m = l / c, h = d / c, p = 0.5, y = Math.cos(p), S = Math.sin(p), b = r.x - o * (m * y - h * S), v = r.y - o * (h * y + m * S), k = r.x - o * (m * y + h * S), w = r.y - o * (h * y - m * S);
|
|
1077
|
+
return `M ${r.x} ${r.y} L ${b} ${v} M ${r.x} ${r.y} L ${k} ${w}`;
|
|
1078
|
+
}
|
|
1079
|
+
function ro(n) {
|
|
1080
|
+
switch (n.kind) {
|
|
1081
|
+
case "marker":
|
|
1082
|
+
case "text":
|
|
1083
|
+
return { x: n.x, y: n.y, width: 0, height: 0 };
|
|
1084
|
+
case "pen":
|
|
1085
|
+
case "highlighter": {
|
|
1086
|
+
if (n.points.length === 0) return { x: 0, y: 0, width: 0, height: 0 };
|
|
1087
|
+
let r = 1 / 0, o = 1 / 0, l = -1 / 0, d = -1 / 0;
|
|
1088
|
+
for (const c of n.points)
|
|
1089
|
+
c.x < r && (r = c.x), c.y < o && (o = c.y), c.x > l && (l = c.x), c.y > d && (d = c.y);
|
|
1090
|
+
return { x: r, y: o, width: l - r, height: d - o };
|
|
1091
|
+
}
|
|
1092
|
+
default: {
|
|
1093
|
+
const r = Math.min(n.from.x, n.to.x), o = Math.min(n.from.y, n.to.y), l = Math.max(n.from.x, n.to.x), d = Math.max(n.from.y, n.to.y);
|
|
1094
|
+
return { x: r, y: o, width: l - r, height: d - o };
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
function io(n) {
|
|
1099
|
+
switch (n.kind) {
|
|
1100
|
+
case "marker":
|
|
1101
|
+
case "text":
|
|
1102
|
+
return { x: n.x, y: n.y };
|
|
1103
|
+
case "pen":
|
|
1104
|
+
case "highlighter": {
|
|
1105
|
+
if (n.points.length === 0) return { x: 0, y: 0 };
|
|
1106
|
+
let r = 1 / 0, o = 1 / 0, l = -1 / 0, d = -1 / 0;
|
|
1107
|
+
for (const c of n.points)
|
|
1108
|
+
c.x < r && (r = c.x), c.y < o && (o = c.y), c.x > l && (l = c.x), c.y > d && (d = c.y);
|
|
1109
|
+
return { x: (r + l) / 2, y: (o + d) / 2 };
|
|
1110
|
+
}
|
|
1111
|
+
default:
|
|
1112
|
+
return { x: (n.from.x + n.to.x) / 2, y: (n.from.y + n.to.y) / 2 };
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
const so = 28, Mn = 26;
|
|
1116
|
+
function oo(n, r = 30) {
|
|
1117
|
+
switch (n.kind) {
|
|
1118
|
+
case "marker":
|
|
1119
|
+
return { type: "circle", cx: n.x, cy: n.y, r: Mn };
|
|
1120
|
+
case "pen":
|
|
1121
|
+
case "highlighter":
|
|
1122
|
+
return { type: "stroke", d: Hr(n.points) };
|
|
1123
|
+
case "arrow":
|
|
1124
|
+
case "line":
|
|
1125
|
+
case "rect":
|
|
1126
|
+
case "ellipse":
|
|
1127
|
+
return { type: "stroke", d: Nn(n.kind, n.from, n.to) };
|
|
1128
|
+
case "text": {
|
|
1129
|
+
const o = Math.max(60, n.text.length * r * 0.62);
|
|
1130
|
+
return {
|
|
1131
|
+
type: "rect",
|
|
1132
|
+
x: n.x - Mn,
|
|
1133
|
+
y: n.y - r * 1.2,
|
|
1134
|
+
width: o + Mn,
|
|
1135
|
+
height: r * 1.7
|
|
1136
|
+
};
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
const De = [1, 0, 0, 1, 0, 0];
|
|
1141
|
+
function Et(n) {
|
|
1142
|
+
return `matrix(${n[0]} ${n[1]} ${n[2]} ${n[3]} ${n[4]} ${n[5]})`;
|
|
1143
|
+
}
|
|
1144
|
+
function rt(n, r) {
|
|
1145
|
+
return {
|
|
1146
|
+
x: n[0] * r.x + n[2] * r.y + n[4],
|
|
1147
|
+
y: n[1] * r.x + n[3] * r.y + n[5]
|
|
1148
|
+
};
|
|
1149
|
+
}
|
|
1150
|
+
function ao(n) {
|
|
1151
|
+
const r = n[0] * n[3] - n[1] * n[2], o = n[3] / r, l = -n[1] / r, d = -n[2] / r, c = n[0] / r;
|
|
1152
|
+
return [o, l, d, c, -(o * n[4] + d * n[5]), -(l * n[4] + c * n[5])];
|
|
1153
|
+
}
|
|
1154
|
+
const co = 0.84;
|
|
1155
|
+
function $r(n, r, o, l = {}) {
|
|
1156
|
+
const d = `0 0 ${o.width} ${o.height}`, c = l.fraction ?? co;
|
|
1157
|
+
if (c <= 0 || c > 1) return d;
|
|
1158
|
+
const m = [
|
|
1159
|
+
{ x: n.x, y: n.y },
|
|
1160
|
+
{ x: n.x + n.width, y: n.y },
|
|
1161
|
+
{ x: n.x, y: n.y + n.height },
|
|
1162
|
+
{ x: n.x + n.width, y: n.y + n.height }
|
|
1163
|
+
].map((I) => rt(r, I));
|
|
1164
|
+
let h = 1 / 0, p = 1 / 0, y = -1 / 0, S = -1 / 0;
|
|
1165
|
+
for (const I of m)
|
|
1166
|
+
h = Math.min(h, I.x), p = Math.min(p, I.y), y = Math.max(y, I.x), S = Math.max(S, I.y);
|
|
1167
|
+
if (l.mirror) {
|
|
1168
|
+
const I = o.width - y;
|
|
1169
|
+
y = o.width - h, h = I;
|
|
1170
|
+
}
|
|
1171
|
+
const b = y - h, v = S - p;
|
|
1172
|
+
if (!Number.isFinite(h + p + b + v) || b <= 0 || v <= 0)
|
|
1173
|
+
return d;
|
|
1174
|
+
const k = o.width / o.height, w = Math.max(v / c, b / c / k), L = w * k;
|
|
1175
|
+
if (L > o.width || w > o.height) return d;
|
|
1176
|
+
const X = Math.min(Math.max(h + b / 2 - L / 2, 0), o.width - L), $ = Math.min(Math.max(p + v / 2 - w / 2, 0), o.height - w);
|
|
1177
|
+
return `${Math.round(X)} ${Math.round($)} ${Math.round(L)} ${Math.round(w)}`;
|
|
1178
|
+
}
|
|
1179
|
+
const lo = 1, Vr = 8, it = { k: 1, fx: 0.5, fy: 0.5 }, Be = (n) => Math.min(Math.max(n, 0), 1);
|
|
1180
|
+
function zt(n) {
|
|
1181
|
+
const [r = 0, o = 0, l = 0, d = 0] = n.split(/\s+/).map(Number);
|
|
1182
|
+
return { x: r, y: o, width: l, height: d };
|
|
1183
|
+
}
|
|
1184
|
+
function uo(n) {
|
|
1185
|
+
return `${Math.round(n.x)} ${Math.round(n.y)} ${Math.round(n.width)} ${Math.round(n.height)}`;
|
|
1186
|
+
}
|
|
1187
|
+
function st(n, r) {
|
|
1188
|
+
if (r.k <= 1) return n;
|
|
1189
|
+
const o = n.width / r.k, l = n.height / r.k;
|
|
1190
|
+
return {
|
|
1191
|
+
x: n.x + r.fx * (n.width - o),
|
|
1192
|
+
y: n.y + r.fy * (n.height - l),
|
|
1193
|
+
width: o,
|
|
1194
|
+
height: l
|
|
1195
|
+
};
|
|
1196
|
+
}
|
|
1197
|
+
function Fr(n, r, o, l) {
|
|
1198
|
+
const d = Math.min(Math.max(r.k * l, lo), Vr);
|
|
1199
|
+
if (d <= 1) return it;
|
|
1200
|
+
if (d === r.k || !Number.isFinite(d)) return r;
|
|
1201
|
+
const c = st(n, r), m = n.width / d, h = n.height / d, p = c.width > 0 ? Be((o.x - c.x) / c.width) : 0.5, y = c.height > 0 ? Be((o.y - c.y) / c.height) : 0.5, S = o.x - p * m, b = o.y - y * h, v = n.width - m, k = n.height - h;
|
|
1202
|
+
return {
|
|
1203
|
+
k: d,
|
|
1204
|
+
fx: v > 0 ? Be((S - n.x) / v) : 0.5,
|
|
1205
|
+
fy: k > 0 ? Be((b - n.y) / k) : 0.5
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
function fo(n, r, o, l) {
|
|
1209
|
+
if (r.k <= 1) return r;
|
|
1210
|
+
const d = st(n, r), c = n.width - d.width, m = n.height - d.height;
|
|
1211
|
+
return {
|
|
1212
|
+
k: r.k,
|
|
1213
|
+
fx: c > 0 ? Be((d.x - o - n.x) / c) : 0.5,
|
|
1214
|
+
fy: m > 0 ? Be((d.y - l - n.y) / m) : 0.5
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
const Ft = Math.PI / 180;
|
|
1218
|
+
function ho(n, r) {
|
|
1219
|
+
const o = n.rotation * Ft, l = Math.cos(o), d = Math.sin(o), c = Math.tan(n.shear * Ft), m = n.scaleX * l, h = n.scaleX * d, p = n.scaleY * (c * l - d), y = n.scaleY * (c * d + l), S = n.translateX + r.x - (m * r.x + p * r.y), b = n.translateY + r.y - (h * r.x + y * r.y);
|
|
1220
|
+
return [m, h, p, y, S, b];
|
|
1221
|
+
}
|
|
1222
|
+
function mo(n, r) {
|
|
1223
|
+
const [o, l, d, c, m, h] = n, p = Math.hypot(o, l), y = Math.atan2(l, o) / Ft, S = o * c - l * d, b = p === 0 ? 0 : S / p, v = Math.atan2(o * d + l * c, S) / Ft, k = m - r.x + (o * r.x + d * r.y), w = h - r.y + (l * r.x + c * r.y);
|
|
1224
|
+
return { scaleX: p, scaleY: b, rotation: y, shear: v, translateX: k, translateY: w };
|
|
1225
|
+
}
|
|
1226
|
+
function Kr(n, r) {
|
|
1227
|
+
const o = Math.min(n.length, r.length);
|
|
1228
|
+
if (o < 3) return De;
|
|
1229
|
+
let l = 0, d = 0, c = 0, m = 0, h = 0, p = 0, y = 0, S = 0, b = 0, v = 0, k = 0;
|
|
1230
|
+
for (let ie = 0; ie < o; ie++) {
|
|
1231
|
+
const E = n[ie], D = r[ie];
|
|
1232
|
+
!E || !D || (l += E.x * E.x, d += E.x * E.y, c += E.x, m += E.y * E.y, h += E.y, p += D.x * E.x, y += D.x * E.y, S += D.x, b += D.y * E.x, v += D.y * E.y, k += D.y);
|
|
1233
|
+
}
|
|
1234
|
+
const w = l * (m * o - h * h) - d * (d * o - h * c) + c * (d * h - m * c);
|
|
1235
|
+
if (Math.abs(w) < 1e-9) return De;
|
|
1236
|
+
const L = m * o - h * h, X = c * h - d * o, $ = d * h - c * m, I = l * o - c * c, R = c * d - l * h, H = l * m - d * d, q = (ie, E, D) => [
|
|
1237
|
+
(L * ie + X * E + $ * D) / w,
|
|
1238
|
+
(X * ie + I * E + R * D) / w,
|
|
1239
|
+
($ * ie + R * E + H * D) / w
|
|
1240
|
+
], [pe, re, Ce] = q(p, y, S), [le, ge, ye] = q(b, v, k);
|
|
1241
|
+
return [pe, le, re, ge, Ce, ye];
|
|
1242
|
+
}
|
|
1243
|
+
function po(n) {
|
|
1244
|
+
const r = (p) => {
|
|
1245
|
+
var y;
|
|
1246
|
+
return (y = n.find((S) => S.id === p)) == null ? void 0 : y.photo;
|
|
1247
|
+
}, o = r("nose-tip"), l = r("right-eye"), d = r("left-eye"), c = r("mouth-right"), m = r("mouth-left");
|
|
1248
|
+
if (!o || !l || !d || !c || !m) return null;
|
|
1249
|
+
const h = (p, y) => Math.abs(p.x - o.x) >= Math.abs(y.x - o.x) ? p : y;
|
|
1250
|
+
return [
|
|
1251
|
+
{ id: "eye", photo: h(l, d) },
|
|
1252
|
+
{ id: "nose-tip", photo: o },
|
|
1253
|
+
{ id: "mouth", photo: h(c, m) }
|
|
1254
|
+
];
|
|
1255
|
+
}
|
|
1256
|
+
function go() {
|
|
1257
|
+
return typeof navigator < "u" && typeof navigator.mediaDevices < "u" && typeof navigator.mediaDevices.getUserMedia == "function";
|
|
1258
|
+
}
|
|
1259
|
+
function yo(n) {
|
|
1260
|
+
const r = n instanceof Error ? n.name : "";
|
|
1261
|
+
return r === "NotAllowedError" || r === "SecurityError" ? "permission-denied" : r === "NotFoundError" || r === "OverconstrainedError" ? "no-camera" : r === "NotReadableError" || r === "AbortError" ? "not-readable" : "capture-failed";
|
|
1262
|
+
}
|
|
1263
|
+
const xo = {
|
|
1264
|
+
"permission-denied": "faceScheme.capture.error.permissionDenied",
|
|
1265
|
+
"no-camera": "faceScheme.capture.error.noCamera",
|
|
1266
|
+
"not-readable": "faceScheme.capture.error.notReadable",
|
|
1267
|
+
"insecure-context": "faceScheme.capture.error.insecureContext",
|
|
1268
|
+
"capture-failed": "faceScheme.capture.error.captureFailed"
|
|
1269
|
+
}, Pe = {
|
|
1270
|
+
neutral: "ds:[fill:var(--muted-foreground)]",
|
|
1271
|
+
info: "ds:[fill:var(--info)]",
|
|
1272
|
+
success: "ds:[fill:var(--success)]",
|
|
1273
|
+
warning: "ds:[fill:var(--warning)]",
|
|
1274
|
+
error: "ds:[fill:var(--destructive)]",
|
|
1275
|
+
accent: "ds:[fill:var(--accent)]"
|
|
1276
|
+
}, Lt = {
|
|
1277
|
+
neutral: "ds:[stroke:var(--muted-foreground)]",
|
|
1278
|
+
info: "ds:[stroke:var(--info)]",
|
|
1279
|
+
success: "ds:[stroke:var(--success)]",
|
|
1280
|
+
warning: "ds:[stroke:var(--warning)]",
|
|
1281
|
+
error: "ds:[stroke:var(--destructive)]",
|
|
1282
|
+
accent: "ds:[stroke:var(--accent)]"
|
|
1283
|
+
}, vo = 13, wo = 5, ko = 24, Rt = 5, bo = 26, Zr = 30, $t = 14, Or = [], Pr = "__draft__", Dr = [
|
|
1284
|
+
"profile-left",
|
|
1285
|
+
"front",
|
|
1286
|
+
"profile-right"
|
|
1287
|
+
], Co = {
|
|
1288
|
+
"profile-left": /* @__PURE__ */ a(Tr, { "aria-hidden": "true" }),
|
|
1289
|
+
front: /* @__PURE__ */ a(Es, { "aria-hidden": "true" }),
|
|
1290
|
+
"profile-right": /* @__PURE__ */ a(Tr, { "aria-hidden": "true", className: "ds:-scale-x-100" })
|
|
1291
|
+
}, So = {
|
|
1292
|
+
select: bs,
|
|
1293
|
+
marker: ls,
|
|
1294
|
+
pen: Ss,
|
|
1295
|
+
highlighter: cs,
|
|
1296
|
+
arrow: as,
|
|
1297
|
+
line: ws,
|
|
1298
|
+
rect: os,
|
|
1299
|
+
ellipse: ss,
|
|
1300
|
+
text: is
|
|
1301
|
+
}, Mo = [
|
|
1302
|
+
"accent",
|
|
1303
|
+
"info",
|
|
1304
|
+
"success",
|
|
1305
|
+
"warning",
|
|
1306
|
+
"error",
|
|
1307
|
+
"neutral"
|
|
1308
|
+
], Br = Xi(
|
|
1309
|
+
[
|
|
1310
|
+
"ds:[vector-effect:non-scaling-stroke]",
|
|
1311
|
+
"ds:transition-[fill-opacity,stroke-opacity] ds:[transition-duration:var(--animation-duration)]",
|
|
1312
|
+
"ds:[fill:transparent] ds:[stroke:var(--accent)] ds:[stroke-width:1] ds:[stroke-opacity:0.35]"
|
|
1313
|
+
].join(" "),
|
|
1314
|
+
{
|
|
1315
|
+
variants: {
|
|
1316
|
+
interactive: { true: "ds:cursor-pointer", false: "" },
|
|
1317
|
+
marked: { true: "", false: "" },
|
|
1318
|
+
selected: { true: "", false: "" }
|
|
1319
|
+
},
|
|
1320
|
+
compoundVariants: [
|
|
1321
|
+
{
|
|
1322
|
+
marked: !1,
|
|
1323
|
+
interactive: !0,
|
|
1324
|
+
class: "ds:hover:[fill:var(--accent)] ds:hover:[fill-opacity:0.14] ds:hover:[stroke-opacity:1]"
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
marked: !0,
|
|
1328
|
+
class: "ds:[fill:var(--accent)] ds:[fill-opacity:0.18] ds:[stroke-opacity:1]"
|
|
1329
|
+
},
|
|
1330
|
+
// Multi-select membership — a heavier outline than the marked tint so the
|
|
1331
|
+
// two states read apart even when they coincide on one zone.
|
|
1332
|
+
{
|
|
1333
|
+
selected: !0,
|
|
1334
|
+
class: "ds:[fill:var(--accent)] ds:[fill-opacity:0.16] ds:[stroke-opacity:0.9] ds:[stroke-width:2] ds:forced-colors:[stroke:Highlight]"
|
|
1335
|
+
}
|
|
1336
|
+
],
|
|
1337
|
+
defaultVariants: { interactive: !1, marked: !1, selected: !1 }
|
|
1338
|
+
}
|
|
1339
|
+
), No = {
|
|
1340
|
+
scaleX: { min: 0.3, max: 1.8, step: 0.01 },
|
|
1341
|
+
scaleY: { min: 0.3, max: 1.8, step: 0.01 },
|
|
1342
|
+
rotation: { min: -20, max: 20, step: 0.5 },
|
|
1343
|
+
shear: { min: -20, max: 20, step: 0.5 },
|
|
1344
|
+
translateX: { min: -240, max: 240, step: 1 },
|
|
1345
|
+
translateY: { min: -240, max: 240, step: 1 }
|
|
1346
|
+
}, Io = [
|
|
1347
|
+
"scaleX",
|
|
1348
|
+
"scaleY",
|
|
1349
|
+
"rotation",
|
|
1350
|
+
"shear",
|
|
1351
|
+
"translateX",
|
|
1352
|
+
"translateY"
|
|
1353
|
+
], Ao = Vi(
|
|
1354
|
+
({
|
|
1355
|
+
id: n,
|
|
1356
|
+
patientPhoto: r,
|
|
1357
|
+
viewPhotos: o,
|
|
1358
|
+
view: l,
|
|
1359
|
+
defaultView: d = "front",
|
|
1360
|
+
onViewChange: c,
|
|
1361
|
+
showViewSwitcher: m = !0,
|
|
1362
|
+
defaultLayout: h = "single",
|
|
1363
|
+
mode: p = "interactive",
|
|
1364
|
+
value: y,
|
|
1365
|
+
defaultValue: S,
|
|
1366
|
+
onChange: b,
|
|
1367
|
+
onSelectZone: v,
|
|
1368
|
+
activeFinding: k,
|
|
1369
|
+
zoneSelect: w = "off",
|
|
1370
|
+
selectedZones: L,
|
|
1371
|
+
defaultSelectedZones: X,
|
|
1372
|
+
onSelectedZonesChange: $,
|
|
1373
|
+
annotations: I,
|
|
1374
|
+
defaultAnnotations: R,
|
|
1375
|
+
onAnnotationsChange: H,
|
|
1376
|
+
onAnnotationSelect: q,
|
|
1377
|
+
showAnnotationToolbar: pe = !0,
|
|
1378
|
+
zoomable: re = !1,
|
|
1379
|
+
defaultPanelOpen: Ce = !0,
|
|
1380
|
+
activeTool: le,
|
|
1381
|
+
defaultTool: ge = null,
|
|
1382
|
+
onToolChange: ye,
|
|
1383
|
+
defaultAnnotationShape: ie = "circle",
|
|
1384
|
+
defaultAnnotationColor: E = "accent",
|
|
1385
|
+
registration: D,
|
|
1386
|
+
defaultRegistration: Ur,
|
|
1387
|
+
onRegistrationChange: ot,
|
|
1388
|
+
registrationMode: Yr = "off",
|
|
1389
|
+
autoDetect: je,
|
|
1390
|
+
onDetectStatus: at,
|
|
1391
|
+
allowCapture: Kt = !1,
|
|
1392
|
+
captureFacingMode: Zt = "user",
|
|
1393
|
+
onCapture: ct,
|
|
1394
|
+
legend: In = !1,
|
|
1395
|
+
ariaLabel: Xr,
|
|
1396
|
+
className: qr
|
|
1397
|
+
}, Gr) => {
|
|
1398
|
+
const { t: f } = qi(), G = Ui(), lt = n ?? G, An = N(null), dt = N(null), ut = N(null), We = N(null), Tn = N(null), _n = N(null), Ot = N(!1), Pt = l !== void 0, [Jr, Qr] = T(
|
|
1399
|
+
l ?? d
|
|
1400
|
+
), A = Pt ? l : Jr, K = N(A);
|
|
1401
|
+
K.current = A;
|
|
1402
|
+
const ft = g(
|
|
1403
|
+
(e) => {
|
|
1404
|
+
Pt || Qr(e), c == null || c(e);
|
|
1405
|
+
},
|
|
1406
|
+
[Pt, c]
|
|
1407
|
+
), [Dt, ht] = T(Ce), En = `${G}-panel`, [mt, zn] = T(h), [Ln, ei] = T(!0), M = Sn[A], [, , B, se] = M.viewBox.split(" ").map(Number), z = p === "interactive", Se = z && Yr === "adjust", Bt = y !== void 0, [ti, ni] = T(S ?? {}), He = Bt ? y : ti, j = N(He);
|
|
1408
|
+
j.current = He;
|
|
1409
|
+
const oe = g(
|
|
1410
|
+
(e) => {
|
|
1411
|
+
Bt || ni(e), b == null || b(e);
|
|
1412
|
+
},
|
|
1413
|
+
[Bt, b]
|
|
1414
|
+
), pt = g(
|
|
1415
|
+
(e, t, i) => {
|
|
1416
|
+
const s = j.current[e] ?? [];
|
|
1417
|
+
s.some((u) => u.type === t) || oe({
|
|
1418
|
+
...j.current,
|
|
1419
|
+
[e]: [...s, { type: t, note: i }]
|
|
1420
|
+
});
|
|
1421
|
+
},
|
|
1422
|
+
[oe]
|
|
1423
|
+
), gt = g(
|
|
1424
|
+
(e, t) => {
|
|
1425
|
+
const s = (j.current[e] ?? []).filter((x) => x.type !== t), u = { ...j.current };
|
|
1426
|
+
s.length > 0 ? u[e] = s : delete u[e], oe(u);
|
|
1427
|
+
},
|
|
1428
|
+
[oe]
|
|
1429
|
+
), Rn = g(
|
|
1430
|
+
(e, t) => {
|
|
1431
|
+
(j.current[e] ?? []).some(
|
|
1432
|
+
(s) => s.type === t
|
|
1433
|
+
) ? gt(e, t) : pt(e, t);
|
|
1434
|
+
},
|
|
1435
|
+
[pt, gt]
|
|
1436
|
+
), J = z && w === "multi", yt = L !== void 0, [ri, ii] = T(
|
|
1437
|
+
X ?? []
|
|
1438
|
+
), V = yt ? L : ri, de = N(V);
|
|
1439
|
+
de.current = V;
|
|
1440
|
+
const $n = xn(
|
|
1441
|
+
() => new Set(V),
|
|
1442
|
+
[V]
|
|
1443
|
+
), Ee = g(
|
|
1444
|
+
(e) => {
|
|
1445
|
+
yt || (de.current = e), yt || ii(e), $ == null || $(e);
|
|
1446
|
+
},
|
|
1447
|
+
[yt, $]
|
|
1448
|
+
), Fn = g(
|
|
1449
|
+
(e) => {
|
|
1450
|
+
const t = de.current;
|
|
1451
|
+
Ee(
|
|
1452
|
+
t.includes(e) ? t.filter((i) => i !== e) : [...t, e]
|
|
1453
|
+
);
|
|
1454
|
+
},
|
|
1455
|
+
[Ee]
|
|
1456
|
+
), Ve = g(() => {
|
|
1457
|
+
de.current.length > 0 && Ee([]);
|
|
1458
|
+
}, [Ee]), [Kn, Zn] = T(""), xt = g(
|
|
1459
|
+
(e, t, i) => {
|
|
1460
|
+
const s = { ...j.current };
|
|
1461
|
+
let u = !1;
|
|
1462
|
+
for (const x of e) {
|
|
1463
|
+
const Y = s[x] ?? [];
|
|
1464
|
+
Y.some((_) => _.type === t) || (s[x] = [...Y, { type: t, note: i }], u = !0);
|
|
1465
|
+
}
|
|
1466
|
+
u && oe(s);
|
|
1467
|
+
},
|
|
1468
|
+
[oe]
|
|
1469
|
+
), jt = g(
|
|
1470
|
+
(e, t) => {
|
|
1471
|
+
const i = { ...j.current };
|
|
1472
|
+
let s = !1;
|
|
1473
|
+
for (const u of e) {
|
|
1474
|
+
const x = i[u] ?? [];
|
|
1475
|
+
if (!x.some((_) => _.type === t)) continue;
|
|
1476
|
+
const Y = x.filter((_) => _.type !== t);
|
|
1477
|
+
Y.length > 0 ? i[u] = Y : delete i[u], s = !0;
|
|
1478
|
+
}
|
|
1479
|
+
s && oe(i);
|
|
1480
|
+
},
|
|
1481
|
+
[oe]
|
|
1482
|
+
), Wt = D !== void 0, [si, oi] = T(
|
|
1483
|
+
Ur ?? {}
|
|
1484
|
+
), vt = Wt ? D : si, Q = vt[A] ?? De, Ht = N(Q);
|
|
1485
|
+
Ht.current = Q;
|
|
1486
|
+
const On = N(vt);
|
|
1487
|
+
On.current = vt;
|
|
1488
|
+
const ae = g(
|
|
1489
|
+
(e) => {
|
|
1490
|
+
const t = { ...On.current, [A]: e };
|
|
1491
|
+
Wt || oi(t), ot == null || ot(t);
|
|
1492
|
+
},
|
|
1493
|
+
[Wt, ot, A]
|
|
1494
|
+
), Vt = xn(
|
|
1495
|
+
() => mo(Q, M.pivot),
|
|
1496
|
+
[Q, M.pivot]
|
|
1497
|
+
), ce = g(
|
|
1498
|
+
(e) => M.mirror ? { x: B - e.x, y: e.y } : e,
|
|
1499
|
+
[M.mirror, B]
|
|
1500
|
+
), [Ut, Pn] = T(
|
|
1501
|
+
() => M.landmarks.map((e) => ce(rt(Q, e)))
|
|
1502
|
+
), wt = N(null), [ai, Dn] = T(null), Bn = N(null), [xe, Me] = T(it), Yt = N(xe);
|
|
1503
|
+
Yt.current = xe;
|
|
1504
|
+
const kt = N(M.viewBox), ze = N(null);
|
|
1505
|
+
ne(() => {
|
|
1506
|
+
wt.current === null && Pn(
|
|
1507
|
+
M.landmarks.map((e) => ce(rt(Q, e)))
|
|
1508
|
+
);
|
|
1509
|
+
}, [Q, M.landmarks, ce]);
|
|
1510
|
+
const bt = g(
|
|
1511
|
+
(e) => {
|
|
1512
|
+
const t = [], i = [];
|
|
1513
|
+
for (const s of e) {
|
|
1514
|
+
const u = M.landmarks.find((x) => x.id === s.id);
|
|
1515
|
+
u && (t.push({ x: u.x, y: u.y }), i.push(ce(s.photo)));
|
|
1516
|
+
}
|
|
1517
|
+
t.length >= 3 && ae(Kr(t, i));
|
|
1518
|
+
},
|
|
1519
|
+
[ae, M.landmarks, ce]
|
|
1520
|
+
), ve = g(
|
|
1521
|
+
(e, t) => {
|
|
1522
|
+
const i = dt.current;
|
|
1523
|
+
if (!i) return { x: 0, y: 0 };
|
|
1524
|
+
const s = i.createSVGPoint();
|
|
1525
|
+
s.x = e, s.y = t;
|
|
1526
|
+
const u = i.getScreenCTM();
|
|
1527
|
+
if (!u) return { x: 0, y: 0 };
|
|
1528
|
+
const x = s.matrixTransform(u.inverse());
|
|
1529
|
+
return { x: x.x, y: x.y };
|
|
1530
|
+
},
|
|
1531
|
+
[]
|
|
1532
|
+
), jn = (e, t) => {
|
|
1533
|
+
const i = zt(kt.current), s = st(i, e);
|
|
1534
|
+
return Fr(
|
|
1535
|
+
i,
|
|
1536
|
+
e,
|
|
1537
|
+
{ x: s.x + s.width / 2, y: s.y + s.height / 2 },
|
|
1538
|
+
t
|
|
1539
|
+
);
|
|
1540
|
+
}, Xt = N(jn);
|
|
1541
|
+
Xt.current = jn;
|
|
1542
|
+
const Wn = g((e) => {
|
|
1543
|
+
Me((t) => Xt.current(t, e));
|
|
1544
|
+
}, []), Hn = g((e) => {
|
|
1545
|
+
Me(
|
|
1546
|
+
(t) => Xt.current(
|
|
1547
|
+
t,
|
|
1548
|
+
Number.isFinite(e) && e > 0 ? e / t.k : 1
|
|
1549
|
+
)
|
|
1550
|
+
);
|
|
1551
|
+
}, []), qt = g(() => Me(it), []), Vn = g((e) => {
|
|
1552
|
+
if (!(!ze.current || ze.current.id !== e.pointerId)) {
|
|
1553
|
+
ze.current = null;
|
|
1554
|
+
try {
|
|
1555
|
+
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
1556
|
+
} catch {
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
}, []), ci = g(
|
|
1560
|
+
(e) => (t) => {
|
|
1561
|
+
wt.current = e, Dn(Bn.current), t.currentTarget.setPointerCapture(t.pointerId);
|
|
1562
|
+
},
|
|
1563
|
+
[]
|
|
1564
|
+
), li = g(
|
|
1565
|
+
(e) => {
|
|
1566
|
+
const t = wt.current;
|
|
1567
|
+
if (t === null) return;
|
|
1568
|
+
const i = ve(e.clientX, e.clientY), s = Ut.map((x, Y) => Y === t ? i : x);
|
|
1569
|
+
Pn(s);
|
|
1570
|
+
const u = M.landmarks.map((x) => ({ x: x.x, y: x.y }));
|
|
1571
|
+
ae(Kr(u, s.map(ce)));
|
|
1572
|
+
},
|
|
1573
|
+
[Ut, ve, M.landmarks, ae, ce]
|
|
1574
|
+
), di = g(() => {
|
|
1575
|
+
wt.current = null, Dn(null);
|
|
1576
|
+
}, []), [Ue, ue] = T("idle"), [Un, Le] = T(
|
|
1577
|
+
null
|
|
1578
|
+
), [Yn, ui] = T({}), Ne = (o == null ? void 0 : o[A]) ?? (A === "front" ? r : void 0), ee = Yn[A] ?? (Ne == null ? void 0 : Ne.src), Gt = I !== void 0, [fi, hi] = T(R ?? {}), Ct = Gt ? I : fi, W = N(Ct);
|
|
1579
|
+
W.current = Ct;
|
|
1580
|
+
const Ie = Ct[A] ?? Or, Z = g(
|
|
1581
|
+
(e) => {
|
|
1582
|
+
const t = { ...W.current };
|
|
1583
|
+
e.length > 0 ? t[K.current] = e : delete t[K.current], W.current = t, Gt || hi(t), H == null || H(t);
|
|
1584
|
+
},
|
|
1585
|
+
[Gt, H]
|
|
1586
|
+
), mi = N(0), Xn = g(
|
|
1587
|
+
() => `${lt}-a${mi.current += 1}`,
|
|
1588
|
+
[lt]
|
|
1589
|
+
), [Ae, pi] = T(null), te = N(null);
|
|
1590
|
+
te.current = Ae;
|
|
1591
|
+
const O = g(
|
|
1592
|
+
(e) => {
|
|
1593
|
+
te.current !== e && (te.current = e, pi(e), q == null || q(e));
|
|
1594
|
+
},
|
|
1595
|
+
[q]
|
|
1596
|
+
), qn = g(
|
|
1597
|
+
(e) => {
|
|
1598
|
+
const t = dt.current;
|
|
1599
|
+
if (!t) return null;
|
|
1600
|
+
const i = rt(
|
|
1601
|
+
ao(Ht.current),
|
|
1602
|
+
ce(e)
|
|
1603
|
+
), s = t.querySelectorAll(
|
|
1604
|
+
"[data-zone] > path:first-of-type"
|
|
1605
|
+
);
|
|
1606
|
+
if (s.length === 0 || typeof s[0].isPointInFill != "function")
|
|
1607
|
+
return null;
|
|
1608
|
+
for (let u = s.length - 1; u >= 0; u -= 1)
|
|
1609
|
+
if (s[u].isPointInFill({ x: i.x, y: i.y })) {
|
|
1610
|
+
const x = s[u].closest("[data-zone]");
|
|
1611
|
+
return (x == null ? void 0 : x.getAttribute("data-zone")) ?? null;
|
|
1612
|
+
}
|
|
1613
|
+
return null;
|
|
1614
|
+
},
|
|
1615
|
+
[ce]
|
|
1616
|
+
), Te = g(
|
|
1617
|
+
(e) => {
|
|
1618
|
+
const t = e.id ?? Xn(), i = { ...e, id: t }, s = i.zoneId === void 0 ? { ...i, zoneId: qn(io(i)) } : i, u = W.current[K.current] ?? [];
|
|
1619
|
+
return Z([...u, s]), O(t), t;
|
|
1620
|
+
},
|
|
1621
|
+
[Z, Xn, O, qn]
|
|
1622
|
+
), St = g(
|
|
1623
|
+
(e) => {
|
|
1624
|
+
const t = W.current[K.current] ?? [];
|
|
1625
|
+
t.some((i) => i.id === e) && Z(t.filter((i) => i.id !== e));
|
|
1626
|
+
},
|
|
1627
|
+
[Z]
|
|
1628
|
+
), Jt = g(
|
|
1629
|
+
(e, t) => {
|
|
1630
|
+
const i = W.current[K.current] ?? [];
|
|
1631
|
+
i.some((s) => s.id === e) && Z(
|
|
1632
|
+
i.map((s) => s.id === e ? { ...s, zoneId: t } : s)
|
|
1633
|
+
);
|
|
1634
|
+
},
|
|
1635
|
+
[Z]
|
|
1636
|
+
), Qt = g(() => {
|
|
1637
|
+
const e = W.current[K.current] ?? [];
|
|
1638
|
+
e.length > 0 && Z(e.slice(0, -1));
|
|
1639
|
+
}, [Z]), en = g(() => {
|
|
1640
|
+
(W.current[K.current] ?? []).length > 0 && Z([]);
|
|
1641
|
+
}, [Z]), tn = le !== void 0, [gi, yi] = T(
|
|
1642
|
+
ge
|
|
1643
|
+
), U = z ? (tn ? le : gi) ?? null : null, nn = N(U);
|
|
1644
|
+
nn.current = U;
|
|
1645
|
+
const rn = g(
|
|
1646
|
+
(e) => {
|
|
1647
|
+
tn || yi(e), ye == null || ye(e);
|
|
1648
|
+
},
|
|
1649
|
+
[tn, ye]
|
|
1650
|
+
), [sn, xi] = T(
|
|
1651
|
+
ie
|
|
1652
|
+
), [on, vi] = T(E), Gn = N(sn);
|
|
1653
|
+
Gn.current = sn;
|
|
1654
|
+
const Ye = N(on);
|
|
1655
|
+
Ye.current = on;
|
|
1656
|
+
const [an, Mt] = T(null), Jn = N(null);
|
|
1657
|
+
Jn.current = an;
|
|
1658
|
+
const Nt = N(!1), [Xe, It] = T(null), cn = N(null);
|
|
1659
|
+
cn.current = Xe, ne(() => {
|
|
1660
|
+
Xe !== null && ht(!0);
|
|
1661
|
+
}, [Xe]), ne(() => {
|
|
1662
|
+
Ae !== null && ht(!0);
|
|
1663
|
+
}, [Ae]);
|
|
1664
|
+
const Qn = N(V.length);
|
|
1665
|
+
ne(() => {
|
|
1666
|
+
Qn.current === 0 && V.length > 0 && ht(!0), Qn.current = V.length;
|
|
1667
|
+
}, [V.length]);
|
|
1668
|
+
const er = N(U), tr = N(A);
|
|
1669
|
+
ne(() => {
|
|
1670
|
+
(er.current !== U || tr.current !== A) && (er.current = U, tr.current = A, O(null));
|
|
1671
|
+
}, [U, A, O]), ne(() => {
|
|
1672
|
+
const e = te.current;
|
|
1673
|
+
e !== null && !Ie.some((t) => t.id === e) && O(null);
|
|
1674
|
+
}, [Ie, O]);
|
|
1675
|
+
const qe = U !== null, wi = g(
|
|
1676
|
+
(e) => {
|
|
1677
|
+
var s, u;
|
|
1678
|
+
const t = nn.current;
|
|
1679
|
+
if (!t) return;
|
|
1680
|
+
e.stopPropagation();
|
|
1681
|
+
const i = ve(e.clientX, e.clientY);
|
|
1682
|
+
if (t === "marker") {
|
|
1683
|
+
Te({
|
|
1684
|
+
kind: "marker",
|
|
1685
|
+
x: i.x,
|
|
1686
|
+
y: i.y,
|
|
1687
|
+
shape: Gn.current,
|
|
1688
|
+
tone: Ye.current
|
|
1689
|
+
});
|
|
1690
|
+
return;
|
|
1691
|
+
}
|
|
1692
|
+
if (t === "text") {
|
|
1693
|
+
const x = Te({
|
|
1694
|
+
kind: "text",
|
|
1695
|
+
x: i.x,
|
|
1696
|
+
y: i.y,
|
|
1697
|
+
text: "",
|
|
1698
|
+
tone: Ye.current
|
|
1699
|
+
});
|
|
1700
|
+
It(x);
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
(u = (s = e.currentTarget).setPointerCapture) == null || u.call(s, e.pointerId), Nt.current = !0, t === "pen" || t === "highlighter" ? Mt({
|
|
1704
|
+
id: Pr,
|
|
1705
|
+
kind: t,
|
|
1706
|
+
points: [i],
|
|
1707
|
+
tone: Ye.current
|
|
1708
|
+
}) : (t === "arrow" || t === "line" || t === "rect" || t === "ellipse") && Mt({
|
|
1709
|
+
id: Pr,
|
|
1710
|
+
kind: t,
|
|
1711
|
+
from: i,
|
|
1712
|
+
to: i,
|
|
1713
|
+
tone: Ye.current
|
|
1714
|
+
});
|
|
1715
|
+
},
|
|
1716
|
+
[ve, Te]
|
|
1717
|
+
), ki = g(
|
|
1718
|
+
(e) => {
|
|
1719
|
+
if (!Nt.current) return;
|
|
1720
|
+
const t = ve(e.clientX, e.clientY);
|
|
1721
|
+
Mt((i) => i && (i.kind === "pen" || i.kind === "highlighter" ? { ...i, points: [...i.points, t] } : i.kind === "arrow" || i.kind === "line" || i.kind === "rect" || i.kind === "ellipse" ? { ...i, to: t } : i));
|
|
1722
|
+
},
|
|
1723
|
+
[ve]
|
|
1724
|
+
), nr = g(
|
|
1725
|
+
(e) => {
|
|
1726
|
+
var u, x;
|
|
1727
|
+
if (!Nt.current) return;
|
|
1728
|
+
Nt.current = !1, (x = (u = e.currentTarget).releasePointerCapture) == null || x.call(u, e.pointerId);
|
|
1729
|
+
const t = Jn.current;
|
|
1730
|
+
if (Mt(null), !t) return;
|
|
1731
|
+
if (t.kind === "pen" || t.kind === "highlighter") {
|
|
1732
|
+
if (t.points.length < 2) return;
|
|
1733
|
+
} else if ((t.kind === "arrow" || t.kind === "line" || t.kind === "rect" || t.kind === "ellipse") && Math.hypot(t.to.x - t.from.x, t.to.y - t.from.y) < 4)
|
|
1734
|
+
return;
|
|
1735
|
+
const { id: i, ...s } = t;
|
|
1736
|
+
Te(s);
|
|
1737
|
+
},
|
|
1738
|
+
[Te]
|
|
1739
|
+
), ln = Xe ? Ie.find((e) => e.id === Xe && e.kind === "text") : void 0, bi = g(
|
|
1740
|
+
(e) => {
|
|
1741
|
+
const t = cn.current;
|
|
1742
|
+
if (!t) return;
|
|
1743
|
+
const i = W.current[K.current] ?? [];
|
|
1744
|
+
Z(
|
|
1745
|
+
i.map(
|
|
1746
|
+
(s) => s.id === t && s.kind === "text" ? { ...s, text: e } : s
|
|
1747
|
+
)
|
|
1748
|
+
);
|
|
1749
|
+
},
|
|
1750
|
+
[Z]
|
|
1751
|
+
), rr = g(() => {
|
|
1752
|
+
const e = cn.current;
|
|
1753
|
+
if (It(null), !e) return;
|
|
1754
|
+
const t = W.current[K.current] ?? [], i = t.find((s) => s.id === e);
|
|
1755
|
+
i && i.kind === "text" && i.text.trim() === "" && Z(t.filter((s) => s.id !== e));
|
|
1756
|
+
}, [Z]), Re = g(() => {
|
|
1757
|
+
var t;
|
|
1758
|
+
(t = We.current) == null || t.getTracks().forEach((i) => i.stop()), We.current = null;
|
|
1759
|
+
const e = ut.current;
|
|
1760
|
+
e && (e.srcObject = null);
|
|
1761
|
+
}, []), dn = g(() => {
|
|
1762
|
+
Re(), ue("idle");
|
|
1763
|
+
}, [Re]), un = g(async () => {
|
|
1764
|
+
var e;
|
|
1765
|
+
if (Kt) {
|
|
1766
|
+
if (!go()) {
|
|
1767
|
+
Le("insecure-context"), ue("error");
|
|
1768
|
+
return;
|
|
1769
|
+
}
|
|
1770
|
+
Le(null), ue("requesting");
|
|
1771
|
+
try {
|
|
1772
|
+
const t = await navigator.mediaDevices.getUserMedia({
|
|
1773
|
+
video: { facingMode: Zt },
|
|
1774
|
+
audio: !1
|
|
1775
|
+
});
|
|
1776
|
+
if (Ot.current) {
|
|
1777
|
+
t.getTracks().forEach((s) => s.stop());
|
|
1778
|
+
return;
|
|
1779
|
+
}
|
|
1780
|
+
We.current = t;
|
|
1781
|
+
const i = ut.current;
|
|
1782
|
+
if (i) {
|
|
1783
|
+
try {
|
|
1784
|
+
i.srcObject = t;
|
|
1785
|
+
} catch {
|
|
1786
|
+
}
|
|
1787
|
+
const s = (e = i.play) == null ? void 0 : e.call(i);
|
|
1788
|
+
s && typeof s.catch == "function" && s.catch(() => {
|
|
1789
|
+
});
|
|
1790
|
+
}
|
|
1791
|
+
ue("streaming");
|
|
1792
|
+
} catch (t) {
|
|
1793
|
+
Re(), Le(yo(t)), ue("error");
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
}, [Kt, Zt, Re]), Ge = g(
|
|
1797
|
+
(e, t, i) => {
|
|
1798
|
+
ui((s) => ({ ...s, [A]: e })), ct == null || ct({ src: e, width: t, height: i, view: A });
|
|
1799
|
+
},
|
|
1800
|
+
[ct, A]
|
|
1801
|
+
), Ci = g(() => {
|
|
1802
|
+
const e = ut.current, t = (e == null ? void 0 : e.videoWidth) || (e == null ? void 0 : e.clientWidth) || 0, i = (e == null ? void 0 : e.videoHeight) || (e == null ? void 0 : e.clientHeight) || 0;
|
|
1803
|
+
if (!e || e.readyState < 2 || t === 0 || i === 0) {
|
|
1804
|
+
Le("capture-failed"), ue("error");
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
const s = document.createElement("canvas");
|
|
1808
|
+
s.width = t, s.height = i;
|
|
1809
|
+
const u = s.getContext("2d");
|
|
1810
|
+
if (!u) {
|
|
1811
|
+
Le("capture-failed"), ue("error");
|
|
1812
|
+
return;
|
|
1813
|
+
}
|
|
1814
|
+
try {
|
|
1815
|
+
u.drawImage(e, 0, 0, t, i);
|
|
1816
|
+
} catch {
|
|
1817
|
+
Le("capture-failed"), ue("error");
|
|
1818
|
+
return;
|
|
1819
|
+
}
|
|
1820
|
+
Re(), Ge(s.toDataURL("image/jpeg", 0.92), t, i), ue("idle");
|
|
1821
|
+
}, [Re, Ge]), Si = g(
|
|
1822
|
+
(e) => {
|
|
1823
|
+
var s;
|
|
1824
|
+
const t = (s = e.target.files) == null ? void 0 : s[0];
|
|
1825
|
+
if (e.target.value = "", !t) return;
|
|
1826
|
+
const i = new FileReader();
|
|
1827
|
+
i.onload = () => {
|
|
1828
|
+
const u = typeof i.result == "string" ? i.result : "";
|
|
1829
|
+
if (!u) return;
|
|
1830
|
+
const x = new Image();
|
|
1831
|
+
x.onload = () => Ge(u, x.naturalWidth, x.naturalHeight), x.onerror = () => Ge(u, B, se), x.src = u;
|
|
1832
|
+
}, i.readAsDataURL(t);
|
|
1833
|
+
},
|
|
1834
|
+
[Ge, B, se]
|
|
1835
|
+
);
|
|
1836
|
+
ne(() => (Ot.current = !1, () => {
|
|
1837
|
+
var e;
|
|
1838
|
+
Ot.current = !0, (e = We.current) == null || e.getTracks().forEach((t) => t.stop()), We.current = null;
|
|
1839
|
+
}), []);
|
|
1840
|
+
const fe = Ue === "streaming", ir = N(!1);
|
|
1841
|
+
ne(() => {
|
|
1842
|
+
var e;
|
|
1843
|
+
ir.current && !fe && ((e = _n.current) == null || e.focus()), ir.current = fe;
|
|
1844
|
+
}, [fe]);
|
|
1845
|
+
const [At, Mi] = T("idle"), $e = g(
|
|
1846
|
+
(e) => {
|
|
1847
|
+
Mi(e), at == null || at(e);
|
|
1848
|
+
},
|
|
1849
|
+
[at]
|
|
1850
|
+
), fn = g(async () => {
|
|
1851
|
+
if (!je || !ee || M.landmarks.length === 0)
|
|
1852
|
+
return !1;
|
|
1853
|
+
const e = typeof je == "object" ? je : {}, t = (i) => $e(i === "detecting" ? "detecting" : "loading");
|
|
1854
|
+
try {
|
|
1855
|
+
$e("loading");
|
|
1856
|
+
let i;
|
|
1857
|
+
if (M.id === "front")
|
|
1858
|
+
i = await Ds(ee, {
|
|
1859
|
+
viewWidth: B,
|
|
1860
|
+
viewHeight: se,
|
|
1861
|
+
onStage: t,
|
|
1862
|
+
wasmBaseUrl: e.wasmBaseUrl,
|
|
1863
|
+
modelAssetPath: e.modelAssetPath
|
|
1864
|
+
});
|
|
1865
|
+
else {
|
|
1866
|
+
const s = await Gs(ee, {
|
|
1867
|
+
viewWidth: B,
|
|
1868
|
+
viewHeight: se,
|
|
1869
|
+
onStage: t,
|
|
1870
|
+
ortModuleUrl: e.ortModuleUrl,
|
|
1871
|
+
ortWasmBaseUrl: e.ortWasmBaseUrl,
|
|
1872
|
+
modelUrl: e.yunetModelUrl
|
|
1873
|
+
});
|
|
1874
|
+
i = s && po(s);
|
|
1875
|
+
}
|
|
1876
|
+
return !i || i.length < 3 ? ($e("no-face"), !1) : (bt(i), $e("done"), !0);
|
|
1877
|
+
} catch {
|
|
1878
|
+
return $e("error"), !1;
|
|
1879
|
+
}
|
|
1880
|
+
}, [
|
|
1881
|
+
je,
|
|
1882
|
+
ee,
|
|
1883
|
+
M.id,
|
|
1884
|
+
M.landmarks,
|
|
1885
|
+
B,
|
|
1886
|
+
se,
|
|
1887
|
+
$e,
|
|
1888
|
+
bt
|
|
1889
|
+
]), sr = g((e) => {
|
|
1890
|
+
var t, i;
|
|
1891
|
+
(i = (t = An.current) == null ? void 0 : t.querySelector(`[data-zone="${e}"]`)) == null || i.focus();
|
|
1892
|
+
}, []), hn = xn(
|
|
1893
|
+
() => ({
|
|
1894
|
+
focusZone: sr,
|
|
1895
|
+
getChart: () => j.current,
|
|
1896
|
+
getZone: (e) => j.current[e] ?? [],
|
|
1897
|
+
zonesWith: (e) => Object.entries(j.current).filter(([, t]) => t.some((i) => i.type === e)).map(([t]) => t),
|
|
1898
|
+
setFinding: pt,
|
|
1899
|
+
removeFinding: gt,
|
|
1900
|
+
clearZone: (e) => {
|
|
1901
|
+
if (!j.current[e]) return;
|
|
1902
|
+
const t = { ...j.current };
|
|
1903
|
+
delete t[e], oe(t);
|
|
1904
|
+
},
|
|
1905
|
+
getRegistration: () => Ht.current,
|
|
1906
|
+
setRegistration: (e) => ae(e),
|
|
1907
|
+
resetRegistration: () => ae(De),
|
|
1908
|
+
fitToLandmarks: bt,
|
|
1909
|
+
detect: fn,
|
|
1910
|
+
startCapture: () => void un(),
|
|
1911
|
+
cancelCapture: dn,
|
|
1912
|
+
getView: () => K.current,
|
|
1913
|
+
getZoom: () => Yt.current.k,
|
|
1914
|
+
setZoom: Hn,
|
|
1915
|
+
resetZoom: qt,
|
|
1916
|
+
setView: ft,
|
|
1917
|
+
getAnnotations: () => W.current[K.current] ?? [],
|
|
1918
|
+
addAnnotation: Te,
|
|
1919
|
+
removeAnnotation: St,
|
|
1920
|
+
undoAnnotation: Qt,
|
|
1921
|
+
clearAnnotations: en,
|
|
1922
|
+
getTool: () => nn.current,
|
|
1923
|
+
setTool: rn,
|
|
1924
|
+
getSelectedAnnotation: () => {
|
|
1925
|
+
const e = te.current;
|
|
1926
|
+
if (e === null) return null;
|
|
1927
|
+
const t = (W.current[K.current] ?? []).find(
|
|
1928
|
+
(i) => i.id === e
|
|
1929
|
+
);
|
|
1930
|
+
return t ? { id: t.id, kind: t.kind } : null;
|
|
1931
|
+
},
|
|
1932
|
+
selectAnnotation: (e) => {
|
|
1933
|
+
if (e === null) {
|
|
1934
|
+
O(null);
|
|
1935
|
+
return;
|
|
1936
|
+
}
|
|
1937
|
+
(W.current[K.current] ?? []).some((i) => i.id === e) && O(e);
|
|
1938
|
+
},
|
|
1939
|
+
setAnnotationZone: Jt,
|
|
1940
|
+
getSelectedZones: () => de.current,
|
|
1941
|
+
setSelectedZones: (e) => Ee([...e]),
|
|
1942
|
+
clearZoneSelection: Ve,
|
|
1943
|
+
applyFindingToSelection: (e, t) => xt(de.current, e, t),
|
|
1944
|
+
removeFindingFromSelection: (e) => jt(de.current, e),
|
|
1945
|
+
setFindingBulk: xt
|
|
1946
|
+
}),
|
|
1947
|
+
[
|
|
1948
|
+
sr,
|
|
1949
|
+
pt,
|
|
1950
|
+
gt,
|
|
1951
|
+
oe,
|
|
1952
|
+
ae,
|
|
1953
|
+
bt,
|
|
1954
|
+
fn,
|
|
1955
|
+
un,
|
|
1956
|
+
dn,
|
|
1957
|
+
ft,
|
|
1958
|
+
Te,
|
|
1959
|
+
St,
|
|
1960
|
+
Qt,
|
|
1961
|
+
en,
|
|
1962
|
+
rn,
|
|
1963
|
+
O,
|
|
1964
|
+
Jt,
|
|
1965
|
+
Ee,
|
|
1966
|
+
Ve,
|
|
1967
|
+
xt,
|
|
1968
|
+
jt,
|
|
1969
|
+
Hn,
|
|
1970
|
+
qt
|
|
1971
|
+
]
|
|
1972
|
+
);
|
|
1973
|
+
Yi(Gr, () => hn, [hn]), Gi(Rs, hn, lt);
|
|
1974
|
+
const or = g(
|
|
1975
|
+
(e) => {
|
|
1976
|
+
const t = f(`faceScheme.zone.${e.labelKey}`), i = j.current[e.id] ?? [];
|
|
1977
|
+
if (i.length === 0) return t;
|
|
1978
|
+
const s = i.map((u) => f(`faceScheme.finding.${u.type}`)).join(", ");
|
|
1979
|
+
return f("faceScheme.zoneWithFindings", {
|
|
1980
|
+
zone: t,
|
|
1981
|
+
findings: s
|
|
1982
|
+
});
|
|
1983
|
+
},
|
|
1984
|
+
[f]
|
|
1985
|
+
), ar = g(
|
|
1986
|
+
(e) => {
|
|
1987
|
+
v == null || v(e.id), J ? Fn(e.id) : z && k && Rn(e.id, k);
|
|
1988
|
+
},
|
|
1989
|
+
[
|
|
1990
|
+
z,
|
|
1991
|
+
J,
|
|
1992
|
+
Fn,
|
|
1993
|
+
k,
|
|
1994
|
+
Rn,
|
|
1995
|
+
v
|
|
1996
|
+
]
|
|
1997
|
+
), Ni = Ne != null && Ne.altKey ? f(Ne.altKey) : f("faceScheme.photo.defaultAlt"), Ii = M.mirror ? `translate(${B} 0) scale(-1 1) ${Et(Q)}` : Et(Q), Ai = g(
|
|
1998
|
+
(e, t) => {
|
|
1999
|
+
ae(ho({ ...Vt, [e]: t }, M.pivot));
|
|
2000
|
+
},
|
|
2001
|
+
[ae, Vt, M.pivot]
|
|
2002
|
+
), cr = !!je && !!ee && M.landmarks.length > 0, mn = Kt, lr = m && eo.length > 1, Je = z && pe, he = z && re, pn = J || Je || Se || he, dr = Dt && pn, we = mt === "all" && lr;
|
|
2003
|
+
ne(() => {
|
|
2004
|
+
Me(it);
|
|
2005
|
+
}, [A, he]), ne(() => {
|
|
2006
|
+
fe && Me(it);
|
|
2007
|
+
}, [fe]), ne(() => {
|
|
2008
|
+
const e = dt.current;
|
|
2009
|
+
if (!e || !he) return;
|
|
2010
|
+
const t = (i) => {
|
|
2011
|
+
i.preventDefault();
|
|
2012
|
+
const s = ve(i.clientX, i.clientY);
|
|
2013
|
+
Me(
|
|
2014
|
+
(u) => Fr(
|
|
2015
|
+
zt(kt.current),
|
|
2016
|
+
u,
|
|
2017
|
+
s,
|
|
2018
|
+
i.deltaY < 0 ? 1.15 : 1 / 1.15
|
|
2019
|
+
)
|
|
2020
|
+
);
|
|
2021
|
+
};
|
|
2022
|
+
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
2023
|
+
}, [he, ve, we, A, fe]);
|
|
2024
|
+
const Qe = dr && !we, Ti = Qe ? "ds:flex ds:flex-col ds:gap-[var(--spacing-md)] ds:lg:flex-row ds:lg:items-stretch ds:lg:justify-center" : "ds:flex ds:flex-col ds:gap-[var(--spacing-md)]", _i = Qe ? "ds:flex ds:w-full ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-sm)] ds:lg:w-[28rem] ds:lg:shrink-0" : "ds:flex ds:w-full ds:min-w-0 ds:flex-col ds:gap-[var(--spacing-sm)]", Ei = Qe ? "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-md)] ds:lg:w-[28rem] ds:lg:shrink-0 ds:lg:self-stretch" : "ds:flex ds:w-full ds:flex-col ds:gap-[var(--spacing-md)]", zi = Qe ? "ds:lg:h-0 ds:lg:min-h-full" : void 0, Li = Qe ? "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:lg:min-h-0 ds:lg:flex-1 ds:lg:overflow-y-auto" : "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]", ur = lr, Ri = ur || mn || pn, fr = pn ? /* @__PURE__ */ a(
|
|
2025
|
+
Ze,
|
|
2026
|
+
{
|
|
2027
|
+
size: "sm",
|
|
2028
|
+
icon: /* @__PURE__ */ a(Ns, { "aria-hidden": "true" }),
|
|
2029
|
+
"aria-label": f("faceScheme.panel.toggle"),
|
|
2030
|
+
"aria-expanded": Dt,
|
|
2031
|
+
"aria-controls": Dt ? En : void 0,
|
|
2032
|
+
"data-overflow-pin": !0,
|
|
2033
|
+
onClick: () => ht((e) => !e)
|
|
2034
|
+
},
|
|
2035
|
+
"panel"
|
|
2036
|
+
) : null, $i = U ?? "select", hr = `${G}-draw`, mr = `${G}-fit`, pr = `${G}-zoom`, gr = `${G}-tools`, yr = `${G}-tones`, xr = `${G}-shapes`, Fi = `${G}-ann-zone`, et = Ae !== null ? Ie.find((e) => e.id === Ae) : void 0, Ki = M.zones.map((e) => ({
|
|
2037
|
+
value: e.id,
|
|
2038
|
+
label: f(`faceScheme.zone.${e.labelKey}`)
|
|
2039
|
+
})), me = "ds:text-[length:var(--font-size-xs)] ds:font-medium ds:text-[var(--muted-foreground)]", vr = `${G}-zones`, wr = `${G}-zones-apply`, Zi = J ? /* @__PURE__ */ C(
|
|
2040
|
+
"div",
|
|
2041
|
+
{
|
|
2042
|
+
"data-testid": "face-scheme-zones",
|
|
2043
|
+
role: "group",
|
|
2044
|
+
"aria-labelledby": vr,
|
|
2045
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
2046
|
+
children: [
|
|
2047
|
+
/* @__PURE__ */ a("span", { id: vr, className: me, children: f("faceScheme.zonesPanel.label") }),
|
|
2048
|
+
/* @__PURE__ */ a("p", { className: "ds:m-0 ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]", children: f("faceScheme.zonesPanel.hint") }),
|
|
2049
|
+
/* @__PURE__ */ a(
|
|
2050
|
+
"span",
|
|
2051
|
+
{
|
|
2052
|
+
"aria-live": "polite",
|
|
2053
|
+
className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--foreground)]",
|
|
2054
|
+
children: f("faceScheme.zonesPanel.selectedTotal", {
|
|
2055
|
+
n: V.length
|
|
2056
|
+
})
|
|
2057
|
+
}
|
|
2058
|
+
),
|
|
2059
|
+
/* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
2060
|
+
/* @__PURE__ */ a("span", { id: wr, className: me, children: f("faceScheme.zonesPanel.applyLabel") }),
|
|
2061
|
+
/* @__PURE__ */ a(
|
|
2062
|
+
"div",
|
|
2063
|
+
{
|
|
2064
|
+
role: "group",
|
|
2065
|
+
"aria-labelledby": wr,
|
|
2066
|
+
className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]",
|
|
2067
|
+
children: Rr.map((e) => {
|
|
2068
|
+
const t = _t[e], i = V.length > 0 && V.every(
|
|
2069
|
+
(s) => (He[s] ?? []).some((u) => u.type === e)
|
|
2070
|
+
);
|
|
2071
|
+
return /* @__PURE__ */ a(
|
|
2072
|
+
P,
|
|
2073
|
+
{
|
|
2074
|
+
size: "sm",
|
|
2075
|
+
intent: "outline",
|
|
2076
|
+
"aria-pressed": i,
|
|
2077
|
+
disabled: V.length === 0,
|
|
2078
|
+
startIcon: /* @__PURE__ */ a("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ a(
|
|
2079
|
+
"path",
|
|
2080
|
+
{
|
|
2081
|
+
d: tt(t.shape, 12, 12, 9),
|
|
2082
|
+
className: Pe[t.tone]
|
|
2083
|
+
}
|
|
2084
|
+
) }),
|
|
2085
|
+
onClick: () => {
|
|
2086
|
+
if (i)
|
|
2087
|
+
jt(de.current, e);
|
|
2088
|
+
else {
|
|
2089
|
+
const s = Kn.trim();
|
|
2090
|
+
xt(
|
|
2091
|
+
de.current,
|
|
2092
|
+
e,
|
|
2093
|
+
s === "" ? void 0 : s
|
|
2094
|
+
), Zn("");
|
|
2095
|
+
}
|
|
2096
|
+
},
|
|
2097
|
+
children: f(`faceScheme.finding.${e}`)
|
|
2098
|
+
},
|
|
2099
|
+
e
|
|
2100
|
+
);
|
|
2101
|
+
})
|
|
2102
|
+
}
|
|
2103
|
+
)
|
|
2104
|
+
] }),
|
|
2105
|
+
/* @__PURE__ */ a(
|
|
2106
|
+
Ar,
|
|
2107
|
+
{
|
|
2108
|
+
"aria-label": f("faceScheme.zonesPanel.noteLabel"),
|
|
2109
|
+
placeholder: f("faceScheme.zonesPanel.notePlaceholder"),
|
|
2110
|
+
value: Kn,
|
|
2111
|
+
onChange: (e) => Zn(e.target.value)
|
|
2112
|
+
}
|
|
2113
|
+
),
|
|
2114
|
+
/* @__PURE__ */ a(
|
|
2115
|
+
P,
|
|
2116
|
+
{
|
|
2117
|
+
size: "sm",
|
|
2118
|
+
intent: "outline",
|
|
2119
|
+
className: "ds:self-start",
|
|
2120
|
+
onClick: Ve,
|
|
2121
|
+
disabled: V.length === 0,
|
|
2122
|
+
children: f("faceScheme.zonesPanel.clearSelection")
|
|
2123
|
+
}
|
|
2124
|
+
)
|
|
2125
|
+
]
|
|
2126
|
+
}
|
|
2127
|
+
) : null, Oi = Je ? /* @__PURE__ */ C(
|
|
2128
|
+
"div",
|
|
2129
|
+
{
|
|
2130
|
+
"data-testid": "face-scheme-toolbar",
|
|
2131
|
+
role: "group",
|
|
2132
|
+
"aria-labelledby": hr,
|
|
2133
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
2134
|
+
children: [
|
|
2135
|
+
/* @__PURE__ */ a("span", { id: hr, className: me, children: f("faceScheme.panel.draw") }),
|
|
2136
|
+
/* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
2137
|
+
/* @__PURE__ */ a("span", { id: gr, className: me, children: f("faceScheme.annotate.toolLabel") }),
|
|
2138
|
+
/* @__PURE__ */ a(
|
|
2139
|
+
vn,
|
|
2140
|
+
{
|
|
2141
|
+
role: "radiogroup",
|
|
2142
|
+
mode: "toggle-single",
|
|
2143
|
+
size: "sm",
|
|
2144
|
+
"aria-labelledby": gr,
|
|
2145
|
+
className: "ds:self-start",
|
|
2146
|
+
value: $i,
|
|
2147
|
+
onValueChange: (e) => rn(e === "select" ? null : e),
|
|
2148
|
+
children: ["select", ...to].map(
|
|
2149
|
+
(e) => {
|
|
2150
|
+
const t = So[e];
|
|
2151
|
+
return /* @__PURE__ */ a(
|
|
2152
|
+
Ze,
|
|
2153
|
+
{
|
|
2154
|
+
value: e,
|
|
2155
|
+
icon: /* @__PURE__ */ a(t, { "aria-hidden": "true" }),
|
|
2156
|
+
"aria-label": f(`faceScheme.annotate.tool.${e}`)
|
|
2157
|
+
},
|
|
2158
|
+
e
|
|
2159
|
+
);
|
|
2160
|
+
}
|
|
2161
|
+
)
|
|
2162
|
+
}
|
|
2163
|
+
)
|
|
2164
|
+
] }),
|
|
2165
|
+
/* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
2166
|
+
/* @__PURE__ */ a("span", { id: yr, className: me, children: f("faceScheme.annotate.colorLabel") }),
|
|
2167
|
+
/* @__PURE__ */ a(
|
|
2168
|
+
vn,
|
|
2169
|
+
{
|
|
2170
|
+
role: "radiogroup",
|
|
2171
|
+
mode: "toggle-single",
|
|
2172
|
+
size: "sm",
|
|
2173
|
+
"aria-labelledby": yr,
|
|
2174
|
+
className: "ds:self-start",
|
|
2175
|
+
value: on,
|
|
2176
|
+
onValueChange: (e) => {
|
|
2177
|
+
const t = e;
|
|
2178
|
+
vi(t);
|
|
2179
|
+
const i = te.current;
|
|
2180
|
+
if (i !== null) {
|
|
2181
|
+
const s = W.current[K.current] ?? [];
|
|
2182
|
+
s.some((u) => u.id === i) && Z(
|
|
2183
|
+
s.map(
|
|
2184
|
+
(u) => u.id === i ? { ...u, tone: t } : u
|
|
2185
|
+
)
|
|
2186
|
+
);
|
|
2187
|
+
}
|
|
2188
|
+
},
|
|
2189
|
+
children: Mo.map((e) => /* @__PURE__ */ a(
|
|
2190
|
+
Ze,
|
|
2191
|
+
{
|
|
2192
|
+
value: e,
|
|
2193
|
+
icon: /* @__PURE__ */ a("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", children: /* @__PURE__ */ a(
|
|
2194
|
+
"circle",
|
|
2195
|
+
{
|
|
2196
|
+
cx: 8,
|
|
2197
|
+
cy: 8,
|
|
2198
|
+
r: 6,
|
|
2199
|
+
className: Pe[e]
|
|
2200
|
+
}
|
|
2201
|
+
) }),
|
|
2202
|
+
"aria-label": f(`faceScheme.annotate.tone.${e}`)
|
|
2203
|
+
},
|
|
2204
|
+
e
|
|
2205
|
+
))
|
|
2206
|
+
}
|
|
2207
|
+
)
|
|
2208
|
+
] }),
|
|
2209
|
+
U === "marker" && /* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
2210
|
+
/* @__PURE__ */ a("span", { id: xr, className: me, children: f("faceScheme.annotate.shapeLabel") }),
|
|
2211
|
+
/* @__PURE__ */ a(
|
|
2212
|
+
vn,
|
|
2213
|
+
{
|
|
2214
|
+
role: "radiogroup",
|
|
2215
|
+
mode: "toggle-single",
|
|
2216
|
+
size: "sm",
|
|
2217
|
+
"aria-labelledby": xr,
|
|
2218
|
+
className: "ds:self-start",
|
|
2219
|
+
value: sn,
|
|
2220
|
+
onValueChange: (e) => xi(e),
|
|
2221
|
+
children: Ji.map((e) => /* @__PURE__ */ a(
|
|
2222
|
+
Ze,
|
|
2223
|
+
{
|
|
2224
|
+
value: e,
|
|
2225
|
+
icon: /* @__PURE__ */ a("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ a(
|
|
2226
|
+
"path",
|
|
2227
|
+
{
|
|
2228
|
+
d: tt(e, 12, 12, 9),
|
|
2229
|
+
className: "ds:[fill:currentColor]"
|
|
2230
|
+
}
|
|
2231
|
+
) }),
|
|
2232
|
+
"aria-label": f(`annotationMarker.shape.${e}`)
|
|
2233
|
+
},
|
|
2234
|
+
e
|
|
2235
|
+
))
|
|
2236
|
+
}
|
|
2237
|
+
)
|
|
2238
|
+
] }),
|
|
2239
|
+
ln && ln.kind === "text" && /* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
2240
|
+
/* @__PURE__ */ a(
|
|
2241
|
+
Ar,
|
|
2242
|
+
{
|
|
2243
|
+
"aria-label": f("faceScheme.annotate.textLabel"),
|
|
2244
|
+
placeholder: f("faceScheme.annotate.textPlaceholder"),
|
|
2245
|
+
value: ln.text,
|
|
2246
|
+
autoFocus: !0,
|
|
2247
|
+
onChange: (e) => bi(e.target.value),
|
|
2248
|
+
onKeyDown: (e) => {
|
|
2249
|
+
(e.key === "Enter" || e.key === "Escape") && (e.preventDefault(), rr());
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
),
|
|
2253
|
+
/* @__PURE__ */ a(P, { size: "sm", intent: "primary", onClick: rr, children: f("faceScheme.annotate.textDone") })
|
|
2254
|
+
] }),
|
|
2255
|
+
et && /* @__PURE__ */ C("div", { className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]", children: [
|
|
2256
|
+
/* @__PURE__ */ a("span", { id: Fi, className: me, children: f("faceScheme.annotate.zoneLabel") }),
|
|
2257
|
+
/* @__PURE__ */ a(
|
|
2258
|
+
"span",
|
|
2259
|
+
{
|
|
2260
|
+
"aria-live": "polite",
|
|
2261
|
+
className: "ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)] ds:empty:hidden",
|
|
2262
|
+
children: et.zoneId === null ? f("faceScheme.annotate.outsideZonesHint") : null
|
|
2263
|
+
}
|
|
2264
|
+
),
|
|
2265
|
+
/* @__PURE__ */ a(
|
|
2266
|
+
ts,
|
|
2267
|
+
{
|
|
2268
|
+
size: "sm",
|
|
2269
|
+
options: Ki,
|
|
2270
|
+
value: et.zoneId ?? "",
|
|
2271
|
+
clearable: !0,
|
|
2272
|
+
placeholder: et.zoneId == null ? f("faceScheme.annotate.zoneNone") : f("faceScheme.annotate.zonePlaceholder"),
|
|
2273
|
+
"aria-label": f("faceScheme.annotate.zoneLabel"),
|
|
2274
|
+
onValueChange: (e) => Jt(et.id, e === "" ? null : e)
|
|
2275
|
+
}
|
|
2276
|
+
)
|
|
2277
|
+
] }),
|
|
2278
|
+
/* @__PURE__ */ C("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: [
|
|
2279
|
+
/* @__PURE__ */ a(
|
|
2280
|
+
P,
|
|
2281
|
+
{
|
|
2282
|
+
size: "sm",
|
|
2283
|
+
intent: "outline",
|
|
2284
|
+
startIcon: /* @__PURE__ */ a(ds, { "aria-hidden": "true" }),
|
|
2285
|
+
onClick: () => {
|
|
2286
|
+
const e = te.current;
|
|
2287
|
+
e !== null && St(e);
|
|
2288
|
+
},
|
|
2289
|
+
disabled: Ae === null,
|
|
2290
|
+
children: f("faceScheme.annotate.deleteSelected")
|
|
2291
|
+
}
|
|
2292
|
+
),
|
|
2293
|
+
/* @__PURE__ */ a(
|
|
2294
|
+
P,
|
|
2295
|
+
{
|
|
2296
|
+
size: "sm",
|
|
2297
|
+
intent: "outline",
|
|
2298
|
+
startIcon: /* @__PURE__ */ a(As, { "aria-hidden": "true" }),
|
|
2299
|
+
onClick: Qt,
|
|
2300
|
+
disabled: Ie.length === 0,
|
|
2301
|
+
children: f("faceScheme.annotate.undo")
|
|
2302
|
+
}
|
|
2303
|
+
),
|
|
2304
|
+
/* @__PURE__ */ a(
|
|
2305
|
+
P,
|
|
2306
|
+
{
|
|
2307
|
+
size: "sm",
|
|
2308
|
+
intent: "outline",
|
|
2309
|
+
startIcon: /* @__PURE__ */ a(us, { "aria-hidden": "true" }),
|
|
2310
|
+
onClick: en,
|
|
2311
|
+
disabled: Ie.length === 0,
|
|
2312
|
+
children: f("faceScheme.annotate.clear")
|
|
2313
|
+
}
|
|
2314
|
+
)
|
|
2315
|
+
] })
|
|
2316
|
+
]
|
|
2317
|
+
}
|
|
2318
|
+
) : null, Pi = (e) => {
|
|
2319
|
+
const t = e.kind === "text" ? e.text.trim() ? f("faceScheme.annotate.labelText", { text: e.text }) : f("faceScheme.annotate.kind.text") : f(`faceScheme.annotate.kind.${e.kind}`);
|
|
2320
|
+
if (!e.zoneId) return t;
|
|
2321
|
+
const i = M.zones.find((s) => s.id === e.zoneId);
|
|
2322
|
+
return i ? f("faceScheme.annotate.labelWithZone", {
|
|
2323
|
+
label: t,
|
|
2324
|
+
zone: f(`faceScheme.zone.${i.labelKey}`)
|
|
2325
|
+
}) : t;
|
|
2326
|
+
}, gn = (e) => {
|
|
2327
|
+
const t = e.tone ?? "accent";
|
|
2328
|
+
switch (e.kind) {
|
|
2329
|
+
case "marker":
|
|
2330
|
+
return /* @__PURE__ */ a(
|
|
2331
|
+
"path",
|
|
2332
|
+
{
|
|
2333
|
+
d: tt(e.shape, e.x, e.y, vo),
|
|
2334
|
+
className: Pe[t],
|
|
2335
|
+
pointerEvents: "none"
|
|
2336
|
+
}
|
|
2337
|
+
);
|
|
2338
|
+
case "pen":
|
|
2339
|
+
case "highlighter":
|
|
2340
|
+
return /* @__PURE__ */ a(
|
|
2341
|
+
"path",
|
|
2342
|
+
{
|
|
2343
|
+
d: Hr(e.points),
|
|
2344
|
+
fill: "none",
|
|
2345
|
+
strokeWidth: e.kind === "highlighter" ? ko : wo,
|
|
2346
|
+
strokeOpacity: e.kind === "highlighter" ? 0.35 : 1,
|
|
2347
|
+
strokeLinecap: "round",
|
|
2348
|
+
strokeLinejoin: "round",
|
|
2349
|
+
className: Lt[t],
|
|
2350
|
+
pointerEvents: "none"
|
|
2351
|
+
}
|
|
2352
|
+
);
|
|
2353
|
+
case "arrow":
|
|
2354
|
+
return /* @__PURE__ */ C("g", { className: Lt[t], pointerEvents: "none", children: [
|
|
2355
|
+
/* @__PURE__ */ a(
|
|
2356
|
+
"path",
|
|
2357
|
+
{
|
|
2358
|
+
d: Nn("arrow", e.from, e.to),
|
|
2359
|
+
fill: "none",
|
|
2360
|
+
strokeWidth: Rt,
|
|
2361
|
+
strokeLinecap: "round"
|
|
2362
|
+
}
|
|
2363
|
+
),
|
|
2364
|
+
/* @__PURE__ */ a(
|
|
2365
|
+
"path",
|
|
2366
|
+
{
|
|
2367
|
+
d: no(e.from, e.to, bo),
|
|
2368
|
+
fill: "none",
|
|
2369
|
+
strokeWidth: Rt,
|
|
2370
|
+
strokeLinecap: "round",
|
|
2371
|
+
strokeLinejoin: "round"
|
|
2372
|
+
}
|
|
2373
|
+
)
|
|
2374
|
+
] });
|
|
2375
|
+
case "line":
|
|
2376
|
+
case "rect":
|
|
2377
|
+
case "ellipse":
|
|
2378
|
+
return /* @__PURE__ */ a(
|
|
2379
|
+
"path",
|
|
2380
|
+
{
|
|
2381
|
+
d: Nn(e.kind, e.from, e.to),
|
|
2382
|
+
fill: "none",
|
|
2383
|
+
strokeWidth: Rt,
|
|
2384
|
+
strokeLinecap: "round",
|
|
2385
|
+
strokeLinejoin: "round",
|
|
2386
|
+
className: Lt[t],
|
|
2387
|
+
pointerEvents: "none"
|
|
2388
|
+
}
|
|
2389
|
+
);
|
|
2390
|
+
case "text":
|
|
2391
|
+
return e.text.trim() ? /* @__PURE__ */ a(
|
|
2392
|
+
"text",
|
|
2393
|
+
{
|
|
2394
|
+
x: e.x,
|
|
2395
|
+
y: e.y,
|
|
2396
|
+
fontSize: Zr,
|
|
2397
|
+
paintOrder: "stroke",
|
|
2398
|
+
strokeWidth: 6,
|
|
2399
|
+
strokeLinejoin: "round",
|
|
2400
|
+
className: `${Pe[t]} ds:[stroke:var(--background)] ds:[font-family:var(--font-sans)] ds:[font-weight:500]`,
|
|
2401
|
+
pointerEvents: "none",
|
|
2402
|
+
children: e.text
|
|
2403
|
+
}
|
|
2404
|
+
) : /* @__PURE__ */ a(
|
|
2405
|
+
"path",
|
|
2406
|
+
{
|
|
2407
|
+
d: `M ${e.x - 10} ${e.y} H ${e.x + 10} M ${e.x} ${e.y - 10} V ${e.y + 10}`,
|
|
2408
|
+
strokeWidth: Rt,
|
|
2409
|
+
strokeLinecap: "round",
|
|
2410
|
+
className: Lt[t],
|
|
2411
|
+
pointerEvents: "none"
|
|
2412
|
+
}
|
|
2413
|
+
);
|
|
2414
|
+
}
|
|
2415
|
+
}, Di = (e) => {
|
|
2416
|
+
const t = oo(e, Zr);
|
|
2417
|
+
switch (t.type) {
|
|
2418
|
+
case "stroke":
|
|
2419
|
+
return /* @__PURE__ */ a(
|
|
2420
|
+
"path",
|
|
2421
|
+
{
|
|
2422
|
+
"data-annotation-hit": "",
|
|
2423
|
+
d: t.d,
|
|
2424
|
+
fill: "none",
|
|
2425
|
+
stroke: "transparent",
|
|
2426
|
+
strokeWidth: so,
|
|
2427
|
+
strokeLinecap: "round",
|
|
2428
|
+
strokeLinejoin: "round",
|
|
2429
|
+
pointerEvents: "stroke",
|
|
2430
|
+
className: "ds:cursor-pointer"
|
|
2431
|
+
}
|
|
2432
|
+
);
|
|
2433
|
+
case "circle":
|
|
2434
|
+
return /* @__PURE__ */ a(
|
|
2435
|
+
"circle",
|
|
2436
|
+
{
|
|
2437
|
+
"data-annotation-hit": "",
|
|
2438
|
+
cx: t.cx,
|
|
2439
|
+
cy: t.cy,
|
|
2440
|
+
r: t.r,
|
|
2441
|
+
fill: "transparent",
|
|
2442
|
+
pointerEvents: "fill",
|
|
2443
|
+
className: "ds:cursor-pointer"
|
|
2444
|
+
}
|
|
2445
|
+
);
|
|
2446
|
+
case "rect":
|
|
2447
|
+
return /* @__PURE__ */ a(
|
|
2448
|
+
"rect",
|
|
2449
|
+
{
|
|
2450
|
+
"data-annotation-hit": "",
|
|
2451
|
+
x: t.x,
|
|
2452
|
+
y: t.y,
|
|
2453
|
+
width: t.width,
|
|
2454
|
+
height: t.height,
|
|
2455
|
+
fill: "transparent",
|
|
2456
|
+
pointerEvents: "fill",
|
|
2457
|
+
className: "ds:cursor-pointer"
|
|
2458
|
+
}
|
|
2459
|
+
);
|
|
2460
|
+
}
|
|
2461
|
+
}, kr = we && ee ? $r(
|
|
2462
|
+
M.meshContentBox,
|
|
2463
|
+
Q,
|
|
2464
|
+
{ width: B, height: se },
|
|
2465
|
+
{ mirror: M.mirror }
|
|
2466
|
+
) : null;
|
|
2467
|
+
Bn.current = kr;
|
|
2468
|
+
const yn = ee ? ai ?? kr ?? M.viewBox : we || !Se ? M.schematicViewBox : M.viewBox;
|
|
2469
|
+
kt.current = yn;
|
|
2470
|
+
const br = he && xe.k > 1, Bi = br ? uo(st(zt(yn), xe)) : yn, Cr = br && U === null, Sr = (e) => {
|
|
2471
|
+
if (e !== A) {
|
|
2472
|
+
const t = Sn[e], i = (o == null ? void 0 : o[e]) ?? (e === "front" ? r : void 0), s = Yn[e] ?? (i == null ? void 0 : i.src), u = vt[e] ?? De, x = t.mirror ? `translate(${B} 0) scale(-1 1) ${Et(u)}` : Et(u), Y = Ct[e] ?? Or;
|
|
2473
|
+
return /* @__PURE__ */ a(Oe, { variant: "elevated", interactive: !0, asChild: !0, children: /* @__PURE__ */ a(
|
|
2474
|
+
"button",
|
|
2475
|
+
{
|
|
2476
|
+
type: "button",
|
|
2477
|
+
"data-testid": "face-scheme-preview",
|
|
2478
|
+
"data-view-preview": e,
|
|
2479
|
+
"aria-label": f(`faceScheme.view.${t.labelKey}`),
|
|
2480
|
+
onClick: () => ft(e),
|
|
2481
|
+
className: "ds:mx-auto ds:block ds:w-full ds:min-w-0 ds:max-w-[28rem] ds:appearance-none ds:p-0 ds:transition-opacity ds:[transition-duration:var(--animation-duration)] ds:hover:opacity-90",
|
|
2482
|
+
children: /* @__PURE__ */ C(
|
|
2483
|
+
"svg",
|
|
2484
|
+
{
|
|
2485
|
+
viewBox: s ? $r(
|
|
2486
|
+
t.meshContentBox,
|
|
2487
|
+
u,
|
|
2488
|
+
{ width: B, height: se },
|
|
2489
|
+
{ mirror: t.mirror }
|
|
2490
|
+
) : t.schematicViewBox,
|
|
2491
|
+
"aria-hidden": "true",
|
|
2492
|
+
className: "ds:block ds:h-auto ds:w-full",
|
|
2493
|
+
children: [
|
|
2494
|
+
s && /* @__PURE__ */ a(
|
|
2495
|
+
"image",
|
|
2496
|
+
{
|
|
2497
|
+
href: s,
|
|
2498
|
+
x: 0,
|
|
2499
|
+
y: 0,
|
|
2500
|
+
width: B,
|
|
2501
|
+
height: se,
|
|
2502
|
+
preserveAspectRatio: "xMidYMid slice"
|
|
2503
|
+
}
|
|
2504
|
+
),
|
|
2505
|
+
/* @__PURE__ */ a("g", { transform: x, children: t.zones.map((_) => {
|
|
2506
|
+
const _e = He[_.id] ?? [], ji = _e.length > 0;
|
|
2507
|
+
return /* @__PURE__ */ C("g", { children: [
|
|
2508
|
+
/* @__PURE__ */ a(
|
|
2509
|
+
"path",
|
|
2510
|
+
{
|
|
2511
|
+
d: _.d,
|
|
2512
|
+
className: Br({
|
|
2513
|
+
interactive: !1,
|
|
2514
|
+
marked: ji,
|
|
2515
|
+
// Cross-view selection stays visible on the
|
|
2516
|
+
// three-up previews (decorative, aria-hidden svg).
|
|
2517
|
+
selected: J && $n.has(_.id)
|
|
2518
|
+
})
|
|
2519
|
+
}
|
|
2520
|
+
),
|
|
2521
|
+
_e.map((Mr, Wi) => {
|
|
2522
|
+
const Nr = _t[Mr.type], Hi = (Wi - (_e.length - 1) / 2) * 26;
|
|
2523
|
+
return /* @__PURE__ */ a(
|
|
2524
|
+
"path",
|
|
2525
|
+
{
|
|
2526
|
+
d: tt(
|
|
2527
|
+
Nr.shape,
|
|
2528
|
+
_.cx + Hi,
|
|
2529
|
+
_.cy,
|
|
2530
|
+
11
|
|
2531
|
+
),
|
|
2532
|
+
className: Pe[Nr.tone]
|
|
2533
|
+
},
|
|
2534
|
+
Mr.type
|
|
2535
|
+
);
|
|
2536
|
+
})
|
|
2537
|
+
] }, _.id);
|
|
2538
|
+
}) }),
|
|
2539
|
+
/* @__PURE__ */ a("g", { children: Y.map((_) => /* @__PURE__ */ a("g", { children: gn(_) }, _.id)) })
|
|
2540
|
+
]
|
|
2541
|
+
}
|
|
2542
|
+
)
|
|
2543
|
+
}
|
|
2544
|
+
) });
|
|
2545
|
+
}
|
|
2546
|
+
return /* @__PURE__ */ a(Ke.Provider, { delayDuration: 200, children: /* @__PURE__ */ a(
|
|
2547
|
+
Oe,
|
|
2548
|
+
{
|
|
2549
|
+
variant: "elevated",
|
|
2550
|
+
"data-testid": "face-scheme-figure",
|
|
2551
|
+
"data-focused": we ? "true" : void 0,
|
|
2552
|
+
className: we ? (
|
|
2553
|
+
// Accent border marks the active tile in the three-up row
|
|
2554
|
+
// (2px width doubles as the non-colour cue; ~3.2:1 ≥ 3:1).
|
|
2555
|
+
"ds:mx-auto ds:w-full ds:max-w-[28rem] ds:border-2 ds:border-[color:var(--accent)] ds:forced-colors:border-[Highlight]"
|
|
2556
|
+
) : "ds:mx-auto ds:w-full ds:max-w-[28rem]",
|
|
2557
|
+
children: /* @__PURE__ */ C(
|
|
2558
|
+
"svg",
|
|
2559
|
+
{
|
|
2560
|
+
ref: dt,
|
|
2561
|
+
"data-testid": "face-scheme-svg",
|
|
2562
|
+
viewBox: Bi,
|
|
2563
|
+
role: "group",
|
|
2564
|
+
"aria-label": f(`faceScheme.view.${M.labelKey}`),
|
|
2565
|
+
className: Cr ? "ds:block ds:h-auto ds:w-full ds:touch-none ds:cursor-grab" : "ds:block ds:h-auto ds:w-full ds:touch-none",
|
|
2566
|
+
onPointerDown: z ? (t) => {
|
|
2567
|
+
var s, u;
|
|
2568
|
+
const i = t.target;
|
|
2569
|
+
if (te.current !== null && !((s = i.closest) != null && s.call(i, "[data-annotation]")) && O(null), Cr && !((u = i.closest) != null && u.call(
|
|
2570
|
+
i,
|
|
2571
|
+
'[data-zone],[data-annotation],[data-annotation-hit],[data-testid="face-scheme-handles"]'
|
|
2572
|
+
))) {
|
|
2573
|
+
ze.current = {
|
|
2574
|
+
id: t.pointerId,
|
|
2575
|
+
x: t.clientX,
|
|
2576
|
+
y: t.clientY
|
|
2577
|
+
};
|
|
2578
|
+
try {
|
|
2579
|
+
t.currentTarget.setPointerCapture(t.pointerId);
|
|
2580
|
+
} catch {
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
} : void 0,
|
|
2584
|
+
onPointerMove: he ? (t) => {
|
|
2585
|
+
const i = ze.current;
|
|
2586
|
+
if (!i || i.id !== t.pointerId) return;
|
|
2587
|
+
const s = t.currentTarget.getBoundingClientRect();
|
|
2588
|
+
if (s.width <= 0 || s.height <= 0) return;
|
|
2589
|
+
const u = zt(kt.current), x = st(u, Yt.current), Y = (t.clientX - i.x) * x.width / s.width, _ = (t.clientY - i.y) * x.height / s.height;
|
|
2590
|
+
ze.current = {
|
|
2591
|
+
id: i.id,
|
|
2592
|
+
x: t.clientX,
|
|
2593
|
+
y: t.clientY
|
|
2594
|
+
}, Me((_e) => fo(u, _e, Y, _));
|
|
2595
|
+
} : void 0,
|
|
2596
|
+
onPointerUp: he ? Vn : void 0,
|
|
2597
|
+
onPointerCancel: he ? Vn : void 0,
|
|
2598
|
+
onKeyDown: J ? (t) => {
|
|
2599
|
+
t.key === "Escape" && Ve();
|
|
2600
|
+
} : void 0,
|
|
2601
|
+
children: [
|
|
2602
|
+
ee && /* @__PURE__ */ a(
|
|
2603
|
+
"image",
|
|
2604
|
+
{
|
|
2605
|
+
href: ee,
|
|
2606
|
+
x: 0,
|
|
2607
|
+
y: 0,
|
|
2608
|
+
width: B,
|
|
2609
|
+
height: se,
|
|
2610
|
+
preserveAspectRatio: "xMidYMid slice",
|
|
2611
|
+
role: "img",
|
|
2612
|
+
"aria-label": Ni
|
|
2613
|
+
}
|
|
2614
|
+
),
|
|
2615
|
+
/* @__PURE__ */ a("g", { transform: Ii, children: M.zones.map((t) => {
|
|
2616
|
+
const i = He[t.id] ?? [], s = i.length > 0, u = J && $n.has(t.id);
|
|
2617
|
+
return /* @__PURE__ */ C(Ke.Root, { children: [
|
|
2618
|
+
/* @__PURE__ */ a(Ke.Trigger, { asChild: !0, children: /* @__PURE__ */ C(
|
|
2619
|
+
"g",
|
|
2620
|
+
{
|
|
2621
|
+
"data-zone": t.id,
|
|
2622
|
+
"data-side": t.side,
|
|
2623
|
+
"data-zone-selected": u ? "true" : void 0,
|
|
2624
|
+
role: z || v ? "button" : "img",
|
|
2625
|
+
"aria-label": or(t),
|
|
2626
|
+
"aria-pressed": J ? u : z && k ? s : void 0,
|
|
2627
|
+
className: "ds:outline-none ds:[&:focus-visible>*:first-child]:[stroke:var(--ring)] ds:[&:focus-visible>*:first-child]:[stroke-width:var(--focus-ring-width)] ds:[&:focus-visible>*:first-child]:[stroke-opacity:1] ds:forced-colors:[&:focus-visible>*:first-child]:[stroke:CanvasText]",
|
|
2628
|
+
tabIndex: z || v ? 0 : -1,
|
|
2629
|
+
onClick: () => ar(t),
|
|
2630
|
+
onKeyDown: (x) => {
|
|
2631
|
+
x.key === "Enter" || x.key === " " ? (x.preventDefault(), ar(t)) : x.key === "Escape" && J && Ve();
|
|
2632
|
+
},
|
|
2633
|
+
children: [
|
|
2634
|
+
/* @__PURE__ */ a(
|
|
2635
|
+
"path",
|
|
2636
|
+
{
|
|
2637
|
+
d: t.d,
|
|
2638
|
+
className: Br({
|
|
2639
|
+
interactive: z,
|
|
2640
|
+
marked: s,
|
|
2641
|
+
selected: u
|
|
2642
|
+
})
|
|
2643
|
+
}
|
|
2644
|
+
),
|
|
2645
|
+
i.map((x, Y) => {
|
|
2646
|
+
const _ = _t[x.type], _e = (Y - (i.length - 1) / 2) * 26;
|
|
2647
|
+
return /* @__PURE__ */ a(
|
|
2648
|
+
"path",
|
|
2649
|
+
{
|
|
2650
|
+
d: tt(
|
|
2651
|
+
_.shape,
|
|
2652
|
+
t.cx + _e,
|
|
2653
|
+
t.cy,
|
|
2654
|
+
11
|
|
2655
|
+
),
|
|
2656
|
+
"aria-hidden": "true",
|
|
2657
|
+
className: Pe[_.tone]
|
|
2658
|
+
},
|
|
2659
|
+
x.type
|
|
2660
|
+
);
|
|
2661
|
+
})
|
|
2662
|
+
]
|
|
2663
|
+
}
|
|
2664
|
+
) }),
|
|
2665
|
+
/* @__PURE__ */ a(Ke.Portal, { children: /* @__PURE__ */ C(
|
|
2666
|
+
Ke.Content,
|
|
2667
|
+
{
|
|
2668
|
+
sideOffset: 4,
|
|
2669
|
+
className: "ds:z-50 ds:rounded-[var(--radius-sm)] ds:bg-[var(--popover)] ds:px-2 ds:py-1 ds:text-[length:var(--font-size-xs)] ds:text-[var(--popover-foreground)] ds:shadow-[var(--shadow-md)]",
|
|
2670
|
+
children: [
|
|
2671
|
+
or(t),
|
|
2672
|
+
/* @__PURE__ */ a(Ke.Arrow, { className: "ds:[fill:var(--popover)]" })
|
|
2673
|
+
]
|
|
2674
|
+
}
|
|
2675
|
+
) })
|
|
2676
|
+
] }, t.id);
|
|
2677
|
+
}) }),
|
|
2678
|
+
/* @__PURE__ */ C("g", { "data-testid": "face-scheme-annotations", children: [
|
|
2679
|
+
Ie.map((t) => {
|
|
2680
|
+
const i = ro(t), s = Ae === t.id;
|
|
2681
|
+
return /* @__PURE__ */ C(
|
|
2682
|
+
"g",
|
|
2683
|
+
{
|
|
2684
|
+
"data-annotation": t.id,
|
|
2685
|
+
"data-annotation-kind": t.kind,
|
|
2686
|
+
"data-annotation-zone": t.zoneId ?? void 0,
|
|
2687
|
+
"data-selected": s ? "true" : void 0,
|
|
2688
|
+
role: z ? "button" : "img",
|
|
2689
|
+
"aria-label": Pi(t),
|
|
2690
|
+
"aria-pressed": z ? s : void 0,
|
|
2691
|
+
tabIndex: z ? 0 : -1,
|
|
2692
|
+
className: "ds:outline-none ds:[&:focus-visible>*:first-child]:[stroke-opacity:1] ds:[&[data-selected=true]>*:first-child]:[stroke-opacity:1] ds:[&[data-selected=true]>*:first-child]:[stroke-dasharray:6_4] ds:forced-colors:[&:focus-visible>*:first-child]:[stroke:CanvasText] ds:forced-colors:[&[data-selected=true]>*:first-child]:[stroke:CanvasText]",
|
|
2693
|
+
onClick: z && U === null ? (u) => {
|
|
2694
|
+
u.currentTarget.focus(), te.current === t.id ? t.kind === "text" ? It(t.id) : O(null) : O(t.id);
|
|
2695
|
+
} : void 0,
|
|
2696
|
+
onKeyDown: (u) => {
|
|
2697
|
+
z && (u.key === "Delete" || u.key === "Backspace" ? (u.preventDefault(), St(t.id)) : u.key === "Escape" ? te.current !== null && (u.stopPropagation(), O(null)) : (u.key === "Enter" || u.key === " ") && (u.preventDefault(), t.kind === "text" ? It(t.id) : te.current === t.id ? O(null) : O(t.id)));
|
|
2698
|
+
},
|
|
2699
|
+
children: [
|
|
2700
|
+
/* @__PURE__ */ a(
|
|
2701
|
+
"rect",
|
|
2702
|
+
{
|
|
2703
|
+
x: i.x - $t,
|
|
2704
|
+
y: i.y - $t,
|
|
2705
|
+
width: i.width + $t * 2,
|
|
2706
|
+
height: i.height + $t * 2,
|
|
2707
|
+
rx: 8,
|
|
2708
|
+
fill: "none",
|
|
2709
|
+
pointerEvents: "none",
|
|
2710
|
+
className: "ds:[stroke:var(--ring)] ds:[stroke-width:var(--focus-ring-width)] ds:[stroke-opacity:0] ds:[vector-effect:non-scaling-stroke]"
|
|
2711
|
+
}
|
|
2712
|
+
),
|
|
2713
|
+
gn(t),
|
|
2714
|
+
z && U === null && Di(t)
|
|
2715
|
+
]
|
|
2716
|
+
},
|
|
2717
|
+
t.id
|
|
2718
|
+
);
|
|
2719
|
+
}),
|
|
2720
|
+
an && /* @__PURE__ */ a("g", { "aria-hidden": "true", "data-testid": "face-scheme-draft", children: gn(an) })
|
|
2721
|
+
] }),
|
|
2722
|
+
/* @__PURE__ */ a(
|
|
2723
|
+
"rect",
|
|
2724
|
+
{
|
|
2725
|
+
"data-testid": "face-scheme-draw-surface",
|
|
2726
|
+
x: 0,
|
|
2727
|
+
y: 0,
|
|
2728
|
+
width: B,
|
|
2729
|
+
height: se,
|
|
2730
|
+
fill: "transparent",
|
|
2731
|
+
"aria-hidden": "true",
|
|
2732
|
+
className: qe ? "ds:cursor-crosshair ds:touch-none" : "ds:[pointer-events:none]",
|
|
2733
|
+
onPointerDown: qe ? wi : void 0,
|
|
2734
|
+
onPointerMove: qe ? ki : void 0,
|
|
2735
|
+
onPointerUp: qe ? nr : void 0,
|
|
2736
|
+
onPointerCancel: qe ? nr : void 0
|
|
2737
|
+
}
|
|
2738
|
+
),
|
|
2739
|
+
Se && ee && U === null && /* @__PURE__ */ a("g", { "aria-hidden": "true", "data-testid": "face-scheme-handles", children: M.landmarks.map((t, i) => {
|
|
2740
|
+
const s = Ut[i] ?? ce(rt(Q, t));
|
|
2741
|
+
return /* @__PURE__ */ C("g", { children: [
|
|
2742
|
+
/* @__PURE__ */ a(
|
|
2743
|
+
"circle",
|
|
2744
|
+
{
|
|
2745
|
+
cx: s.x,
|
|
2746
|
+
cy: s.y,
|
|
2747
|
+
r: 13,
|
|
2748
|
+
"data-handle": t.id,
|
|
2749
|
+
onPointerDown: ci(i),
|
|
2750
|
+
onPointerMove: li,
|
|
2751
|
+
onPointerUp: di,
|
|
2752
|
+
className: "ds:[fill:var(--background)] ds:[fill-opacity:0.9] ds:[stroke:var(--accent)] ds:[stroke-width:2.5] ds:[vector-effect:non-scaling-stroke] ds:cursor-grab ds:touch-none"
|
|
2753
|
+
}
|
|
2754
|
+
),
|
|
2755
|
+
/* @__PURE__ */ a(
|
|
2756
|
+
"path",
|
|
2757
|
+
{
|
|
2758
|
+
d: `M ${s.x - 5} ${s.y} H ${s.x + 5} M ${s.x} ${s.y - 5} V ${s.y + 5}`,
|
|
2759
|
+
className: "ds:[stroke:var(--accent)] ds:[stroke-width:2] ds:[vector-effect:non-scaling-stroke]",
|
|
2760
|
+
pointerEvents: "none"
|
|
2761
|
+
}
|
|
2762
|
+
)
|
|
2763
|
+
] }, t.id);
|
|
2764
|
+
}) })
|
|
2765
|
+
]
|
|
2766
|
+
}
|
|
2767
|
+
)
|
|
2768
|
+
}
|
|
2769
|
+
) });
|
|
2770
|
+
}, Fe = [];
|
|
2771
|
+
if (ur) {
|
|
2772
|
+
for (const e of Dr) {
|
|
2773
|
+
const t = mt === "single" && A === e;
|
|
2774
|
+
Fe.push(
|
|
2775
|
+
/* @__PURE__ */ a(
|
|
2776
|
+
P,
|
|
2777
|
+
{
|
|
2778
|
+
size: "sm",
|
|
2779
|
+
intent: t ? "primary" : void 0,
|
|
2780
|
+
"aria-pressed": t,
|
|
2781
|
+
startIcon: Co[e],
|
|
2782
|
+
onClick: () => {
|
|
2783
|
+
ft(e), zn("single");
|
|
2784
|
+
},
|
|
2785
|
+
children: f(`faceScheme.viewShort.${Sn[e].labelKey}`)
|
|
2786
|
+
},
|
|
2787
|
+
e
|
|
2788
|
+
)
|
|
2789
|
+
);
|
|
2790
|
+
}
|
|
2791
|
+
Fe.push(
|
|
2792
|
+
/* @__PURE__ */ a(
|
|
2793
|
+
P,
|
|
2794
|
+
{
|
|
2795
|
+
size: "sm",
|
|
2796
|
+
intent: mt === "all" ? "primary" : void 0,
|
|
2797
|
+
"aria-pressed": mt === "all",
|
|
2798
|
+
startIcon: /* @__PURE__ */ a(xs, { "aria-hidden": "true" }),
|
|
2799
|
+
onClick: () => zn("all"),
|
|
2800
|
+
children: f("faceScheme.viewShort.all")
|
|
2801
|
+
},
|
|
2802
|
+
"all"
|
|
2803
|
+
)
|
|
2804
|
+
);
|
|
2805
|
+
}
|
|
2806
|
+
return mn && (Fe.push(
|
|
2807
|
+
/* @__PURE__ */ a(
|
|
2808
|
+
P,
|
|
2809
|
+
{
|
|
2810
|
+
ref: _n,
|
|
2811
|
+
size: "sm",
|
|
2812
|
+
intent: "outline",
|
|
2813
|
+
startIcon: /* @__PURE__ */ a(fs, { "aria-hidden": "true" }),
|
|
2814
|
+
"data-overflow-pin": !0,
|
|
2815
|
+
onClick: () => void un(),
|
|
2816
|
+
disabled: Ue === "requesting",
|
|
2817
|
+
children: f(
|
|
2818
|
+
ee ? "faceScheme.capture.retake" : "faceScheme.capture.take"
|
|
2819
|
+
)
|
|
2820
|
+
},
|
|
2821
|
+
"capture"
|
|
2822
|
+
)
|
|
2823
|
+
), Fe.push(
|
|
2824
|
+
/* @__PURE__ */ a(
|
|
2825
|
+
P,
|
|
2826
|
+
{
|
|
2827
|
+
size: "sm",
|
|
2828
|
+
intent: "outline",
|
|
2829
|
+
startIcon: /* @__PURE__ */ a(hs, { "aria-hidden": "true" }),
|
|
2830
|
+
onClick: () => {
|
|
2831
|
+
var e;
|
|
2832
|
+
return (e = Tn.current) == null ? void 0 : e.click();
|
|
2833
|
+
},
|
|
2834
|
+
children: f("faceScheme.capture.upload")
|
|
2835
|
+
},
|
|
2836
|
+
"upload"
|
|
2837
|
+
)
|
|
2838
|
+
)), fr && Fe.push(fr), /* @__PURE__ */ C(
|
|
2839
|
+
"div",
|
|
2840
|
+
{
|
|
2841
|
+
ref: An,
|
|
2842
|
+
"data-component": "face-scheme",
|
|
2843
|
+
"data-component-id": lt,
|
|
2844
|
+
"data-view": A,
|
|
2845
|
+
"data-layout": we ? "all" : "single",
|
|
2846
|
+
className: [Ti, qr].filter(Boolean).join(" "),
|
|
2847
|
+
role: "group",
|
|
2848
|
+
"aria-label": Xr ?? f("faceScheme.ariaLabel"),
|
|
2849
|
+
children: [
|
|
2850
|
+
/* @__PURE__ */ C("div", { className: _i, children: [
|
|
2851
|
+
!fe && Ri && /* @__PURE__ */ a(
|
|
2852
|
+
es,
|
|
2853
|
+
{
|
|
2854
|
+
toolbar: !0,
|
|
2855
|
+
label: f("faceScheme.viewSwitcherLabel"),
|
|
2856
|
+
overflow: "menu",
|
|
2857
|
+
collapseToIcons: !0,
|
|
2858
|
+
className: "ds:text-center",
|
|
2859
|
+
children: Fe
|
|
2860
|
+
}
|
|
2861
|
+
),
|
|
2862
|
+
mn && /* @__PURE__ */ C("div", { className: "ds:mx-auto ds:flex ds:w-full ds:max-w-[28rem] ds:flex-col", children: [
|
|
2863
|
+
/* @__PURE__ */ a(
|
|
2864
|
+
"input",
|
|
2865
|
+
{
|
|
2866
|
+
ref: Tn,
|
|
2867
|
+
type: "file",
|
|
2868
|
+
accept: "image/*",
|
|
2869
|
+
capture: Zt,
|
|
2870
|
+
onChange: Si,
|
|
2871
|
+
className: "ds:sr-only",
|
|
2872
|
+
"aria-hidden": "true",
|
|
2873
|
+
tabIndex: -1,
|
|
2874
|
+
"data-testid": "face-scheme-file-input"
|
|
2875
|
+
}
|
|
2876
|
+
),
|
|
2877
|
+
/* @__PURE__ */ a(
|
|
2878
|
+
"span",
|
|
2879
|
+
{
|
|
2880
|
+
role: "status",
|
|
2881
|
+
"aria-live": "polite",
|
|
2882
|
+
className: Ue === "requesting" ? "ds:text-start ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)] ds:empty:hidden" : "ds:text-start ds:text-[length:var(--font-size-xs)] ds:text-[var(--destructive)] ds:empty:hidden",
|
|
2883
|
+
children: Ue === "requesting" ? f(
|
|
2884
|
+
"faceScheme.capture.requesting",
|
|
2885
|
+
"Waiting for camera permission…"
|
|
2886
|
+
) : Ue === "error" && Un ? f(xo[Un]) : ""
|
|
2887
|
+
}
|
|
2888
|
+
)
|
|
2889
|
+
] }),
|
|
2890
|
+
fe && /* @__PURE__ */ C(
|
|
2891
|
+
"div",
|
|
2892
|
+
{
|
|
2893
|
+
"data-testid": "face-scheme-viewfinder",
|
|
2894
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
2895
|
+
children: [
|
|
2896
|
+
/* @__PURE__ */ a(
|
|
2897
|
+
"video",
|
|
2898
|
+
{
|
|
2899
|
+
ref: ut,
|
|
2900
|
+
autoPlay: !0,
|
|
2901
|
+
playsInline: !0,
|
|
2902
|
+
muted: !0,
|
|
2903
|
+
"aria-label": f("faceScheme.capture.viewfinder"),
|
|
2904
|
+
className: "ds:mx-auto ds:block ds:w-full ds:max-w-[28rem] ds:[border-radius:var(--radius-md)] ds:[transform:scaleX(-1)]"
|
|
2905
|
+
}
|
|
2906
|
+
),
|
|
2907
|
+
/* @__PURE__ */ C("div", { className: "ds:flex ds:flex-wrap ds:justify-center ds:gap-[var(--spacing-xs)]", children: [
|
|
2908
|
+
/* @__PURE__ */ a(
|
|
2909
|
+
P,
|
|
2910
|
+
{
|
|
2911
|
+
size: "sm",
|
|
2912
|
+
intent: "primary",
|
|
2913
|
+
onClick: () => Ci(),
|
|
2914
|
+
children: f("faceScheme.capture.capture")
|
|
2915
|
+
}
|
|
2916
|
+
),
|
|
2917
|
+
/* @__PURE__ */ a(P, { size: "sm", intent: "outline", onClick: dn, children: f("faceScheme.capture.cancel") })
|
|
2918
|
+
] })
|
|
2919
|
+
]
|
|
2920
|
+
}
|
|
2921
|
+
),
|
|
2922
|
+
!fe && (we ? (
|
|
2923
|
+
// Equal columns in every case: the three cards stay the same
|
|
2924
|
+
// size, and the photoless schematic crops give the maps
|
|
2925
|
+
// matching aspects within them.
|
|
2926
|
+
/* @__PURE__ */ a("div", { className: "ds:grid ds:grid-cols-1 ds:items-center ds:gap-[var(--spacing-md)] ds:md:grid-cols-3", children: Dr.map((e) => /* @__PURE__ */ a("div", { className: "ds:min-w-0", children: Sr(e) }, e)) })
|
|
2927
|
+
) : Sr(A)),
|
|
2928
|
+
In && Ln && /* @__PURE__ */ a(Oe, { variant: "elevated", "data-testid": "face-scheme-legend", children: /* @__PURE__ */ a(Oe.Body, { children: /* @__PURE__ */ a(
|
|
2929
|
+
"ul",
|
|
2930
|
+
{
|
|
2931
|
+
"aria-label": f("faceScheme.legendLabel"),
|
|
2932
|
+
className: "ds:m-0 ds:flex ds:flex-wrap ds:gap-x-4 ds:gap-y-1 ds:p-0 ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]",
|
|
2933
|
+
children: Rr.map((e) => {
|
|
2934
|
+
const t = _t[e];
|
|
2935
|
+
return /* @__PURE__ */ a(
|
|
2936
|
+
"li",
|
|
2937
|
+
{
|
|
2938
|
+
className: "ds:flex ds:list-none ds:items-center",
|
|
2939
|
+
children: /* @__PURE__ */ a(
|
|
2940
|
+
Qi,
|
|
2941
|
+
{
|
|
2942
|
+
shape: t.shape,
|
|
2943
|
+
tone: t.tone,
|
|
2944
|
+
size: "sm",
|
|
2945
|
+
label: f(`faceScheme.finding.${e}`)
|
|
2946
|
+
}
|
|
2947
|
+
)
|
|
2948
|
+
},
|
|
2949
|
+
e
|
|
2950
|
+
);
|
|
2951
|
+
})
|
|
2952
|
+
}
|
|
2953
|
+
) }) })
|
|
2954
|
+
] }),
|
|
2955
|
+
dr && /* @__PURE__ */ a("div", { className: Ei, children: /* @__PURE__ */ a(
|
|
2956
|
+
Oe,
|
|
2957
|
+
{
|
|
2958
|
+
variant: "elevated",
|
|
2959
|
+
"data-testid": "face-scheme-panel",
|
|
2960
|
+
id: En,
|
|
2961
|
+
className: zi,
|
|
2962
|
+
children: /* @__PURE__ */ C(Oe.Body, { className: Li, children: [
|
|
2963
|
+
Zi,
|
|
2964
|
+
J && (Je || Se) && /* @__PURE__ */ a(Tt, {}),
|
|
2965
|
+
Oi,
|
|
2966
|
+
Je && Se && /* @__PURE__ */ a(Tt, {}),
|
|
2967
|
+
Se && /* @__PURE__ */ C(
|
|
2968
|
+
"div",
|
|
2969
|
+
{
|
|
2970
|
+
"data-testid": "face-scheme-registration",
|
|
2971
|
+
role: "group",
|
|
2972
|
+
"aria-labelledby": mr,
|
|
2973
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
2974
|
+
children: [
|
|
2975
|
+
/* @__PURE__ */ a("span", { id: mr, className: me, children: f("faceScheme.panel.fit") }),
|
|
2976
|
+
/* @__PURE__ */ a("p", { className: "ds:m-0 ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]", children: f("faceScheme.registration.hint") }),
|
|
2977
|
+
/* @__PURE__ */ a("div", { className: "ds:grid ds:grid-cols-1 ds:gap-[var(--spacing-xs)] ds:sm:grid-cols-2", children: Io.map((e) => {
|
|
2978
|
+
const t = No[e], i = e === "scaleX" || e === "scaleY";
|
|
2979
|
+
return /* @__PURE__ */ C(
|
|
2980
|
+
"div",
|
|
2981
|
+
{
|
|
2982
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-xs)] ds:text-[length:var(--font-size-xs)] ds:text-[var(--foreground)]",
|
|
2983
|
+
children: [
|
|
2984
|
+
/* @__PURE__ */ a("span", { children: f(`faceScheme.registration.${e}`) }),
|
|
2985
|
+
/* @__PURE__ */ a(
|
|
2986
|
+
ns,
|
|
2987
|
+
{
|
|
2988
|
+
"aria-label": f(`faceScheme.registration.${e}`),
|
|
2989
|
+
value: [Vt[e]],
|
|
2990
|
+
min: t.min,
|
|
2991
|
+
max: t.max,
|
|
2992
|
+
step: t.step,
|
|
2993
|
+
formatValue: (s) => i ? `${Math.round(s * 100)}%` : e === "rotation" || e === "shear" ? `${s.toFixed(1)}°` : `${Math.round(s)}`,
|
|
2994
|
+
onValueChange: (s) => {
|
|
2995
|
+
const u = s[0];
|
|
2996
|
+
typeof u == "number" && Ai(e, u);
|
|
2997
|
+
}
|
|
2998
|
+
}
|
|
2999
|
+
)
|
|
3000
|
+
]
|
|
3001
|
+
},
|
|
3002
|
+
e
|
|
3003
|
+
);
|
|
3004
|
+
}) }),
|
|
3005
|
+
/* @__PURE__ */ C("div", { className: "ds:flex ds:flex-wrap ds:gap-[var(--spacing-xs)]", children: [
|
|
3006
|
+
cr && /* @__PURE__ */ a(
|
|
3007
|
+
P,
|
|
3008
|
+
{
|
|
3009
|
+
size: "sm",
|
|
3010
|
+
intent: "primary",
|
|
3011
|
+
onClick: () => void fn(),
|
|
3012
|
+
disabled: At === "loading" || At === "detecting",
|
|
3013
|
+
children: f("faceScheme.registration.autoDetect")
|
|
3014
|
+
}
|
|
3015
|
+
),
|
|
3016
|
+
/* @__PURE__ */ a(
|
|
3017
|
+
P,
|
|
3018
|
+
{
|
|
3019
|
+
size: "sm",
|
|
3020
|
+
intent: "outline",
|
|
3021
|
+
onClick: () => ae(De),
|
|
3022
|
+
children: f("faceScheme.registration.reset")
|
|
3023
|
+
}
|
|
3024
|
+
),
|
|
3025
|
+
cr && /* @__PURE__ */ a(
|
|
3026
|
+
"span",
|
|
3027
|
+
{
|
|
3028
|
+
role: "status",
|
|
3029
|
+
"aria-live": "polite",
|
|
3030
|
+
className: "ds:self-center ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]",
|
|
3031
|
+
children: At === "idle" ? "" : f(`faceScheme.detect.${At}`)
|
|
3032
|
+
}
|
|
3033
|
+
)
|
|
3034
|
+
] })
|
|
3035
|
+
]
|
|
3036
|
+
}
|
|
3037
|
+
),
|
|
3038
|
+
he && /* @__PURE__ */ C(Ir, { children: [
|
|
3039
|
+
(J || Je || Se) && /* @__PURE__ */ a(Tt, {}),
|
|
3040
|
+
/* @__PURE__ */ C(
|
|
3041
|
+
"div",
|
|
3042
|
+
{
|
|
3043
|
+
"data-testid": "face-scheme-zoom",
|
|
3044
|
+
role: "group",
|
|
3045
|
+
"aria-labelledby": pr,
|
|
3046
|
+
className: "ds:flex ds:flex-col ds:gap-[var(--spacing-sm)]",
|
|
3047
|
+
children: [
|
|
3048
|
+
/* @__PURE__ */ a("span", { id: pr, className: me, children: f("faceScheme.zoomLabel") }),
|
|
3049
|
+
/* @__PURE__ */ C("div", { className: "ds:flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]", children: [
|
|
3050
|
+
/* @__PURE__ */ a(
|
|
3051
|
+
Ze,
|
|
3052
|
+
{
|
|
3053
|
+
size: "sm",
|
|
3054
|
+
icon: /* @__PURE__ */ a(ms, { "aria-hidden": "true" }),
|
|
3055
|
+
"aria-label": f("faceScheme.zoomOut"),
|
|
3056
|
+
disabled: xe.k <= 1,
|
|
3057
|
+
onClick: () => Wn(1 / 1.3)
|
|
3058
|
+
}
|
|
3059
|
+
),
|
|
3060
|
+
/* @__PURE__ */ C(
|
|
3061
|
+
"span",
|
|
3062
|
+
{
|
|
3063
|
+
role: "status",
|
|
3064
|
+
"aria-live": "polite",
|
|
3065
|
+
"aria-label": f("faceScheme.zoomLevel"),
|
|
3066
|
+
className: "ds:min-w-[3.5rem] ds:text-center ds:text-[length:var(--font-size-xs)] ds:text-[var(--muted-foreground)]",
|
|
3067
|
+
children: [
|
|
3068
|
+
Math.round(xe.k * 100),
|
|
3069
|
+
"%"
|
|
3070
|
+
]
|
|
3071
|
+
}
|
|
3072
|
+
),
|
|
3073
|
+
/* @__PURE__ */ a(
|
|
3074
|
+
Ze,
|
|
3075
|
+
{
|
|
3076
|
+
size: "sm",
|
|
3077
|
+
icon: /* @__PURE__ */ a(ps, { "aria-hidden": "true" }),
|
|
3078
|
+
"aria-label": f("faceScheme.zoomIn"),
|
|
3079
|
+
disabled: xe.k >= Vr,
|
|
3080
|
+
onClick: () => Wn(1.3)
|
|
3081
|
+
}
|
|
3082
|
+
),
|
|
3083
|
+
/* @__PURE__ */ a(
|
|
3084
|
+
P,
|
|
3085
|
+
{
|
|
3086
|
+
size: "sm",
|
|
3087
|
+
intent: "outline",
|
|
3088
|
+
startIcon: /* @__PURE__ */ a(gs, { "aria-hidden": "true" }),
|
|
3089
|
+
disabled: xe.k <= 1,
|
|
3090
|
+
onClick: qt,
|
|
3091
|
+
children: f("faceScheme.resetView")
|
|
3092
|
+
}
|
|
3093
|
+
)
|
|
3094
|
+
] })
|
|
3095
|
+
]
|
|
3096
|
+
}
|
|
3097
|
+
)
|
|
3098
|
+
] }),
|
|
3099
|
+
In && /* @__PURE__ */ C(Ir, { children: [
|
|
3100
|
+
/* @__PURE__ */ a(Tt, {}),
|
|
3101
|
+
/* @__PURE__ */ a(
|
|
3102
|
+
rs,
|
|
3103
|
+
{
|
|
3104
|
+
size: "sm",
|
|
3105
|
+
label: f("faceScheme.showLegend"),
|
|
3106
|
+
checked: Ln,
|
|
3107
|
+
onCheckedChange: ei
|
|
3108
|
+
}
|
|
3109
|
+
)
|
|
3110
|
+
] })
|
|
3111
|
+
] })
|
|
3112
|
+
}
|
|
3113
|
+
) })
|
|
3114
|
+
]
|
|
3115
|
+
}
|
|
3116
|
+
);
|
|
3117
|
+
}
|
|
3118
|
+
);
|
|
3119
|
+
Ao.displayName = "FaceScheme";
|
|
3120
|
+
export {
|
|
3121
|
+
sa as A,
|
|
3122
|
+
to as F,
|
|
3123
|
+
De as I,
|
|
3124
|
+
_t as a,
|
|
3125
|
+
Rr as b,
|
|
3126
|
+
Sn as c,
|
|
3127
|
+
eo as d,
|
|
3128
|
+
Ao as e,
|
|
3129
|
+
Et as f,
|
|
3130
|
+
io as g,
|
|
3131
|
+
ro as h,
|
|
3132
|
+
rt as i,
|
|
3133
|
+
no as j,
|
|
3134
|
+
ho as k,
|
|
3135
|
+
mo as l,
|
|
3136
|
+
Ds as m,
|
|
3137
|
+
Rs as n,
|
|
3138
|
+
Hr as o,
|
|
3139
|
+
ao as p,
|
|
3140
|
+
aa as q,
|
|
3141
|
+
ca as r,
|
|
3142
|
+
oa as s,
|
|
3143
|
+
Nn as t,
|
|
3144
|
+
Kr as u
|
|
3145
|
+
};
|
|
3146
|
+
//# sourceMappingURL=face-scheme-C0rk21gg.js.map
|