@sekyro/elements 0.1.0-rc.3 → 0.1.0-rc.30

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +256 -0
  2. package/README.md +9 -10
  3. package/custom-elements.json +2 -2
  4. package/dist/cdn/chunks/barcode-detect-C5IOXMKI-ZOZ2WOWU.js +1 -0
  5. package/dist/cdn/chunks/{camera-trait-V4UAOPIQ-TFCPOCSU.js → camera-trait-DELAK3YN-4I2GHAFU.js} +1 -1
  6. package/dist/cdn/chunks/capture-session-doc-NJKFAWHW-5ISANLWB.js +1 -0
  7. package/dist/cdn/chunks/challenge-frame-LWDSKM5K-J3CNO3XT.js +1 -0
  8. package/dist/cdn/chunks/chunk-2HKOE6CN.js +25 -0
  9. package/dist/cdn/chunks/chunk-37BKUH3E.js +1 -0
  10. package/dist/cdn/chunks/chunk-4GDGJEJ6.js +1 -0
  11. package/dist/cdn/chunks/{chunk-QOZB3DLY.js → chunk-4H47RI64.js} +1 -1
  12. package/dist/cdn/chunks/{chunk-POHYEXNR.js → chunk-52X5ZO4S.js} +1 -1
  13. package/dist/cdn/chunks/{chunk-UQKRYXN5.js → chunk-5JSOPXYS.js} +1 -1
  14. package/dist/cdn/chunks/{chunk-UNQ3QO4U.js → chunk-5KTQLZKN.js} +1 -1
  15. package/dist/cdn/chunks/{chunk-WPRIGJHG.js → chunk-5Y7NCFTK.js} +1 -1
  16. package/dist/cdn/chunks/chunk-6MYG4HWP.js +1 -0
  17. package/dist/cdn/chunks/chunk-7UCVVWRT.js +1 -0
  18. package/dist/cdn/chunks/{chunk-CXQO6QMQ.js → chunk-DEDYOTBZ.js} +1 -1
  19. package/dist/cdn/chunks/{chunk-H22YHQ6V.js → chunk-FOPIRIC2.js} +1 -1
  20. package/dist/cdn/chunks/chunk-GORELL4J.js +1 -0
  21. package/dist/cdn/chunks/{chunk-5K4YQOZN.js → chunk-GR6JK2ML.js} +1 -1
  22. package/dist/cdn/chunks/chunk-IAPQGT6L.js +1 -0
  23. package/dist/cdn/chunks/chunk-IWRPGU4X.js +1 -0
  24. package/dist/cdn/chunks/chunk-JB27ZDFD.js +1 -0
  25. package/dist/cdn/chunks/{chunk-FV4TIWHC.js → chunk-JU4XNPJJ.js} +1 -1
  26. package/dist/cdn/chunks/{chunk-RKH7O2P5.js → chunk-KEO772AF.js} +1 -1
  27. package/dist/cdn/chunks/chunk-KPUG7TMO.js +33 -0
  28. package/dist/cdn/chunks/chunk-LNE2P3TV.js +1 -0
  29. package/dist/cdn/chunks/chunk-PND4F7JQ.js +1 -0
  30. package/dist/cdn/chunks/chunk-RVL4N5KZ.js +1 -0
  31. package/dist/cdn/chunks/chunk-SIBJ56BG.js +1 -0
  32. package/dist/cdn/chunks/chunk-SLLJX5QK.js +1 -0
  33. package/dist/cdn/chunks/{chunk-LA2MA2UQ.js → chunk-TBQUAM5Z.js} +1 -1
  34. package/dist/cdn/chunks/chunk-W2IBE5PM.js +1 -0
  35. package/dist/cdn/chunks/chunk-W5WWCOOW.js +1 -0
  36. package/dist/cdn/chunks/chunk-X6SULJS2.js +3 -0
  37. package/dist/cdn/chunks/chunk-XKZZC74I.js +1 -0
  38. package/dist/cdn/chunks/chunk-XZKF2U76.js +1 -0
  39. package/dist/cdn/chunks/chunk-YZWLMKXA.js +1 -0
  40. package/dist/cdn/chunks/create-document-capture-3DB2Y3GP-SMSQUDH2.js +1 -0
  41. package/dist/cdn/chunks/{create-portrait-capture-5VGYZUOK-N3333DJC.js → create-portrait-capture-5VGYZUOK-KTCFCHTN.js} +1 -1
  42. package/dist/cdn/chunks/{detector-scanic-23DAYT3H-AJXQA7H4.js → detector-scanic-3VQFGZAA-NF7AFUUP.js} +1 -1
  43. package/dist/cdn/chunks/document-capture-view-SCXJCJET-YFWA53XE.js +1 -0
  44. package/dist/cdn/chunks/eid-view-F75DTWPK-AE6YBJNY.js +1 -0
  45. package/dist/cdn/chunks/email-otp-view-T3NRXENJ-K6FY5XVU.js +1 -0
  46. package/dist/cdn/chunks/flow-views-TVG4PFSE-2UL4L6TO.js +1 -0
  47. package/dist/cdn/chunks/form-view-7NPB2AJE-TCOF3XPH.js +1 -0
  48. package/dist/cdn/chunks/icons-form-R366YPMB-6C7SJPCB.js +1 -0
  49. package/dist/cdn/chunks/mrz-band-IH54XO42-AE4D3F2E.js +1 -0
  50. package/dist/cdn/chunks/overlay-de-SYWE2LZE-AZG4RYMA.js +1 -0
  51. package/dist/cdn/chunks/overlay-es-D43QR7EF-ZODSTOP2.js +1 -0
  52. package/dist/cdn/chunks/overlay-pt-2YUWBZX7-UTMWWMN7.js +1 -0
  53. package/dist/cdn/chunks/plan-runner-432VPNQW-OBQFQCWK.js +1 -0
  54. package/dist/cdn/chunks/portrait-capture-view-4HUAQUIA-G3YLZEHM.js +1 -0
  55. package/dist/cdn/chunks/{portrait-review-view-TBSABVSX-5SVU25AE.js → portrait-review-view-VKRWP4HK-6NZPPDWZ.js} +1 -1
  56. package/dist/cdn/chunks/print-DCYX3CZD-DLQCPZZE.js +11 -0
  57. package/dist/cdn/chunks/proof-of-address-view-BXQ4O2CU-RFNWZRUP.js +1 -0
  58. package/dist/cdn/chunks/reader-652D2CK6.js +2 -0
  59. package/dist/cdn/define.js +1 -1
  60. package/dist/cdn/index.js +1 -1
  61. package/dist/{chunk-2FHYNKUL.js → chunk-2XRKOCPR.js} +1 -1
  62. package/dist/chunk-3SFLN33V.js +1 -0
  63. package/dist/chunk-4BQSPVSM.js +33 -0
  64. package/dist/{chunk-JCCTKW23.js → chunk-5MOE4EK4.js} +1 -1
  65. package/dist/{chunk-UZJG5SPC.js → chunk-7GCPE3LG.js} +1 -1
  66. package/dist/chunk-CX7T4ADY.js +1 -0
  67. package/dist/{chunk-CFERAKA2.js → chunk-D2KOFFZS.js} +1 -1
  68. package/dist/chunk-HBK2ROSI.js +1 -0
  69. package/dist/{chunk-PMIO3U3J.js → chunk-L7NFG55Y.js} +1 -1
  70. package/dist/chunk-P223YKM3.js +1 -0
  71. package/dist/{chunk-PNTIMH72.js → chunk-Q47EK3FL.js} +1 -1
  72. package/dist/{chunk-JUB6FRPB.js → chunk-QDHTMKLS.js} +1 -1
  73. package/dist/chunk-RSXZISUG.js +25 -0
  74. package/dist/chunk-SCZ22CNO.js +1 -0
  75. package/dist/chunk-XXCBLQ53.js +1 -0
  76. package/dist/{chunk-UXPM24JI.js → chunk-YHJQJMRS.js} +1 -1
  77. package/dist/{chunk-YPBTBTOU.js → chunk-ZG77WO25.js} +1 -1
  78. package/dist/define.cjs +6 -6
  79. package/dist/define.js +1 -1
  80. package/dist/document-capture-view-SCXJCJET-WFZYQEU2.js +1 -0
  81. package/dist/{eid-view-FKFEF42L-ZXQWPIIA.js → eid-view-F75DTWPK-QMS64USC.js} +1 -1
  82. package/dist/{email-otp-view-NRZCAJJ4-RANTR7SO.js → email-otp-view-T3NRXENJ-WF5ZRHQS.js} +1 -1
  83. package/dist/flow-views-TVG4PFSE-OWVBXJ2R.js +1 -0
  84. package/dist/form-view-7NPB2AJE-5GEBWQJ7.js +1 -0
  85. package/dist/icons-form-R366YPMB-KUTXHC7X.js +1 -0
  86. package/dist/index.cjs +6 -6
  87. package/dist/index.d.cts +169 -17
  88. package/dist/index.d.ts +169 -17
  89. package/dist/index.js +1 -1
  90. package/dist/overlay-de-SYWE2LZE-QIFDHKT6.js +1 -0
  91. package/dist/overlay-es-D43QR7EF-FZNYZGGS.js +1 -0
  92. package/dist/overlay-pt-2YUWBZX7-4AFNZWV2.js +1 -0
  93. package/dist/{portrait-capture-view-6KZGPAJU-LAGNB7A4.js → portrait-capture-view-4HUAQUIA-LYTXJIEX.js} +1 -1
  94. package/dist/{portrait-review-view-TBSABVSX-MLNZZBL5.js → portrait-review-view-VKRWP4HK-4XFARABZ.js} +1 -1
  95. package/dist/proof-of-address-view-BXQ4O2CU-455UQJ3O.js +1 -0
  96. package/dist/styles.css +172 -20
  97. package/package.json +2 -2
  98. package/sbom.cdx.json +4 -4
  99. package/dist/cdn/chunks/capture-session-doc-WZMI5XPE-AZDHR6MQ.js +0 -1
  100. package/dist/cdn/chunks/challenge-frame-NUGPTWFP-V3GGQN65.js +0 -1
  101. package/dist/cdn/chunks/chunk-2FETDQV5.js +0 -1
  102. package/dist/cdn/chunks/chunk-2T6RLTDQ.js +0 -1
  103. package/dist/cdn/chunks/chunk-434MMEWK.js +0 -1
  104. package/dist/cdn/chunks/chunk-6BRQUKUP.js +0 -1
  105. package/dist/cdn/chunks/chunk-7MV4CI4L.js +0 -1
  106. package/dist/cdn/chunks/chunk-CW56KMMH.js +0 -1
  107. package/dist/cdn/chunks/chunk-EWTKC2C2.js +0 -1
  108. package/dist/cdn/chunks/chunk-KVTY4E6J.js +0 -1
  109. package/dist/cdn/chunks/chunk-L22GFJQV.js +0 -1
  110. package/dist/cdn/chunks/chunk-MJEQ5ANO.js +0 -1
  111. package/dist/cdn/chunks/chunk-SGUCIULX.js +0 -3
  112. package/dist/cdn/chunks/chunk-SIPFHN7E.js +0 -25
  113. package/dist/cdn/chunks/chunk-TKJVGZWP.js +0 -33
  114. package/dist/cdn/chunks/chunk-YRTHQZAW.js +0 -1
  115. package/dist/cdn/chunks/chunk-ZMHEKDRM.js +0 -1
  116. package/dist/cdn/chunks/chunk-ZYZPLDA2.js +0 -1
  117. package/dist/cdn/chunks/create-document-capture-OXPLKHOF-GVCM77EK.js +0 -1
  118. package/dist/cdn/chunks/document-capture-view-UL3ISHNS-WZLR5RSQ.js +0 -1
  119. package/dist/cdn/chunks/eid-view-FKFEF42L-2OQYMKAB.js +0 -1
  120. package/dist/cdn/chunks/email-otp-view-NRZCAJJ4-BJNXOVUF.js +0 -1
  121. package/dist/cdn/chunks/flow-views-N7LBFI55-27RU7EZG.js +0 -1
  122. package/dist/cdn/chunks/mrz-band-VYHOTDHY-VEZ2J5IL.js +0 -1
  123. package/dist/cdn/chunks/overlay-de-KYSF3MDD-XORYFTYU.js +0 -1
  124. package/dist/cdn/chunks/overlay-es-36H5G6S5-22UFLFPZ.js +0 -1
  125. package/dist/cdn/chunks/overlay-pt-EB4UDBFE-CWJXQDCQ.js +0 -1
  126. package/dist/cdn/chunks/plan-runner-EP26JU6A-LU7KJ6JU.js +0 -1
  127. package/dist/cdn/chunks/portrait-capture-view-6KZGPAJU-2O54W4SR.js +0 -1
  128. package/dist/cdn/chunks/print-SEWS3VHQ-HWJTHADG.js +0 -11
  129. package/dist/cdn/chunks/proof-of-address-view-3GG3XEQK-CPQ2AQEQ.js +0 -1
  130. package/dist/chunk-A75VY7L7.js +0 -1
  131. package/dist/chunk-APM7FCA2.js +0 -25
  132. package/dist/chunk-LYFBZCIH.js +0 -33
  133. package/dist/chunk-WBXQX6DQ.js +0 -1
  134. package/dist/chunk-YZ6YGLNN.js +0 -1
  135. package/dist/document-capture-view-UL3ISHNS-K636D7VR.js +0 -1
  136. package/dist/flow-views-N7LBFI55-DZ3PH2EP.js +0 -1
  137. package/dist/overlay-de-KYSF3MDD-2ZNXM2N7.js +0 -1
  138. package/dist/overlay-es-36H5G6S5-VQWD57TO.js +0 -1
  139. package/dist/overlay-pt-EB4UDBFE-6VWPTFO2.js +0 -1
  140. package/dist/proof-of-address-view-3GG3XEQK-FWM7OQ4K.js +0 -1
package/dist/styles.css CHANGED
@@ -761,6 +761,13 @@
761
761
  @font-face { font-family: "Sekyro Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/SekyroInter-SemiBold.woff2") format("woff2"); unicode-range: U+0000-017F, U+02BB-02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2713, U+FEFF; }
