@seekbuddy/dsh-ui 0.0.0-stage → 0.2.0-beta.1

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 (213) hide show
  1. package/CHANGELOG.md +83 -0
  2. package/LICENSE +22 -0
  3. package/README.md +175 -2
  4. package/README.zh.md +176 -0
  5. package/THIRD_PARTY_NOTICES.md +42 -0
  6. package/UPSTREAM.md +59 -0
  7. package/dist/blocks.js +1617 -0
  8. package/dist/chunks/chunk-23KOEBWJ.js +104 -0
  9. package/dist/chunks/chunk-6SGSJ5KW.js +57 -0
  10. package/dist/chunks/chunk-7NH2UOZO.js +155 -0
  11. package/dist/chunks/chunk-7SKW4S35.js +66 -0
  12. package/dist/chunks/chunk-B3EEK7A2.js +408 -0
  13. package/dist/chunks/chunk-CEBTQO6W.js +24 -0
  14. package/dist/chunks/chunk-ENKPNYOB.js +26 -0
  15. package/dist/chunks/chunk-EWAZFWLW.js +27 -0
  16. package/dist/chunks/chunk-F352IICS.js +57 -0
  17. package/dist/chunks/chunk-FFJ6TCCF.js +31 -0
  18. package/dist/chunks/chunk-FZXK4LTI.js +129 -0
  19. package/dist/chunks/chunk-JA3XDLIA.js +1115 -0
  20. package/dist/chunks/chunk-L7XALG4J.js +36 -0
  21. package/dist/chunks/chunk-OCAQFVT3.js +3172 -0
  22. package/dist/chunks/chunk-RAXDA2PT.js +202 -0
  23. package/dist/chunks/chunk-RNVSCTW7.js +24 -0
  24. package/dist/chunks/chunk-RZOP2PFC.js +152 -0
  25. package/dist/chunks/chunk-SN6RSUWC.js +61 -0
  26. package/dist/chunks/chunk-SNVSQWCU.js +22 -0
  27. package/dist/chunks/chunk-SO3DCAWG.js +170 -0
  28. package/dist/chunks/chunk-UAEFKTV3.js +144 -0
  29. package/dist/chunks/chunk-UGEORMLD.js +89 -0
  30. package/dist/chunks/chunk-W6FLI3AK.js +112 -0
  31. package/dist/chunks/chunk-WX46TSKP.js +328 -0
  32. package/dist/chunks/chunk-XL33IPCV.js +261 -0
  33. package/dist/chunks/chunk-XW4L4ZGL.js +967 -0
  34. package/dist/chunks/chunk-YOBY6PSL.js +850 -0
  35. package/dist/chunks/chunk-ZA47FP7C.js +7 -0
  36. package/dist/icons.js +859 -0
  37. package/dist/index.js +1675 -0
  38. package/dist/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  39. package/dist/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  40. package/dist/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  41. package/dist/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  42. package/dist/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  43. package/dist/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  44. package/dist/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  45. package/dist/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  46. package/dist/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  47. package/dist/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  48. package/dist/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  49. package/dist/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  50. package/dist/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  51. package/dist/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  52. package/dist/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  53. package/dist/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  54. package/dist/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  55. package/dist/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  56. package/dist/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  57. package/dist/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  58. package/dist/katex.css +1 -0
  59. package/dist/katex.css.d.ts +2 -0
  60. package/dist/markdown.js +225 -0
  61. package/dist/meta.json +7575 -0
  62. package/dist/root-inputs.json +86 -0
  63. package/dist/seekbuddy-card.js +7 -0
  64. package/dist/seekbuddy-empty.js +8 -0
  65. package/dist/seekbuddy-internal/DangerButton.js +7 -0
  66. package/dist/seekbuddy-internal/Mark.js +7 -0
  67. package/dist/seekbuddy-internal/Message.js +10 -0
  68. package/dist/seekbuddy-internal/Pagination.js +9 -0
  69. package/dist/seekbuddy-internal/StatusBadge.js +7 -0
  70. package/dist/seekbuddy-internal/SubtleButton.js +7 -0
  71. package/dist/seekbuddy-internal/Switch.js +7 -0
  72. package/dist/seekbuddy-internal/Upload.js +7 -0
  73. package/dist/seekbuddy-internal/date/Calendar.js +8 -0
  74. package/dist/seekbuddy-internal/date/DatePicker.js +9 -0
  75. package/dist/seekbuddy-internal/date/DateRangePicker.js +9 -0
  76. package/dist/seekbuddy-internal/date/TimePicker.js +8 -0
  77. package/dist/seekbuddy-internal/date/fields.js +16 -0
  78. package/dist/seekbuddy-internal/qr/QrCode.js +7 -0
  79. package/dist/seekbuddy-spinner.js +7 -0
  80. package/dist/seekbuddy-tabs.js +7 -0
  81. package/dist/seekbuddy-timeline.js +8 -0
  82. package/dist/seekbuddy.js +89 -0
  83. package/dist/theme-bootstrap.js +13 -0
  84. package/dist/theme.js +37 -0
  85. package/dist/tokens.css +974 -0
  86. package/dist/tokens.css.d.ts +2 -0
  87. package/dist/types/AnimatedRows.d.ts +45 -0
  88. package/dist/types/Button.d.ts +18 -0
  89. package/dist/types/Checkbox.d.ts +19 -0
  90. package/dist/types/CodeFileIcon.d.ts +11 -0
  91. package/dist/types/CodeToolbar.d.ts +29 -0
  92. package/dist/types/CommandText.d.ts +15 -0
  93. package/dist/types/ConfigField.d.ts +32 -0
  94. package/dist/types/ConnectionIndicator.d.ts +25 -0
  95. package/dist/types/DetailDocument.d.ts +77 -0
  96. package/dist/types/DiffBlock.d.ts +51 -0
  97. package/dist/types/DisclosureRow.d.ts +37 -0
  98. package/dist/types/DraggableImage.d.ts +18 -0
  99. package/dist/types/FileTypeIcon.d.ts +42 -0
  100. package/dist/types/FoldToggle.d.ts +19 -0
  101. package/dist/types/HoverCard.d.ts +44 -0
  102. package/dist/types/HoverCardGroup.d.ts +24 -0
  103. package/dist/types/ImageLightbox.d.ts +29 -0
  104. package/dist/types/ImagePreview.d.ts +11 -0
  105. package/dist/types/InlineEditor.d.ts +22 -0
  106. package/dist/types/Input.d.ts +11 -0
  107. package/dist/types/JsonTree.d.ts +58 -0
  108. package/dist/types/LinkIcon.d.ts +33 -0
  109. package/dist/types/Menu.d.ts +163 -0
  110. package/dist/types/MenuGroup.d.ts +21 -0
  111. package/dist/types/MenuSurface.d.ts +24 -0
  112. package/dist/types/Modal.d.ts +43 -0
  113. package/dist/types/PermissionIcon.d.ts +50 -0
  114. package/dist/types/Pill.d.ts +12 -0
  115. package/dist/types/QuotePreview.d.ts +23 -0
  116. package/dist/types/ReadBlock.d.ts +47 -0
  117. package/dist/types/ReferenceIcon.d.ts +20 -0
  118. package/dist/types/RiskConfirmation.d.ts +19 -0
  119. package/dist/types/SearchBlock.d.ts +71 -0
  120. package/dist/types/SegmentedControl.d.ts +34 -0
  121. package/dist/types/SegmentedTabs.d.ts +27 -0
  122. package/dist/types/ShortcutKeys.d.ts +10 -0
  123. package/dist/types/SiteGlyph.d.ts +24 -0
  124. package/dist/types/StateDot.d.ts +19 -0
  125. package/dist/types/Switch.d.ts +19 -0
  126. package/dist/types/Tag.d.ts +31 -0
  127. package/dist/types/TerminalBlock.d.ts +85 -0
  128. package/dist/types/TextShimmer.d.ts +22 -0
  129. package/dist/types/Toast.d.ts +48 -0
  130. package/dist/types/Tooltip.d.ts +69 -0
  131. package/dist/types/UserMessageBubble.d.ts +10 -0
  132. package/dist/types/WebBlock.d.ts +60 -0
  133. package/dist/types/ZoomControls.d.ts +26 -0
  134. package/dist/types/ansi.d.ts +16 -0
  135. package/dist/types/blocks.d.ts +21 -0
  136. package/dist/types/clipboard.d.ts +8 -0
  137. package/dist/types/code-file-icon-artwork.d.ts +53 -0
  138. package/dist/types/code-file-types.d.ts +29 -0
  139. package/dist/types/code-highlighting.d.ts +11 -0
  140. package/dist/types/css-modules.d.ts +6 -0
  141. package/dist/types/darwin-desktop.d.ts +8 -0
  142. package/dist/types/document-zoom.d.ts +16 -0
  143. package/dist/types/file-drag-actions.d.ts +36 -0
  144. package/dist/types/file-size.d.ts +7 -0
  145. package/dist/types/focus.d.ts +15 -0
  146. package/dist/types/guide-artwork.d.ts +14 -0
  147. package/dist/types/head-tail-cap.d.ts +22 -0
  148. package/dist/types/icons/artwork.d.ts +421 -0
  149. package/dist/types/icons/index.d.ts +397 -0
  150. package/dist/types/icons/props.d.ts +8 -0
  151. package/dist/types/icons/shared-artwork.d.ts +36 -0
  152. package/dist/types/icons.d.ts +6 -0
  153. package/dist/types/image-drag.d.ts +16 -0
  154. package/dist/types/index.d.ts +71 -0
  155. package/dist/types/input-modality.d.ts +18 -0
  156. package/dist/types/keyboard-composition.d.ts +10 -0
  157. package/dist/types/markdown/CodeBlock.d.ts +34 -0
  158. package/dist/types/markdown/JsonBlock.d.ts +7 -0
  159. package/dist/types/markdown/MarkdownDelegate.d.ts +68 -0
  160. package/dist/types/markdown/MarkdownText.d.ts +54 -0
  161. package/dist/types/markdown/cjkFriendlyStrong.d.ts +8 -0
  162. package/dist/types/markdown/file-link.d.ts +22 -0
  163. package/dist/types/markdown/highlight.d.ts +169 -0
  164. package/dist/types/markdown/incremental.d.ts +79 -0
  165. package/dist/types/markdown/katex.d.ts +18 -0
  166. package/dist/types/markdown/local-image-syntax.d.ts +9 -0
  167. package/dist/types/markdown/mathCompatibility.d.ts +10 -0
  168. package/dist/types/markdown/parse.d.ts +24 -0
  169. package/dist/types/markdown/plain-text.d.ts +21 -0
  170. package/dist/types/markdown/quote-text.d.ts +7 -0
  171. package/dist/types/markdown/render.d.ts +145 -0
  172. package/dist/types/markdown/useViewportHighlighting.d.ts +10 -0
  173. package/dist/types/markdown/windows-path-destinations.d.ts +10 -0
  174. package/dist/types/markdown.d.ts +12 -0
  175. package/dist/types/overlay-top-margin.d.ts +14 -0
  176. package/dist/types/plugin-artwork.d.ts +16 -0
  177. package/dist/types/pointer-grace.d.ts +21 -0
  178. package/dist/types/rank-by-name.d.ts +21 -0
  179. package/dist/types/relative-time.d.ts +22 -0
  180. package/dist/types/seekbuddy/Card.d.ts +28 -0
  181. package/dist/types/seekbuddy/DangerButton.d.ts +31 -0
  182. package/dist/types/seekbuddy/Empty.d.ts +34 -0
  183. package/dist/types/seekbuddy/Mark.d.ts +27 -0
  184. package/dist/types/seekbuddy/Message.d.ts +52 -0
  185. package/dist/types/seekbuddy/Pagination.d.ts +66 -0
  186. package/dist/types/seekbuddy/Spinner.d.ts +20 -0
  187. package/dist/types/seekbuddy/StatusBadge.d.ts +33 -0
  188. package/dist/types/seekbuddy/SubtleButton.d.ts +30 -0
  189. package/dist/types/seekbuddy/Switch.d.ts +36 -0
  190. package/dist/types/seekbuddy/Tabs.d.ts +49 -0
  191. package/dist/types/seekbuddy/Timeline.d.ts +42 -0
  192. package/dist/types/seekbuddy/Upload.d.ts +101 -0
  193. package/dist/types/seekbuddy/date/Calendar.d.ts +94 -0
  194. package/dist/types/seekbuddy/date/DatePicker.d.ts +29 -0
  195. package/dist/types/seekbuddy/date/DateRangePicker.d.ts +41 -0
  196. package/dist/types/seekbuddy/date/TimePicker.d.ts +35 -0
  197. package/dist/types/seekbuddy/date/date.d.ts +79 -0
  198. package/dist/types/seekbuddy/date/fields.d.ts +45 -0
  199. package/dist/types/seekbuddy/index.d.ts +49 -0
  200. package/dist/types/seekbuddy/qr/QrCode.d.ts +37 -0
  201. package/dist/types/seekbuddy/qr/qr.d.ts +38 -0
  202. package/dist/types/theme-bootstrap.d.ts +3 -0
  203. package/dist/types/theme-core.d.ts +14 -0
  204. package/dist/types/theme.d.ts +4 -0
  205. package/dist/types/tooltip-placement.d.ts +34 -0
  206. package/dist/types/use-clipboard-copy.d.ts +13 -0
  207. package/dist/types/useAnchoredMaxHeight.d.ts +13 -0
  208. package/dist/types/useAnchoredPosition.d.ts +35 -0
  209. package/dist/types/useDismissOnOutsidePointer.d.ts +10 -0
  210. package/dist/types/useModalLayer.d.ts +26 -0
  211. package/dist/types/useRowDragPreview.d.ts +19 -0
  212. package/dist/types/user-text.d.ts +31 -0
  213. package/package.json +151 -4
