@copio/sdk 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +34 -0
- package/dist/adapters/edge/index.js +2 -0
- package/dist/adapters/edge/index.js.map +7 -0
- package/dist/adapters/edge/null-edge-detector-adapter.js +2 -0
- package/dist/adapters/edge/null-edge-detector-adapter.js.map +7 -0
- package/dist/adapters/edge/scanic-wasm-adapter.js +2 -0
- package/dist/adapters/edge/scanic-wasm-adapter.js.map +7 -0
- package/dist/adapters/image/canvas2d-adapter.js +1 -1
- package/dist/adapters/image/index.js +1 -1
- package/dist/adapters/image/null-image-processor-adapter.js +1 -1
- package/dist/adapters/index.js +1 -1
- package/dist/adapters/indexeddb-adapter.js +1 -1
- package/dist/adapters/memory-adapter.js +1 -1
- package/dist/adapters/ocr/index.js +1 -1
- package/dist/adapters/ocr/null-ocr-adapter.js +1 -1
- package/dist/adapters/ocr/tesseract-wasm-adapter.js +1 -1
- package/dist/adapters/pdf/index.js +1 -1
- package/dist/adapters/pdf/null-pdf-adapter.js +1 -1
- package/dist/adapters/pdf/pdfkit-adapter.js +1 -1
- package/dist/adapters/storage/index.js +1 -1
- package/dist/adapters/storage/indexeddb-adapter.js +1 -1
- package/dist/adapters/storage/memory-adapter.js +1 -1
- package/dist/adapters/sync/index.js +1 -1
- package/dist/adapters/sync/null-sync-adapter.js +1 -1
- package/dist/adapters/sync/peerjs-adapter.js +1 -1
- package/dist/canvas-GKLGWNAJ.js +2 -0
- package/dist/cdn.js +189 -1409
- package/dist/chunk-25WAHT3G.js +2 -0
- package/dist/chunk-2VH2NPXW.js +175 -0
- package/dist/{chunk-DIU5BGU5.js → chunk-4D6GC55I.js} +2 -2
- package/dist/chunk-6QK7337A.js +2 -0
- package/dist/chunk-GLY5CGCY.js +2 -0
- package/dist/chunk-GU6OQMYK.js +4 -0
- package/dist/chunk-HCCNUPKB.js +2 -0
- package/dist/chunk-JIPKWRBK.js +2 -0
- package/dist/{chunk-GGERQ3CJ.js → chunk-NM4YYZYB.js} +3 -3
- package/dist/chunk-NNSM2I5L.js +2 -0
- package/dist/chunk-PBF7V4Z6.js +2 -0
- package/dist/chunk-PSGIWIRH.js +2 -0
- package/dist/chunk-Q7SOUI6D.js +2 -0
- package/dist/chunk-R6Q4OXDG.js +2 -0
- package/dist/chunk-SZHKZARU.js +2 -0
- package/dist/{chunk-J7HWZNIP.js → chunk-T5CPA7B2.js} +2 -2
- package/dist/chunk-V2D55DVU.js +1 -0
- package/dist/chunk-VPSUKD6F.js +2 -0
- package/dist/chunk-WZZ7FNDX.js +2 -0
- package/dist/chunk-ZILTJGT2.js +2 -0
- package/dist/core.js +1 -1
- package/dist/custom-elements.json +2358 -177
- package/dist/export.js +1 -1
- package/dist/fs-Y7NMZRBK.js +2 -0
- package/dist/handoff-transport-7YFK4RYL.js +2 -0
- package/dist/handoff.js +2 -0
- package/dist/http-CYZIMVXQ.js +2 -0
- package/dist/https-OLG7KUSR.js +2 -0
- package/dist/index.js +11 -11
- package/dist/ocr.js +1 -1
- package/dist/path2d-HD3LU76S.js +2 -0
- package/dist/scanic-mlDetector-BCSVQYFV.js +2 -0
- package/dist/scanic-ort.wasm.min-MU4NYSP2.js +2 -0
- package/dist/scanner.js +3 -1396
- package/dist/sync.js +1 -1
- package/dist/types/js/adapters/edge/edge-detector-port.d.ts +183 -0
- package/dist/types/js/adapters/edge/index.d.ts +3 -0
- package/dist/types/js/adapters/edge/null-edge-detector-adapter.d.ts +35 -0
- package/dist/types/js/adapters/edge/scanic-wasm-adapter.d.ts +54 -0
- package/dist/types/js/adapters/storage/indexeddb-adapter.d.ts +11 -0
- package/dist/types/js/adapters/storage/memory-adapter.d.ts +11 -0
- package/dist/types/js/adapters/storage/opfs-adapter.d.ts +11 -0
- package/dist/types/js/adapters/storage/storage-port.d.ts +27 -0
- package/dist/types/js/services/doc-repository.d.ts +6 -1
- package/dist/types/js/services/handoff-crypto.d.ts +84 -0
- package/dist/types/js/services/handoff-session.d.ts +257 -0
- package/dist/types/js/services/handoff-transport.d.ts +51 -0
- package/dist/types/js/services/ice-servers.d.ts +33 -1
- package/dist/types/js/services/migration-runner.d.ts +100 -0
- package/dist/types/js/utils/perspective.d.ts +70 -0
- package/dist/types/js/utils/utils.d.ts +19 -1
- package/dist/types/sdk/core.d.ts +52 -6
- package/dist/types/sdk/elements.d.ts +2 -0
- package/dist/types/sdk/events.d.ts +42 -0
- package/dist/types/sdk/handoff-session.d.ts +4 -0
- package/dist/types/sdk/handoff-styles.d.ts +9 -0
- package/dist/types/sdk/handoff.d.ts +108 -0
- package/dist/types/sdk/index.d.ts +5 -1
- package/dist/types/sdk/models.d.ts +248 -1
- package/dist/types/sdk/scanner.d.ts +94 -1
- package/dist/types/sdk/styles.d.ts +1 -1
- package/dist/types/sdk/version.d.ts +1 -1
- package/dist/url-NYR4TEJV.js +2 -0
- package/package.json +10 -3
- package/sdk/core.js +226 -13
- package/sdk/events.js +14 -0
- package/sdk/handoff-session.js +26 -0
- package/sdk/handoff-styles.js +531 -0
- package/sdk/handoff.js +1079 -0
- package/sdk/index.js +38 -1
- package/sdk/models.js +116 -4
- package/sdk/scanner.js +1517 -151
- package/sdk/styles.js +305 -22
- package/sdk/version.js +1 -1
- package/dist/canvas-FAXPLPXN.js +0 -2
- package/dist/chunk-4C666HHU.js +0 -2
- package/dist/chunk-FQRADJY6.js +0 -2
- package/dist/chunk-G5EUMLYT.js +0 -4
- package/dist/chunk-K4NR6OAC.js +0 -2
- package/dist/chunk-L4OVZN23.js +0 -2
- package/dist/chunk-MEE2NNYB.js +0 -2
- package/dist/chunk-O7IV7A6O.js +0 -2
- package/dist/chunk-Q7XPZMZA.js +0 -1395
- package/dist/chunk-WETG2JD7.js +0 -2
- package/dist/fs-HJ6WWW73.js +0 -2
- package/dist/http-FKJJMT2N.js +0 -2
- package/dist/https-MUBFLDZM.js +0 -2
- package/dist/path2d-QWN6DFCC.js +0 -2
- package/dist/url-ABJ6S2Y6.js +0 -2
package/dist/chunk-Q7XPZMZA.js
DELETED
|
@@ -1,1395 +0,0 @@
|
|
|
1
|
-
import{h as L,i as M,m as c,n as z,t as A}from"./chunk-O7IV7A6O.js";import{a as S,b as I}from"./chunk-YNY65JUJ.js";import{b as R}from"./chunk-ZT72PD2C.js";var P=`
|
|
2
|
-
:host {
|
|
3
|
-
all: initial;
|
|
4
|
-
display: block;
|
|
5
|
-
position: relative;
|
|
6
|
-
width: 100%;
|
|
7
|
-
height: 100%;
|
|
8
|
-
min-height: 200px;
|
|
9
|
-
container-type: size;
|
|
10
|
-
container-name: copio-scanner;
|
|
11
|
-
overflow: hidden;
|
|
12
|
-
contain: layout;
|
|
13
|
-
box-sizing: border-box;
|
|
14
|
-
text-align: left;
|
|
15
|
-
direction: ltr;
|
|
16
|
-
-webkit-font-smoothing: antialiased;
|
|
17
|
-
-moz-osx-font-smoothing: grayscale;
|
|
18
|
-
--copio-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
19
|
-
--copio-font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
|
|
20
|
-
--copio-color-bg: #0b0f17;
|
|
21
|
-
--copio-color-surface: #131b26;
|
|
22
|
-
--copio-color-surface-elevated: #1c2736;
|
|
23
|
-
--copio-color-surface-overlay: rgba(15, 22, 32, 0.88);
|
|
24
|
-
--copio-color-stage-bg: #070a0f;
|
|
25
|
-
--copio-color-text: #f1f5f9;
|
|
26
|
-
--copio-color-text-muted: #94a3b8;
|
|
27
|
-
--copio-color-text-inverse: #090d14;
|
|
28
|
-
--copio-color-primary: #38bdf8;
|
|
29
|
-
--copio-color-primary-hover: #7dd3fc;
|
|
30
|
-
--copio-color-primary-contrast: #06131f;
|
|
31
|
-
--copio-color-success: #22c55e;
|
|
32
|
-
--copio-color-warning: #f59e0b;
|
|
33
|
-
--copio-color-danger: #ef4444;
|
|
34
|
-
--copio-color-border: rgba(148, 163, 184, 0.18);
|
|
35
|
-
--copio-color-border-strong: rgba(148, 163, 184, 0.34);
|
|
36
|
-
--copio-focus-ring: 0 0 0 2px #0b0f17, 0 0 0 4px #38bdf8;
|
|
37
|
-
--copio-radius-sm: 6px;
|
|
38
|
-
--copio-radius-md: 10px;
|
|
39
|
-
--copio-radius-lg: 14px;
|
|
40
|
-
--copio-radius-pill: 9999px;
|
|
41
|
-
--copio-spacing-xs: 4px;
|
|
42
|
-
--copio-spacing-sm: 8px;
|
|
43
|
-
--copio-spacing-md: 12px;
|
|
44
|
-
--copio-spacing-lg: 16px;
|
|
45
|
-
--copio-spacing-xl: 24px;
|
|
46
|
-
--copio-touch-target-min: 44px;
|
|
47
|
-
--copio-crop-handle-hit: 48px;
|
|
48
|
-
--copio-crop-handle-visual: 16px;
|
|
49
|
-
--copio-shadow-elevated: 0 12px 32px -4px rgba(0, 0, 0, 0.55);
|
|
50
|
-
--copio-transition-fast: 150ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
51
|
-
--copio-transition-normal: 240ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
52
|
-
--sl-font-sans: var(--copio-font-family);
|
|
53
|
-
--sl-font-mono: var(--copio-font-mono);
|
|
54
|
-
--sl-color-primary-50: #f0f9ff;
|
|
55
|
-
--sl-color-primary-100: #e0f2fe;
|
|
56
|
-
--sl-color-primary-200: #bae6fd;
|
|
57
|
-
--sl-color-primary-300: #7dd3fc;
|
|
58
|
-
--sl-color-primary-400: #38bdf8;
|
|
59
|
-
--sl-color-primary-500: #0ea5e9;
|
|
60
|
-
--sl-color-primary-600: var(--copio-color-primary);
|
|
61
|
-
--sl-color-primary-700: #0369a1;
|
|
62
|
-
--sl-color-primary-800: #075985;
|
|
63
|
-
--sl-color-primary-900: #0c4a6e;
|
|
64
|
-
--sl-color-primary-950: #082f49;
|
|
65
|
-
font-family: var(--copio-font-family);
|
|
66
|
-
font-size: 14px;
|
|
67
|
-
line-height: 1.5;
|
|
68
|
-
color: var(--copio-color-text);
|
|
69
|
-
background-color: var(--copio-color-bg);
|
|
70
|
-
color-scheme: dark;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:host([theme="dark"]),
|
|
74
|
-
:host(.copio-theme-dark),
|
|
75
|
-
:host-context([data-theme="dark"]),
|
|
76
|
-
:host-context(.sl-theme-dark),
|
|
77
|
-
:host-context(.theme-dark) {
|
|
78
|
-
color-scheme: dark;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/* Light Theme Override */
|
|
82
|
-
:host([theme="light"]),
|
|
83
|
-
:host(.copio-theme-light),
|
|
84
|
-
:host-context([data-theme="light"]),
|
|
85
|
-
:host-context(.sl-theme-light),
|
|
86
|
-
:host-context(.theme-light) {
|
|
87
|
-
--copio-color-bg: #f8fafc;
|
|
88
|
-
--copio-color-surface: #ffffff;
|
|
89
|
-
--copio-color-surface-elevated: #f1f5f9;
|
|
90
|
-
--copio-color-surface-overlay: rgba(255, 255, 255, 0.92);
|
|
91
|
-
--copio-color-stage-bg: #1e293b;
|
|
92
|
-
--copio-color-text: #0f172a;
|
|
93
|
-
--copio-color-text-muted: #475569;
|
|
94
|
-
--copio-color-text-inverse: #ffffff;
|
|
95
|
-
--copio-color-primary: #0284c7;
|
|
96
|
-
--copio-color-primary-hover: #0369a1;
|
|
97
|
-
--copio-color-primary-contrast: #ffffff;
|
|
98
|
-
--copio-color-success: #16a34a;
|
|
99
|
-
--copio-color-warning: #d97706;
|
|
100
|
-
--copio-color-danger: #dc2626;
|
|
101
|
-
--copio-color-border: rgba(15, 23, 42, 0.12);
|
|
102
|
-
--copio-color-border-strong: rgba(15, 23, 42, 0.26);
|
|
103
|
-
--copio-focus-ring: 0 0 0 2px #ffffff, 0 0 0 4px #0284c7;
|
|
104
|
-
--copio-radius-sm: 6px;
|
|
105
|
-
--copio-radius-md: 10px;
|
|
106
|
-
--copio-radius-lg: 14px;
|
|
107
|
-
--copio-shadow-elevated: 0 12px 28px -4px rgba(15, 23, 42, 0.18);
|
|
108
|
-
color-scheme: light;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/* Brand Theme Override (Emerald) */
|
|
112
|
-
:host([theme="brand"]),
|
|
113
|
-
:host(.copio-theme-brand),
|
|
114
|
-
:host-context([data-theme="brand"]),
|
|
115
|
-
:host-context(.theme-brand) {
|
|
116
|
-
--copio-color-bg: #0f111a;
|
|
117
|
-
--copio-color-surface: #181b28;
|
|
118
|
-
--copio-color-surface-elevated: #23273a;
|
|
119
|
-
--copio-color-surface-overlay: rgba(24, 27, 40, 0.90);
|
|
120
|
-
--copio-color-stage-bg: #090a10;
|
|
121
|
-
--copio-color-text: #f8fafc;
|
|
122
|
-
--copio-color-text-muted: #9ca3af;
|
|
123
|
-
--copio-color-text-inverse: #ffffff;
|
|
124
|
-
--copio-color-primary: #10b981;
|
|
125
|
-
--copio-color-primary-hover: #34d399;
|
|
126
|
-
--copio-color-primary-contrast: #042f2e;
|
|
127
|
-
--copio-color-success: #10b981;
|
|
128
|
-
--copio-color-warning: #f59e0b;
|
|
129
|
-
--copio-color-danger: #ef4444;
|
|
130
|
-
--copio-color-border: rgba(16, 185, 129, 0.22);
|
|
131
|
-
--copio-color-border-strong: rgba(16, 185, 129, 0.42);
|
|
132
|
-
--copio-focus-ring: 0 0 0 2px #0f111a, 0 0 0 4px #10b981;
|
|
133
|
-
--copio-radius-sm: 4px;
|
|
134
|
-
--copio-radius-md: 8px;
|
|
135
|
-
--copio-radius-lg: 12px;
|
|
136
|
-
--copio-shadow-elevated: 0 12px 32px -4px rgba(0, 0, 0, 0.65);
|
|
137
|
-
color-scheme: dark;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
/* Auto Theme: follows prefers-color-scheme when theme is auto */
|
|
141
|
-
@media (prefers-color-scheme: light) {
|
|
142
|
-
:host([theme="auto"]),
|
|
143
|
-
:host(.copio-theme-auto) {
|
|
144
|
-
--copio-color-bg: #f8fafc;
|
|
145
|
-
--copio-color-surface: #ffffff;
|
|
146
|
-
--copio-color-surface-elevated: #f1f5f9;
|
|
147
|
-
--copio-color-surface-overlay: rgba(255, 255, 255, 0.92);
|
|
148
|
-
--copio-color-stage-bg: #1e293b;
|
|
149
|
-
--copio-color-text: #0f172a;
|
|
150
|
-
--copio-color-text-muted: #475569;
|
|
151
|
-
--copio-color-text-inverse: #ffffff;
|
|
152
|
-
--copio-color-primary: #0284c7;
|
|
153
|
-
--copio-color-primary-hover: #0369a1;
|
|
154
|
-
--copio-color-primary-contrast: #ffffff;
|
|
155
|
-
--copio-color-success: #16a34a;
|
|
156
|
-
--copio-color-warning: #d97706;
|
|
157
|
-
--copio-color-danger: #dc2626;
|
|
158
|
-
--copio-color-border: rgba(15, 23, 42, 0.12);
|
|
159
|
-
--copio-color-border-strong: rgba(15, 23, 42, 0.26);
|
|
160
|
-
--copio-focus-ring: 0 0 0 2px #ffffff, 0 0 0 4px #0284c7;
|
|
161
|
-
--copio-radius-sm: 6px;
|
|
162
|
-
--copio-radius-md: 10px;
|
|
163
|
-
--copio-radius-lg: 14px;
|
|
164
|
-
--copio-shadow-elevated: 0 12px 28px -4px rgba(15, 23, 42, 0.18);
|
|
165
|
-
color-scheme: light;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
/* ==========================================================================
|
|
170
|
-
2. INTERNAL ELEMENT RESET (Scoped to Shadow DOM)
|
|
171
|
-
========================================================================== */
|
|
172
|
-
*, *::before, *::after {
|
|
173
|
-
box-sizing: border-box;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
::slotted(*) {
|
|
177
|
-
box-sizing: border-box;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/* ==========================================================================
|
|
181
|
-
3. ROOT CONTAINER & COMPONENT SHELL
|
|
182
|
-
========================================================================== */
|
|
183
|
-
.copio-scanner-container {
|
|
184
|
-
width: 100%;
|
|
185
|
-
height: 100%;
|
|
186
|
-
position: relative;
|
|
187
|
-
display: flex;
|
|
188
|
-
flex-direction: column;
|
|
189
|
-
overflow: hidden;
|
|
190
|
-
box-sizing: border-box;
|
|
191
|
-
container-type: size;
|
|
192
|
-
container-name: copio-scanner;
|
|
193
|
-
contain: layout;
|
|
194
|
-
background: var(--copio-color-bg);
|
|
195
|
-
color: var(--copio-color-text);
|
|
196
|
-
font-family: var(--copio-font-family);
|
|
197
|
-
font-size: 14px;
|
|
198
|
-
line-height: 1.5;
|
|
199
|
-
text-align: left;
|
|
200
|
-
direction: ltr;
|
|
201
|
-
user-select: none;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/* Header (Shadow Part: header) */
|
|
205
|
-
.copio-header {
|
|
206
|
-
display: flex;
|
|
207
|
-
align-items: center;
|
|
208
|
-
justify-content: space-between;
|
|
209
|
-
gap: var(--copio-spacing-sm);
|
|
210
|
-
padding: var(--copio-spacing-sm) var(--copio-spacing-md);
|
|
211
|
-
background: var(--copio-color-surface);
|
|
212
|
-
border-bottom: 1px solid var(--copio-color-border);
|
|
213
|
-
min-height: 52px;
|
|
214
|
-
flex-shrink: 0;
|
|
215
|
-
z-index: 5;
|
|
216
|
-
box-sizing: border-box;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
.copio-header-left {
|
|
220
|
-
display: flex;
|
|
221
|
-
align-items: center;
|
|
222
|
-
gap: var(--copio-spacing-sm);
|
|
223
|
-
min-width: 0;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.copio-mode-badge {
|
|
227
|
-
display: inline-flex;
|
|
228
|
-
align-items: center;
|
|
229
|
-
gap: 5px;
|
|
230
|
-
font-size: 11px;
|
|
231
|
-
font-weight: 600;
|
|
232
|
-
padding: 4px 8px;
|
|
233
|
-
border-radius: var(--copio-radius-pill);
|
|
234
|
-
background: var(--copio-color-surface-elevated);
|
|
235
|
-
color: var(--copio-color-primary);
|
|
236
|
-
border: 1px solid var(--copio-color-border);
|
|
237
|
-
white-space: nowrap;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
.copio-title-group {
|
|
241
|
-
display: flex;
|
|
242
|
-
flex-direction: column;
|
|
243
|
-
min-width: 0;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
.copio-title {
|
|
247
|
-
font-size: 13px;
|
|
248
|
-
font-weight: 600;
|
|
249
|
-
color: var(--copio-color-text);
|
|
250
|
-
margin: 0;
|
|
251
|
-
white-space: nowrap;
|
|
252
|
-
overflow: hidden;
|
|
253
|
-
text-overflow: ellipsis;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
.copio-subtitle {
|
|
257
|
-
font-size: 11px;
|
|
258
|
-
color: var(--copio-color-text-muted);
|
|
259
|
-
margin: 0;
|
|
260
|
-
white-space: nowrap;
|
|
261
|
-
overflow: hidden;
|
|
262
|
-
text-overflow: ellipsis;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
.copio-header-actions {
|
|
266
|
-
display: flex;
|
|
267
|
-
align-items: center;
|
|
268
|
-
gap: 6px;
|
|
269
|
-
flex-shrink: 0;
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
/* Interactive Stage Switcher Pill (Viewfinder vs Workbench) */
|
|
273
|
-
.copio-stage-tabs {
|
|
274
|
-
display: inline-flex;
|
|
275
|
-
background: var(--copio-color-bg);
|
|
276
|
-
padding: 2px;
|
|
277
|
-
border-radius: var(--copio-radius-md);
|
|
278
|
-
border: 1px solid var(--copio-color-border);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
.copio-stage-tab {
|
|
282
|
-
appearance: none;
|
|
283
|
-
border: none;
|
|
284
|
-
background: transparent;
|
|
285
|
-
color: var(--copio-color-text-muted);
|
|
286
|
-
font-family: inherit;
|
|
287
|
-
font-size: 11px;
|
|
288
|
-
font-weight: 600;
|
|
289
|
-
padding: 6px 10px;
|
|
290
|
-
min-height: var(--copio-touch-target-min);
|
|
291
|
-
min-width: var(--copio-touch-target-min);
|
|
292
|
-
border-radius: var(--copio-radius-sm);
|
|
293
|
-
cursor: pointer;
|
|
294
|
-
display: inline-flex;
|
|
295
|
-
align-items: center;
|
|
296
|
-
justify-content: center;
|
|
297
|
-
transition: background var(--copio-transition-fast), color var(--copio-transition-fast);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
.copio-stage-tab[aria-selected="true"] {
|
|
301
|
-
background: var(--copio-color-surface-elevated);
|
|
302
|
-
color: var(--copio-color-text);
|
|
303
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/* Touch-Safe Interactive Buttons (>=44px touch invariant) */
|
|
307
|
-
.copio-btn {
|
|
308
|
-
appearance: none;
|
|
309
|
-
border: 1px solid var(--copio-color-border);
|
|
310
|
-
background: var(--copio-color-surface-elevated);
|
|
311
|
-
color: var(--copio-color-text);
|
|
312
|
-
font-family: inherit;
|
|
313
|
-
font-size: 13px;
|
|
314
|
-
font-weight: 600;
|
|
315
|
-
min-height: var(--copio-touch-target-min);
|
|
316
|
-
min-width: var(--copio-touch-target-min);
|
|
317
|
-
padding: 0 12px;
|
|
318
|
-
border-radius: var(--copio-radius-md);
|
|
319
|
-
display: inline-flex;
|
|
320
|
-
align-items: center;
|
|
321
|
-
justify-content: center;
|
|
322
|
-
gap: 7px;
|
|
323
|
-
cursor: pointer;
|
|
324
|
-
transition: all var(--copio-transition-fast);
|
|
325
|
-
white-space: nowrap;
|
|
326
|
-
text-decoration: none;
|
|
327
|
-
box-sizing: border-box;
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
.copio-btn:hover {
|
|
331
|
-
background: var(--copio-color-primary-hover);
|
|
332
|
-
color: var(--copio-color-primary-contrast);
|
|
333
|
-
border-color: var(--copio-color-primary);
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
.copio-btn-primary {
|
|
337
|
-
background: var(--copio-color-primary);
|
|
338
|
-
color: var(--copio-color-primary-contrast);
|
|
339
|
-
border-color: var(--copio-color-primary);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
.copio-btn-danger {
|
|
343
|
-
background: rgba(239, 68, 68, 0.15);
|
|
344
|
-
color: var(--copio-color-danger);
|
|
345
|
-
border-color: rgba(239, 68, 68, 0.35);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
.copio-btn-danger:hover {
|
|
349
|
-
background: var(--copio-color-danger);
|
|
350
|
-
color: #fff;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
/* Viewfinder (Shadow Part: viewfinder) */
|
|
354
|
-
.copio-viewfinder,
|
|
355
|
-
.copio-viewfinder-stage {
|
|
356
|
-
position: relative;
|
|
357
|
-
flex: 1 1 auto;
|
|
358
|
-
display: flex;
|
|
359
|
-
flex-direction: column;
|
|
360
|
-
justify-content: space-between;
|
|
361
|
-
background: var(--copio-color-stage-bg);
|
|
362
|
-
overflow: hidden;
|
|
363
|
-
min-height: 0;
|
|
364
|
-
width: 100%;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
.copio-viewfinder-feed,
|
|
368
|
-
.copio-camera-feed {
|
|
369
|
-
position: absolute;
|
|
370
|
-
inset: 0;
|
|
371
|
-
display: flex;
|
|
372
|
-
align-items: center;
|
|
373
|
-
justify-content: center;
|
|
374
|
-
padding: 56px 20px 104px 20px;
|
|
375
|
-
background: radial-gradient(circle at 50% 45%, #1e293b 0%, #090d14 75%);
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/* Framing Guide Overlay (receipt | card | a4 | auto) */
|
|
379
|
-
.copio-framing-guide {
|
|
380
|
-
position: relative;
|
|
381
|
-
display: flex;
|
|
382
|
-
align-items: center;
|
|
383
|
-
justify-content: center;
|
|
384
|
-
max-width: 100%;
|
|
385
|
-
max-height: 100%;
|
|
386
|
-
border: 1.5px dashed rgba(56, 189, 248, 0.55);
|
|
387
|
-
border-radius: 12px;
|
|
388
|
-
box-shadow: 0 0 0 9999px rgba(4, 7, 12, 0.52);
|
|
389
|
-
transition: all var(--copio-transition-normal);
|
|
390
|
-
overflow: hidden;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
.copio-framing-guide[data-aspect="receipt"] {
|
|
394
|
-
aspect-ratio: 1 / 2.1;
|
|
395
|
-
height: 100%;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
.copio-framing-guide[data-aspect="card"] {
|
|
399
|
-
aspect-ratio: 1.586 / 1;
|
|
400
|
-
width: 92%;
|
|
401
|
-
max-height: 82%;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
.copio-framing-guide[data-aspect="a4"] {
|
|
405
|
-
aspect-ratio: 1 / 1.414;
|
|
406
|
-
height: 96%;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
.copio-framing-guide[data-aspect="auto"] {
|
|
410
|
-
width: 94%;
|
|
411
|
-
height: 94%;
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
/* Corner Targeting Brackets */
|
|
415
|
-
.copio-corner {
|
|
416
|
-
position: absolute;
|
|
417
|
-
width: 22px;
|
|
418
|
-
height: 22px;
|
|
419
|
-
border-color: var(--copio-color-primary);
|
|
420
|
-
border-style: solid;
|
|
421
|
-
border-width: 0;
|
|
422
|
-
pointer-events: none;
|
|
423
|
-
z-index: 2;
|
|
424
|
-
}
|
|
425
|
-
.copio-corner.tl { top: 6px; left: 6px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 6px; }
|
|
426
|
-
.copio-corner.tr { top: 6px; right: 6px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 6px; }
|
|
427
|
-
.copio-corner.bl { bottom: 6px; left: 6px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 6px; }
|
|
428
|
-
.copio-corner.br { bottom: 6px; right: 6px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 6px; }
|
|
429
|
-
|
|
430
|
-
.copio-edge-quad {
|
|
431
|
-
position: absolute;
|
|
432
|
-
inset: 12px;
|
|
433
|
-
border: 1px solid rgba(56, 189, 248, 0.28);
|
|
434
|
-
border-radius: 8px;
|
|
435
|
-
background: rgba(56, 189, 248, 0.04);
|
|
436
|
-
pointer-events: none;
|
|
437
|
-
z-index: 1;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
.copio-camera-placeholder {
|
|
441
|
-
position: relative;
|
|
442
|
-
z-index: 2;
|
|
443
|
-
display: flex;
|
|
444
|
-
flex-direction: column;
|
|
445
|
-
align-items: center;
|
|
446
|
-
justify-content: center;
|
|
447
|
-
gap: 8px;
|
|
448
|
-
padding: 16px;
|
|
449
|
-
text-align: center;
|
|
450
|
-
color: var(--copio-color-text-muted);
|
|
451
|
-
font-size: 12px;
|
|
452
|
-
font-weight: 500;
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
.copio-status-dot {
|
|
456
|
-
width: 7px;
|
|
457
|
-
height: 7px;
|
|
458
|
-
border-radius: 50%;
|
|
459
|
-
background: var(--copio-color-primary);
|
|
460
|
-
box-shadow: 0 0 8px var(--copio-color-primary);
|
|
461
|
-
flex-shrink: 0;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
/* Top Viewfinder HUD Overlay (Step Pill + Privacy Assurance Badge) */
|
|
465
|
-
.copio-viewfinder-hud-top {
|
|
466
|
-
position: relative;
|
|
467
|
-
z-index: 3;
|
|
468
|
-
display: flex;
|
|
469
|
-
align-items: center;
|
|
470
|
-
justify-content: space-between;
|
|
471
|
-
gap: 8px;
|
|
472
|
-
padding: 10px 14px;
|
|
473
|
-
background: linear-gradient(to bottom, rgba(7, 10, 15, 0.85), transparent);
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
.copio-step-pill {
|
|
477
|
-
display: inline-flex;
|
|
478
|
-
align-items: center;
|
|
479
|
-
gap: 6px;
|
|
480
|
-
padding: 5px 12px;
|
|
481
|
-
border-radius: var(--copio-radius-pill);
|
|
482
|
-
background: rgba(15, 23, 42, 0.88);
|
|
483
|
-
border: 1px solid rgba(56, 189, 248, 0.45);
|
|
484
|
-
color: #f8fafc;
|
|
485
|
-
font-size: 12px;
|
|
486
|
-
font-weight: 600;
|
|
487
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
.copio-privacy-pill {
|
|
491
|
-
display: inline-flex;
|
|
492
|
-
align-items: center;
|
|
493
|
-
gap: 5px;
|
|
494
|
-
padding: 4px 9px;
|
|
495
|
-
border-radius: var(--copio-radius-pill);
|
|
496
|
-
background: rgba(22, 101, 52, 0.35);
|
|
497
|
-
border: 1px solid rgba(34, 197, 94, 0.4);
|
|
498
|
-
color: #86efac;
|
|
499
|
-
font-size: 11px;
|
|
500
|
-
font-weight: 500;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
/* Shutter Dock (Shadow Part: shutter-dock) */
|
|
504
|
-
.copio-shutter-dock {
|
|
505
|
-
position: relative;
|
|
506
|
-
z-index: 3;
|
|
507
|
-
display: flex;
|
|
508
|
-
align-items: center;
|
|
509
|
-
justify-content: space-between;
|
|
510
|
-
gap: 12px;
|
|
511
|
-
padding: 12px 16px;
|
|
512
|
-
background: var(--copio-color-surface);
|
|
513
|
-
border-top: 1px solid var(--copio-color-border);
|
|
514
|
-
min-height: 84px;
|
|
515
|
-
flex-shrink: 0;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
.copio-shutter-side {
|
|
519
|
-
flex: 1;
|
|
520
|
-
display: flex;
|
|
521
|
-
align-items: center;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
.copio-shutter-side.right {
|
|
525
|
-
justify-content: flex-end;
|
|
526
|
-
}
|
|
527
|
-
|
|
528
|
-
.copio-shutter-btn {
|
|
529
|
-
appearance: none;
|
|
530
|
-
width: 64px;
|
|
531
|
-
height: 64px;
|
|
532
|
-
border-radius: var(--copio-radius-pill);
|
|
533
|
-
border: 4px solid var(--copio-color-primary);
|
|
534
|
-
background: transparent;
|
|
535
|
-
padding: 4px;
|
|
536
|
-
cursor: pointer;
|
|
537
|
-
display: inline-flex;
|
|
538
|
-
align-items: center;
|
|
539
|
-
justify-content: center;
|
|
540
|
-
transition: transform var(--copio-transition-fast), border-color 150ms ease;
|
|
541
|
-
flex-shrink: 0;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
.copio-shutter-btn:hover {
|
|
545
|
-
transform: scale(1.04);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
.copio-shutter-btn:active {
|
|
549
|
-
transform: scale(0.94);
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
.copio-shutter-btn-inner,
|
|
553
|
-
.copio-shutter-inner {
|
|
554
|
-
width: 100%;
|
|
555
|
-
height: 100%;
|
|
556
|
-
border-radius: var(--copio-radius-pill);
|
|
557
|
-
background: var(--copio-color-primary);
|
|
558
|
-
display: flex;
|
|
559
|
-
align-items: center;
|
|
560
|
-
justify-content: center;
|
|
561
|
-
color: var(--copio-color-primary-contrast);
|
|
562
|
-
transition: transform var(--copio-transition-fast);
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
.copio-shutter-btn:active .copio-shutter-btn-inner,
|
|
566
|
-
.copio-shutter-btn:active .copio-shutter-inner {
|
|
567
|
-
transform: scale(0.88);
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
/* Stacking Thumbnail Counter Pill in Viewfinder */
|
|
571
|
-
.copio-stack-pill {
|
|
572
|
-
display: inline-flex;
|
|
573
|
-
align-items: center;
|
|
574
|
-
gap: 8px;
|
|
575
|
-
min-height: var(--copio-touch-target-min);
|
|
576
|
-
padding: 4px 12px 4px 6px;
|
|
577
|
-
border-radius: var(--copio-radius-md);
|
|
578
|
-
background: var(--copio-color-surface-elevated);
|
|
579
|
-
border: 1px solid var(--copio-color-primary);
|
|
580
|
-
color: var(--copio-color-text);
|
|
581
|
-
font-size: 12px;
|
|
582
|
-
font-weight: 600;
|
|
583
|
-
cursor: pointer;
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
.copio-stack-thumb {
|
|
587
|
-
width: 30px;
|
|
588
|
-
height: 36px;
|
|
589
|
-
border-radius: 4px;
|
|
590
|
-
object-fit: cover;
|
|
591
|
-
border: 1px solid rgba(255, 255, 255, 0.35);
|
|
592
|
-
background: #000;
|
|
593
|
-
}
|
|
594
|
-
|
|
595
|
-
/* Workbench & Filmstrip (Shadow Part: workbench) */
|
|
596
|
-
.copio-workbench,
|
|
597
|
-
.copio-workbench-stage {
|
|
598
|
-
position: relative;
|
|
599
|
-
flex: 1 1 auto;
|
|
600
|
-
display: flex;
|
|
601
|
-
flex-direction: column;
|
|
602
|
-
background: var(--copio-color-bg);
|
|
603
|
-
overflow: hidden;
|
|
604
|
-
min-height: 0;
|
|
605
|
-
width: 100%;
|
|
606
|
-
}
|
|
607
|
-
|
|
608
|
-
.copio-workbench-main {
|
|
609
|
-
flex: 1;
|
|
610
|
-
display: flex;
|
|
611
|
-
flex-direction: column;
|
|
612
|
-
min-height: 0;
|
|
613
|
-
width: 100%;
|
|
614
|
-
overflow: hidden;
|
|
615
|
-
}
|
|
616
|
-
|
|
617
|
-
.copio-stage-canvas,
|
|
618
|
-
.copio-canvas-viewport {
|
|
619
|
-
position: relative;
|
|
620
|
-
flex: 1 1 auto;
|
|
621
|
-
display: flex;
|
|
622
|
-
flex-direction: column;
|
|
623
|
-
align-items: center;
|
|
624
|
-
justify-content: center;
|
|
625
|
-
overflow: hidden;
|
|
626
|
-
padding: 16px 20px 44px 20px;
|
|
627
|
-
background: var(--copio-color-stage-bg);
|
|
628
|
-
min-height: 180px;
|
|
629
|
-
}
|
|
630
|
-
|
|
631
|
-
.copio-canvas-viewport.has-card-switcher {
|
|
632
|
-
padding-top: 66px;
|
|
633
|
-
}
|
|
634
|
-
|
|
635
|
-
.copio-canvas-viewport.is-cropping {
|
|
636
|
-
padding: 74px 26px 26px 26px;
|
|
637
|
-
}
|
|
638
|
-
|
|
639
|
-
/* Card Side Switcher */
|
|
640
|
-
.copio-card-side-switcher {
|
|
641
|
-
position: absolute;
|
|
642
|
-
top: 8px;
|
|
643
|
-
left: 50%;
|
|
644
|
-
transform: translateX(-50%);
|
|
645
|
-
z-index: 6;
|
|
646
|
-
display: inline-flex;
|
|
647
|
-
gap: 4px;
|
|
648
|
-
padding: 3px;
|
|
649
|
-
background: var(--copio-color-surface-overlay, rgba(15, 22, 32, 0.88));
|
|
650
|
-
border: 1px solid var(--copio-color-border-strong);
|
|
651
|
-
border-radius: var(--copio-radius-pill);
|
|
652
|
-
backdrop-filter: blur(8px);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
.copio-side-pill {
|
|
656
|
-
appearance: none;
|
|
657
|
-
border: none;
|
|
658
|
-
background: transparent;
|
|
659
|
-
color: var(--copio-color-text-muted);
|
|
660
|
-
font-family: inherit;
|
|
661
|
-
font-size: 11px;
|
|
662
|
-
font-weight: 600;
|
|
663
|
-
padding: 6px 12px;
|
|
664
|
-
min-height: var(--copio-touch-target-min);
|
|
665
|
-
min-width: var(--copio-touch-target-min);
|
|
666
|
-
border-radius: var(--copio-radius-pill);
|
|
667
|
-
cursor: pointer;
|
|
668
|
-
display: inline-flex;
|
|
669
|
-
align-items: center;
|
|
670
|
-
justify-content: center;
|
|
671
|
-
}
|
|
672
|
-
|
|
673
|
-
.copio-side-pill[aria-selected="true"] {
|
|
674
|
-
background: var(--copio-color-primary);
|
|
675
|
-
color: var(--copio-color-primary-contrast);
|
|
676
|
-
}
|
|
677
|
-
|
|
678
|
-
.copio-stage-figure,
|
|
679
|
-
.copio-canvas-wrapper {
|
|
680
|
-
position: relative;
|
|
681
|
-
display: flex;
|
|
682
|
-
align-items: center;
|
|
683
|
-
justify-content: center;
|
|
684
|
-
max-width: 100%;
|
|
685
|
-
max-height: 100%;
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
.copio-stage-canvas img,
|
|
689
|
-
.copio-stage-img,
|
|
690
|
-
.copio-stage-image {
|
|
691
|
-
display: block;
|
|
692
|
-
max-width: 100%;
|
|
693
|
-
max-height: 100%;
|
|
694
|
-
width: auto;
|
|
695
|
-
height: auto;
|
|
696
|
-
object-fit: contain;
|
|
697
|
-
box-shadow: var(--copio-shadow-elevated);
|
|
698
|
-
border-radius: var(--copio-radius-sm);
|
|
699
|
-
user-select: none;
|
|
700
|
-
}
|
|
701
|
-
|
|
702
|
-
.copio-crop-layer {
|
|
703
|
-
position: absolute;
|
|
704
|
-
inset: 0;
|
|
705
|
-
width: 100%;
|
|
706
|
-
height: 100%;
|
|
707
|
-
overflow: hidden;
|
|
708
|
-
z-index: 8;
|
|
709
|
-
touch-action: none;
|
|
710
|
-
}
|
|
711
|
-
|
|
712
|
-
.copio-crop-box {
|
|
713
|
-
position: absolute;
|
|
714
|
-
border: 2px solid var(--copio-color-primary);
|
|
715
|
-
box-shadow: 0 0 0 9999px rgba(5, 8, 14, 0.68);
|
|
716
|
-
cursor: move;
|
|
717
|
-
touch-action: none;
|
|
718
|
-
box-sizing: border-box;
|
|
719
|
-
}
|
|
720
|
-
|
|
721
|
-
/* Rule-of-thirds crop grid */
|
|
722
|
-
.copio-crop-grid {
|
|
723
|
-
position: absolute;
|
|
724
|
-
inset: 0;
|
|
725
|
-
pointer-events: none;
|
|
726
|
-
background-image:
|
|
727
|
-
linear-gradient(to right, rgba(56, 189, 248, 0.28) 1px, transparent 1px),
|
|
728
|
-
linear-gradient(to bottom, rgba(56, 189, 248, 0.28) 1px, transparent 1px);
|
|
729
|
-
background-size: 33.333% 33.333%;
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
/* 48px x 48px Touch Target Handles (exceeds 44px requirement) */
|
|
733
|
-
.copio-crop-handle {
|
|
734
|
-
position: absolute;
|
|
735
|
-
width: var(--copio-crop-handle-hit);
|
|
736
|
-
height: var(--copio-crop-handle-hit);
|
|
737
|
-
min-width: 44px;
|
|
738
|
-
min-height: 44px;
|
|
739
|
-
display: flex;
|
|
740
|
-
align-items: center;
|
|
741
|
-
justify-content: center;
|
|
742
|
-
z-index: 10;
|
|
743
|
-
touch-action: none;
|
|
744
|
-
box-sizing: border-box;
|
|
745
|
-
}
|
|
746
|
-
|
|
747
|
-
.copio-crop-handle::after {
|
|
748
|
-
content: '';
|
|
749
|
-
width: var(--copio-crop-handle-visual);
|
|
750
|
-
height: var(--copio-crop-handle-visual);
|
|
751
|
-
border-radius: 50%;
|
|
752
|
-
background: var(--copio-color-primary);
|
|
753
|
-
border: 2.5px solid #ffffff;
|
|
754
|
-
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
|
|
755
|
-
transition: transform 120ms ease;
|
|
756
|
-
box-sizing: border-box;
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
.copio-crop-handle:hover::after,
|
|
760
|
-
.copio-crop-handle:active::after {
|
|
761
|
-
transform: scale(1.25);
|
|
762
|
-
background: var(--copio-color-success, #22c55e);
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
.copio-crop-handle.nw { top: -24px; left: -24px; cursor: nwse-resize; }
|
|
766
|
-
.copio-crop-handle.ne { top: -24px; right: -24px; cursor: nesw-resize; }
|
|
767
|
-
.copio-crop-handle.sw { bottom: -24px; left: -24px; cursor: nesw-resize; }
|
|
768
|
-
.copio-crop-handle.se { bottom: -24px; right: -24px; cursor: nwse-resize; }
|
|
769
|
-
.copio-crop-handle.n, .copio-crop-handle.edge-n { top: -24px; left: calc(50% - 24px); cursor: ns-resize; }
|
|
770
|
-
.copio-crop-handle.s, .copio-crop-handle.edge-s { bottom: -24px; left: calc(50% - 24px); cursor: ns-resize; }
|
|
771
|
-
.copio-crop-handle.w, .copio-crop-handle.edge-w { left: -24px; top: calc(50% - 24px); cursor: ew-resize; }
|
|
772
|
-
.copio-crop-handle.e, .copio-crop-handle.edge-e { right: -24px; top: calc(50% - 24px); cursor: ew-resize; }
|
|
773
|
-
|
|
774
|
-
/* Filmstrip & Reorder Tray */
|
|
775
|
-
.copio-filmstrip,
|
|
776
|
-
.copio-filmstrip-bar {
|
|
777
|
-
display: flex;
|
|
778
|
-
align-items: center;
|
|
779
|
-
gap: 8px;
|
|
780
|
-
padding: 8px 12px;
|
|
781
|
-
background: var(--copio-color-surface);
|
|
782
|
-
border-top: 1px solid var(--copio-color-border);
|
|
783
|
-
overflow-x: auto;
|
|
784
|
-
min-height: 80px;
|
|
785
|
-
flex-shrink: 0;
|
|
786
|
-
scrollbar-width: thin;
|
|
787
|
-
}
|
|
788
|
-
|
|
789
|
-
.copio-filmstrip-scroll {
|
|
790
|
-
display: flex;
|
|
791
|
-
align-items: center;
|
|
792
|
-
gap: 8px;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
.copio-filmstrip-item {
|
|
796
|
-
display: flex;
|
|
797
|
-
flex-direction: column;
|
|
798
|
-
align-items: center;
|
|
799
|
-
gap: 4px;
|
|
800
|
-
flex-shrink: 0;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
.copio-thumb-container {
|
|
804
|
-
position: relative;
|
|
805
|
-
width: 56px;
|
|
806
|
-
height: 70px;
|
|
807
|
-
border-radius: var(--copio-radius-sm);
|
|
808
|
-
overflow: hidden;
|
|
809
|
-
background: var(--copio-color-surface-elevated, #1c2736);
|
|
810
|
-
border: 2px solid var(--copio-color-border);
|
|
811
|
-
cursor: pointer;
|
|
812
|
-
transition: all var(--copio-transition-fast);
|
|
813
|
-
display: flex;
|
|
814
|
-
align-items: center;
|
|
815
|
-
justify-content: center;
|
|
816
|
-
}
|
|
817
|
-
|
|
818
|
-
.copio-filmstrip-item.is-active .copio-thumb-container {
|
|
819
|
-
border-color: var(--copio-color-primary);
|
|
820
|
-
box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
.copio-thumb-num {
|
|
824
|
-
position: absolute;
|
|
825
|
-
bottom: 3px;
|
|
826
|
-
right: 3px;
|
|
827
|
-
min-width: 16px;
|
|
828
|
-
height: 16px;
|
|
829
|
-
padding: 0 4px;
|
|
830
|
-
border-radius: 999px;
|
|
831
|
-
background: rgba(15, 23, 42, 0.85);
|
|
832
|
-
color: #f8fafc;
|
|
833
|
-
font-size: 10px;
|
|
834
|
-
font-weight: 700;
|
|
835
|
-
display: inline-flex;
|
|
836
|
-
align-items: center;
|
|
837
|
-
justify-content: center;
|
|
838
|
-
}
|
|
839
|
-
|
|
840
|
-
.copio-thumb-reorder {
|
|
841
|
-
display: flex;
|
|
842
|
-
align-items: center;
|
|
843
|
-
gap: 4px;
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
.copio-reorder-btn {
|
|
847
|
-
appearance: none;
|
|
848
|
-
border: 1px solid var(--copio-color-border);
|
|
849
|
-
background: var(--copio-color-surface-elevated);
|
|
850
|
-
color: var(--copio-color-text-muted);
|
|
851
|
-
border-radius: 4px;
|
|
852
|
-
font-size: 9px;
|
|
853
|
-
padding: 2px 5px;
|
|
854
|
-
cursor: pointer;
|
|
855
|
-
}
|
|
856
|
-
|
|
857
|
-
.copio-reorder-btn:disabled {
|
|
858
|
-
opacity: 0.35;
|
|
859
|
-
cursor: not-allowed;
|
|
860
|
-
}
|
|
861
|
-
|
|
862
|
-
.copio-thumb-img {
|
|
863
|
-
max-width: 100%;
|
|
864
|
-
max-height: 100%;
|
|
865
|
-
width: auto;
|
|
866
|
-
height: auto;
|
|
867
|
-
object-fit: contain;
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
/* Edit Action Toolbar & Primary Completion Dock */
|
|
871
|
-
.copio-toolbar,
|
|
872
|
-
.copio-controls-dock {
|
|
873
|
-
display: flex;
|
|
874
|
-
flex-direction: column;
|
|
875
|
-
gap: 8px;
|
|
876
|
-
padding: 10px 12px;
|
|
877
|
-
background: var(--copio-color-surface);
|
|
878
|
-
border-top: 1px solid var(--copio-color-border);
|
|
879
|
-
min-height: 56px;
|
|
880
|
-
flex-shrink: 0;
|
|
881
|
-
z-index: 6;
|
|
882
|
-
}
|
|
883
|
-
|
|
884
|
-
.copio-edit-toolbar,
|
|
885
|
-
.copio-toolbar-tools {
|
|
886
|
-
display: flex;
|
|
887
|
-
flex-wrap: wrap;
|
|
888
|
-
align-items: center;
|
|
889
|
-
gap: 6px;
|
|
890
|
-
width: 100%;
|
|
891
|
-
}
|
|
892
|
-
|
|
893
|
-
.copio-toolbar-tools .copio-tool-btn {
|
|
894
|
-
flex: 1 1 56px;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
.copio-toolbar-actions {
|
|
898
|
-
display: flex;
|
|
899
|
-
align-items: center;
|
|
900
|
-
gap: 8px;
|
|
901
|
-
width: 100%;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
.copio-toolbar-actions .copio-btn-primary {
|
|
905
|
-
width: 100%;
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
.copio-tool-btn {
|
|
909
|
-
appearance: none;
|
|
910
|
-
border: 1px solid var(--copio-color-border);
|
|
911
|
-
background: var(--copio-color-surface-elevated);
|
|
912
|
-
color: var(--copio-color-text);
|
|
913
|
-
font-family: inherit;
|
|
914
|
-
font-size: 11px;
|
|
915
|
-
font-weight: 600;
|
|
916
|
-
min-height: var(--copio-touch-target-min);
|
|
917
|
-
min-width: var(--copio-touch-target-min);
|
|
918
|
-
padding: 4px 6px;
|
|
919
|
-
border-radius: var(--copio-radius-md);
|
|
920
|
-
display: flex;
|
|
921
|
-
flex-direction: column;
|
|
922
|
-
align-items: center;
|
|
923
|
-
justify-content: center;
|
|
924
|
-
gap: 3px;
|
|
925
|
-
cursor: pointer;
|
|
926
|
-
transition: all var(--copio-transition-fast);
|
|
927
|
-
}
|
|
928
|
-
|
|
929
|
-
.copio-tool-btn:hover:not(:disabled) {
|
|
930
|
-
border-color: var(--copio-color-border-strong);
|
|
931
|
-
background: rgba(255, 255, 255, 0.06);
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
.copio-tool-btn[aria-pressed="true"] {
|
|
935
|
-
background: rgba(56, 189, 248, 0.16);
|
|
936
|
-
color: var(--copio-color-primary);
|
|
937
|
-
border-color: var(--copio-color-primary);
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
.copio-tool-btn.danger {
|
|
941
|
-
color: #fca5a5;
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
.copio-tool-btn.danger:hover:not(:disabled) {
|
|
945
|
-
background: rgba(239, 68, 68, 0.16);
|
|
946
|
-
border-color: rgba(239, 68, 68, 0.45);
|
|
947
|
-
}
|
|
948
|
-
|
|
949
|
-
.copio-toast-region {
|
|
950
|
-
position: absolute;
|
|
951
|
-
bottom: 124px;
|
|
952
|
-
left: 12px;
|
|
953
|
-
right: 12px;
|
|
954
|
-
z-index: 30;
|
|
955
|
-
display: flex;
|
|
956
|
-
flex-direction: column;
|
|
957
|
-
gap: 8px;
|
|
958
|
-
pointer-events: none;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
.copio-toast {
|
|
962
|
-
pointer-events: auto;
|
|
963
|
-
display: flex;
|
|
964
|
-
align-items: center;
|
|
965
|
-
justify-content: space-between;
|
|
966
|
-
gap: 10px;
|
|
967
|
-
padding: 8px 12px;
|
|
968
|
-
border-radius: var(--copio-radius-md);
|
|
969
|
-
background: #0f172a;
|
|
970
|
-
color: #f8fafc;
|
|
971
|
-
border: 1px solid var(--copio-color-primary);
|
|
972
|
-
box-shadow: var(--copio-shadow-elevated);
|
|
973
|
-
font-size: 12px;
|
|
974
|
-
font-weight: 500;
|
|
975
|
-
position: relative;
|
|
976
|
-
overflow: hidden;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
.copio-toast-progress {
|
|
980
|
-
position: absolute;
|
|
981
|
-
bottom: 0;
|
|
982
|
-
left: 0;
|
|
983
|
-
height: 3px;
|
|
984
|
-
background: var(--copio-color-primary);
|
|
985
|
-
transition: width 100ms linear;
|
|
986
|
-
}
|
|
987
|
-
|
|
988
|
-
.copio-toast-undo-btn,
|
|
989
|
-
.copio-btn-toast-undo {
|
|
990
|
-
appearance: none;
|
|
991
|
-
border: 1px solid rgba(56, 189, 248, 0.45);
|
|
992
|
-
background: rgba(56, 189, 248, 0.16);
|
|
993
|
-
color: #38bdf8;
|
|
994
|
-
font-family: inherit;
|
|
995
|
-
font-size: 12px;
|
|
996
|
-
font-weight: 700;
|
|
997
|
-
min-height: var(--copio-touch-target-min);
|
|
998
|
-
min-width: var(--copio-touch-target-min);
|
|
999
|
-
padding: 0 12px;
|
|
1000
|
-
border-radius: var(--copio-radius-sm);
|
|
1001
|
-
cursor: pointer;
|
|
1002
|
-
flex-shrink: 0;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
.copio-ocr-content {
|
|
1006
|
-
display: flex;
|
|
1007
|
-
flex-direction: column;
|
|
1008
|
-
gap: 8px;
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
.copio-ocr-text {
|
|
1012
|
-
margin: 0;
|
|
1013
|
-
padding: 10px;
|
|
1014
|
-
max-height: 180px;
|
|
1015
|
-
overflow: auto;
|
|
1016
|
-
background: var(--copio-color-bg);
|
|
1017
|
-
color: var(--copio-color-text);
|
|
1018
|
-
border: 1px solid var(--copio-color-border);
|
|
1019
|
-
border-radius: var(--copio-radius-sm);
|
|
1020
|
-
font-family: var(--copio-font-mono);
|
|
1021
|
-
font-size: 11px;
|
|
1022
|
-
line-height: 1.5;
|
|
1023
|
-
white-space: pre-wrap;
|
|
1024
|
-
}
|
|
1025
|
-
|
|
1026
|
-
.copio-ocr-meta {
|
|
1027
|
-
font-size: 11px;
|
|
1028
|
-
color: var(--copio-color-text-muted);
|
|
1029
|
-
}
|
|
1030
|
-
|
|
1031
|
-
/* Slide-up OCR Extraction Sheet */
|
|
1032
|
-
.copio-ocr-sheet {
|
|
1033
|
-
position: absolute;
|
|
1034
|
-
inset: auto 0 0 0;
|
|
1035
|
-
max-height: 78%;
|
|
1036
|
-
background: var(--copio-color-surface);
|
|
1037
|
-
border-top: 1px solid var(--copio-color-primary);
|
|
1038
|
-
border-radius: 16px 16px 0 0;
|
|
1039
|
-
box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.65);
|
|
1040
|
-
z-index: 25;
|
|
1041
|
-
display: flex;
|
|
1042
|
-
flex-direction: column;
|
|
1043
|
-
padding: 14px;
|
|
1044
|
-
gap: 10px;
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
.copio-ocr-header {
|
|
1048
|
-
display: flex;
|
|
1049
|
-
align-items: center;
|
|
1050
|
-
justify-content: space-between;
|
|
1051
|
-
gap: 8px;
|
|
1052
|
-
}
|
|
1053
|
-
|
|
1054
|
-
.copio-ocr-textarea {
|
|
1055
|
-
width: 100%;
|
|
1056
|
-
min-height: 130px;
|
|
1057
|
-
flex: 1;
|
|
1058
|
-
resize: none;
|
|
1059
|
-
background: var(--copio-color-bg);
|
|
1060
|
-
color: var(--copio-color-text);
|
|
1061
|
-
border: 1px solid var(--copio-color-border);
|
|
1062
|
-
border-radius: var(--copio-radius-sm);
|
|
1063
|
-
padding: 10px;
|
|
1064
|
-
font-family: var(--copio-font-mono);
|
|
1065
|
-
font-size: 11px;
|
|
1066
|
-
line-height: 1.5;
|
|
1067
|
-
}
|
|
1068
|
-
|
|
1069
|
-
/* Container-Scoped Toast Stack */
|
|
1070
|
-
.sl-toast-stack,
|
|
1071
|
-
.copio-toast-stack-scoped {
|
|
1072
|
-
position: absolute !important;
|
|
1073
|
-
top: auto !important;
|
|
1074
|
-
bottom: 0 !important;
|
|
1075
|
-
left: 0 !important;
|
|
1076
|
-
right: 0 !important;
|
|
1077
|
-
width: 100% !important;
|
|
1078
|
-
max-width: 100% !important;
|
|
1079
|
-
padding: var(--copio-spacing-md) !important;
|
|
1080
|
-
box-sizing: border-box !important;
|
|
1081
|
-
z-index: 1000 !important;
|
|
1082
|
-
pointer-events: none;
|
|
1083
|
-
}
|
|
1084
|
-
|
|
1085
|
-
.sl-toast-stack sl-alert,
|
|
1086
|
-
.copio-toast-stack-scoped sl-alert {
|
|
1087
|
-
pointer-events: auto;
|
|
1088
|
-
margin-top: var(--copio-spacing-sm);
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
/* ==========================================================================
|
|
1092
|
-
4. @container BREAKPOINTS (Strictly Container Queries)
|
|
1093
|
-
========================================================================== */
|
|
1094
|
-
|
|
1095
|
-
@container copio-scanner (max-width: 400px) {
|
|
1096
|
-
.copio-header {
|
|
1097
|
-
padding: 6px 10px;
|
|
1098
|
-
min-height: 52px;
|
|
1099
|
-
}
|
|
1100
|
-
.copio-header-left {
|
|
1101
|
-
flex-direction: column;
|
|
1102
|
-
align-items: flex-start;
|
|
1103
|
-
gap: 2px;
|
|
1104
|
-
}
|
|
1105
|
-
.copio-mode-badge {
|
|
1106
|
-
font-size: 10px;
|
|
1107
|
-
padding: 2px 6px;
|
|
1108
|
-
}
|
|
1109
|
-
.copio-subtitle {
|
|
1110
|
-
display: none;
|
|
1111
|
-
}
|
|
1112
|
-
.copio-filmstrip,
|
|
1113
|
-
.copio-filmstrip-bar {
|
|
1114
|
-
gap: 6px;
|
|
1115
|
-
padding: 6px 8px;
|
|
1116
|
-
}
|
|
1117
|
-
.copio-tool-btn {
|
|
1118
|
-
font-size: 10px;
|
|
1119
|
-
padding: 3px 4px;
|
|
1120
|
-
}
|
|
1121
|
-
.copio-btn {
|
|
1122
|
-
padding: 0 8px;
|
|
1123
|
-
font-size: 12px;
|
|
1124
|
-
}
|
|
1125
|
-
}
|
|
1126
|
-
|
|
1127
|
-
@container copio-scanner (min-width: 401px) and (max-width: 767px) {
|
|
1128
|
-
.copio-header {
|
|
1129
|
-
padding: var(--copio-spacing-sm) var(--copio-spacing-md);
|
|
1130
|
-
}
|
|
1131
|
-
.copio-tool-btn {
|
|
1132
|
-
flex-direction: row;
|
|
1133
|
-
font-size: 12px;
|
|
1134
|
-
gap: 6px;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
@container copio-scanner (min-width: 768px) {
|
|
1139
|
-
.copio-header {
|
|
1140
|
-
padding: var(--copio-spacing-md) var(--copio-spacing-lg);
|
|
1141
|
-
}
|
|
1142
|
-
.copio-workbench-main {
|
|
1143
|
-
flex-direction: row;
|
|
1144
|
-
}
|
|
1145
|
-
.copio-filmstrip,
|
|
1146
|
-
.copio-filmstrip-bar {
|
|
1147
|
-
order: -1;
|
|
1148
|
-
flex-direction: column;
|
|
1149
|
-
width: 168px;
|
|
1150
|
-
height: 100%;
|
|
1151
|
-
border-top: none;
|
|
1152
|
-
border-right: 1px solid var(--copio-color-border);
|
|
1153
|
-
overflow-y: auto;
|
|
1154
|
-
overflow-x: hidden;
|
|
1155
|
-
padding: 12px;
|
|
1156
|
-
}
|
|
1157
|
-
.copio-filmstrip-scroll {
|
|
1158
|
-
flex-direction: column;
|
|
1159
|
-
width: 100%;
|
|
1160
|
-
}
|
|
1161
|
-
.copio-thumb-container {
|
|
1162
|
-
width: 112px;
|
|
1163
|
-
height: 140px;
|
|
1164
|
-
}
|
|
1165
|
-
.copio-toolbar,
|
|
1166
|
-
.copio-controls-dock {
|
|
1167
|
-
flex-direction: row;
|
|
1168
|
-
align-items: center;
|
|
1169
|
-
justify-content: space-between;
|
|
1170
|
-
}
|
|
1171
|
-
.copio-toolbar-tools {
|
|
1172
|
-
width: auto;
|
|
1173
|
-
flex: 1;
|
|
1174
|
-
}
|
|
1175
|
-
.copio-toolbar-actions {
|
|
1176
|
-
width: auto;
|
|
1177
|
-
min-width: 200px;
|
|
1178
|
-
}
|
|
1179
|
-
}
|
|
1180
|
-
`,C=null;function T(){if(C)return C;if(typeof CSSStyleSheet<"u"&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype)try{return C=new CSSStyleSheet,C.replaceSync(P),C}catch{return null}return null}function O(v){if(!v)return;let t=T();if(t&&"adoptedStyleSheets"in v){let e=v.adoptedStyleSheets||[];e.includes(t)||(v.adoptedStyleSheets=[...e,t])}else if(!v.querySelector("style[data-copio-encapsulated-styles]")){let e=document.createElement("style");e.setAttribute("data-copio-encapsulated-styles",""),e.textContent=P,v.appendChild(e)}}var D=typeof HTMLElement<"u"?HTMLElement:class{},B=class extends D{#t=null;#b=null;#h=null;#m=!1;#n="viewfinder";#e=0;#g=0;#f=!1;#i=!1;#a=null;#s=null;#u=0;#l=null;#x=null;#c=null;onShutter=null;get#r(){return this.docId?this.docId:(this.#x||(this.#x=`doc_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,6)}`),this.#x)}static get observedAttributes(){return["mode","aspect","stage","doc-id","features","export-formats","ocr-languages","max-pages","asset-base","license-key","theme","ocr","pdf"]}constructor(){super(),typeof this.attachShadow=="function"&&this.attachShadow({mode:"open"}),this.#A()}#A(){let t={storage:this.#b};typeof this.getAttribute=="function"&&(this.hasAttribute("features")&&(t.features=this.getAttribute("features")),this.hasAttribute("export-formats")&&(t.exportFormats=this.getAttribute("export-formats")),this.hasAttribute("ocr-languages")&&(t.ocrLanguages=this.getAttribute("ocr-languages")),this.hasAttribute("max-pages")&&(t.maxPages=this.getAttribute("max-pages")),this.hasAttribute("asset-base")&&(t.assetBase=this.getAttribute("asset-base")),this.hasAttribute("license-key")&&(t.licenseKey=this.getAttribute("license-key")),this.hasAttribute("ocr")&&(t.ocr=this.getAttribute("ocr")!=="false"),this.hasAttribute("pdf")&&(t.pdf=this.getAttribute("pdf")!=="false")),this.#t=new A(t)}connectedCallback(){this.shadowRoot&&(O(this.shadowRoot),this.#I()),typeof S=="function"&&typeof document<"u"&&I()===document.body&&S(this.shadowRoot?.querySelector(".copio-scanner-container")||this),this.#t&&(this.#h=this.#t.subscribe(async()=>{let t=await this.getPages();this.dispatch(c.PAGES_CHANGED,{pages:t,docId:this.docId}),this.#o()})),this.hasAttribute&&this.hasAttribute("asset-base")&&R(this.getAttribute("asset-base")),this.#p(),this.#o()}disconnectedCallback(){if(this.#d(),typeof this.#h=="function"&&(this.#h(),this.#h=null),this.#s&&(clearInterval(this.#s),this.#s=null),typeof S=="function"&&typeof document<"u"){let t=this.shadowRoot?.querySelector(".copio-scanner-container")||this;I()===t&&S(null)}}attributeChangedCallback(t,e,o){if(!(e===o||!this.#t))switch(t){case"features":this.#t.setFeatures(o),this.#p();break;case"export-formats":this.#t.exportFormats=o,this.#p();break;case"ocr-languages":this.#t.ocrLanguages=o;break;case"asset-base":this.#t.assetBase=o;break;case"license-key":this.#t.licenseKey=o;break;case"ocr":this.#t.ocr=o!=="false",this.#p();break;case"pdf":this.#t.pdf=o!=="false",this.#p();break;case"stage":if(o==="viewfinder"||o==="workbench"){this.#n=o;let i=this.shadowRoot;if(i){let r=i.getElementById("viewfinder-section"),a=i.getElementById("workbench-section");r&&a&&(r.style.display=o==="viewfinder"?"flex":"none",a.style.display=o==="workbench"?"flex":"none")}this.#o()}break;case"max-pages":this.#t.maxPages=o,this.#o();break;case"mode":case"aspect":case"theme":this.#o();break}}#p(){if(typeof this.querySelectorAll!="function")return;let t=[];this.shadowRoot&&t.push(this.shadowRoot),t.push(this);for(let e of t){let o=e.querySelectorAll("copio-carousel, copio-row, copio-images");for(let i of o)"ocr"in i&&(i.ocr=this.ocrEnabled),"pdf"in i&&(i.pdf=this.pdf)}}#I(){if(!this.shadowRoot||this.shadowRoot.innerHTML)return;let t="Align Document Inside Frame";this.aspect==="card"?t="Step 1 of 2: Capture Front of ID Card":this.mode==="batch"&&(t="Batch Capture \xB7 Page 1"),this.shadowRoot.innerHTML=`
|
|
1181
|
-
<div class="copio-scanner-container copio-scanner-host" part="scanner-root">
|
|
1182
|
-
<header class="copio-header" part="header">
|
|
1183
|
-
<div class="copio-header-left">
|
|
1184
|
-
<span class="copio-mode-badge" id="mode-badge">${(this.mode||"single").toUpperCase()}</span>
|
|
1185
|
-
<div class="copio-title-group">
|
|
1186
|
-
<h2 class="copio-title" id="header-title">Copio Scanner</h2>
|
|
1187
|
-
<p class="copio-subtitle" id="header-subtitle">Non-destructive mobile document scanner</p>
|
|
1188
|
-
</div>
|
|
1189
|
-
</div>
|
|
1190
|
-
<div class="copio-header-actions" part="header-actions">
|
|
1191
|
-
<div class="copio-stage-tabs" role="tablist" aria-label="Scanner Stage">
|
|
1192
|
-
<button type="button" class="copio-stage-tab" id="tab-viewfinder" role="tab" aria-selected="true">Camera</button>
|
|
1193
|
-
<button type="button" class="copio-stage-tab" id="tab-workbench" role="tab" aria-selected="false">Workbench</button>
|
|
1194
|
-
</div>
|
|
1195
|
-
<slot name="header-actions"></slot>
|
|
1196
|
-
</div>
|
|
1197
|
-
</header>
|
|
1198
|
-
|
|
1199
|
-
<!-- Viewfinder Stage -->
|
|
1200
|
-
<div class="copio-viewfinder copio-viewfinder-stage" part="viewfinder" id="viewfinder-section">
|
|
1201
|
-
<div class="copio-viewfinder-hud-top">
|
|
1202
|
-
<div class="copio-step-pill" id="step-pill">
|
|
1203
|
-
<span class="copio-status-dot"></span>
|
|
1204
|
-
<span id="step-pill-text">${t}</span>
|
|
1205
|
-
</div>
|
|
1206
|
-
<div class="copio-privacy-pill" title="100% Local On-Device Processing">
|
|
1207
|
-
<span>\u{1F512} 100% Local</span>
|
|
1208
|
-
</div>
|
|
1209
|
-
</div>
|
|
1210
|
-
|
|
1211
|
-
<div class="copio-camera-feed" id="camera-feed">
|
|
1212
|
-
<video id="camera-video" autoplay playsinline muted style="display:none; position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:0;"></video>
|
|
1213
|
-
<slot name="viewfinder">
|
|
1214
|
-
<div class="copio-framing-guide" id="framing-guide" data-aspect="${this.aspect}">
|
|
1215
|
-
<span class="copio-corner tl"></span>
|
|
1216
|
-
<span class="copio-corner tr"></span>
|
|
1217
|
-
<span class="copio-corner bl"></span>
|
|
1218
|
-
<span class="copio-corner br"></span>
|
|
1219
|
-
<div class="copio-edge-quad"></div>
|
|
1220
|
-
<div class="copio-camera-placeholder">
|
|
1221
|
-
<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">
|
|
1222
|
-
<path d="M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"/>
|
|
1223
|
-
<circle cx="12" cy="13" r="4"/>
|
|
1224
|
-
</svg>
|
|
1225
|
-
<span>Position document within guide lines</span>
|
|
1226
|
-
</div>
|
|
1227
|
-
</div>
|
|
1228
|
-
</slot>
|
|
1229
|
-
</div>
|
|
1230
|
-
|
|
1231
|
-
<div class="copio-shutter-dock" part="shutter-dock">
|
|
1232
|
-
<div class="copio-shutter-side left">
|
|
1233
|
-
<button type="button" class="copio-btn copio-btn-secondary" id="btn-import-file" title="Import image from file">
|
|
1234
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1235
|
-
<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/>
|
|
1236
|
-
<polyline points="17 8 12 3 7 8"/>
|
|
1237
|
-
<line x1="12" y1="3" x2="12" y2="15"/>
|
|
1238
|
-
</svg>
|
|
1239
|
-
<span>Import</span>
|
|
1240
|
-
</button>
|
|
1241
|
-
</div>
|
|
1242
|
-
|
|
1243
|
-
<slot name="shutter-dock">
|
|
1244
|
-
<button type="button" class="copio-shutter-btn" id="btn-shutter" aria-label="Capture page">
|
|
1245
|
-
<span class="copio-shutter-btn-inner"></span>
|
|
1246
|
-
</button>
|
|
1247
|
-
</slot>
|
|
1248
|
-
|
|
1249
|
-
<div class="copio-shutter-side right">
|
|
1250
|
-
<button type="button" class="copio-stack-pill" id="btn-review" title="Review pages" style="display:none;">
|
|
1251
|
-
<span id="review-pill-text">Review (0) \u2192</span>
|
|
1252
|
-
</button>
|
|
1253
|
-
</div>
|
|
1254
|
-
</div>
|
|
1255
|
-
</div>
|
|
1256
|
-
|
|
1257
|
-
<!-- Workbench Stage -->
|
|
1258
|
-
<div class="copio-workbench copio-workbench-stage" part="workbench" id="workbench-section" style="display: none;">
|
|
1259
|
-
<div class="copio-workbench-main">
|
|
1260
|
-
<div class="copio-canvas-viewport" id="canvas-viewport">
|
|
1261
|
-
<div class="copio-card-side-switcher" id="card-side-switcher" style="display:none;" role="tablist" aria-label="Card side switcher">
|
|
1262
|
-
<button type="button" role="tab" class="copio-side-pill active" id="btn-card-front" aria-selected="true">1. Front Side</button>
|
|
1263
|
-
<button type="button" role="tab" class="copio-side-pill" id="btn-card-back" aria-selected="false">2. Back Side</button>
|
|
1264
|
-
</div>
|
|
1265
|
-
|
|
1266
|
-
<div class="copio-canvas-wrapper" id="canvas-wrapper">
|
|
1267
|
-
<img id="stage-img" class="copio-stage-image" alt="Active document page" />
|
|
1268
|
-
</div>
|
|
1269
|
-
</div>
|
|
1270
|
-
|
|
1271
|
-
<!-- Filmstrip Tray -->
|
|
1272
|
-
<div class="copio-filmstrip" id="filmstrip-tray" part="filmstrip">
|
|
1273
|
-
<div class="copio-filmstrip-scroll" id="filmstrip-scroll">
|
|
1274
|
-
<slot name="filmstrip"></slot>
|
|
1275
|
-
</div>
|
|
1276
|
-
</div>
|
|
1277
|
-
</div>
|
|
1278
|
-
|
|
1279
|
-
<!-- Bottom Action Toolbar -->
|
|
1280
|
-
<footer class="copio-toolbar" part="toolbar" id="workbench-toolbar">
|
|
1281
|
-
<div class="copio-toolbar-tools">
|
|
1282
|
-
<button type="button" class="copio-tool-btn" id="btn-retake" title="Retake page">
|
|
1283
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1284
|
-
<path d="M23 4v6h-6M1 20v-6h6"/>
|
|
1285
|
-
<path d="M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15"/>
|
|
1286
|
-
</svg>
|
|
1287
|
-
<span>Retake</span>
|
|
1288
|
-
</button>
|
|
1289
|
-
|
|
1290
|
-
<button type="button" class="copio-tool-btn" id="btn-crop" title="Adjust crop">
|
|
1291
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1292
|
-
<path d="M6 2v14a2 2 0 0 0 2 2h14"/>
|
|
1293
|
-
<path d="M18 22V8a2 2 0 0 0-2-2H2"/>
|
|
1294
|
-
</svg>
|
|
1295
|
-
<span id="crop-btn-label">Crop</span>
|
|
1296
|
-
</button>
|
|
1297
|
-
|
|
1298
|
-
<button type="button" class="copio-tool-btn" id="btn-rotate" title="Rotate 90\xB0">
|
|
1299
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1300
|
-
<path d="M21.5 2v6h-6M21.34 15.57a10 10 0 1 1-.57-8.38l5.67-5.67"/>
|
|
1301
|
-
</svg>
|
|
1302
|
-
<span>Rotate</span>
|
|
1303
|
-
</button>
|
|
1304
|
-
|
|
1305
|
-
<button type="button" class="copio-tool-btn" id="btn-filter-bw" title="Toggle B&W filter">
|
|
1306
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1307
|
-
<circle cx="12" cy="12" r="10"/>
|
|
1308
|
-
<path d="M12 2a10 10 0 0 1 0 20z" fill="currentColor"/>
|
|
1309
|
-
</svg>
|
|
1310
|
-
<span>B&W</span>
|
|
1311
|
-
</button>
|
|
1312
|
-
|
|
1313
|
-
<button type="button" class="copio-tool-btn" id="btn-ocr" title="Recognize text">
|
|
1314
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1315
|
-
<path d="M4 7V4h16v3M9 20h6M12 4v16"/>
|
|
1316
|
-
</svg>
|
|
1317
|
-
<span>OCR</span>
|
|
1318
|
-
</button>
|
|
1319
|
-
|
|
1320
|
-
<button type="button" class="copio-tool-btn copio-btn-danger" id="btn-delete" title="Delete active page">
|
|
1321
|
-
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
|
1322
|
-
<polyline points="3 6 5 6 21 6"/>
|
|
1323
|
-
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/>
|
|
1324
|
-
</svg>
|
|
1325
|
-
<span>Delete</span>
|
|
1326
|
-
</button>
|
|
1327
|
-
</div>
|
|
1328
|
-
|
|
1329
|
-
<div class="copio-toolbar-actions">
|
|
1330
|
-
<slot name="toolbar">
|
|
1331
|
-
<button type="button" class="copio-btn copio-btn-primary" id="btn-primary-complete">
|
|
1332
|
-
\u2713 Use Photo
|
|
1333
|
-
</button>
|
|
1334
|
-
</slot>
|
|
1335
|
-
</div>
|
|
1336
|
-
</footer>
|
|
1337
|
-
|
|
1338
|
-
<!-- Scoped OCR Slide-out / Bottom Sheet -->
|
|
1339
|
-
<div class="copio-ocr-sheet" id="ocr-sheet" style="display:none;" part="ocr-sheet">
|
|
1340
|
-
<div class="copio-ocr-header">
|
|
1341
|
-
<strong class="copio-ocr-title">Text Recognition (OCR)</strong>
|
|
1342
|
-
<button type="button" class="copio-btn copio-btn-secondary" id="btn-close-ocr">\u2715</button>
|
|
1343
|
-
</div>
|
|
1344
|
-
<div class="copio-ocr-body" id="ocr-body">
|
|
1345
|
-
<p class="copio-ocr-placeholder">Select text or extract full page data...</p>
|
|
1346
|
-
</div>
|
|
1347
|
-
</div>
|
|
1348
|
-
|
|
1349
|
-
<!-- Container-scoped Toast Region (5s undo) -->
|
|
1350
|
-
<div class="copio-toast-region" id="toast-region" aria-live="polite"></div>
|
|
1351
|
-
</div>
|
|
1352
|
-
|
|
1353
|
-
<!-- Hidden input for file picker fallback -->
|
|
1354
|
-
<input type="file" id="internal-file-input" accept="image/*" style="display: none;" />
|
|
1355
|
-
<slot></slot>
|
|
1356
|
-
</div>
|
|
1357
|
-
`,this.#P()}#P(){let t=this.shadowRoot;if(!t)return;t.getElementById("tab-viewfinder")?.addEventListener("click",()=>{this.stage="viewfinder"}),t.getElementById("tab-workbench")?.addEventListener("click",()=>{this.stage="workbench"});let e=t.getElementById("internal-file-input");t.getElementById("btn-import-file")?.addEventListener("click",()=>{e?.click()}),e?.addEventListener("change",async o=>{let i=o.target;i.files&&i.files.length>0&&(await this.addFiles(i.files),i.value="")}),t.getElementById("btn-shutter")?.addEventListener("click",async()=>{await this.#L()}),t.getElementById("btn-review")?.addEventListener("click",()=>{this.stage="workbench"}),t.getElementById("btn-retake")?.addEventListener("click",()=>{this.#f=!0,this.#i=!1,this.stage="viewfinder"}),t.getElementById("btn-rotate")?.addEventListener("click",async()=>{await this.#k()}),t.getElementById("btn-filter-bw")?.addEventListener("click",async()=>{await this.#E()}),t.getElementById("btn-crop")?.addEventListener("click",async()=>{await this.#S()}),t.getElementById("btn-delete")?.addEventListener("click",async()=>{await this.#C()}),t.getElementById("btn-ocr")?.addEventListener("click",async()=>{await this.#z()}),t.getElementById("btn-close-ocr")?.addEventListener("click",()=>{this.#T()}),t.getElementById("btn-primary-complete")?.addEventListener("click",async()=>{await this.#O()}),t.getElementById("btn-card-front")?.addEventListener("click",()=>{this.#i=!1,this.#e=0,this.#o()}),t.getElementById("btn-card-back")?.addEventListener("click",()=>{this.#i=!1,this.#e=1,this.#o()}),this.#v()}#v(){let t=this.shadowRoot;if(!t)return;let e=t.getElementById("crop-box"),o=t.querySelectorAll(".copio-crop-handle");if(!e||o.length===0)return;let i=null,r=!1,a=0,s=0,p=null,m=l=>{let g=l.target.closest(".copio-crop-handle");if(g)i=g.getAttribute("data-handle"),r=!1;else if(l.target===e||l.target.classList.contains("copio-crop-grid"))i=null,r=!0;else return;l.preventDefault(),l.stopPropagation(),a=l.clientX,s=l.clientY,p=this.#a?{...this.#a}:{x:.05,y:.05,w:.9,h:.9},window.addEventListener("pointermove",k),window.addEventListener("pointerup",y)},k=l=>{if(!i&&!r||!p)return;let E=(t.getElementById("canvas-wrapper")||t.getElementById("canvas-viewport"))?.getBoundingClientRect()||{width:300,height:400},w=(l.clientX-a)/Math.max(E.width,1),x=(l.clientY-s)/Math.max(E.height,1),{x:n,y:u,w:f,h}=p;if(r)n=Math.min(Math.max(0,n+w),1-f),u=Math.min(Math.max(0,u+x),1-h);else if(i){if(i.includes("w")){let d=Math.min(Math.max(0,n+w),n+f-.1);f+=n-d,n=d}if(i.includes("e")&&(f=Math.min(Math.max(.1,f+w),1-n)),i.includes("n")){let d=Math.min(Math.max(0,u+x),u+h-.1);h+=u-d,u=d}i.includes("s")&&(h=Math.min(Math.max(.1,h+x),1-u))}this.#a={x:n,y:u,w:f,h},this.#y()},y=()=>{i=null,r=!1,p=null,window.removeEventListener("pointermove",k),window.removeEventListener("pointerup",y)};e.addEventListener("pointerdown",m),o.forEach(l=>{l.addEventListener("pointerdown",m)})}#y(){let t=this.shadowRoot;if(!t||!this.#a)return;let e=t.getElementById("crop-box");e&&(e.style.left=`${(this.#a.x*100).toFixed(1)}%`,e.style.top=`${(this.#a.y*100).toFixed(1)}%`,e.style.width=`${(this.#a.w*100).toFixed(1)}%`,e.style.height=`${(this.#a.h*100).toFixed(1)}%`)}async#o(){if(this.shadowRoot)return this.#l?this.#l:(this.#l=(async()=>{try{await Promise.resolve(),await this.#B()}finally{this.#l=null}})(),this.#l)}async#B(){if(this.shadowRoot)try{let t=await this.getPages();this.#g=t.length;let e=this.shadowRoot,o=e.getElementById("mode-badge");o&&(o.textContent=(this.mode||"single").toUpperCase());let i=e.getElementById("tab-viewfinder"),r=e.getElementById("tab-workbench");i&&i.setAttribute("aria-selected",String(this.#n==="viewfinder")),r&&r.setAttribute("aria-selected",String(this.#n==="workbench"));let a=e.getElementById("viewfinder-section"),s=e.getElementById("workbench-section");a&&s&&(this.#n==="viewfinder"?(a.style.display="flex",s.style.display="none"):(a.style.display="none",s.style.display="flex"));let p=e.getElementById("framing-guide");p&&p.setAttribute("data-aspect",this.aspect||"auto");let m=e.getElementById("step-pill-text");m&&(this.#c?m.textContent="Camera Active \xB7 Tap Shutter to Snap":this.aspect==="card"&&this.maxPages===2?m.textContent=t.length===0?"Step 1 of 2: Capture Front of ID Card":"Step 2 of 2: Capture Back of ID Card":this.aspect==="card"?m.textContent="Align Card Inside Frame":this.mode==="batch"?m.textContent=`Batch Capture \xB7 Page ${t.length+1}`:m.textContent="Align Document Inside Frame");let k=e.getElementById("btn-ocr");k&&(k.style.display=this.ocrEnabled&&this.hasFeature("ocr")?"":"none");let y=e.getElementById("btn-review"),l=e.getElementById("review-pill-text");if(y&&l&&(t.length>0?(y.style.display="inline-flex",l.textContent=`Review (${t.length}) \u2192`):y.style.display="none"),t.length===0){this.#n==="workbench"&&(this.stage="viewfinder");return}this.#e>=t.length&&(this.#e=Math.max(0,t.length-1));let g=t[this.#e],E=e.getElementById("card-side-switcher");if(E){let h=this.aspect==="card"&&this.maxPages===2;E.style.display=h?"flex":"none";let d=e.getElementById("btn-card-front"),b=e.getElementById("btn-card-back");d&&(d.classList.toggle("active",this.#e===0),d.setAttribute("aria-selected",String(this.#e===0))),b&&(b.classList.toggle("active",this.#e===1),b.setAttribute("aria-selected",String(this.#e===1)))}let w=e.getElementById("canvas-viewport");w&&w.classList.toggle("is-cropping",this.#i);let x=e.getElementById("stage-img");if(x)if(this.#i){let h=g.edits?.rotate||0,d=g.edits?.filter||"none",b=g.originalSrc||g.src||"";if(h!==0||d!=="none"){let F=this.#t?await this.#t.renderEdits(b,{rotate:h,filter:d}):b;x.src=F||b}else x.src=b}else x.src=g.src||g.originalSrc||"";let n=e.getElementById("crop-layer");if(this.#i){if(!n){let b=e.getElementById("canvas-wrapper");n=document.createElement("div"),n.className="copio-crop-layer",n.id="crop-layer",n.innerHTML=`
|
|
1358
|
-
<div class="copio-crop-box" id="crop-box">
|
|
1359
|
-
<div class="copio-crop-grid"></div>
|
|
1360
|
-
<span class="copio-crop-handle nw" data-handle="nw"></span>
|
|
1361
|
-
<span class="copio-crop-handle ne" data-handle="ne"></span>
|
|
1362
|
-
<span class="copio-crop-handle se" data-handle="se"></span>
|
|
1363
|
-
<span class="copio-crop-handle sw" data-handle="sw"></span>
|
|
1364
|
-
<span class="copio-crop-handle n edge-n" data-handle="n"></span>
|
|
1365
|
-
<span class="copio-crop-handle e edge-e" data-handle="e"></span>
|
|
1366
|
-
<span class="copio-crop-handle s edge-s" data-handle="s"></span>
|
|
1367
|
-
<span class="copio-crop-handle w edge-w" data-handle="w"></span>
|
|
1368
|
-
</div>
|
|
1369
|
-
`,b?.appendChild(n),this.#v()}n.style.display="block";let h=g.edits?.rotate||0,d=g.edits?.crop;this.#a=d?L(d,h):{x:.05,y:.05,w:.9,h:.9},this.#y()}else n&&n.remove();let u=e.getElementById("crop-btn-label");u&&(u.textContent=this.#i?"Apply":"Crop");let f=e.getElementById("btn-primary-complete");f&&(this.aspect==="card"&&this.maxPages===2&&t.length===1?f.textContent="Next: Capture Back (Step 2/2) \u2192":this.aspect==="card"&&t.length>=2?f.textContent="\u2713 Complete ID Scan (2 Sides)":this.mode==="batch"?f.textContent=`\u2713 Complete Scan (${t.length} Pages)`:f.textContent="\u2713 Use Photo"),this.#R(t)}catch{}}#R(t){let e=this.shadowRoot;if(!e)return;let o=e.getElementById("filmstrip-scroll");o&&(o.innerHTML="",t.forEach((i,r)=>{let a=document.createElement("div");a.className=`copio-filmstrip-item ${r===this.#e?"is-active":""}`,a.setAttribute("data-index",String(r)),a.innerHTML=`
|
|
1370
|
-
<div class="copio-thumb-container">
|
|
1371
|
-
<img src="${i.src||i.originalSrc}" alt="Page ${r+1}" class="copio-thumb-img" />
|
|
1372
|
-
<span class="copio-thumb-num">${r+1}</span>
|
|
1373
|
-
</div>
|
|
1374
|
-
${this.mode==="batch"?`
|
|
1375
|
-
<div class="copio-thumb-reorder">
|
|
1376
|
-
<button type="button" class="copio-reorder-btn move-left" title="Move Left" ${r===0?"disabled":""}>\u25C0</button>
|
|
1377
|
-
<button type="button" class="copio-reorder-btn move-right" title="Move Right" ${r===t.length-1?"disabled":""}>\u25B6</button>
|
|
1378
|
-
</div>
|
|
1379
|
-
`:""}
|
|
1380
|
-
`,a.querySelector(".copio-thumb-container")?.addEventListener("click",()=>{this.#e=r,this.#i=!1,this.#o()}),this.mode==="batch"&&(a.querySelector(".move-left")?.addEventListener("click",async s=>{s.stopPropagation(),await this.#w(r,r-1)}),a.querySelector(".move-right")?.addEventListener("click",async s=>{s.stopPropagation(),await this.#w(r,r+1)})),o.appendChild(a)}))}async#w(t,e){let o=await this.getPages();if(e<0||e>=o.length||t===e)return;let i=o.map(a=>a.id),[r]=i.splice(t,1);i.splice(e,0,r),await this.#t.reorderPages(this.#r,i),this.#e=e,this.#o()}#d(){this.#c&&(this.#c.getTracks().forEach(i=>i.stop()),this.#c=null);let t=this.shadowRoot,e=t?.getElementById("camera-video");e&&(e.srcObject=null,e.style.display="none");let o=t?.querySelector(".copio-camera-placeholder");o&&(o.style.display="")}async#L(){if(typeof this.onShutter=="function"&&await this.onShutter()!==!1)return;let t=this.shadowRoot,e=t?.getElementById("camera-video");if(this.#c&&e&&e.readyState>=2){let r=document.createElement("canvas");r.width=e.videoWidth||1280,r.height=e.videoHeight||720;let a=r.getContext("2d");if(a){a.drawImage(e,0,0,r.width,r.height);let s=await new Promise(p=>r.toBlob(p,"image/jpeg",.92));if(s){this.#d();let p=new File([s],`capture_${Date.now()}.jpg`,{type:"image/jpeg"});await this.addFiles([p]);return}}}if(!(typeof navigator<"u"&&navigator.webdriver===!0)&&typeof navigator<"u"&&navigator.mediaDevices?.getUserMedia&&e)try{this.#c=await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:"environment"},width:{ideal:1920},height:{ideal:1080}},audio:!1}),e.srcObject=this.#c,e.style.display="block",await e.play();let r=t?.querySelector(".copio-camera-placeholder");r&&(r.style.display="none");let a=t?.getElementById("step-pill-text");a&&(a.textContent="Camera Active \xB7 Tap Shutter to Snap");return}catch{}let i=t?.getElementById("internal-file-input");i&&typeof i.click=="function"&&i.click()}async#k(){let e=(await this.getPages())[this.#e];if(!e)return;this.#i&&(this.#i=!1,this.#a=null);let i=((e.edits?.rotate||0)+90)%360;await this.#t.applyEdit(this.#r,e.id,{rotate:i}),await this.#o()}async#E(){let e=(await this.getPages())[this.#e];if(!e)return;this.#i&&(this.#i=!1,this.#a=null);let i=(e.edits?.filter||"none")==="bw"?"none":"bw";await this.#t.applyEdit(this.#r,e.id,{filter:i}),await this.#o()}async#S(){let e=(await this.getPages())[this.#e];if(e){if(this.#i){this.#i=!1;let o=this.#a;if(this.#a=null,o){let i=e.edits?.rotate||0,r=M(o,i);await this.#t.applyEdit(this.#r,e.id,{crop:r})}}else this.#i=!0;await this.#o()}}async#C(){let t=await this.getPages(),e=t[this.#e];if(!e)return;let o=e.id;await this.#t.deletePage(this.#r,o),this.dispatch(c.PAGE_REMOVED,{pageId:o,docId:this.docId}),this.#e>=t.length-1&&(this.#e=Math.max(0,t.length-2)),this.#M(),await this.#o()}#M(){let t=this.shadowRoot;if(!t)return;let e=t.getElementById("toast-region");if(!e)return;this.#s&&clearInterval(this.#s),this.#u=5;let o=()=>{e.innerHTML=`
|
|
1381
|
-
<div class="copio-toast copio-toast-undo">
|
|
1382
|
-
<span>Page deleted</span>
|
|
1383
|
-
<button type="button" class="copio-btn-toast-undo" id="btn-toast-undo">
|
|
1384
|
-
Undo (${this.#u}s)
|
|
1385
|
-
</button>
|
|
1386
|
-
</div>
|
|
1387
|
-
`,t.getElementById("btn-toast-undo")?.addEventListener("click",async()=>{clearInterval(this.#s),this.#s=null,e.innerHTML="",await this.#t.undo(this.#r),await this.#o()})};o(),this.#s=setInterval(()=>{this.#u-=1,this.#u<=0?(clearInterval(this.#s),this.#s=null,e.innerHTML=""):o()},1e3)}async#z(){let t=this.shadowRoot;if(!t)return;let e=t.getElementById("ocr-sheet"),o=t.getElementById("ocr-body");if(!(!e||!o)){e.style.display="block",o.innerHTML='<p class="copio-ocr-loading">Recognizing text...</p>';try{let r=(await this.getPages())[this.#e],a=await this.ocr(r?.id||null),s=a.averageConfidence||0,p=s<=1&&s>0?Math.round(s*100):Math.round(s);o.innerHTML=`
|
|
1388
|
-
<div class="copio-ocr-content">
|
|
1389
|
-
<pre class="copio-ocr-text">${a.text||"No text detected."}</pre>
|
|
1390
|
-
<div class="copio-ocr-meta">
|
|
1391
|
-
<span>Confidence: ${p}%</span>
|
|
1392
|
-
</div>
|
|
1393
|
-
</div>
|
|
1394
|
-
`}catch(i){o.innerHTML=`<p class="copio-ocr-error">OCR recognition failed: ${i.message}</p>`}}}#T(){let t=this.shadowRoot;if(!t)return;let e=t.getElementById("ocr-sheet");e&&(e.style.display="none")}async#O(){if(this.aspect==="card"&&this.maxPages===2&&this.#g===1){this.stage="viewfinder";return}let t=await this.getPages();if(this.aspect==="card"&&this.maxPages===2&&t.length===1){this.stage="viewfinder";return}let e=t.map((i,r)=>({id:i.id,pageNumber:r+1,label:i.label||`Page ${r+1}`,originalSrc:i.originalSrc,src:i.src,originalPreserved:!0,dimensions:{width:i.width||0,height:i.height||0},edits:i.edits||{crop:{x:0,y:0,w:1,h:1},rotate:0,filter:"none"},ocrText:i.ocrText||null,blob:i.blob||null})),o={mode:this.mode,aspect:this.aspect,docId:this.docId,pageCount:e.length,pages:e};this.mode==="single"&&(o.page=e[0]||null,this.maxPages>1&&(o.maxPages=this.maxPages)),this.dispatch(c.SCAN_COMPLETE,o)}get theme(){return typeof this.getAttribute=="function"&&this.getAttribute("theme")||"dark"}set theme(t){typeof this.setAttribute=="function"&&(t?this.setAttribute("theme",t):this.removeAttribute("theme"))}get mode(){return typeof this.getAttribute=="function"&&this.getAttribute("mode")||"document"}set mode(t){typeof this.setAttribute=="function"&&this.setAttribute("mode",t)}get aspect(){return typeof this.getAttribute=="function"&&this.getAttribute("aspect")||"auto"}set aspect(t){typeof this.setAttribute=="function"&&this.setAttribute("aspect",t)}get stage(){return this.#n}set stage(t){if(t==="viewfinder"||t==="workbench"){this.#n=t,typeof this.setAttribute=="function"&&this.getAttribute("stage")!==t&&this.setAttribute("stage",t);let e=this.shadowRoot;if(e){let o=e.getElementById("viewfinder-section"),i=e.getElementById("workbench-section");o&&i&&(o.style.display=t==="viewfinder"?"flex":"none",i.style.display=t==="workbench"?"flex":"none")}this.#o()}}get docId(){return typeof this.getAttribute=="function"?this.getAttribute("doc-id"):null}set docId(t){typeof this.setAttribute=="function"&&(t?this.setAttribute("doc-id",t):this.removeAttribute("doc-id"))}async rotateActivePage(){return this.#k()}async toggleActivePageBw(){return this.#E()}async toggleCropMode(){return this.#S()}async deleteActivePageWithUndo(){return this.#C()}setCameraStream(t){this.#d(),this.#c=t}get features(){return this.#t?this.#t.features:[]}set features(t){if(typeof this.setAttribute=="function"){let e=Array.isArray(t)?t.join(" "):String(t||"");this.setAttribute("features",e)}this.#t&&this.#t.setFeatures(t)}hasFeature(t){return this.#t?this.#t.hasFeature(t):!1}get ocrEnabled(){return this.#t?this.#t.ocr:!0}set ocrEnabled(t){let e=!!t;typeof this.setAttribute=="function"&&this.setAttribute("ocr",e?"true":"false"),this.#t&&(this.#t.ocr=e),this.#p()}get pdf(){return this.#t?this.#t.pdf:!0}set pdf(t){let e=!!t;typeof this.setAttribute=="function"&&this.setAttribute("pdf",e?"true":"false"),this.#t&&(this.#t.pdf=e),this.#p()}get exportFormats(){return this.#t?this.#t.exportFormats:[]}set exportFormats(t){if(typeof this.setAttribute=="function"){let e=Array.isArray(t)?t.join(","):String(t||"");this.setAttribute("export-formats",e)}this.#t&&(this.#t.exportFormats=t)}get ocrLanguages(){return this.#t?this.#t.ocrLanguages:[]}set ocrLanguages(t){if(typeof this.setAttribute=="function"){let e=Array.isArray(t)?t.join(","):String(t||"");this.setAttribute("ocr-languages",e)}this.#t&&(this.#t.ocrLanguages=t)}get maxPages(){return this.#t?this.#t.maxPages:0}set maxPages(t){typeof this.setAttribute=="function"&&this.setAttribute("max-pages",String(t)),this.#t&&(this.#t.maxPages=t)}get assetBase(){return this.#t?this.#t.assetBase:""}set assetBase(t){typeof this.setAttribute=="function"&&this.setAttribute("asset-base",String(t||"")),this.#t&&(this.#t.assetBase=t)}get licenseKey(){return this.#t?this.#t.licenseKey:""}set licenseKey(t){typeof this.setAttribute=="function"&&this.setAttribute("license-key",String(t||"")),this.#t&&(this.#t.licenseKey=t)}get storage(){return this.#b}set storage(t){this.#b=t,this.#t&&this.#t.setStorage(t)}get engine(){return this.#t}set engine(t){t instanceof A&&(this.#t=t)}dispatch(t,e={}){return z(this,t,e)}async open(){this.#m=!0,typeof this.focus=="function"&&this.focus()}async close(){this.#m=!1,this.#d()}get isOpen(){return this.#m}async capture(){return new Promise(t=>{let e=document.createElement("input");e.type="file",e.accept="image/*",e.capture="environment",e.style.display="none",e.onchange=async()=>{try{if(e.files&&e.files.length>0){let o=await this.addFiles([e.files[0]]);t(o[0]||null)}else t(null)}catch(o){this.dispatch(c.ERROR,{code:"CAPTURE_FAILED",message:o.message,error:o}),t(null)}finally{e.remove()}},e.onerror=()=>{e.remove(),t(null)},document.body.appendChild(e),e.click()})}async addFiles(t){try{let e=await this.getPages(),o=null;if(e.length>0){if(this.mode==="single"&&this.maxPages<=1)await this.#t.clear(this.#r);else if(this.#f||this.maxPages>0&&e.length>=this.maxPages){let a=Math.min(this.#e,e.length-1),s=e[a];s&&(o=a,await this.#t.deletePage(this.#r,s.id))}}this.#f=!1;let i=await this.#t.addFiles(t,this.#r);for(let a=0;a<i.length;a++)this.dispatch(c.PAGE_ADDED,{page:i[a],pageNumber:a+1,docId:this.docId,source:"file"});let r=await this.getPages();if(o!==null&&i.length===1&&o<r.length-1){let a=r.map(p=>p.id),s=a.pop();s&&(a.splice(o,0,s),await this.#t.reorderPages(this.#r,a),r=await this.getPages())}return this.#g=r.length,i.length>0&&(this.#e=o!==null?Math.min(o,Math.max(0,r.length-1)):Math.max(0,r.length-1),this.mode==="single"&&(this.#n="workbench",typeof this.setAttribute=="function"&&this.getAttribute("stage")!=="workbench"&&this.setAttribute("stage","workbench"))),this.dispatch(c.PAGES_CHANGED,{pages:r,docId:this.docId}),this.mode==="single"&&i.length>0&&this.maxPages<=1&&this.dispatch(c.SCAN_COMPLETE,{mode:this.mode,aspect:this.aspect,docId:this.docId,pages:r,page:r[r.length-1]||null,pageCount:r.length}),await this.#o(),i}catch(e){throw this.dispatch(c.ERROR,{code:e.code||"ADD_FILES_FAILED",message:e.message,error:e}),e}}async getPages(){return this.#t.getPages(this.#r)}async clear(){this.#d(),this.#e=0,this.#g=0,this.#f=!1,this.#i=!1,await this.#t.clear(this.#r),this.dispatch(c.PAGES_CHANGED,{pages:[],docId:this.docId}),await this.#o()}async exportPdf(t={}){try{let e=await this.#t.exportPdf(this.#r,t);return this.dispatch(c.EXPORT_COMPLETE,{type:"pdf",format:"pdf",blob:e,searchable:!!t.searchable,docId:this.docId}),e}catch(e){throw this.dispatch(c.ERROR,{code:e.code||"EXPORT_FAILED",message:e.message,error:e}),e}}async exportZip(t={}){try{let e=await this.#t.exportZip(this.#r,t);return this.dispatch(c.EXPORT_COMPLETE,{type:"zip",format:"zip",blob:e,docId:this.docId}),e}catch(e){throw this.dispatch(c.ERROR,{code:e.code||"EXPORT_FAILED",message:e.message,error:e}),e}}async ocr(t=null,e={}){try{let o=await this.#t.runOcr(this.#r,t,e);return this.dispatch(c.OCR_COMPLETE,{text:o.text,pages:o.pagesResults,averageConfidence:o.averageConfidence,docId:this.docId,pageId:t}),o}catch(o){throw this.dispatch(c.ERROR,{code:o.code||"OCR_FAILED",message:o.message,error:o}),o}}async runOcr(t=null,e={}){return this.ocr(t,e)}async sync(t={}){try{return await this.#t.sync({onStateChange:o=>{o&&(o.step==="connected"||o.step==="syncing")&&this.dispatch(c.SYNC_CONNECTED,{peerId:o.peerId,mode:o.mode}),t.onStateChange&&t.onStateChange(o)}})}catch(e){throw this.dispatch(c.ERROR,{code:e.code||"SYNC_FAILED",message:e.message,error:e}),e}}};typeof customElements<"u"&&!customElements.get("copio-scanner")&&customElements.define("copio-scanner",B);export{P as a,T as b,O as c,B as d};
|
|
1395
|
-
//# sourceMappingURL=chunk-Q7XPZMZA.js.map
|