762
762
  @font-face { font-family: "Sekyro Geist"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/SekyroGeist-SemiBold.woff2") format("woff2"); unicode-range: U+0000-017F, U+02BB-02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2713, U+FEFF; }
763
763
  @font-face { font-family: "Sekyro Geist"; font-style: normal; font-weight: 700; font-display: swap; src: url("./fonts/SekyroGeist-Bold.woff2") format("woff2"); unicode-range: U+0000-017F, U+02BB-02DC, U+2000-206F, U+20AC, U+2122, U+2190-2193, U+2212, U+2713, U+FEFF; }
764
+ /* Geist's metric-matched local fallbacks (in --sekyro-font-display after "Sekyro Geist"), shown while the title face
765
+ loads: a real bold face sized to Geist 600 (the flow-* titles), so the swap neither moves a title nor draws it in
766
+ synthetic bold, crowded by the titles' negative tracking. size-adjust = Geist 600's mean width over the local face
767
+ on French and English titles; ascent/descent = Geist's 1.005/0.295 em over size-adjust (fontTools, 2026-11-15; the
768
+ same method as @sekyro/brand/font-fallbacks.css, which is tuned at 650 for the website's heroes). */
769
+ @font-face { font-family: "Sekyro Geist Fallback"; font-style: normal; font-weight: 550 1000; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("LiberationSans-Bold"), local("Arimo Bold"), local("Arimo-Bold"), local("Helvetica Bold"), local("Helvetica-Bold"); ascent-override: 98.41%; descent-override: 28.89%; line-gap-override: 0%; size-adjust: 102.12%; }
770
+ @font-face { font-family: "Sekyro Geist Fallback Roboto"; font-style: normal; font-weight: 550 1000; src: local("Roboto Bold"), local("Roboto-Bold"); ascent-override: 92.61%; descent-override: 27.18%; line-gap-override: 0%; size-adjust: 108.52%; }
764
771
  @font-face { font-family: "Sekyro Cairo"; font-style: normal; font-weight: 400; font-display: swap; src: url("./fonts/SekyroCairo-Regular.woff2") format("woff2"); unicode-range: U+0020-00FF, U+0600-06FF, U+2013-2026, U+FB50-FDFF, U+FE70-FEFC; }
765
772
  @font-face { font-family: "Sekyro Cairo"; font-style: normal; font-weight: 600; font-display: swap; src: url("./fonts/SekyroCairo-SemiBold.woff2") format("woff2"); unicode-range: U+0020-00FF, U+0600-06FF, U+2013-2026, U+FB50-FDFF, U+FE70-FEFC; }
766
773
  @font-face { font-family: "Sekyro Cairo"; font-style: normal; font-weight: 700; font-display: swap; src: url("./fonts/SekyroCairo-Bold.woff2") format("woff2"); unicode-range: U+0020-00FF, U+0600-06FF, U+2013-2026, U+FB50-FDFF, U+FE70-FEFC; }
@@ -790,6 +797,10 @@
790
797
 
791
798
  /* ── The flow's surface ────────────────────────────────────────────────── */
792
799
  /* Arabic: Cairo (Latin-1 included), Inter after it for the rest of the Latin text. */
800
+ /* Ink on the browser check's dimmed backdrop (a line outside the themed root: .sekyro-check-confirm). */
801
+ :root {
802
+ --sekyro-color-on-scrim: #ffffff;
803
+ }
793
804
  :root { --sekyro-font-arabic: "Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif; }
794
805
  .sekyro-root {
795
806
  /* Shades derived from the (possibly partner) theme on THIS element, so a partner brand recolours them too. */
@@ -865,6 +876,8 @@
865
876
  .sekyro-org__close { flex-shrink: 0; margin-inline-end: -4px; }
866
877
  /* The back disc before the tile; its chevron points to the start, so it turns round in Arabic. */
867
878
  .sekyro-org__back { flex-shrink: 0; margin-inline-start: -4px; }
879
+ /* KI-535: nowhere to go back to: the disc stays in place, quiet and inert. */
880
+ .sekyro-org__back:disabled { color: var(--sekyro-color-fg-subtle); cursor: default; }
868
881
  .sekyro-flow[dir="rtl"] .sekyro-org__back .sekyro-glyph { transform: scaleX(-1); }
869
882
  /* A phone keeps room for the name: with a back disc the org tile steps aside (the name still says who asks). */
870
883
  @media (max-width: 430px) { .sekyro-org__back + .sekyro-org__tile { display: none; } }
@@ -1010,27 +1023,32 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
1010
1023
  .sekyro-phone__lead { position: relative; display: flex; flex: none; align-items: center; align-self: stretch; margin-inline-start: -1rem; padding-inline-start: 1rem; }
1011
1024
  .sekyro-phone__dial { display: inline-flex; align-items: center; gap: 6px; padding-inline-end: 0.75rem; border-inline-end: 1px solid var(--sekyro-color-line); color: var(--sekyro-color-fg); }
1012
1025
  .sekyro-phone__flag { font-size: 1.25rem; line-height: 1; }
1013
- /* Several contact countries (person data spec Q16): a native select, transparent, over the whole segment from the field's edge. 17 px text keeps iOS from zooming on focus. */
1014
- .sekyro-phone__country {
1015
- position: absolute; inset: 0; z-index: 1; inline-size: 100%; block-size: 100%; margin: 0; padding: 0;
1016
- border: 0; opacity: 0; appearance: none; cursor: pointer;
1017
- font: var(--sekyro-type-flow-input) var(--sekyro-font);
1026
+ /* Several contact countries or "Another country" (phone rules spec 2026-11-02 §4.2): the segment is a button with a
1027
+ chevron; it opens the country list under the field, as the native sheet. */
1028
+ .sekyro-phone__pick {
1029
+ margin-block: 0; padding-block: 0; border: 0; background: transparent; color: inherit; font: inherit; cursor: pointer;
1030
+ border-start-start-radius: var(--sekyro-radius); border-end-start-radius: var(--sekyro-radius);
1018
1031
  }
1019
1032
  /* The chevron is drawn here so the JS bundle carries no extra icon; the tighter segment keeps nine digits in view at 320 px. */
1020
- .sekyro-phone:has(.sekyro-phone__country) { padding-inline-end: 0.5rem; }
1033
+ .sekyro-phone:has(.sekyro-phone__pick) { padding-inline-end: 0.5rem; }
1021
1034
  /* Nine grouped digits stay in view beside the chevron on the narrowest phones (phone rules spec 2026-11-02 §4.1). */
1022
- @media (max-width: 359px) { .sekyro-phone:has(.sekyro-phone__country) { gap: 0.5rem; padding-inline-end: 0.25rem; } }
1023
- .sekyro-phone__country + .sekyro-phone__dial { gap: 4px; padding-inline-end: 0.5rem; }
1024
- .sekyro-phone__country + .sekyro-phone__dial::after {
1035
+ @media (max-width: 359px) { .sekyro-phone:has(.sekyro-phone__pick) { gap: 0.5rem; padding-inline-end: 0.25rem; } }
1036
+ .sekyro-phone__pick .sekyro-phone__dial { gap: 4px; padding-inline-end: 0.5rem; }
1037
+ .sekyro-phone__pick .sekyro-phone__dial::after {
1025
1038
  content: ""; inline-size: 7px; block-size: 7px; margin-block-start: -4px; margin-inline-start: 2px;
1026
1039
  border-block-end: 1.5px solid var(--sekyro-color-fg-muted); border-inline-end: 1.5px solid var(--sekyro-color-fg-muted);
1027
1040
  transform: rotate(45deg);
1028
1041
  }
1029
- .sekyro-phone__country:focus-visible + .sekyro-phone__dial { border-radius: 4px; outline: 2px solid var(--sekyro-color-ring); outline-offset: 2px; }
1042
+ .sekyro-phone__pick[aria-expanded="true"] .sekyro-phone__dial::after { margin-block-start: 4px; transform: rotate(-135deg); }
1043
+ .sekyro-phone__pick:focus-visible { outline: none; }
1044
+ .sekyro-phone__pick:focus-visible .sekyro-phone__dial { border-radius: 4px; outline: 2px solid var(--sekyro-color-ring); outline-offset: 2px; }
1045
+ .sekyro-phone__list { display: flex; flex-direction: column; gap: 0.75rem; }
1030
1046
  .sekyro-phone__input {
1031
1047
  flex: 1; min-inline-size: 0; padding: 0; border: 0; outline: none; background: transparent;
1032
1048
  font: inherit; font-variant-numeric: tabular-nums; color: var(--sekyro-color-fg); caret-color: var(--sekyro-color-brand);
1033
1049
  }
1050
+ /* The Form's phone answer: the height of every other field of the form (its text role is set with the Form's fields). */
1051
+ .sekyro-phone--compact { min-block-size: 52px; }
1034
1052
 
1035
1053
  /* The one-time code: full-width boxes over ONE input (paste and autofill land in it). */
1036
1054
  .sekyro-otp-boxes { position: relative; }
@@ -1107,6 +1125,11 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
1107
1125
  transform: rotate(calc(45deg * var(--sekyro-inline-sign)));
1108
1126
  }
1109
1127
  .sekyro-row-btn__flag { font-size: 1.375rem; line-height: 1; }
1128
+ /* Inside the rounded list (overflow hidden) the focus ring sits inside the row, so it is never clipped. */
1129
+ .sekyro-rows .sekyro-row-btn:focus-visible { outline-offset: -2px; }
1130
+ .sekyro-row-btn__name { flex: 1; min-inline-size: 0; }
1131
+ /* The phone list's calling code: left to right, muted, before the row's chevron. */
1132
+ .sekyro-row-btn__detail { color: var(--sekyro-color-fg-muted); font-variant-numeric: tabular-nums; }
1110
1133
 
1111
1134
  /* A small label over a group (the ICAO tips' "For your ID photo:"). */
1112
1135
  .sekyro-section-label { margin: 0; font: var(--sekyro-type-flow-label) var(--sekyro-font); color: var(--sekyro-color-fg-muted); }
@@ -1137,9 +1160,67 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
1137
1160
  border: 1px solid var(--sekyro-color-line); background: var(--sekyro-color-sunken);
1138
1161
  }
1139
1162
 
1163
+ /* ── Form (spec 2026-11-14 §14.2): one column of questions, choices as touch rows, consents last ── */
1164
+ /* Every answer's value in one text role, the body's (17 px: no zoom on focus in iOS Safari): text, numbers, the date's
1165
+ parts, the country and the phone number alike. The extra class outweighs a host page's own input rules. */
1166
+ .sekyro-root .sekyro-form.sekyro-step :is(input.sekyro-input, textarea.sekyro-input, button.sekyro-form-country, .sekyro-phone, .sekyro-phone__input) {
1167
+ font: var(--sekyro-type-flow-body) var(--sekyro-font);
1168
+ }
1169
+ .sekyro-form-questions { display: flex; flex-direction: column; gap: 1.25rem; }
1170
+ .sekyro-form-q { min-inline-size: 0; }
1171
+ .sekyro-form-group { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; border: 0; }
1172
+ .sekyro-form-group > legend { padding: 0; margin-block-end: 0.5rem; }
1173
+ .sekyro-root .sekyro-form-q .sekyro-label { color: var(--sekyro-color-fg); }
1174
+ .sekyro-form-optional { font-weight: 400; color: var(--sekyro-color-fg-muted); white-space: nowrap; }
1175
+ .sekyro-form-choices { display: flex; flex-direction: column; gap: 0.5rem; }
1176
+ .sekyro-form-choice {
1177
+ display: flex; align-items: center; gap: 0.75rem; min-block-size: 52px; padding-block: 0.75rem; padding-inline: 1rem;
1178
+ border: 1px solid var(--sekyro-color-line); border-radius: var(--sekyro-radius); background: var(--sekyro-color-surface);
1179
+ color: var(--sekyro-color-fg); cursor: pointer; transition: border-color 150ms, box-shadow 150ms;
1180
+ }
1181
+ .sekyro-form-choice > input { flex: none; inline-size: 20px; block-size: 20px; margin: 0; accent-color: var(--sekyro-color-brand); cursor: pointer; }
1182
+ .sekyro-form-choice:has(> input:checked) { border-color: var(--sekyro-color-brand); box-shadow: inset 0 0 0 1px var(--sekyro-color-brand); }
1183
+ .sekyro-form-choice:has(> input:focus-visible) { outline: 2px solid var(--sekyro-color-ring); outline-offset: 2px; }
1184
+ .sekyro-form-choice:has(> input[aria-invalid="true"]) { border-color: var(--sekyro-color-danger); }
1185
+ .sekyro-root .sekyro-form-textarea { min-block-size: 7.5rem; padding-block: 0.75rem; resize: vertical; }
1186
+ .sekyro-form-date { display: flex; gap: 0.75rem; }
1187
+ .sekyro-form-date > div { display: flex; flex-direction: column; gap: 0.25rem; }
1188
+ .sekyro-form-date__day, .sekyro-form-date__month { inline-size: 4.5rem; }
1189
+ .sekyro-form-date__year { inline-size: 6.5rem; }
1190
+ .sekyro-form-date .sekyro-input { inline-size: 100%; text-align: center; }
1191
+ /* A country answer: the chosen country as a field (flag, name, a chevron); the document picker's list opens under it. */
1192
+ .sekyro-root .sekyro-form-country { display: flex; align-items: center; gap: 0.75rem; inline-size: 100%; color: var(--sekyro-color-fg); text-align: start; cursor: pointer; }
1193
+ .sekyro-form-country::after {
1194
+ content: ""; flex: none; margin-inline-start: auto; inline-size: 7px; block-size: 7px; margin-block-start: -4px;
1195
+ border-block-end: 1.5px solid var(--sekyro-color-fg-muted); border-inline-end: 1.5px solid var(--sekyro-color-fg-muted);
1196
+ transform: rotate(calc(45deg * var(--sekyro-inline-sign)));
1197
+ }
1198
+ .sekyro-form-country[aria-expanded="true"]::after { margin-block-start: 4px; transform: rotate(calc(-135deg * var(--sekyro-inline-sign))); }
1199
+ .sekyro-form-country__name { min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1200
+ .sekyro-form-country__name.is-empty { color: var(--sekyro-color-fg-subtle); }
1201
+ .sekyro-form-country__list { display: flex; flex-direction: column; gap: 0.75rem; }
1202
+ .sekyro-rows--scroll { max-block-size: 18rem; overflow-y: auto; overscroll-behavior: contain; }
1203
+ .sekyro-row-btn[aria-current="true"] { background: var(--sekyro-color-brand-soft); font-weight: 600; }
1204
+ .sekyro-form-address { display: flex; flex-direction: column; gap: 0.75rem; }
1205
+ .sekyro-form-consents { gap: 0.75rem; }
1206
+ .sekyro-form-consent { display: flex; flex-direction: column; gap: 0.375rem; }
1207
+ .sekyro-form-consent__row { align-items: flex-start; cursor: default; }
1208
+ .sekyro-form-consent__row > input { margin-block-start: 2px; }
1209
+ .sekyro-form-consent__text { display: flex; flex-direction: column; gap: 0.25rem; }
1210
+ .sekyro-form-consent__text > label { cursor: pointer; }
1211
+ .sekyro-root .sekyro-form-consent__link { align-self: flex-start; color: var(--sekyro-color-brand); text-decoration: underline; text-underline-offset: 0.2em; }
1212
+
1140
1213
  /* ── The camera intros' marks: line geometry of what the camera will do ── */
1141
1214
  .sekyro-mark { display: block; margin-inline: auto; overflow: visible; }
1142
- .sekyro-mark--card { inline-size: min(100%, 15.75rem); margin-block: 0.75rem; }
1215
+ .sekyro-mark--card { inline-size: min(100%, 10rem); margin-block: 0; }
1216
+ .sekyro-mark__page { fill: var(--sekyro-color-surface); stroke: var(--sekyro-color-line); stroke-width: 1; }
1217
+ .sekyro-mark__code { stroke: var(--sekyro-color-line-subtle); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 7 4; }
1218
+ /* The document intro (2026-11-16): the mark, the title, the tips and the actions fit a phone screen without scrolling. */
1219
+ .sekyro-step--doc-intro { gap: 1rem; padding-block-start: 0.75rem; }
1220
+ .sekyro-step--doc-intro .sekyro-tiprows { gap: 0.75rem; }
1221
+ /* A short screen (an SE-class phone) drops the mark so the camera button stays on screen. */
1222
+ @media (max-height: 700px) { .sekyro-step--doc-intro > .sekyro-mark--card { display: none; } }
1223
+ .sekyro-root .sekyro-doc-only { margin: 0; font: var(--sekyro-type-flow-body) var(--sekyro-font); color: var(--sekyro-color-fg); }
1143
1224
  .sekyro-mark--face { inline-size: 10.5rem; }
1144
1225
  .sekyro-mark__card { fill: var(--sekyro-color-surface); stroke: var(--sekyro-color-line); stroke-width: 1; }
1145
1226
  .sekyro-mark__photo { fill: var(--sekyro-color-sunken); }
@@ -1160,14 +1241,23 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
1160
1241
  .sekyro-root .sekyro-result { display: flex; flex-direction: column; flex: 1; padding-block-start: 2rem; }
1161
1242
  .sekyro-result__body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.25rem; flex: 1; padding-block-end: 2rem; text-align: center; }
1162
1243
  .sekyro-root .sekyro-result .sekyro-heading { align-items: center; }
1163
- /* The approved disc (64 px) in its soft ring (8 px each side). */
1164
- .sekyro-outcome { inline-size: calc(var(--sekyro-size-result-disc) + 2 * var(--sekyro-size-result-ring)); block-size: calc(var(--sekyro-size-result-disc) + 2 * var(--sekyro-size-result-ring)); }
1165
- .sekyro-outcome__ring { fill: var(--sekyro-color-success-soft, color-mix(in srgb, var(--sekyro-color-success) 14%, var(--sekyro-color-surface))); transform-origin: center; transform-box: fill-box; animation: sekyro-fill 380ms var(--sekyro-spring) both; }
1166
- .sekyro-outcome__disc { fill: var(--sekyro-color-success); transform-origin: center; transform-box: fill-box; animation: sekyro-fill 380ms var(--sekyro-spring) 120ms both; }
1244
+ /* The result's title is the flow's hero role (28/34, Geist 600, -0.015em), as on iOS and Android (ResultScreen). */
1245
+ .sekyro-root .sekyro-result .sekyro-heading > h2 { font: var(--sekyro-type-flow-hero) var(--sekyro-font-display); letter-spacing: var(--sekyro-tracking-flow-hero); }
1246
+ .sekyro-root [lang="ar"] .sekyro-result .sekyro-heading > h2 { font-family: var(--sekyro-font-arabic); line-height: 1.4; }
1247
+ /* The simulated Sandbox session's notice: the width of the column, read from the start like every notice. */
1248
+ .sekyro-result__body .sekyro-notice { align-self: stretch; text-align: start; }
1249
+ /* The verified mark (136 px, as before the 2026-11-05 refresh): the soft success band draws itself round, the disc springs in, the check is traced. */
1250
+ .sekyro-outcome { inline-size: 136px; block-size: 136px; }
1251
+ .sekyro-outcome__ring {
1252
+ fill: none; stroke: var(--sekyro-color-success-soft, color-mix(in srgb, var(--sekyro-color-success) 14%, var(--sekyro-color-surface))); stroke-width: 12; stroke-linecap: butt;
1253
+ stroke-dasharray: 1; stroke-dashoffset: 1; transform: rotate(-90deg); transform-origin: center; transform-box: fill-box;
1254
+ animation: sekyro-draw 450ms ease-out forwards;
1255
+ }
1256
+ .sekyro-outcome__disc { fill: var(--sekyro-color-success); transform-origin: center; transform-box: fill-box; animation: sekyro-fill 380ms var(--sekyro-spring) 380ms both; }
1167
1257
  @keyframes sekyro-fill { from { opacity: 0; transform: scale(0.86); } }
1168
1258
  .sekyro-outcome__glyph {
1169
- fill: none; stroke: var(--sekyro-color-on-success, var(--sekyro-color-surface)); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
1170
- stroke-dasharray: 1; stroke-dashoffset: 1; animation: sekyro-draw 320ms ease-out 380ms forwards;
1259
+ fill: none; stroke: var(--sekyro-color-on-success, var(--sekyro-color-surface)); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round;
1260
+ stroke-dasharray: 1; stroke-dashoffset: 1; animation: sekyro-draw 320ms ease-out 620ms forwards;
1171
1261
  }
1172
1262
  @keyframes sekyro-draw { to { stroke-dashoffset: 0; } }
1173
1263
  .sekyro-outcome-tile { animation: sekyro-fill 380ms var(--sekyro-spring) both; }
@@ -1282,7 +1372,16 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
1282
1372
  .sekyro-root [lang="ar"] .sekyro-lm-line { font-family: var(--sekyro-font-arabic); line-height: 1.4; }
1283
1373
  .sekyro-lm-line.is-leaving { opacity: 0; }
1284
1374
  @keyframes sekyro-line-in { from { opacity: 0; transform: translateY(4px); } }
1285
- .sekyro-lm-attempts { margin: 0; font: var(--sekyro-type-flow-caption) var(--sekyro-font); color: color-mix(in srgb, var(--sekyro-color-on-stage) 80%, transparent); }
1375
+ /* Under the document slot (2026-11-16): the notice band, then the turn cue or the reading note, one column as wide as the
1376
+ slot. The band grows in and out (its rows animate from 0), so what sits under it slides instead of jumping. */
1377
+ .sekyro-lm-below { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; pointer-events: none; }
1378
+ .sekyro-lm-below > .sekyro-lm-note, .sekyro-lm-below > .sekyro-lm-flip { display: flex; margin: 0; }
1379
+ .sekyro-lm-band { display: grid; grid-template-rows: 0fr; inline-size: 100%; opacity: 0; transition: grid-template-rows 200ms ease-out, opacity 150ms ease-out; }
1380
+ .sekyro-lm-band.is-open { grid-template-rows: 1fr; opacity: 1; }
1381
+ .sekyro-lm-band > div { overflow: hidden; min-block-size: 0; }
1382
+ /* The flow's own warning notice (warning-soft, warning-fg, as on iOS and Android), lifted off the scene by a shadow. */
1383
+ .sekyro-root .sekyro-lm-band .sekyro-notice { text-align: start; box-shadow: 0 4px 16px color-mix(in srgb, var(--sekyro-color-stage) 35%, transparent); }
1384
+ .sekyro-root [lang="ar"] .sekyro-lm-band .sekyro-notice { font-family: var(--sekyro-font-arabic); }
1286
1385
  .sekyro-lm-under { position: absolute; inset-inline: 0; display: flex; justify-content: center; margin: 0; pointer-events: none; }
1287
1386
  .sekyro-lm-note { align-items: center; gap: 0.75rem; font: var(--sekyro-type-flow-label) var(--sekyro-font); color: color-mix(in srgb, var(--sekyro-color-on-stage) 85%, transparent); animation: sekyro-fade 250ms ease-out 100ms both; }
1288
1387
  .sekyro-lm-spinner {
@@ -1321,6 +1420,8 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
1321
1420
  max-inline-size: 100%; padding-block: 0.5rem; padding-inline: 0.75rem 1rem; border-radius: 9999px; font: inherit; text-align: start;
1322
1421
  }
1323
1422
  .sekyro-glass.is-on { background: var(--sekyro-color-on-stage); color: var(--sekyro-color-stage); }
1423
+ /* KI-546: too dark to read, the light button is ringed so it is easy to find (it stays off until tapped). */
1424
+ .sekyro-glass.is-cue { box-shadow: 0 0 0 2px var(--sekyro-color-on-stage); }
1324
1425
  .sekyro-glass:focus-visible, .sekyro-shutter:focus-visible { outline: 3px solid var(--sekyro-color-on-stage); outline-offset: 2px; }
1325
1426
  .sekyro-shutter {
1326
1427
  align-self: center; inline-size: 74px; block-size: 74px; border: 3px solid color-mix(in srgb, var(--sekyro-color-on-stage) 90%, transparent);
@@ -1339,6 +1440,8 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
1339
1440
  animation: sekyro-fill 400ms var(--sekyro-spring) both;
1340
1441
  }
1341
1442
  .sekyro-lm-thumb > img { inline-size: 100%; block-size: 100%; object-fit: cover; border-radius: 4.5px; }
1443
+ .sekyro-lm-thumb > .sekyro-glyph { position: absolute; inset: 0; margin: auto; inline-size: 22px; block-size: 22px; fill: currentColor; }
1444
+ .sekyro-lm-received { font: var(--sekyro-type-flow-caption) var(--sekyro-font); color: var(--sekyro-color-on-camera-success); }
1342
1445
  .sekyro-lm-check {
1343
1446
  position: absolute; inset-block-start: -6px; inset-inline-end: -6px; inline-size: 18px; block-size: 18px; border-radius: 50%;
1344
1447
  background: var(--sekyro-color-on-camera-success); fill: none; stroke: var(--sekyro-color-on-stage); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
@@ -1426,10 +1529,11 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
1426
1529
  .sekyro-mark__read { animation: none; transform: translate(calc(var(--sekyro-read-w) * 0.62), 0); }
1427
1530
  .sekyro-mark__arc { animation: none; stroke-dashoffset: 0.45; }
1428
1531
  .sekyro-lm-read, .sekyro-lm-flip-card { animation: none; }
1532
+ .sekyro-lm-band { transition: none; }
1429
1533
  .sekyro-lm-flip-card { transform: rotateY(180deg); }
1430
1534
  .sekyro-lm-read.is-repeating { transform: translateX(calc(var(--sekyro-guide-w) * 0.5 * var(--sekyro-inline-sign))); }
1431
- .sekyro-outcome__glyph { animation: none; stroke-dashoffset: 0; }
1432
- .sekyro-outcome__ring, .sekyro-outcome__disc, .sekyro-outcome-tile, .sekyro-dialog[open], .sekyro-skeleton__bar, .sekyro-handoff__pulse { animation: none; }
1535
+ .sekyro-outcome__ring, .sekyro-outcome__glyph { animation: none; stroke-dashoffset: 0; }
1536
+ .sekyro-outcome__disc, .sekyro-outcome-tile, .sekyro-dialog[open], .sekyro-skeleton__bar, .sekyro-handoff__pulse { animation: none; }
1433
1537
  .sekyro-tile.is-busy { animation: none; }
1434
1538
  .sekyro-lm-brackets > path, .sekyro-progress__bar::before, .sekyro-root .sekyro-btn, .sekyro-card { transition: none; }
1435
1539
  .sekyro-root .sekyro-btn:active, .sekyro-card:active { transform: none; }
@@ -1468,6 +1572,54 @@ a.sekyro-btn { text-decoration: none; }
1468
1572
  /* WhatsApp and SMS as equals: one row, two buttons of the same kind and width (Salem 2026-11-05). */
1469
1573
  .sekyro-channel-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
1470
1574
  .sekyro-channel-row > .sekyro-btn { padding-inline: 0.75rem; }
1575
+ /* Remote choice spec 2026-11-21 §9.1: option cards from the organization's system (form-remote.tsx). The whole card
1576
+ is the target; the picked one carries the partner's brand colour, as the choice rows do. */
1577
+ .sekyro-form-remote { display: flex; flex-direction: column; gap: 0.75rem; }
1578
+ .sekyro-form-cards { display: flex; flex-direction: column; gap: 0.5rem; }
1579
+ .sekyro-form-card {
1580
+ display: flex; align-items: center; gap: 0.75rem; min-block-size: 56px; padding-block: 0.75rem; padding-inline: 1rem;
1581
+ border: 1px solid var(--sekyro-color-line); border-radius: var(--sekyro-radius); background: var(--sekyro-color-surface);
1582
+ color: var(--sekyro-color-fg); cursor: pointer; transition: border-color 150ms, box-shadow 150ms;
1583
+ }
1584
+ .sekyro-form-card > input { flex: none; inline-size: 20px; block-size: 20px; margin: 0; accent-color: var(--sekyro-color-brand); cursor: pointer; }
1585
+ .sekyro-form-card:has(> input:checked) { border-color: var(--sekyro-color-brand); box-shadow: inset 0 0 0 1px var(--sekyro-color-brand); }
1586
+ .sekyro-form-card:has(> input:focus-visible) { outline: 2px solid var(--sekyro-color-ring); outline-offset: 2px; }
1587
+ .sekyro-form-card:has(> input[aria-invalid="true"]) { border-color: var(--sekyro-color-danger); }
1588
+ .sekyro-form-card__picture, .sekyro-form-card__icon {
1589
+ flex: none; inline-size: 40px; block-size: 40px; border-radius: calc(var(--sekyro-radius) * 0.75); object-fit: cover;
1590
+ }
1591
+ .sekyro-form-card__icon {
1592
+ display: inline-flex; align-items: center; justify-content: center; background: var(--sekyro-color-brand-soft);
1593
+ color: var(--sekyro-color-brand);
1594
+ }
1595
+ .sekyro-form-card__icon > svg { inline-size: 22px; block-size: 22px; }
1596
+ .sekyro-form-card__text { display: flex; flex-direction: column; gap: 0.125rem; min-inline-size: 0; }
1597
+ .sekyro-form-card__title { font-size: 0.8125em; color: var(--sekyro-color-fg-muted); }
1598
+ .sekyro-form-card__label { overflow-wrap: anywhere; }
1599
+ .sekyro-form-card__description { font-size: 0.875em; color: var(--sekyro-color-fg-muted); overflow-wrap: anywhere; }
1600
+ .sekyro-form-remote__none { margin: 0; }
1601
+
1602
+ /* 2026-11-22: the browser security check is still running and a submission waits on it (any step). */
1603
+ .sekyro-check-pending {
1604
+ position: fixed; inset-inline: 1rem; inset-block-end: max(1rem, env(safe-area-inset-bottom)); z-index: 2147483000;
1605
+ display: flex; align-items: center; gap: 0.625rem; margin: 0 auto; max-inline-size: 28rem; padding: 0.75rem 1rem; border-radius: 16px;
1606
+ font: var(--sekyro-type-flow-caption) var(--sekyro-font); color: var(--sekyro-color-fg);
1607
+ background: var(--sekyro-color-surface); border: 1px solid var(--sekyro-color-line);
1608
+ box-shadow: 0 6px 24px color-mix(in srgb, var(--sekyro-color-fg) 16%, transparent);
1609
+ }
1610
+ .sekyro-check-pending__spinner {
1611
+ flex: none; inline-size: 18px; block-size: 18px; border-radius: 50%; box-sizing: border-box;
1612
+ border: 2px solid var(--sekyro-color-brand); border-block-start-color: transparent; animation: sekyro-turn 0.9s linear infinite;
1613
+ }
1614
+ @media (prefers-reduced-motion: reduce) { .sekyro-check-pending__spinner { animation: none; } }
1615
+ /* 2026-11-22: the browser check asks the person to confirm. The line sits on @sekyro/web's dimmed backdrop, just
1616
+ above the check's box (65 px high, centered): outside the themed root (a portal on <body>), so it carries its own
1617
+ ink, white on the backdrop's 55% black (contrast 9:1 or more over any page). */
1618
+ .sekyro-check-confirm {
1619
+ position: fixed; inset-inline: 1rem; inset-block-start: calc(50% - 33px - 0.75rem); transform: translateY(-100%); z-index: 2147483647;
1620
+ margin: 0 auto; max-inline-size: 22.5rem; text-align: center; pointer-events: none;
1621
+ font: 600 1rem/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", sans-serif; color: var(--sekyro-color-on-scrim);
1622
+ }
1471
1623
 
1472
1624
  /* @sekyro/elements: the element is a block, like the flow's own root. */
1473
1625
  sekyro-verification { display: block; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekyro/elements",
3
- "version": "0.1.0-rc.3",
3
+ "version": "0.1.0-rc.30",
4
4
  "description": "Sekyro AI custom elements: <sekyro-verification> for Vue, Angular, Svelte and plain HTML, the @sekyro/react flow with React bundled inside",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -94,7 +94,7 @@
94
94
  "api:check": "api-extractor run"
95
95
  },
96
96
  "peerDependencies": {
97
- "@sekyro/web": "^0.1.0-rc.26 || ^0.2.0-rc.0"
97
+ "@sekyro/web": "^0.1.0-rc.53 || ^0.2.0-rc.0"
98
98
  },
99
99
  "devDependencies": {
100
100
  "@microsoft/api-extractor": "^7.59.4",
package/sbom.cdx.json CHANGED
@@ -97,8 +97,8 @@
97
97
  "type": "application",
98
98
  "name": "elements",
99
99
  "group": "@sekyro",
100
- "version": "0.1.0-rc.3",
101
- "bom-ref": "@sekyro/elements@0.1.0-rc.3",
100
+ "version": "0.1.0-rc.30",
101
+ "bom-ref": "@sekyro/elements@0.1.0-rc.30",
102
102
  "description": "Sekyro AI custom elements: <sekyro-verification> for Vue, Angular, Svelte and plain HTML, the @sekyro/react flow with React bundled inside",
103
103
  "licenses": [
104
104
  {
@@ -108,7 +108,7 @@
108
108
  }
109
109
  }
110
110
  ],
111
- "purl": "pkg:npm/%40sekyro/elements@0.1.0-rc.3?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-elements",
111
+ "purl": "pkg:npm/%40sekyro/elements@0.1.0-rc.30?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-elements",
112
112
  "externalReferences": [
113
113
  {
114
114
  "url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
@@ -147,7 +147,7 @@
147
147
  "components": [],
148
148
  "dependencies": [
149
149
  {
150
- "ref": "@sekyro/elements@0.1.0-rc.3"
150
+ "ref": "@sekyro/elements@0.1.0-rc.30"
151
151
  }
152
152
  ]
153
153
  }
@@ -1 +0,0 @@
1
- import{c as a,d as s,e as o,f as r,g as _,h as t,i as A,j as C,k as D,l as p,m as i}from"./chunk-ZMHEKDRM.js";import"./chunk-WPRIGJHG.js";import"./chunk-2FETDQV5.js";import"./chunk-EWTKC2C2.js";import"./chunk-L22GFJQV.js";import"./chunk-434MMEWK.js";import"./chunk-P7K7ELYZ.js";import"./chunk-JS2IXPNL.js";import"./chunk-4FHWXBOB.js";export{i as CAPTURE_CANDIDATE_SPACING_MS,p as CAPTURE_EXTRA_CANDIDATES,C as CaptureSessionDoc,o as DOC_BLACK_FRAME_LUMA,r as DOC_BLACK_FRAME_TICKS,_ as DOC_CADENCE_HZ,s as DOC_FIRST_FRAME_MS,t as DOC_SHUTTER_DEFAULTS,D as passportBandOf,A as resolveDocShutterTuning,a as warmDocDetector};
@@ -1 +0,0 @@
1
- import{a as i}from"./chunk-4FHWXBOB.js";var k=new Set(["challenge_frame_blocked","challenge_script_blocked","site_key_rejected","challenge_failed","timeout","embedder_opaque"]),f,o=(f=class extends Error{constructor(t,n){super(`Sekyro challenge failed: ${t}${n!==void 0?` (${n})`:""}`),this.name="ChallengeError",this.code=t,n!==void 0&&(this.detail=n)}},i(f,"i"),f),b=1e4,p=3e4,E="sekyro.challenge.",T="position:fixed;width:1px;height:1px;inset-block-start:0;inset-inline-start:0;opacity:0;pointer-events:none;border:0",d=null,m=Promise.resolve();function S(){h(),m=Promise.resolve(),g=!1}i(S,"A");function u(){return new o("aborted")}i(u,"d");function L(){let e=globalThis.crypto;return e!==void 0&&typeof e.randomUUID=="function"?e.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}i(L,"k");function v(e){return new URL(e,document.baseURI).origin}i(v,"y");function h(){let e=d;if(e!==null){d=null,window.removeEventListener("message",e.listener),e.iframe.remove();for(let t of e.waiters.values())t.reject(new o("challenge_frame_blocked"));e.waiters.clear()}}i(h,"u");function R(e,t){if(t.source!==e.iframe.contentWindow||t.origin!==e.origin)return;let n=t.data;if(typeof n!="object"||n===null)return;let r=n;if(typeof r.type!="string"||!r.type.startsWith(E)||r.v!==1)return;if(r.type==="sekyro.challenge.ready"){e.isReady=!0,e.onReady?.();return}if(typeof r.id!="string")return;let l=e.waiters.get(r.id);if(l!==void 0){if(r.type==="sekyro.challenge.token"&&typeof r.token=="string"&&r.token!=="")e.waiters.delete(r.id),l.resolve(r.token);else if(r.type==="sekyro.challenge.error"){e.waiters.delete(r.id);let a=typeof r.code=="string"&&k.has(r.code)?r.code:"challenge_failed",s=typeof r.detail=="string"||typeof r.detail=="number"?String(r.detail).slice(0,32):void 0;l.reject(new o(a,s))}}}i(R,"C");function U(e){if(d!==null&&d.url===e)return d;h();let t=document.createElement("iframe");t.setAttribute("title","Security check"),t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex","-1"),t.setAttribute("referrerpolicy","no-referrer"),t.setAttribute("style",T);let n={url:e,origin:v(e),iframe:t,isReady:!1,onReady:null,waiters:new Map,listener:i(r=>R(n,r),"listener")};return window.addEventListener("message",n.listener),t.src=e,document.body.appendChild(t),d=n,n}i(U,"M");function x(e,t,n){return e.isReady?Promise.resolve():new Promise((r,l)=>{let a=i(()=>{clearTimeout(c),n?.removeEventListener("abort",s),e.onReady=null},"o"),s=i(()=>{a(),l(u())},"s"),c=setTimeout(()=>{a(),l(new o("challenge_frame_blocked"))},t);n?.addEventListener("abort",s,{once:!0}),e.onReady=()=>{a(),r()}})}i(x,"x");async function w(e){let t=e.signal;if(t?.aborted)throw u();let n=U(e.frameUrl);await x(n,e.readyTimeoutMs??b,t);let r=n.iframe.contentWindow;if(r===null)throw new o("challenge_frame_blocked");let l=e.timeoutMs??p,a=L(),s,c;try{return await new Promise((_,y)=>{n.waiters.set(a,{resolve:_,reject:y}),s=setTimeout(()=>y(new o("timeout")),l),t!==void 0&&(c=i(()=>y(u()),"l"),t.addEventListener("abort",c,{once:!0})),r.postMessage({type:"sekyro.challenge.request",v:1,id:a,siteKey:e.siteKey,action:e.action,subject:e.subject},n.origin)})}finally{clearTimeout(s),t!==void 0&&c!==void 0&&t.removeEventListener("abort",c),n.waiters.delete(a)}}i(w,"h");var g=!1;function A(e,t){if(g)return;let n;if(t==="challenge_frame_blocked"){let r=e;try{r=v(e)}catch{}n=`Sekyro: the security check frame could not load. Allow \`frame-src ${r}\` in your Content-Security-Policy.`}else if(t==="embedder_opaque")n="Sekyro: the security check needs a page with an origin. Do not run the SDK in a sandboxed or data: document.";else return;g=!0,console.warn(n)}i(A,"R");async function C(e){if(globalThis.origin==="null")throw new o("embedder_opaque");if(e.signal?.aborted)throw u();try{return await w(e)}catch(t){if(h(),e.signal?.aborted||t instanceof o&&t.code==="aborted")throw u();try{return await w(e)}catch(n){throw h(),e.signal?.aborted?u():n instanceof o?n:new o("challenge_failed")}}}i(C,"S");function M(e){let t=i(()=>C(e).catch(r=>{throw r instanceof o&&A(e.frameUrl,r.code),r}),"n"),n=m.then(t,t);return m=n.catch(()=>{}),n}i(M,"T");export{p as CHALLENGE_EXECUTE_TIMEOUT_MS,b as CHALLENGE_READY_TIMEOUT_MS,o as ChallengeError,M as executeChallenge,S as resetChallengeFrameForTests};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk-4FHWXBOB.js";var z=Object.freeze({minLines:4,fillMin:.55,fillMax:.98,offsetMax:.12,steadyFillDelta:.04,steadyOffsetDelta:.03,layoutShiftMax:.025,lineCountDelta:1,lockMs:600,steadyMs:900,minFrames:3});function R(r,t){let e=r.lineBoxes;if(e.length===0)return{lineCount:0,detected:!1,fill:0,offsetX:0,offsetY:0,centers:[]};let s=Math.min(...e.map(i=>i[0])),a=Math.max(...e.map(i=>i[0]+i[2])),l=Math.min(...e.map(i=>i[1])),h=Math.max(...e.map(i=>i[1]+i[3]));return{lineCount:e.length,detected:e.length>=t.minLines,fill:a-s,offsetX:(s+a)/2-.5,offsetY:(l+h)/2-.5,centers:e.map(i=>[i[0]+i[2]/2,i[1]+i[3]/2])}}n(R,"y");function N(r,t){if(r.centers.length===0||t.centers.length===0)return Number.POSITIVE_INFINITY;let e=0;for(let[s,a]of t.centers){let l=Number.POSITIVE_INFINITY;for(let[h,i]of r.centers)l=Math.min(l,Math.hypot(s-h,a-i));e+=l}return e/t.centers.length}n(N,"x");var x,O=(x=class{constructor(t=z){this.t=t,this.last=null,this.goodSince=null,this.steadySince=null,this.frames=0}offer(t,e,s={glareOk:!0,sharpOk:!0}){let a=this.t,l=R(t,a),h=this.last;this.last=l;let i=l.fill>=a.fillMin&&l.fill<=a.fillMax,o=Math.abs(l.offsetX)<=a.offsetMax&&Math.abs(l.offsetY)<=a.offsetMax,c=h!==null&&h.detected&&Math.abs(l.lineCount-h.lineCount)<=a.lineCountDelta&&N(h,l)<=a.layoutShiftMax,u=l.detected&&s.glareOk&&s.sharpOk&&i&&c&&h!==null&&Math.abs(l.fill-h.fill)<=a.steadyFillDelta&&Math.abs(l.offsetX-h.offsetX)<=a.steadyOffsetDelta&&Math.abs(l.offsetY-h.offsetY)<=a.steadyOffsetDelta,g=u&&o,m=l.detected?s.glareOk?l.fill<a.fillMin?"closer":l.fill>a.fillMax?"farther":o?s.sharpOk?void 0:"blurry":"center":"glare":void 0;return u?(this.frames++,this.steadySince??(this.steadySince=e),this.goodSince=g?this.goodSince??e:null,(this.goodSince!==null&&e-this.goodSince>=a.lockMs||e-this.steadySince>=a.steadyMs)&&this.frames>=a.minFrames?{state:"locked"}:{state:"locking",...m?{hint:m}:{}}):(this.goodSince=null,this.steadySince=null,this.frames=l.detected?1:0,{state:l.detected?"locking":"searching",...m?{hint:m}:{}})}reset(){this.last=null,this.goodSince=null,this.steadySince=null,this.frames=0}},n(x,"c"),x);var C=[[1,0],[0,1],[1,1],[1,-1]];function E(r){let{width:t,height:e,data:s}=r;if(t<16||e<16)return-1;let a=new Uint8Array(t*e);for(let h=0,i=0;h<a.length;h+=1,i+=4)a[h]=Math.round(.299*(s[i]??0)+.587*(s[i+1]??0)+.114*(s[i+2]??0));let l=-1;for(let[h,i]of C){let o=new Uint32Array(256),c=new Float64Array(256),u=0;for(let d=1;d<e-1;d+=1){let f=d*t,F=(d+i)*t,_=(d-i)*t;for(let p=1;p<t-1;p+=1){let T=a[F+p+h]??0,I=a[_+p-h]??0,S=Math.abs(T-I);o[S]=(o[S]??0)+1,c[S]=(c[S]??0)+Math.abs(T+I-2*(a[f+p]??0)),u+=1}}let g=Math.max(1,Math.floor(u/20)),m=0,M=0,k=0;for(let d=255;d>=0&&m<g;d-=1){let f=o[d]??0;m+=f,M+=f*d,k+=c[d]??0}if(M===0)return 0;let y=k/M;l=l<0?y:Math.min(l,y)}return l}n(E,"w");var A=.06;function B(r,t,e,s=A){if(r===null||t.width<=0||t.height<=0)return null;let a=[r.topLeft,r.topRight,r.bottomRight,r.bottomLeft],l=e.width/t.width,h=e.height/t.height,i=Math.min(...a.map(f=>f.x))*l,o=Math.max(...a.map(f=>f.x))*l,c=Math.min(...a.map(f=>f.y))*h,u=Math.max(...a.map(f=>f.y))*h,g=(o-i)*s,m=(u-c)*s,M=Math.max(0,Math.floor(i-g)),k=Math.max(0,Math.floor(c-m)),y=Math.min(e.width,Math.ceil(o+g)),d=Math.min(e.height,Math.ceil(u+m));return y-M<16||d-k<16?null:{x:M,y:k,width:y-M,height:d-k}}n(B,"P");function X(r,t){let e=t??{x:0,y:0,width:r.width,height:r.height},s=Math.min(1,1e3/Math.max(e.width,e.height)),a=Math.max(1,Math.round(e.width*s)),l=Math.max(1,Math.round(e.height*s)),h=document.createElement("canvas");h.width=a,h.height=l;try{let i=h.getContext("2d",{willReadFrequently:!0});return i===null?-1:(i.imageSmoothingQuality="high",i.drawImage(r,e.x,e.y,e.width,e.height,0,0,a,l),E(i.getImageData(0,0,a,l)))}catch{return-1}finally{h.width=0,h.height=0}}n(X,"B");var b,G=(b=class{constructor(t=2){this.stableReads=t,this.last=null,this.run=0}offer(t){return t===null?(this.reset(),!1):(this.run=t===this.last?this.run+1:1,this.last=t,this.run>=this.stableReads)}reset(){this.last=null,this.run=0}},n(b,"k"),b),L=Object.freeze({...z,minIntervalMs:150,maxWidthPx:480,detectorLimit:960,searchTimeoutMs:12e3}),P=Object.freeze({detectorLimit:960,bandMaxWidthPx:1280,minBandWidthPx:900,bandTop:.55,minIntervalMs:150,stableReads:2,profileReads:5,maxReadMs:1200,searchTimeoutMs:12e3}),V=n((r,t,e)=>createImageBitmap(r,Math.round(t.x),Math.round(t.y),Math.max(1,Math.round(t.w)),Math.max(1,Math.round(t.h)),{resizeWidth:Math.max(1,Math.round(Math.min(t.w,e))),resizeQuality:"high"}),"C"),w=n((r,t)=>{if(r.length===0)return 0;let e=[...r].sort((s,a)=>s-a);return e[Math.min(e.length-1,Math.floor(e.length*t))]},"x");function Y(r){return r<=250?"fast":r<=600?"mid":"slow"}n(Y,"G");function j(r,t,e){let s=r.y+r.h*t,a=Math.min(e,r.y+r.h*1.05);return{x:r.x,y:s,w:r.w,h:Math.max(1,a-s)}}n(j,"Y");var v,U=(v=class{constructor(t){this.o=t,this.engine=null,this.gen=0,this.inFlight=!1,this.lastReadAt=Number.NEGATIVE_INFINITY,this.firstSeen=null,this.reads=0,this.times=[],this.mrzState={state:"searching"},this.lockState={state:"searching"},this.fallback=null,this.lockOff=!1,this.lockError=!1,this.fired=null,this.valid=null,this.faceMode="off",this.disabled=!1,this.crop=t.crop??V,this.mrzGate=new G(t.liveMrz?.stableReads??2),this.lockGate=new O(t.textLock??L)}setEngine(t){this.engine=t}get bandTop(){return this.o.liveMrz?.bandTop??P.bandTop}get hasEngine(){return this.engine!==null&&!this.disabled}reset(){this.gen++,this.inFlight=!1,this.lastReadAt=Number.NEGATIVE_INFINITY,this.firstSeen=null,this.reads=0,this.times=[],this.mrzGate.reset(),this.lockGate.reset(),this.mrzState={state:"searching"},this.lockState={state:"searching"},this.fallback=null,this.lockOff=!1,this.lockError=!1,this.fired=null,this.valid=null,this.faceMode="off"}rearmFace(){this.gen++,this.inFlight=!1,this.lastReadAt=Number.NEGATIVE_INFINITY,this.mrzGate.reset(),this.lockGate.reset(),this.fired=null,this.valid=null,this.fallback===null&&(this.mrzState={state:"searching"}),this.lockOff||(this.lockState={state:"searching"})}liveCapture(){return this.fired?.via==="live_mrz"?this.valid:null}modeFor(t){return this.engine===null||this.disabled?"off":t.mrzFace&&this.o.liveMrz!==null&&this.fallback===null?"live_mrz":this.o.textLock!==null&&!this.lockOff?"text_lock":"off"}tick(t){let e=this.modeFor(t);return e!=="off"&&(this.faceMode=e),this.fired!==null?{ready:!0,via:this.fired.via,suspendQuality:this.fired.via==="live_mrz",mode:e,...this.states()}:e==="live_mrz"?this.liveTick(t,this.o.liveMrz):e==="text_lock"?this.lockTick(t,this.o.textLock):{ready:!1,suspendQuality:!1,mode:e,...this.states()}}states(){return{...this.faceMode==="live_mrz"||this.fallback!==null?{mrz:this.fallback!==null?{state:"fallback",reason:this.fallback}:this.mrzState}:{},...this.faceMode==="text_lock"?{lock:this.lockState}:{}}}canRead(t,e){let s=this.engine;return s!==null&&!this.inFlight&&!s.busy&&t-this.lastReadAt>=e}fall(t){this.fallback=t,this.mrzGate.reset()}liveTick(t,e){let s=n(()=>this.fallback!==null?{ready:!1,suspendQuality:!1,mode:"live_mrz",mrz:{state:"fallback",reason:this.fallback}}:{ready:!1,suspendQuality:!0,mode:"live_mrz",mrz:this.mrzState},"r");if(!t.present||t.band===null)return this.mrzGate.reset(),this.mrzState={state:"searching"},s();if(this.firstSeen??(this.firstSeen=t.atMs),t.atMs-this.firstSeen>e.searchTimeoutMs)return this.fall("timeout"),s();if(t.band.w<e.minBandWidthPx)return t.card!==null&&t.card.w<e.minBandWidthPx?(this.fall("unsupported"),s()):(this.mrzState={state:"reading",coach:t.portrait?"turnSideways":"moveCloser"},{ready:!1,suspendQuality:!1,mode:"live_mrz",mrz:this.mrzState});if(!this.canRead(t.atMs,e.minIntervalMs))return s();this.inFlight=!0,this.lastReadAt=t.atMs;let a=this.gen,l=this.engine,h=t.glareOk?t.sharpOk?void 0:"holdStill":"glare";return this.crop(t.video,t.band,e.bandMaxWidthPx).then(i=>l.bandRead(i,e.detectorLimit)).then(i=>{if(a===this.gen){if(this.reads++,this.times.push(i.ms),this.times.length>8&&this.times.shift(),this.reads>=e.profileReads&&w(this.times,.5)>e.maxReadMs)return this.fall("slow");if(this.mrzGate.offer(i.valid?i.digest??null:null)&&i.format&&i.digest){this.valid={format:i.format,...i.documentCode!==void 0?{documentCode:i.documentCode}:{},digest:i.digest,lineCount:i.lineCount,framesToValid:this.reads,msToValid:Math.round(t.atMs-(this.firstSeen??t.atMs))},this.mrzState={state:"valid",format:i.format},this.fired={via:"live_mrz",at:t.atMs};return}this.mrzState={state:"reading",...h?{coach:h}:{},...i.format?{format:i.format}:{}}}}).catch(()=>{a===this.gen&&this.fall("error")}).finally(()=>{a===this.gen&&(this.inFlight=!1)}),s()}lockTick(t,e){let s=n(()=>({ready:!1,suspendQuality:!1,mode:"text_lock",lock:this.lockState,...this.fallback!==null?{mrz:{state:"fallback",reason:this.fallback}}:{}}),"r");if(!t.present||t.card===null)return this.lockGate.reset(),this.lockState={state:"searching"},s();if(this.firstSeen??(this.firstSeen=t.atMs),t.atMs-this.firstSeen>e.searchTimeoutMs)return this.lockOff=!0,s();if(!this.canRead(t.atMs,e.minIntervalMs))return s();this.inFlight=!0,this.lastReadAt=t.atMs;let a=this.gen,l=this.engine,h={glareOk:t.glareOk,sharpOk:t.sharpOk};return this.crop(t.video,t.card,e.maxWidthPx).then(i=>l.layoutRead(i,e.detectorLimit)).then(i=>{if(a!==this.gen)return;this.reads++,this.times.push(i.ms),this.times.length>8&&this.times.shift();let o=this.lockGate.offer(i,t.atMs,h);this.lockState=o.state==="locked"?{state:"locked"}:{state:o.state,...o.hint?{hint:o.hint}:{}},o.state==="locked"&&(this.fired={via:"text_lock",at:t.atMs})}).catch(()=>{a===this.gen&&(this.lockOff=!0,this.lockError=!0)}).finally(()=>{a===this.gen&&(this.inFlight=!1)}),s()}disable(){this.disabled=!0,this.reset()}report(t,e,s){let a=this.faceMode;if(a==="off")return null;let l=w(this.times,.5),h={capture:t,mode:a,reads:this.reads,...this.times.length>0?{readP50Ms:Math.round(l),readP90Ms:Math.round(w(this.times,.9)),deviceClass:Y(l)}:{}};return a==="live_mrz"?this.fired?.via==="live_mrz"&&this.valid!==null&&e==="live_mrz"?{...h,outcome:"valid",format:this.valid.format,framesToValid:this.valid.framesToValid,msToValid:this.valid.msToValid}:this.fallback!==null?{...h,outcome:this.fallback}:{...h,outcome:s-(this.firstSeen??s)>=(this.o.liveMrz?.searchTimeoutMs??1/0)?"timeout":"off"}:this.fired?.via==="text_lock"?{...h,outcome:"locked",framesToLock:Math.max(1,this.reads),msToLock:Math.round(this.fired.at-(this.firstSeen??this.fired.at))}:{...h,outcome:this.lockError?"error":this.lockOff?"timeout":"off"}}},n(v,"L"),v);export{B as a,X as b,L as c,P as d,j as e,U as f};
@@ -1 +0,0 @@
1
- import{a as xr}from"./chunk-MJEQ5ANO.js";import{b as gr,d as kr}from"./chunk-UNQ3QO4U.js";import{b as Sr,c as bt}from"./chunk-5K4YQOZN.js";import{c as _t}from"./chunk-YRTHQZAW.js";import{a as mr,b as yr,c as vr,d as Le}from"./chunk-QOZB3DLY.js";import{F as _r,K as Cr,L as wr,a as D,b as de,c as X,m as dr,n as Je,p as pr,q as Xe,r as hr,s as fr,t as kt,u as se,v as Ae,w as et,y as br}from"./chunk-SIPFHN7E.js";import{b as or,c as lr,d as cr,g as ur}from"./chunk-7MV4CI4L.js";import{b as gt}from"./chunk-434MMEWK.js";import{a as s}from"./chunk-5QL6W6FW.js";import{f as ir}from"./chunk-CW56KMMH.js";import{a as i,c as E}from"./chunk-4FHWXBOB.js";var Mr=E(D(),1),v=E(de(),1),ee=E(de(),1),ye=E(D(),1),B=E(de(),1),_=E(D(),1),y=E(D(),1),st=E(D(),1),fe=E(de(),1),Qr=E(D(),1),Y=E(D(),1),it=E(D(),1),we=E(de(),1),Se=E(de(),1),U=E(de(),1);var ot=E(D(),1),pe=E(D(),1);var Q=E(D(),1);var M=E(D(),1),me=E(D(),1),Te=E(D(),1),Mt=E(de(),1),k=E(de(),1);function ie({className:e,children:t}){return(0,v.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}i(ie,"te");s(ie,"Svg");var Rt="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function Rr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,v.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}i(Rr,"cn");s(Rr,"SunIcon");function Lr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,v.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}i(Lr,"ln");s(Lr,"FaceUncoveredIcon");function Ar(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,v.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,v.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}i(Ar,"un");s(Ar,"PhoneEyeLevelIcon");function Er(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,v.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}i(Er,"dn");s(Er,"LookStraightIcon");function Ir(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:Rt}),(0,v.jsx)("path",{d:"M9 13l2 2 4-4"})]})}i(Ir,"pn");s(Ir,"CameraCheckIcon");function Ur(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:Rt}),(0,v.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}i(Ur,"fn");s(Ur,"CameraAskIcon");function jr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:Rt}),(0,v.jsx)("path",{d:"M3 3l18 18"})]})}i(jr,"mn");s(jr,"CameraBlockedIcon");function rt({off:e,className:t}){return(0,v.jsxs)(ie,{className:t,children:[(0,v.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,v.jsx)("path",{d:"M4 4l16 16"}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,v.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}i(rt,"Ve");s(rt,"SpeakerIcon");function Tr(e){return(0,v.jsx)(ie,{...e,children:(0,v.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}i(Tr,"yn");s(Tr,"CheckIcon");function Pr(e){return(0,v.jsxs)(ie,{className:e.className??"sekyro-spinner",children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,v.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}i(Pr,"gn");s(Pr,"SpinnerIcon");var Ct=["light","uncover","eyeLevel","straight"],An={light:{key:"capture.tips.light",icon:s(()=>(0,ee.jsx)(Rr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,ee.jsx)(Lr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,ee.jsx)(Ar,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,ee.jsx)(Er,{}),"icon")}};function Or({tips:e}){let t=Le(),n=(0,Mr.useId)();return e.length===0?null:(0,ee.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,ee.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,ee.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?An[r]:void 0,o=typeof r=="string"?r:r.id,l=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,u=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,ee.jsxs)("li",{className:"sekyro-tips__item",children:[l!=null?(0,ee.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:l}):null,(0,ee.jsx)("span",{children:u})]},o)})})]})}i(Or,"vn");s(Or,"TipList");var En=220;function Br({title:e,description:t,options:n,busy:r,error:a,focus:o,testId:l,look:u="cards",marked:S,onChoose:h}){let w=(0,ye.useId)(),x=kt(),[I,d]=(0,ye.useState)(null),N=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&d(null)},[a]),(0,ye.useEffect)(()=>()=>{N.current!==null&&clearTimeout(N.current)},[]);let R=s(p=>{r||I!==null||(d(p),N.current=setTimeout(()=>{N.current=null,d(null),h(p)},En))},"choose");return(0,B.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":l,children:[(0,B.jsxs)("div",{className:u==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,B.jsx)("h2",{id:w,ref:o?x:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,B.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,B.jsx)(se,{tone:"danger",children:(0,B.jsx)("span",{children:a})}):null,u==="buttons"?(0,B.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((p,j)=>(0,B.jsx)(X,{kind:j===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:i(()=>h(p.id),"onClick"),children:p.label},p.id))}):(0,B.jsx)("div",{className:"sekyro-choices",children:n.map(p=>(0,B.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(I??S)===p.id,"aria-busy":r||void 0,disabled:r||I!==null&&I!==p.id,onClick:i(()=>R(p.id),"onClick"),children:[p.glyph!==void 0?(0,B.jsx)("span",{className:"sekyro-card__tile",children:p.glyph}):null,(0,B.jsxs)("span",{className:"sekyro-card__body",children:[(0,B.jsx)("span",{className:"sekyro-card__title",children:p.label}),p.sub!==void 0?(0,B.jsx)("span",{className:"sekyro-card__sub",children:p.sub}):null]}),(0,B.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},p.id))})]})}i(Br,"kn");s(Br,"ChoiceScreen");var qr=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary"];function nt(e){return e!==null&&qr.includes(e)}i(nt,"he");s(nt,"isVoiceKey");var In=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&In(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}i(je,"Me");s(je,"resolveClip");var Un="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",jn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ae(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}i(ae,"ne");s(ae,"synth");function Vr(){return ae()!==null&&typeof SpeechSynthesisUtterance=="function"}i(Vr,"wr");s(Vr,"speechAvailable");function wt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}i(wt,"bn");s(wt,"baseLang");function Lt(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=wt(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>wt(a.lang)===r)}i(Lt,"Vn");s(Lt,"pickVoice");function Hr(e){if(!Vr())return!1;let t=[];try{t=ae()?.getVoices()??[]}catch{return!0}return t.length===0||Lt(t,e)!==void 0}i(Hr,"Mn");s(Hr,"speechUsable");function Dr(e){let t=ae();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}i(Dr,"wn");s(Dr,"subscribeVoices");function He(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}i(He,"Ke");s(He,"clipIdentity");function St(e){e.pause(),e.removeAttribute("src"),e.load()}i(St,"Sn");s(St,"release");function $r(){let e=null,t=null,n=0,r=null,a=[],o=new Map,l=s(()=>{a=ae()?.getVoices()??[]},"loadVoices"),u=!1,S=s(()=>{let d=ae();u||d===null||(u=!0,l(),d.addEventListener?.("voiceschanged",l))},"bindVoices"),h=s(()=>(e??(e=new Audio),e),"element"),w=s((d,N,R)=>{let p=ae();if(p!==null&&d!==""&&typeof SpeechSynthesisUtterance=="function"){S();let j=Lt(a,N);if(a.length===0||j!==void 0){p.cancel();let C=new SpeechSynthesisUtterance(d);C.lang=N,j!==void 0&&(C.voice=j),C.rate=.95,R!==void 0&&(C.onend=C.onerror=R),p.speak(C);return}}R?.()},"speak"),x=s(()=>{n+=1,r=null,e!==null&&(e.pause(),e.currentTime=0),ae()?.cancel()},"stop"),I=s(d=>{for(let N of d){let R=He(N);if(o.has(R))continue;let p=new Audio;p.preload="auto",p.src=N,o.set(R,p)}},"warmClips");return{say(d){let N=d.url!==null?He(d.url):`tts:${d.lang}:${d.text}`;if(N===r)return;r=N,n+=1;let R=n,p=d.onEnd,j=p!==void 0?()=>{R===n&&p()}:void 0;if(ae()?.cancel(),d.url!==null){let C=h();C.pause(),C.muted=!1,C.src=d.url,C.currentTime=0,C.onended=j??null,C.play()?.catch(A=>{R===n&&A?.name!=="AbortError"&&(d.speech?w(d.text,d.lang,j):j?.())});return}d.speech?w(d.text,d.lang,j):j?.()},unlock({lang:d,speech:N,prefetch:R}){let p=h();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let A=Uint8Array.from(atob(Un),q=>q.charCodeAt(0));t=URL.createObjectURL(new Blob([A],{type:"audio/wav"}))}let j=p.paused===!1&&t!==null&&p.src!==t;t!==null&&!j&&(p.muted=!0,p.onended=null,p.src=t,p.play()?.catch(()=>{}));let C=ae();if(N&&C!==null&&typeof SpeechSynthesisUtterance=="function"){S();let A=new SpeechSynthesisUtterance(" ");A.volume=0,A.lang=d,C.speak(A)}I(R??[])},prefetch:I,stop:x,dispose(){x(),u&&ae()?.removeEventListener?.("voiceschanged",l),u=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&St(e),e=null;for(let d of o.values())St(d);o.clear()}}}i($r,"Ln");s($r,"createVoicePlayer");var Tn="sekyro.voiceGuidance";function Fr(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}i(Fr,"xn");s(Fr,"readVoicePreference");function Gr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}i(Gr,"In");s(Gr,"writeVoicePreference");var Ve="capture.tips.summary",Pn=typeof window<"u"?_.useLayoutEffect:_.useEffect,On=Object.freeze({});function tt(e,t){let n=new Set,r=[];for(let a of qr){let o=a===Ve?null:je(e,a,t);o===null||n.has(He(o))||(n.add(He(o)),r.push(o))}return r}i(tt,"gt");s(tt,"resolvedClipUrls");function Kr({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},o=a.storageKey===void 0?Tn:a.storageKey,[l,u]=(0,_.useState)(a.defaultEnabled??!0),S=(0,_.useRef)(l),[h,w]=(0,_.useState)(!1),[x,I]=(0,_.useState)("none"),[d,N]=(0,_.useState)(!1),R=(0,_.useRef)(!1),[p,j]=(0,_.useState)(0),C=(0,_.useRef)(null),A=(0,_.useCallback)(()=>(C.current??(C.current=$r()),C.current),[]),q=jn[e],$=a.speechFallback,f=$===void 0||$===!0?!0:$===!1?!1:$.includes(e),F=a.clips??t??On,oe=(0,_.useRef)(!1),le=(0,_.useRef)(F);Pn(()=>{le.current=F,S.current=l}),(0,_.useEffect)(()=>{if(r||o===null)return;let L=Fr(o);L!==null&&(S.current=L,u(L))},[r,o]),(0,_.useEffect)(()=>{if(!(r||!f))return Dr(()=>j(L=>L+1))},[r,f]);let c=a.clips;(0,_.useEffect)(()=>{if(r)return;let L=f&&Hr(q);w(tt(F,e).length>0||L),I(c!==void 0&&je(c,Ve,e)!==null?"partner":je(F,Ve,e)!==null||L?"default":"none")},[r,F,c,e,f,q,p]),(0,_.useEffect)(()=>{if(r||!l||!oe.current)return;let L=tt(F,e);L.length>0&&A().prefetch(L)},[r,l,F,e,A]),(0,_.useEffect)(()=>()=>{C.current?.dispose(),C.current=null,oe.current=!1},[]);let V=(0,_.useCallback)(L=>{r||(oe.current=!0,A().unlock({lang:q,speech:f,...L?{prefetch:tt(le.current,e)}:{}}))},[r,A,q,f,e]),T=(0,_.useCallback)(()=>V(S.current),[V]),G=(0,_.useCallback)(()=>{R.current=!1,N(!1)},[]),O=(0,_.useCallback)(()=>{G(),C.current?.stop()},[G]),ve=(0,_.useCallback)(()=>{R.current&&O()},[O]),he=(0,_.useCallback)((L,xe)=>{if(r)return;if(R.current){O();return}let ge=A();ge.stop(),R.current=!0,N(!0);let P=xe?.clip===!1?null:je(le.current,Ve,e);ge.say({url:P,text:L,lang:q,speech:f,onEnd:G})},[r,O,A,e,q,f,G]),K=(0,_.useCallback)(L=>{r||(L?V(!0):O(),o!==null&&Gr(o,L),S.current=L,u(L))},[r,V,O,o]),z=(0,_.useCallback)(()=>K(!S.current),[K]),te=(0,_.useCallback)((L,xe)=>{if(r||!l)return;R.current&&G();let ge=je(le.current,L,e);A().say({url:ge,text:xe,lang:q,speech:f})},[r,l,e,A,q,f,G]);return(0,_.useMemo)(()=>({supported:!r&&h,enabled:!r&&l,setEnabled:K,toggle:z,unlock:T,speakKey:te,stop:O,summary:r?"none":x,summaryPlaying:d,toggleSummary:he,stopSummary:ve}),[r,h,l,K,z,T,te,O,x,d,he,ve])}i(Kr,"ht");s(Kr,"useVoiceGuidance");function zr(e,t,n,r){let{speakKey:a,stop:o,enabled:l}=e,u=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!r||!l){u.current&&o(),u.current=!1;return}u.current=!0,nt(t)&&t!==Ve&&n!==""&&a(t,n)},[r,l,t,n,a,o])}i(zr,"vt");s(zr,"useSpeakGuidance");function at(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}i(at,"Pn");s(at,"retryCoachingOf");var De={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function Zr({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let o=Le(),l=(0,st.useRef)(null);return(0,st.useEffect)(()=>{r&&l.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:o(De[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:De[t].tips.map(u=>(0,fe.jsx)("li",{children:o(u)},u))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(X,{ref:l,className:"sekyro-btn--start",onClick:a,children:o("capture.recordAgain")}):null]})}i(Zr,"An");s(Zr,"CapturedPanel");function At(){try{return!1}catch{return!1}}i(At,"tt");s(At,"isDevBuild");var Bn=(0,Qr.createContext)(null);function Wr({state:e}){let t=Le(),[n,r]=(0,it.useState)(!1);(0,it.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Ir,{}):e==="denied"?(0,we.jsx)(jr,{}):(0,we.jsx)(Ur,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}i(Wr,"Kn");s(Wr,"PermissionRow");function Yr({voice:e}){let t=Le();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:i(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(rt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Tr,{className:"sekyro-switch__check"}):null})})]})}i(Yr,"Un");s(Yr,"VoiceSwitch");function Jr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:o,summary:l,startLabel:u,startDisabled:S,onStart:h}){let w=Le(),x=(0,Y.useRef)(l?.stop);x.current=l?.stop,(0,Y.useEffect)(()=>()=>x.current?.(),[]);let I=(0,Y.useRef)(null),d=(0,Y.useRef)(null),N=(0,Y.useRef)(null),R=(0,Y.useRef)(e),p=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{let f=R.current;if(R.current=e,f===e)return;let F=p.current;e!=="loading"&&(p.current=!1),Xr(I.current)&&(e==="failed"?N.current?.focus():F&&d.current?.focus())},[e]);let j=(0,Y.useCallback)(()=>{p.current=!0,t()},[t]),C=e==="loading",A=C||S,q=(0,Y.useCallback)(()=>{A||(x.current?.(),h())},[A,h]),$;return e==="failed"?$=(0,U.jsxs)(se,{tone:"danger",testId:"sekyro-assets-error",children:[(0,U.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,U.jsx)(X,{kind:"ghost",ref:N,className:"sekyro-btn--start",onClick:j,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):$=(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,U.jsx)(X,{ref:d,full:!0,"data-testid":"sekyro-start","aria-disabled":A?"true":void 0,"aria-busy":C?"true":void 0,onClick:q,children:C?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Pr,{}),w("capture.preparing.title")]}):u??w("capture.start")}),C?(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,U.jsxs)("div",{ref:I,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,U.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,o!==!1?(0,U.jsx)(Or,{tips:o}):null,l!==void 0?(0,U.jsxs)(X,{kind:"ghost",className:"sekyro-btn--start",onClick:l.toggle,"data-testid":"sekyro-tips-listen",children:[(0,U.jsx)(rt,{off:!1}),w(l.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,U.jsx)(Wr,{state:n}),(0,U.jsx)(Yr,{voice:a}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),$,(0,U.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}i(Jr,"Gn");s(Jr,"PreCaptureScreen");function Xr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}i(Xr,"Or");s(Xr,"focusIsOurs");function en(){let[e,t]=(0,ot.useState)({state:"unknown",settled:!1});return(0,ot.useEffect)(()=>ir(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}i(en,"Fn");s(en,"useCameraStatus");function tn(e){return Et(e,"mobileRequired")}i(tn,"qn");s(tn,"useMobileRequired");function rn(e){return Et(e,"returning").required}i(rn,"Dn");s(rn,"useReturning");function Et(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let o=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(l=>{o&&r({required:l===!0,settled:!0})},()=>{o&&r({required:!1,settled:!0})}),()=>{o=!1}},[e,t]),n}i(Et,"jn");s(Et,"useFlag");function nn(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let o=e?.captureMode,l=e?.captureChoice??null;if(e===void 0||typeof o!="function"){r({session:"self",choice:l,settled:!0});return}let u=!0;return r({session:"self",choice:l,settled:!1}),Promise.resolve().then(()=>o.call(e)).then(S=>{let h=e.captureChoice??null;u&&r({session:h!==null&&S===h?"choice":S==="assisted"||S==="choice"?S:"self",choice:h,settled:!0})},()=>{u&&r({session:"self",choice:null,settled:!0})}),()=>{u=!1}},[e]);let a=(0,pe.useCallback)(o=>{e?.chooseCaptureMode?.(o),r(l=>({...l,choice:o}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}i(nn,"$n");s(nn,"useCaptureMode");function sn(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}i(sn,"zn");s(sn,"useBusy");var qn=s(()=>"idle","serverSnapshot");function xt(e){return or(e!==void 0?{assetBaseUrl:e}:{})}i(xt,"Wn");s(xt,"preload");function an(e,t=!0){let n=(0,Q.useSyncExternalStore)((0,Q.useCallback)(h=>cr(h,e),[e]),()=>lr(e),qn),[r,a]=(0,Q.useState)(null),o=(0,Q.useRef)(!1),l=(0,Q.useCallback)(()=>{xt(e).then(h=>{o.current&&h==="idle"&&a({base:e})})},[e]);(0,Q.useEffect)(()=>(o.current=!0,l(),()=>{o.current=!1}),[l]);let u=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{if(n!=="idle"){u.current={base:e};return}!t||u.current===null||u.current.base!==e||(u.current=null,l())},[n,e,l,t]);let S=(0,Q.useCallback)(()=>{xt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}i(an,"Qn");s(an,"useLivenessAssets");var Nr={progress:0,hint:null,faceDetected:!1};function on(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,M.useRef)(e.verification).current,a=(0,M.useRef)(!1);e.verification!==r&&!a.current&&At()&&(a.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let o=(0,M.useRef)(null),[l,u]=(0,M.useState)("idle"),[S,h]=(0,M.useState)(Nr),[w,x]=(0,M.useState)(!1),[I,d]=(0,M.useState)(!1),[N,R]=(0,M.useState)(null),[p,j]=(0,M.useState)(!1),[C,A]=(0,M.useState)(null),[q,$]=(0,M.useState)(null),[f,F]=(0,M.useState)(null),[oe,le]=(0,M.useState)(null),[c,V]=(0,M.useState)(null),[T,G]=(0,M.useState)(!1),O=(0,M.useRef)(null),ve=(0,M.useRef)("idle"),he=(0,M.useRef)(-1),[K,z]=(0,M.useState)(0),te=(0,M.useRef)(e);te.current=e,(0,M.useEffect)(()=>{let J=t.current;if(J===null)return;let ce={video:J,...n!==void 0?{assetBaseUrl:n}:{}},H=r!==void 0?r.liveness(ce):ur(ce);o.current=H;let Ne=s(()=>V(H.facingMode??null),"readFacing");Ne();let $e=[H.on("state",b=>{b==="mode_switch"?G(!0):b!=="starting"&&b!=="gating"&&G(!1),b==="starting"?(ve.current!=="starting"&&(he.current+=1,z(Math.max(0,he.current))),$(null),F(null),h(Nr),d(!1),x(!1),R(null),A(null),O.current=null):b==="gating"&&ve.current==="recording"&&(d(!1),x(!1),R(null),O.current=null),ve.current=b,Ne(),u(b),te.current.onStateChange?.(b)}),H.on("gate",b=>{let ke=O.current;O.current=b.progress,x(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&d(!0),h(b)}),H.on("frozen",({previewDataUrl:b})=>R(b)),H.on("profile",({animations:b})=>j(b==="reduced")),H.on("ramp",({colour:b})=>A(b)),H.on("captured",b=>{$(b),le(null),te.current.onCaptured?.(b)}),H.on("error",b=>{F(b);let ke=r?.reportCaptureIssue;ke!==void 0&&bt(Ee=>ke.call(r,Ee),Sr("liveness",b,Math.max(0,he.current))),te.current.onError?.(b)}),r?.on("result",b=>{le(b),te.current.onResult?.(b)})];return()=>{for(let b of $e)b?.();o.current=null,H.destroy()}},[r,t,n]);let L=(0,M.useCallback)(()=>{o.current?.start()},[]),xe=(0,M.useCallback)(()=>{o.current?.retry()},[]),ge=(0,M.useCallback)(async()=>{let J=o.current;return J===null||typeof J.canSwitchCaptureMode!="function"?!1:await J.canSwitchCaptureMode().catch(()=>!1)===!0},[]),P=(0,M.useCallback)(async J=>{let ce=o.current;if(ce===null||typeof ce.setCaptureMode!="function")return!1;let H=await ce.setCaptureMode(J).catch(()=>!1)===!0;return H&&V(ce.facingMode??null),H},[]);return{state:l,gate:S,draining:w,gateLocked:I,frozenPreview:N,reduceMotion:p,rampColour:C,artifacts:q,error:f,result:oe,facingMode:c,start:L,retry:xe,canSwitchCaptureMode:ge,setCaptureMode:P,modeRestarted:T,attempt:K}}i(on,"Xn");s(on,"useLivenessHandle");var Vn=new Set(["national_number"]);function Nt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Vn.has(n));return t.length>0?{...e,options:t}:null}i(Nt,"er");s(Nt,"pending");function ln(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[o,l]=(0,me.useState)(!1),[u,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let x=!0,I=e.methodChoice;typeof I=="function"?(a(!1),Promise.resolve().then(()=>I.call(e)).then(N=>{x&&n(Nt(N))},()=>{}).finally(()=>{x&&a(!0)})):a(!0);let d=e.on("method",N=>n(Nt(N)));return()=>{x=!1,d()}},[e]);let h=(0,me.useCallback)(async x=>{if(e===void 0)return!1;l(!0),S(!1);try{return await e.selectMethod(x),n(null),!0}catch{return S(!0),!1}finally{l(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!u?w:null,settled:r,busy:o,failed:u,select:h}}i(ln,"tr");s(ln,"useMethodChoice");var Hn=["ar","fr","en"];function cn(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}i(cn,"oo");s(cn,"isClipUrl");function un(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Hn){let a=t[r];if(!(typeof a!="object"||a===null))for(let[o,l]of Object.entries(a))!nt(o)||!cn(l)||((n[r]??(n[r]={}))[o]=l)}return Object.keys(n).length>0?n:null}i(un,"so");s(un,"toVoiceClipMap");function dn(e){let[t,n]=(0,Te.useState)(null);(0,Te.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,o=s(u=>{if(!a)return;let S=typeof u=="object"&&u!==null&&typeof u.setId=="string"?u:null;n(h=>h?.setId===S?.setId?h:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(o,()=>o(null))}catch{o(null)}let l=e.on("view",u=>o(u.voice));return()=>{a=!1,l()}},[e]);let r=(0,Te.useMemo)(()=>t!==null?un(t):null,[t]);return e===void 0?null:r}i(dn,"nr");s(dn,"useServerVoiceClips");function pn({voice:e}){let t=Le();return(0,Mt.jsx)(X,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:i(()=>e.toggle(),"onClick"),children:(0,Mt.jsx)(rt,{off:!e.enabled,className:"sekyro-icon"})})}i(pn,"or");s(pn,"VoiceChip");var Dn=new Set(["abandoned","not_opened","cancelled","superseded"]),$n=800;function hn(e){return e===void 0||e!==!1&&e.length===Ct.length&&Ct.every(t=>e.includes(t))}i(hn,"uo");s(hn,"isDefaultTips");function fn(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}i(fn,"po");s(fn,"carriesActivation");function mn(e){return typeof e=="object"&&e!==null&&!(0,y.isValidElement)(e)&&"tone"in e&&"text"in e}i(mn,"fo");s(mn,"isNoticeObject");var Fn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function yn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}i(yn,"yo");s(yn,"isCapturing");function vn(e){return e==="captured"||e==="uploading"||e==="checking"}i(vn,"go");s(vn,"isPostCapture");function Gn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:o=!1,notice:l,startDisabled:u=!1,startLabel:S,tips:h,tipsSummary:w,coach:x,voice:I,onGuidance:d,onCaptured:N,onResult:R,onError:p,onStateChange:j,assetBaseUrl:C,className:A}){let q=yr(t),$=(0,y.useMemo)(()=>mr(t,r),[t,r,q]),f=(0,y.useMemo)(()=>g=>$[g]??"",[$]),F=n??(t==="ar"?"rtl":"ltr"),oe=(0,y.useRef)(null),le=(0,y.useContext)(Bn),c=on({verification:e,videoRef:oe,assetBaseUrl:C,onCaptured:N,onResult:R,onError:p,onStateChange:j}),V=an(C,c.state==="idle"&&c.error===null),T=ln(e),G=T.choice!==null,O=tn(e),ve=rn(e),he=sn(e),K=en(),z=nn(e),te=z.session==="choice",L=z.mode==="assisted",xe=I!==!1&&I?.clips===void 0,ge=dn(xe?e:void 0),P=Kr({locale:t,defaultClips:ge,options:I}),J=L?"environment":"user",ce=z.settled,H=(0,y.useRef)(null),Ne=(0,y.useRef)(!1),$e=(0,y.useRef)(P.unlock);$e.current=P.unlock,(0,y.useEffect)(()=>{let g=H.current;if(g===null)return;let ne=["pointerup","touchend","click","keydown"],Ce=s(()=>{for(let qe of ne)g.removeEventListener(qe,Re,!0)},"disarm");function Re(qe){if(Ne.current){Ce();return}fn(qe)&&(Ne.current=!0,Ce(),$e.current())}i(Re,"Re"),s(Re,"onGesture");for(let qe of ne)g.addEventListener(qe,Re,{capture:!0,passive:!0});return Ce},[]);let b=(0,y.useCallback)(()=>{Ne.current||(Ne.current=!0,P.unlock()),c.start()},[P.unlock,c.start]),ke=(0,y.useCallback)(()=>c.start(),[c.start]),Ee=(0,y.useRef)(!1),Pe=c.state==="idle"&&c.error===null,Ut=!G&&!O.required&&(o===!0||o==="when-permitted"&&K.permission==="granted"),jt=Ut&&T.settled&&O.settled&&ce,bn=o==="when-permitted"&&!K.permissionSettled&&!Ee.current,Tt=Ut&&Pe&&!Ee.current,ct=(bn||Tt||!ce)&&V.gate==="ready"?"loading":V.gate;(0,y.useEffect)(()=>{!jt||!Pe||V.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[jt,Pe,V.gate,ke]);let _n=Pe&&!G&&!O.required&&!(Tt&&V.gate==="ready"),[Pt,Ot]=(0,y.useState)(!1),{canSwitchCaptureMode:Bt,setCaptureMode:qt}=c;(0,y.useEffect)(()=>{if(!z.settled||!te){Ot(!1);return}let g=!0;return Bt().then(ne=>{g&&Ot(ne)}),()=>{g=!1}},[z.settled,te,Bt]);let{choose:Vt}=z,Ie=L?"self":"assisted",Cn=(0,y.useCallback)(async()=>{await qt(Ie)&&Vt(Ie)},[qt,Vt,Ie]),Ht=c.state!=="idle"&&c.facingMode!==null?c.facingMode:J;(0,y.useEffect)(()=>{let g=oe.current?.style;Ht==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[Ht]);let Fe=(0,y.useMemo)(()=>c.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(c.artifacts.keyframe):null,[c.artifacts]);(0,y.useEffect)(()=>{if(Fe!==null)return()=>URL.revokeObjectURL(Fe)},[Fe]);let Dt=c.frozenPreview??Fe,Ue=e!==void 0,Z=yn(c.state),be=vn(c.state),Ge=Z||be,re=c.result,$t=c.state==="done"&&re!==null,ut=c.state==="recording"&&c.frozenPreview!==null,Ke=le!==null,Ft=Pt&&Z&&!ut?{to:Ie,label:f(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:f(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{Cn()},"onSwitch")}:null,ze=c.modeRestarted&&Z?f("capture.modeSwitch.restarted"):null,Oe=be||ut,Gt=be?"checking":ut?"frozen":c.state==="recording"?"recording":c.gateLocked||c.gate.progress>=1?"locked":c.gate.faceDetected?"aligning":"seeking",Ze=Z?c.gate.hint:null,Qe=c.state==="starting"?"capture.preparing.title":Ze===null?null:Ze==="center"&&!c.gate.faceDetected?"fcv3.no_face":dr(Ze),[wn,Kt]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(Qe!=="fcv3.no_face"){Kt(Qe);return}if(!Z)return;let g=setTimeout(()=>Kt(Qe),$n);return()=>clearTimeout(g)},[Qe,Z]);let dt=Z&&typeof x=="string"&&x!=="",zt=L&&Z?f("capture.assisted.stage"):null,Me=Z&&!dt?wn:null,pt=dt?x:Me===null?"":f(Me);zr(P,Me,pt,Z);let Zt=(0,y.useRef)(d);Zt.current=d,(0,y.useEffect)(()=>{if(nt(Me))try{Zt.current?.(Me)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Me]);let Be=(0,y.useMemo)(()=>({supported:P.supported,enabled:P.enabled,setEnabled:P.setEnabled,toggle:P.toggle}),[P.supported,P.enabled,P.setEnabled,P.toggle]),ht=a?.voicePrompt,Qt=ht!==void 0,Wt=I===void 0,Yt=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!Qt||!Wt||Yt.current||!At()||(Yt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[Qt,Wt]);let Sn=ht!==void 0?(g,ne,Ce)=>ht(g,ne,Ce,Be):P.supported?()=>(0,k.jsx)(pn,{voice:Be}):void 0,{summary:ft,summaryPlaying:Jt,toggleSummary:Xt,stopSummary:er}=P,We=w!==void 0&&w!=="",tr=We?w:f("capture.tips.summary"),rr=We?ft!=="none":ft==="partner"||ft==="default"&&hn(h),xn=(0,y.useMemo)(()=>rr?{playing:Jt,toggle:s(()=>Xt(tr,{clip:!We}),"toggle"),stop:er}:void 0,[rr,Jt,Xt,tr,er,We]),Nn=(0,y.useMemo)(()=>({assets:ct,retryAssets:V.retry,permission:K.permission,permissionSettled:K.permissionSettled,captureMode:z.mode,facing:J,voice:Be}),[ct,V.retry,K.permission,K.permissionSettled,z.mode,J,Be]),Mn=mn(l)?(0,k.jsx)(se,{tone:l.tone,testId:"sekyro-host-notice",children:(0,k.jsx)("span",{children:l.text})}):l??null,ue=re!==null&&re.status==="retry"?re:null,W=$t&&re.status==="unavailable"&&!G&&re.reasonCode!=="portrait_required"?re:null,_e=$t&&(re.status==="verified"||re.status==="not_verified"||re.status==="review")?re:null,mt=s((g,ne)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Re=hr(t,ne);if(Re!==null)return f(Re.key).replace("{time}",Re.time)}let Ce=Xe(g);return Ce===null?null:f(Ce)},"reasonText"),yt=s(g=>{let ne=g.retakeHint===void 0?null:Je(g.retakeHint);return ne===null?mt(g.reasonCode):f(ne)},"retryText"),nr=_e===null?null:mt(_e.reasonCode,_e.retryAfter)??(_e.status==="not_verified"&&_e.reason!==void 0&&Dn.has(_e.reason)?f("errors.session_expired"):null),Rn=W!==null&&W.reasonCode!==void 0&&W.reasonCode!=="nni_unbound"&&W.reasonCode!=="id_number_unbound"&&W.reasonCode!=="method_required"&&W.reasonCode!=="mobile_required"&&!(W.reasonCode==="no_recorder"&&c.artifacts?.degraded==="NO_RECORDER"),Ye=W?.reasonCode,sr=c.attempt;(0,y.useEffect)(()=>{W===null||Ye===void 0||e?.reportCaptureIssue===void 0||Fn.has(Ye)||bt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Ye,attempt:Math.min(1e3,sr)})},[W,Ye,sr,e]);let ar=kt(),Ln=G&&T.auto===null&&!Z&&!be&&c.error===null,vt=(0,y.useCallback)(async g=>{await T.select(g)&&c.state==="done"&&c.retry()},[T.select,c.state,c.retry]);return(0,y.useEffect)(()=>{T.auto!==null&&!T.busy&&!Z&&!be&&vt(T.auto)},[T.auto,T.busy,Z,be,vt]),(0,k.jsx)(vr,{value:f,children:(0,k.jsxs)("div",{ref:H,className:A===void 0?"sekyro-capture":`sekyro-capture ${A}`,dir:F,lang:t,"data-testid":"sekyro-liveness-capture","data-state":c.state,children:[a?.header,ue!==null&&yt(ue)!==null&&!(Ke&&Ge)?(0,k.jsx)(se,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,k.jsx)("span",{children:yt(ue)})}):null,ze!==null&&!Ke?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,k.jsx)("span",{children:ze})}):null,he&&be&&!Ke?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,k.jsx)("span",{children:f("capture.busy")})}):null,O.required&&Pe?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,k.jsx)("span",{children:f("reasons.mobile_required")})}):null,c.error!==null?a?.errorPanel!==void 0?a.errorPanel(c.error,c.retry):(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-error-notice",children:[(0,k.jsx)("span",{children:f(pr(c.error))}),c.error.retryable?(0,k.jsx)(X,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("common.retry")}):null]}):null,W!==null?(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,k.jsx)("span",{children:mt(W.reasonCode)??f(W.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),Rn?(0,k.jsx)(X,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("capture.recordAgain")}):null]}):null,nr!==null&&_e!==null?(0,k.jsx)(se,{tone:_e.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,k.jsx)("span",{children:nr})}):null,(0,k.jsx)("div",{className:Ge?void 0:"sekyro-hidden","data-capture-live":Ge?"":void 0,children:Ke?le({videoRef:oe,guidance:Oe&&Ue?f("capture.checking"):pt,coached:dt&&!(Oe&&Ue),note:Oe?Ue?f(he?"capture.busy":"capture.checkingHint"):null:ze??(ue!==null?yt(ue):zt),settled:Oe&&Ue,progress:c.gate.progress,phase:Gt,still:Oe?Dt:null,live:Ge,modeSwitch:Ft,...Pt?{status:ze}:{},ramp:c.rampColour===null?null:{colour:c.rampColour}}):(0,k.jsx)(gr,{videoRef:oe,guidanceText:pt,guidanceHint:Ze,guidanceKey:Me,progress:c.gate.progress,phase:Gt,draining:c.draining,stillUrl:Dt,showChecking:Ue,operatorText:zt,voicePrompt:Sn,overlay:i(g=>(0,k.jsxs)(k.Fragment,{children:[a?.stageOverlay?.(g),(0,k.jsx)(kr,{colour:c.rampColour})]}),"overlay"),reduceMotion:c.reduceMotion,modeSwitch:Ft})}),Ln&&T.choice!==null?(0,k.jsx)(Br,{title:f("method.title"),description:f("method.description"),options:T.choice.options.map(g=>({id:g,label:f(`method.${g}`)})),busy:T.busy,error:T.failed?f("errors.network_error"):null,focus:c.state==="done",testId:"sekyro-method",look:"buttons",onChoose:i(g=>{vt(g)},"onChoose")}):null,_n?(0,k.jsxs)(k.Fragment,{children:[ve&&a?.header===void 0&&a?.intro===void 0?(0,k.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,k.jsx)("h2",{className:"sekyro-text-body",children:f("returning.title")}),(0,k.jsx)("p",{className:"sekyro-text-muted",children:f("returning.description")})]}):null,Mn,a?.intro!==void 0?a.intro(b,Nn):(0,k.jsx)(Jr,{assets:ct,onRetryAssets:V.retry,permission:K.permission,captureMode:z.mode,voice:Be,tips:h??Ct,summary:xn,startLabel:S,startDisabled:u,onStart:b})]}):null,(0,k.jsx)(Zr,{showCoaching:ue!==null,coaching:at(ue?.reasonCode),attemptsText:ue?.attemptsRemaining!==void 0?fr($,t,ue.attemptsRemaining):null,showRetake:ue!==null&&!Z&&!be||!Ue&&c.state==="captured",onRetake:c.retry}),a?.footer]})})}i(Gn,"_i");s(Gn,"LivenessCapture");var It=E(D(),1),lt=E(D(),1),m=E(de(),1);var ks={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function Kn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}i(Kn,"Y");s(Kn,"identityLabel");function zn(e,t){let[n,r]=(0,It.useState)(!1),[a,o]=(0,It.useState)(null);return{busy:n,error:a,run:s(l=>{r(!0),o(null),l().then(()=>r(!1),u=>{r(!1),o(e.t(xr(u,e.strings))),t?.(u)})},"run")}}i(zn,"q");s(zn,"useChoiceAction");function gn(){let e=`sekyro-face-light-${(0,lt.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,m.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,m.jsx)("defs",{children:(0,m.jsx)("mask",{id:e,children:(0,m.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,m.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,m.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}i(gn,"O");s(gn,"FaceMark");var Zn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Qn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}i(Qn,"te");s(Qn,"faceIntroRetryOf");var Wn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function Yn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:o=!1,notice:l,retry:u}){let S=_t(),{t:h}=S,w=u===void 0?"face":at(u.reason),x=w==="face"?null:De[w].tips,I=(0,lt.useContext)(_r)?.busy===!0;return(0,m.jsxs)("section",{className:"sekyro-step",children:[(0,m.jsx)(gn,{}),t.captureMode==="assisted"?(0,m.jsx)(et,{title:h("capture.assisted.heading"),lead:h("capture.assisted.lead")}):o?(0,m.jsx)(et,{title:h("returning.heading"),lead:h("returning.description")}):(0,m.jsx)(et,{title:h(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:h(a?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?(0,m.jsx)(kn,{retry:u,title:De[w].title}):null,r!==void 0&&x===null?(0,m.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,m.jsx)("ul",{className:"sekyro-tiprows",children:x!==null?x.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Wn[d]??"face"}),h(d)]},d)):n!==void 0?n.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Zn[d.id]??"face"}),d.text]},d.id)):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"light"}),h("capture.tips.light")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"jGlasses"}),h("capture.tips.uncover")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"smartphone"}),h("capture.tips.eyeLevel")]})]})}),l??null,l!==void 0?null:t.assets==="failed"?(0,m.jsx)(X,{kind:"secondary",full:!0,onClick:t.retryAssets,children:h("common.retry")}):null,l!==void 0?null:(0,m.jsx)(br,{children:(0,m.jsxs)(X,{full:!0,disabled:t.assets!=="ready"||I,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,m.jsx)(Ae,{name:"camera"}),h("capture.start")]})})]})}i(Yn,"ne");s(Yn,"FaceIntro");var Jn=new Set(["match_inconclusive","no_face_source","below_threshold"]);function kn({retry:e,title:t}){let n=_t(),r=e.retakeHint===void 0?null:Je(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":Jn.has(e.reason)?"capture.retryMatch.message":Xe(e.reason);return(0,m.jsxs)(Cr,{tone:"warning",children:[r!==null?(0,m.jsx)("span",{children:n.t(r)}):a!==null?(0,m.jsx)("span",{children:n.t(a)}):null,r===null?(0,m.jsx)("span",{children:n.t(t)}):null,(0,m.jsx)("span",{children:wr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}i(kn,"T");s(kn,"RetryNotice");function Xn(e){return gt(e)}i(Xn,"se");s(Xn,"isInAppBrowser");function es(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}i(es,"ce");s(es,"androidBrowserIntent");export{Br as a,At as b,Bn as c,nn as d,Gn as e,ks as f,Kn as g,zn as h,Qn as i,Yn as j,Xn as k,es as l};
@@ -1 +0,0 @@
1
- import{a as n}from"./chunk-4FHWXBOB.js";var S="0.1.0-rc.26",k=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function O(t){let e=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));return k.test(e)}n(O,"p");var f="sekyro.did",C=1e4,w=n(()=>globalThis.process?.versions?.node,"v"),l;function y(){let t=globalThis.crypto;try{if(typeof t?.randomUUID=="function")return t.randomUUID()}catch{}try{if(typeof t?.getRandomValues=="function"){let e=t.getRandomValues(new Uint8Array(16));return Array.from(e,a=>a.toString(16).padStart(2,"0")).join("")}}catch{}}n(y,"b");function H(){try{let t=localStorage.getItem(f);if(t)return t;let e=y();return e!==void 0&&localStorage.setItem(f,e),e}catch{return l??(l=y()),l}}n(H,"I");async function M(){let t=globalThis.crypto?.subtle;if(!t)return"";let e=navigator,a=JSON.stringify([e.userAgent,e.platform,e.hardwareConcurrency??null,e.deviceMemory??null,e.maxTouchPoints??0,screen.width,screen.height,screen.colorDepth,globalThis.devicePixelRatio??1,Intl.DateTimeFormat().resolvedOptions().timeZone,e.languages?.join(",")??e.language]),i=await t.digest("SHA-256",new TextEncoder().encode(a));return Array.from(new Uint8Array(i),s=>s.toString(16).padStart(2,"0")).join("").slice(0,32)}n(M,"w");function x(){try{let t=Number(navigator.maxTouchPoints);return Number.isFinite(t)&&t>=0?{touch:Math.min(64,Math.trunc(t))}:{}}catch{return{}}}n(x,"k");function W(t){let e=new TextEncoder().encode(t),a="";for(let i of e)a+=String.fromCharCode(i);return btoa(a).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}n(W,"x");function j(t){let e,a,i,s,c,d,m=n(()=>d?.readyState==="live","u"),T=n(()=>{c!==void 0||!globalThis.crypto?.subtle||w()||m()||(c=Promise.race([import("./print-SEWS3VHQ-HWJTHADG.js"),new Promise(r=>setTimeout(r,C))]).then(r=>r?.computePrint(m)).then(r=>{r==="busy"?c=void 0:s=r}).catch(()=>{}))},"_");return{timezone(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone?.slice(0,64)||void 0}catch{return}},noteCameraLabel(r){r&&(e=r.slice(0,128))},noteCamera(r){a=r},noteCameraTrack(r){d=r},async deviceHeader(){try{i??(i=M().catch(()=>""));let r=[];navigator.webdriver&&r.push("webdriver"),/HeadlessChrome/.test(navigator.userAgent)&&r.push("headless");let g=await i,p=H(),A={v:1,platform:"web",sdk:t.sdk.slice(0,64),ids:[...p?[{kind:"web_local",value:p.slice(0,128)}]:[],...g?[{kind:"web_fp",value:g}]:[]],screen:{w:screen.width,h:screen.height,dpr:globalThis.devicePixelRatio??1},...x(),...e?{cameraLabel:e}:{},...r.length?{signals:r}:{},...s?{print:{v:2,...s,...a?{camera:a}:{}}}:{},...O()?{inApp:!0}:{}},I=W(JSON.stringify(A));return T(),I}catch{return}},printReady(){return c??Promise.resolve()}}}n(j,"A");var v=Symbol.for("sekyro.web.clientContext"),b=globalThis,u=b[v]??(b[v]=j({sdk:`@sekyro/web@${S}`}));function z(t){try{let e=t.getVideoTracks?.()[0];if(e){if(u.noteCameraLabel(e.label),u.noteCameraTrack(e),w())return;import("./camera-trait-V4UAOPIQ-TFCPOCSU.js").then(a=>a.noteCameraTrait(e,u)).catch(()=>{})}}catch{}}n(z,"M");var P=Object.freeze({LOW:Object.freeze({cadenceHz:5,inputWidth:128,animations:"reduced"}),MID:Object.freeze({cadenceHz:8,inputWidth:160,animations:"full"}),HIGH:Object.freeze({cadenceHz:10,inputWidth:192,animations:"full"})}),L=new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11]);function F(){let t=typeof navigator>"u"?void 0:navigator,e=!1;try{e=typeof WebAssembly<"u"&&WebAssembly.validate(L)}catch{e=!1}return{cores:t?.hardwareConcurrency??2,memGB:t?.deviceMemory??null,simd:e}}n(F,"o");function U(t){let e=t.memGB??4;return t.cores<4||e<3?"LOW":t.cores>=8&&e>=6?"HIGH":"MID"}n(U,"l");var h=["LOW","MID","HIGH"],o,_=(o=class{constructor(e){this.samples=[],this.adjusted=!1,this.current=e}get deviceClass(){return this.current}get profile(){return P[this.current]}record(e){if(this.adjusted||this.samples.length>=10)return this.current;if(this.samples.push(e),this.samples.length<10)return this.current;this.adjusted=!0;let a=this.samples.reduce((i,s)=>i+s,0)/this.samples.length;if(a>70)this.current="LOW";else if(a<25){let i=h.indexOf(this.current);this.current=h[Math.min(h.length-1,i+1)]??this.current}return this.current}},n(o,"i"),o);export{S as a,O as b,u as c,z as d,F as e,U as f,_ as g};