@@ -0,0 +1,408 @@
1
+ import {
2
+ __publicField
3
+ } from "./chunk-ZA47FP7C.js";
4
+
5
+ // src/seekbuddy/qr/QrCode.tsx
6
+ import { useMemo } from "react";
7
+ import clsx from "clsx";
8
+
9
+ // src/seekbuddy/qr/qr.ts
10
+ var MAX_VERSION = 20;
11
+ var EC_LEVEL_BITS = 0;
12
+ var EC_BLOCKS = [
13
+ [0, 0, 0, 0, 0],
14
+ [10, 1, 16, 0, 0],
15
+ [16, 1, 28, 0, 0],
16
+ [26, 1, 44, 0, 0],
17
+ [18, 2, 32, 0, 0],
18
+ [24, 2, 43, 0, 0],
19
+ [16, 4, 27, 0, 0],
20
+ [18, 4, 31, 0, 0],
21
+ [22, 2, 38, 2, 39],
22
+ [22, 3, 36, 2, 37],
23
+ [26, 4, 43, 1, 44],
24
+ [30, 1, 50, 4, 51],
25
+ [22, 6, 36, 2, 37],
26
+ [22, 8, 37, 1, 38],
27
+ [24, 4, 40, 5, 41],
28
+ [24, 5, 41, 5, 42],
29
+ [28, 7, 45, 3, 46],
30
+ [28, 10, 46, 1, 47],
31
+ [26, 9, 43, 4, 44],
32
+ [26, 3, 44, 11, 45],
33
+ [26, 3, 41, 13, 42]
34
+ ];
35
+ var ALIGNMENT = [
36
+ [],
37
+ [],
38
+ [6, 18],
39
+ [6, 22],
40
+ [6, 26],
41
+ [6, 30],
42
+ [6, 34],
43
+ [6, 22, 38],
44
+ [6, 24, 42],
45
+ [6, 26, 46],
46
+ [6, 28, 50],
47
+ [6, 30, 54],
48
+ [6, 32, 58],
49
+ [6, 34, 62],
50
+ [6, 26, 46, 66],
51
+ [6, 26, 48, 70],
52
+ [6, 26, 50, 74],
53
+ [6, 30, 54, 78],
54
+ [6, 30, 56, 82],
55
+ [6, 30, 58, 86],
56
+ [6, 34, 62, 90]
57
+ ];
58
+ var EXP = new Uint8Array(512);
59
+ var LOG = new Uint8Array(256);
60
+ {
61
+ let value = 1;
62
+ for (let index = 0; index < 255; index += 1) {
63
+ EXP[index] = value;
64
+ LOG[value] = index;
65
+ value <<= 1;
66
+ if (value & 256) value ^= 285;
67
+ }
68
+ for (let index = 255; index < 512; index += 1) EXP[index] = EXP[index - 255];
69
+ }
70
+ function gfMul(a, b) {
71
+ return a === 0 || b === 0 ? 0 : EXP[LOG[a] + LOG[b]];
72
+ }
73
+ function generator(degree) {
74
+ let poly = new Uint8Array([1]);
75
+ for (let index = 0; index < degree; index += 1) {
76
+ const next = new Uint8Array(poly.length + 1);
77
+ for (let position = 0; position < poly.length; position += 1) {
78
+ next[position] = next[position] ^ poly[position];
79
+ next[position + 1] = next[position + 1] ^ gfMul(poly[position], EXP[index]);
80
+ }
81
+ poly = next;
82
+ }
83
+ return poly;
84
+ }
85
+ function remainder(data, ecCount) {
86
+ const gen = generator(ecCount);
87
+ const buffer = new Uint8Array(data.length + ecCount);
88
+ buffer.set(data);
89
+ for (let index = 0; index < data.length; index += 1) {
90
+ const factor = buffer[index];
91
+ if (factor === 0) continue;
92
+ for (let position = 1; position < gen.length; position += 1) {
93
+ buffer[index + position] = buffer[index + position] ^ gfMul(gen[position], factor);
94
+ }
95
+ }
96
+ return buffer.slice(data.length);
97
+ }
98
+ var Bits = class {
99
+ constructor() {
100
+ __publicField(this, "values", []);
101
+ }
102
+ /**
103
+ * 追加 `length` 位。
104
+ *
105
+ * @param value - 数值
106
+ * @param length - 位数
107
+ */
108
+ push(value, length) {
109
+ for (let index = length - 1; index >= 0; index -= 1) this.values.push(value >>> index & 1);
110
+ }
111
+ };
112
+ function capacityOf(version) {
113
+ const [ecCount, blocks1, data1, blocks2, data2] = EC_BLOCKS[version];
114
+ const dataCodewords = blocks1 * data1 + blocks2 * data2;
115
+ void ecCount;
116
+ const countBits = version < 10 ? 8 : 16;
117
+ return Math.floor((dataCodewords * 8 - 4 - countBits) / 8);
118
+ }
119
+ function codewordsOf(bytes, version) {
120
+ const [ecCount, blocks1, data1, blocks2, data2] = EC_BLOCKS[version];
121
+ const dataTotal = blocks1 * data1 + blocks2 * data2;
122
+ const bits = new Bits();
123
+ bits.push(4, 4);
124
+ bits.push(bytes.length, version < 10 ? 8 : 16);
125
+ for (const byte of bytes) bits.push(byte, 8);
126
+ const terminator = Math.min(4, dataTotal * 8 - bits.values.length);
127
+ bits.push(0, terminator);
128
+ while (bits.values.length % 8 !== 0) bits.values.push(0);
129
+ const data = new Uint8Array(dataTotal);
130
+ for (let index = 0; index < bits.values.length / 8; index += 1) {
131
+ let byte = 0;
132
+ for (let offset = 0; offset < 8; offset += 1) byte = byte << 1 | bits.values[index * 8 + offset];
133
+ data[index] = byte;
134
+ }
135
+ for (let index = bits.values.length / 8; index < dataTotal; index += 1) {
136
+ data[index] = (index - bits.values.length / 8) % 2 === 0 ? 236 : 17;
137
+ }
138
+ const dataBlocks = [];
139
+ const ecBlocks = [];
140
+ let cursor = 0;
141
+ for (const [count, size] of [
142
+ [blocks1, data1],
143
+ [blocks2, data2]
144
+ ]) {
145
+ for (let index = 0; index < count; index += 1) {
146
+ const block = data.slice(cursor, cursor + size);
147
+ cursor += size;
148
+ dataBlocks.push(block);
149
+ ecBlocks.push(remainder(block, ecCount));
150
+ }
151
+ }
152
+ const out = [];
153
+ const maxData = Math.max(data1, data2);
154
+ for (let index = 0; index < maxData; index += 1) {
155
+ for (const block of dataBlocks) if (index < block.length) out.push(block[index]);
156
+ }
157
+ for (let index = 0; index < ecCount; index += 1) {
158
+ for (const block of ecBlocks) out.push(block[index]);
159
+ }
160
+ return new Uint8Array(out);
161
+ }
162
+ function put(grid, x, y, dark) {
163
+ grid.modules[y * grid.size + x] = dark ? 1 : 0;
164
+ grid.reserved[y * grid.size + x] = 1;
165
+ }
166
+ function functionPatterns(version) {
167
+ const size = version * 4 + 17;
168
+ const grid = { size, modules: new Uint8Array(size * size), reserved: new Uint8Array(size * size) };
169
+ for (const [ox, oy] of [
170
+ [0, 0],
171
+ [size - 7, 0],
172
+ [0, size - 7]
173
+ ]) {
174
+ for (let y = -1; y <= 7; y += 1) {
175
+ for (let x = -1; x <= 7; x += 1) {
176
+ const px = ox + x;
177
+ const py = oy + y;
178
+ if (px < 0 || py < 0 || px >= size || py >= size) continue;
179
+ const ring = Math.max(Math.abs(x - 3), Math.abs(y - 3));
180
+ put(grid, px, py, x >= 0 && x <= 6 && y >= 0 && y <= 6 && ring !== 2);
181
+ }
182
+ }
183
+ }
184
+ const centers = ALIGNMENT[version];
185
+ for (const cy of centers) {
186
+ for (const cx of centers) {
187
+ if (cx === 6 && cy === 6 || cx === 6 && cy === size - 7 || cx === size - 7 && cy === 6) continue;
188
+ for (let y = -2; y <= 2; y += 1) {
189
+ for (let x = -2; x <= 2; x += 1) {
190
+ put(grid, cx + x, cy + y, Math.max(Math.abs(x), Math.abs(y)) !== 1);
191
+ }
192
+ }
193
+ }
194
+ }
195
+ for (let index = 8; index < size - 8; index += 1) {
196
+ put(grid, index, 6, index % 2 === 0);
197
+ put(grid, 6, index, index % 2 === 0);
198
+ }
199
+ put(grid, 8, size - 8, true);
200
+ for (let index = 0; index < 9; index += 1) {
201
+ if (index !== 6) put(grid, index, 8, false);
202
+ if (index !== 6) put(grid, 8, index, false);
203
+ }
204
+ for (let index = 0; index < 8; index += 1) {
205
+ put(grid, size - 1 - index, 8, false);
206
+ if (index < 7) put(grid, 8, size - 1 - index, false);
207
+ }
208
+ if (version >= 7) {
209
+ for (let index = 0; index < 18; index += 1) {
210
+ const a = Math.floor(index / 3);
211
+ const b = index % 3 + size - 11;
212
+ put(grid, a, b, false);
213
+ put(grid, b, a, false);
214
+ }
215
+ }
216
+ return grid;
217
+ }
218
+ function placeData(grid, codewords) {
219
+ const { size } = grid;
220
+ let bit = 0;
221
+ let upward = true;
222
+ for (let right = size - 1; right >= 1; right -= 2) {
223
+ const column = right <= 6 ? right - 1 : right;
224
+ for (let step = 0; step < size; step += 1) {
225
+ const y = upward ? size - 1 - step : step;
226
+ for (const x of [column, column - 1]) {
227
+ if (grid.reserved[y * size + x] === 1) continue;
228
+ const byte = codewords[bit >>> 3];
229
+ const dark = byte !== void 0 && (byte >>> 7 - (bit & 7) & 1) === 1;
230
+ grid.modules[y * size + x] = dark ? 1 : 0;
231
+ bit += 1;
232
+ }
233
+ }
234
+ upward = !upward;
235
+ }
236
+ }
237
+ var MASKS = [
238
+ (x, y) => (x + y) % 2 === 0,
239
+ (_x, y) => y % 2 === 0,
240
+ (x) => x % 3 === 0,
241
+ (x, y) => (x + y) % 3 === 0,
242
+ (x, y) => (Math.floor(y / 2) + Math.floor(x / 3)) % 2 === 0,
243
+ (x, y) => x * y % 2 + x * y % 3 === 0,
244
+ (x, y) => (x * y % 2 + x * y % 3) % 2 === 0,
245
+ (x, y) => ((x + y) % 2 + x * y % 3) % 2 === 0
246
+ ];
247
+ function penalty(modules, size) {
248
+ let score = 0;
249
+ const at = (x, y) => modules[y * size + x];
250
+ for (let line = 0; line < size; line += 1) {
251
+ for (const horizontal of [true, false]) {
252
+ let run = 1;
253
+ for (let index = 1; index < size; index += 1) {
254
+ const current = horizontal ? at(index, line) : at(line, index);
255
+ const previous = horizontal ? at(index - 1, line) : at(line, index - 1);
256
+ if (current === previous) {
257
+ run += 1;
258
+ if (run === 5) score += 3;
259
+ else if (run > 5) score += 1;
260
+ } else run = 1;
261
+ }
262
+ }
263
+ }
264
+ for (let y = 0; y < size - 1; y += 1) {
265
+ for (let x = 0; x < size - 1; x += 1) {
266
+ const value = at(x, y);
267
+ if (value === at(x + 1, y) && value === at(x, y + 1) && value === at(x + 1, y + 1)) score += 3;
268
+ }
269
+ }
270
+ const FINDER_AHEAD = 1488;
271
+ const FINDER_BEHIND = 93;
272
+ for (let line = 0; line < size; line += 1) {
273
+ let row = 0;
274
+ let column = 0;
275
+ for (let index = 0; index < size; index += 1) {
276
+ row = row << 1 & 2047 | at(index, line);
277
+ column = column << 1 & 2047 | at(line, index);
278
+ if (index < 10) continue;
279
+ if (row === FINDER_AHEAD || row === FINDER_BEHIND) score += 40;
280
+ if (column === FINDER_AHEAD || column === FINDER_BEHIND) score += 40;
281
+ }
282
+ }
283
+ const dark = modules.reduce((total, value) => total + value, 0);
284
+ const ratio = dark * 100 / (size * size);
285
+ score += Math.abs(Math.ceil(ratio / 5) - 10) * 10;
286
+ return score;
287
+ }
288
+ function writeFormat(grid, mask) {
289
+ const { size } = grid;
290
+ const data = EC_LEVEL_BITS << 3 | mask;
291
+ let rest = data << 10;
292
+ for (let index = 4; index >= 0; index -= 1) {
293
+ if (rest & 1 << index + 10) rest ^= 1335 << index;
294
+ }
295
+ const bits = (data << 10 | rest) ^ 21522;
296
+ const set = (x, y, dark) => void (grid.modules[y * size + x] = dark ? 1 : 0);
297
+ for (let index = 0; index < 15; index += 1) {
298
+ const dark = (bits >>> index & 1) === 1;
299
+ if (index < 6) set(8, index, dark);
300
+ else if (index === 6) set(8, 7, dark);
301
+ else if (index === 7) set(8, 8, dark);
302
+ else if (index === 8) set(7, 8, dark);
303
+ else set(14 - index, 8, dark);
304
+ if (index < 8) set(size - 1 - index, 8, dark);
305
+ else set(8, size - 15 + index, dark);
306
+ }
307
+ }
308
+ function writeVersion(grid, version) {
309
+ if (version < 7) return;
310
+ const { size } = grid;
311
+ let rest = version << 12;
312
+ for (let index = 5; index >= 0; index -= 1) {
313
+ if (rest & 1 << index + 12) rest ^= 7973 << index;
314
+ }
315
+ const bits = version << 12 | rest;
316
+ for (let index = 0; index < 18; index += 1) {
317
+ const dark = (bits >>> index & 1) === 1 ? 1 : 0;
318
+ const a = Math.floor(index / 3);
319
+ const b = index % 3 + size - 11;
320
+ grid.modules[b * size + a] = dark;
321
+ grid.modules[a * size + b] = dark;
322
+ }
323
+ }
324
+ function encodeQr(text) {
325
+ if (text === "") return null;
326
+ const bytes = new TextEncoder().encode(text);
327
+ let version = 0;
328
+ for (let candidate = 1; candidate <= MAX_VERSION; candidate += 1) {
329
+ if (capacityOf(candidate) >= bytes.length) {
330
+ version = candidate;
331
+ break;
332
+ }
333
+ }
334
+ if (version === 0) return null;
335
+ const codewords = codewordsOf(bytes, version);
336
+ const base = functionPatterns(version);
337
+ placeData(base, codewords);
338
+ let best = null;
339
+ for (let mask = 0; mask < MASKS.length; mask += 1) {
340
+ const modules = Uint8Array.from(base.modules);
341
+ const condition = MASKS[mask];
342
+ for (let y = 0; y < base.size; y += 1) {
343
+ for (let x = 0; x < base.size; x += 1) {
344
+ if (base.reserved[y * base.size + x] === 1) continue;
345
+ if (condition(x, y)) modules[y * base.size + x] = modules[y * base.size + x] ^ 1;
346
+ }
347
+ }
348
+ const candidate = { size: base.size, modules, reserved: base.reserved };
349
+ writeFormat(candidate, mask);
350
+ writeVersion(candidate, version);
351
+ if (best === null || penalty(modules, base.size) < penalty(best.modules, base.size)) {
352
+ best = { mask, modules };
353
+ }
354
+ }
355
+ return {
356
+ size: base.size,
357
+ version,
358
+ modules: Array.from(best.modules, (value) => value === 1)
359
+ };
360
+ }
361
+
362
+ // .build/css/seekbuddy/qr/QrCode.module.mjs
363
+ var id = "@seekbuddy/dsh-ui/seekbuddy/qr/QrCode.module.css";
364
+ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
365
+ const element = document.createElement("style");
366
+ element.setAttribute("data-dsh-ui-primitives", id);
367
+ element.textContent = ".kJqaaq_qr{border-radius:var(--dsw-radius-sm);display:block}";
368
+ document.head.appendChild(element);
369
+ }
370
+ var QrCode_module_default = { "qr": "kJqaaq_qr" };
371
+
372
+ // src/seekbuddy/qr/QrCode.tsx
373
+ import { jsx, jsxs } from "react/jsx-runtime";
374
+ var QUIET = 4;
375
+ function QrCode({ text, label, fallback, size = 180, className }) {
376
+ const drawing = useMemo(() => {
377
+ const matrix = encodeQr(text);
378
+ if (matrix === null) return null;
379
+ let path = "";
380
+ for (let y = 0; y < matrix.size; y += 1) {
381
+ for (let x = 0; x < matrix.size; x += 1) {
382
+ if (matrix.modules[y * matrix.size + x]) path += `M${String(x + QUIET)} ${String(y + QUIET)}h1v1h-1z`;
383
+ }
384
+ }
385
+ return { path, extent: matrix.size + QUIET * 2 };
386
+ }, [text]);
387
+ if (drawing === null) return fallback ?? null;
388
+ return /* @__PURE__ */ jsxs(
389
+ "svg",
390
+ {
391
+ className: clsx(QrCode_module_default.qr, className),
392
+ width: size,
393
+ height: size,
394
+ viewBox: `0 0 ${String(drawing.extent)} ${String(drawing.extent)}`,
395
+ role: "img",
396
+ "aria-label": label,
397
+ shapeRendering: "crispEdges",
398
+ children: [
399
+ /* @__PURE__ */ jsx("rect", { width: drawing.extent, height: drawing.extent, fill: "#fff" }),
400
+ /* @__PURE__ */ jsx("path", { d: drawing.path, fill: "#000" })
401
+ ]
402
+ }
403
+ );
404
+ }
405
+
406
+ export {
407
+ QrCode
408
+ };
@@ -0,0 +1,24 @@
1
+ // src/seekbuddy/DangerButton.tsx
2
+ import clsx from "clsx";
3
+ import { forwardRef } from "react";
4
+ import { Button } from "@seekbuddy/dsh-ui";
5
+
6
+ // .build/css/seekbuddy/DangerButton.module.mjs
7
+ var id = "@seekbuddy/dsh-ui/seekbuddy/DangerButton.module.css";
8
+ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
9
+ const element = document.createElement("style");
10
+ element.setAttribute("data-dsh-ui-primitives", id);
11
+ element.textContent = ".t5_aDG_danger{color:var(--dsw-alias-state-error-primary);border-color:var(--dsw-alias-state-error-primary)}.t5_aDG_danger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover-danger)}.t5_aDG_danger:active:not(:disabled){background:color-mix(in srgb, var(--dsw-alias-state-error-primary) 18%, transparent)}.t5_aDG_danger:focus-visible{outline-offset:2px;outline-style:solid}";
12
+ document.head.appendChild(element);
13
+ }
14
+ var DangerButton_module_default = { "danger": "t5_aDG_danger" };
15
+
16
+ // src/seekbuddy/DangerButton.tsx
17
+ import { jsx } from "react/jsx-runtime";
18
+ var DangerButton = forwardRef(function DangerButton2({ className, ...rest }, ref) {
19
+ return /* @__PURE__ */ jsx(Button, { ...rest, ref, variant: "outline", className: clsx(DangerButton_module_default.danger, className) });
20
+ });
21
+
22
+ export {
23
+ DangerButton
24
+ };
@@ -0,0 +1,26 @@
1
+ // src/Button.tsx
2
+ import { forwardRef } from "react";
3
+ import clsx from "clsx";
4
+
5
+ // .build/css/Button.module.mjs
6
+ var id = "@seekbuddy/dsh-ui/Button.module.css";
7
+ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
8
+ const element = document.createElement("style");
9
+ element.setAttribute("data-dsh-ui-primitives", id);
10
+ element.textContent = ".wa-Ieq_button{box-sizing:border-box;border-radius:var(--dsw-radius-md);cursor:pointer;color:var(--dsw-alias-label-primary);background:0 0;border:none;justify-content:center;align-items:center;gap:4px;padding:0 14px;font-size:14px;line-height:22px;display:inline-flex}.wa-Ieq_button:disabled{cursor:not-allowed;opacity:.4}.wa-Ieq_md{height:36px}.wa-Ieq_sm{border-radius:var(--dsw-radius-sm);height:28px;padding:0 10px;font-size:12px;line-height:18px}.wa-Ieq_primary{background:var(--dsw-alias-button-primary-fill);color:var(--dsw-alias-label-primary-foreground)}@media (hover:hover){.wa-Ieq_primary:hover:not(:disabled){background:var(--dsw-alias-button-primary-hover)}.wa-Ieq_ghost:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}}.wa-Ieq_ghost:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}.wa-Ieq_outline{box-shadow:inset 0 0 0 var(--dsh-hairline-width,.5px) var(--dsh-button-outline-color,var(--dsw-alias-border-l3));background:0 0;border:.5px solid #0000}@media (hover:hover){.wa-Ieq_outline:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}}.wa-Ieq_toolbar{background:var(--dsw-alias-button-tool-bar-fill)}@media (hover:hover){.wa-Ieq_toolbar:hover:not(:disabled){background:var(--dsw-alias-button-tool-bar-hover)}}.wa-Ieq_icon{justify-content:center;align-items:center;width:16px;height:16px;display:inline-flex}";
11
+ document.head.appendChild(element);
12
+ }
13
+ var Button_module_default = { "primary": "wa-Ieq_primary", "ghost": "wa-Ieq_ghost", "md": "wa-Ieq_md", "sm": "wa-Ieq_sm", "icon": "wa-Ieq_icon", "button": "wa-Ieq_button", "toolbar": "wa-Ieq_toolbar", "outline": "wa-Ieq_outline" };
14
+
15
+ // src/Button.tsx
16
+ import { jsx, jsxs } from "react/jsx-runtime";
17
+ var Button = forwardRef(function Button2({ variant = "ghost", size = "md", icon, className, children, ...rest }, ref) {
18
+ return /* @__PURE__ */ jsxs("button", { ref, type: "button", className: clsx(Button_module_default.button, Button_module_default[variant], Button_module_default[size], className), ...rest, children: [
19
+ icon != null && /* @__PURE__ */ jsx("span", { className: Button_module_default.icon, children: icon }),
20
+ children
21
+ ] });
22
+ });
23
+
24
+ export {
25
+ Button
26
+ };
@@ -0,0 +1,27 @@
1
+ // src/seekbuddy/Spinner.tsx
2
+ import clsx from "clsx";
3
+
4
+ // .build/css/seekbuddy/Spinner.module.mjs
5
+ var id = "@seekbuddy/dsh-ui/seekbuddy/Spinner.module.css";
6
+ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
7
+ const element = document.createElement("style");
8
+ element.setAttribute("data-dsh-ui-primitives", id);
9
+ element.textContent = ".ACvqaW_ring{box-sizing:border-box;corner-shape:round;border:2px solid color-mix(in srgb, currentColor 35%, transparent);border-top-color:currentColor;border-radius:50%;flex:none;animation:.85s linear infinite ACvqaW_dsh-seekbuddy-spinner;display:inline-block}.ACvqaW_sm{width:.85rem;height:.85rem}.ACvqaW_md{border-width:3px;width:2rem;height:2rem}.ACvqaW_page{color:var(--dsw-alias-label-primary)}.ACvqaW_status{align-items:center;display:inline-flex;position:relative}.ACvqaW_label{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}@keyframes ACvqaW_dsh-seekbuddy-spinner{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.ACvqaW_ring{border-top-color:color-mix(in srgb, currentColor 35%, transparent);border-right-color:currentColor;animation:none}}";
10
+ document.head.appendChild(element);
11
+ }
12
+ var Spinner_module_default = { "status": "ACvqaW_status", "page": "ACvqaW_page", "md": "ACvqaW_md", "label": "ACvqaW_label", "ring": "ACvqaW_ring", "dsh-seekbuddy-spinner": "ACvqaW_dsh-seekbuddy-spinner", "sm": "ACvqaW_sm" };
13
+
14
+ // src/seekbuddy/Spinner.tsx
15
+ import { jsx, jsxs } from "react/jsx-runtime";
16
+ function Spinner({ size = "sm", tone = "inherit", label, className }) {
17
+ const ring = clsx(Spinner_module_default.ring, Spinner_module_default[size], tone === "page" && Spinner_module_default.page);
18
+ if (label === void 0) return /* @__PURE__ */ jsx("span", { className: clsx(ring, className), "aria-hidden": "true" });
19
+ return /* @__PURE__ */ jsxs("span", { className: clsx(Spinner_module_default.status, className), role: "status", "aria-live": "polite", children: [
20
+ /* @__PURE__ */ jsx("span", { className: ring, "aria-hidden": "true" }),
21
+ /* @__PURE__ */ jsx("span", { className: Spinner_module_default.label, children: label })
22
+ ] });
23
+ }
24
+
25
+ export {
26
+ Spinner
27
+ };
@@ -0,0 +1,57 @@
1
+ // src/seekbuddy/Mark.tsx
2
+ import clsx from "clsx";
3
+ import { Tooltip } from "@seekbuddy/dsh-ui";
4
+
5
+ // .build/css/seekbuddy/Mark.module.mjs
6
+ var id = "@seekbuddy/dsh-ui/seekbuddy/Mark.module.css";
7
+ if (typeof document !== "undefined" && !document.querySelector('style[data-dsh-ui-primitives="' + id + '"]')) {
8
+ const element = document.createElement("style");
9
+ element.setAttribute("data-dsh-ui-primitives", id);
10
+ element.textContent = ".NiEJAq_mark{box-sizing:border-box;vertical-align:middle;border-radius:var(--dsw-radius-xs);cursor:help;flex:none;justify-content:center;align-items:center;line-height:0;display:inline-flex}.NiEJAq_plain{cursor:default}.NiEJAq_mark:focus-visible{outline-offset:2px;outline-style:solid}.NiEJAq_official{color:var(--dsw-alias-state-business-primary)}";
11
+ document.head.appendChild(element);
12
+ }
13
+ var Mark_module_default = { "plain": "NiEJAq_plain", "mark": "NiEJAq_mark", "official": "NiEJAq_official" };
14
+
15
+ // src/seekbuddy/Mark.tsx
16
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
17
+ function Mark({ kind, label, size = 16, tooltip = true, className }) {
18
+ const mark = /* @__PURE__ */ jsx(
19
+ "span",
20
+ {
21
+ className: clsx(Mark_module_default.mark, Mark_module_default[kind], !tooltip && Mark_module_default.plain, className),
22
+ role: "img",
23
+ "aria-label": label,
24
+ tabIndex: 0,
25
+ "data-kind": kind,
26
+ children: /* @__PURE__ */ jsx(
27
+ "svg",
28
+ {
29
+ width: size,
30
+ height: size,
31
+ viewBox: "0 0 24 24",
32
+ fill: "none",
33
+ stroke: "currentColor",
34
+ strokeWidth: "2",
35
+ strokeLinecap: "round",
36
+ strokeLinejoin: "round",
37
+ "aria-hidden": "true",
38
+ focusable: "false",
39
+ children: GLYPHS[kind]
40
+ }
41
+ )
42
+ }
43
+ );
44
+ if (!tooltip) return mark;
45
+ return /* @__PURE__ */ jsx(Tooltip, { label, side: "top", children: mark });
46
+ }
47
+ var GLYPHS = {
48
+ // Twelve-point seal (outer r 9.5 / inner r 8.1, generated, centred on 12,12) with a check: "issued by the platform".
49
+ official: /* @__PURE__ */ jsxs(Fragment, { children: [
50
+ /* @__PURE__ */ jsx("path", { d: "M12 2.5 14.1 4.18 16.75 3.77 17.73 6.27 20.23 7.25 19.82 9.9 21.5 12 19.82 14.1 20.23 16.75 17.73 17.73 16.75 20.23 14.1 19.82 12 21.5 9.9 19.82 7.25 20.23 6.27 17.73 3.77 16.75 4.18 14.1 2.5 12 4.18 9.9 3.77 7.25 6.27 6.27 7.25 3.77 9.9 4.18Z" }),
51
+ /* @__PURE__ */ jsx("path", { d: "m8.5 12 2.5 2.5 4.5-5" })
52
+ ] })
53
+ };
54
+
55
+ export {
56
+ Mark
57
+ };
@@ -0,0 +1,31 @@
1
+ import {
2
+ BrowseOutlineArtwork,
3
+ ChatLinesOutlineArtwork,
4
+ FolderCloseArtwork,
5
+ ICON_MEDIUM_STROKE,
6
+ ICON_REGULAR_STROKE
7
+ } from "./chunk-XW4L4ZGL.js";
8
+
9
+ // src/ReferenceIcon.tsx
10
+ import { jsx } from "react/jsx-runtime";
11
+ function ReferenceIconArtwork({ kind, size = 16, className, strokeWidth }) {
12
+ switch (kind) {
13
+ case "session":
14
+ return /* @__PURE__ */ jsx(ChatLinesOutlineArtwork, { size, className, strokeWidth });
15
+ case "file":
16
+ return /* @__PURE__ */ jsx(BrowseOutlineArtwork, { size, className, strokeWidth });
17
+ case "folder":
18
+ return /* @__PURE__ */ jsx(FolderCloseArtwork, { size, className, strokeWidth });
19
+ }
20
+ }
21
+ function ReferenceIconRegular(props) {
22
+ return /* @__PURE__ */ jsx(ReferenceIconArtwork, { ...props, strokeWidth: ICON_REGULAR_STROKE });
23
+ }
24
+ function ReferenceIconMedium(props) {
25
+ return /* @__PURE__ */ jsx(ReferenceIconArtwork, { ...props, strokeWidth: ICON_MEDIUM_STROKE });
26
+ }
27
+
28
+ export {
29
+ ReferenceIconRegular,
30
+ ReferenceIconMedium
31
+ };