omnipay-reactnative-sdk 1.2.2-beta.0 → 1.2.2-beta.2

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 (69) hide show
  1. package/README.md +45 -136
  2. package/android/build.gradle +13 -0
  3. package/android/src/main/AndroidManifest.xml +5 -0
  4. package/android/src/main/java/com/omniretail/omnipay/LivenessCameraViewManager.java +116 -0
  5. package/android/src/main/java/com/omniretail/omnipay/LivenessDetectionModule.java +588 -0
  6. package/android/src/main/java/com/omniretail/omnipay/OmnipayActivityPackage.java +4 -1
  7. package/ios/LivenessCameraView.h +22 -0
  8. package/ios/LivenessCameraView.m +135 -0
  9. package/ios/LivenessCameraViewManager.h +12 -0
  10. package/ios/LivenessCameraViewManager.m +24 -0
  11. package/ios/LivenessDetectionModule.h +46 -0
  12. package/ios/LivenessDetectionModule.m +603 -0
  13. package/lib/commonjs/components/OmnipayProvider.js +6 -56
  14. package/lib/commonjs/components/OmnipayProvider.js.map +1 -1
  15. package/lib/commonjs/components/biometrics/FaceVerification.js +439 -0
  16. package/lib/commonjs/components/biometrics/FaceVerification.js.map +1 -0
  17. package/lib/commonjs/components/biometrics/LivenessCameraView.js +43 -0
  18. package/lib/commonjs/components/biometrics/LivenessCameraView.js.map +1 -0
  19. package/lib/commonjs/components/biometrics/LivenessDetection.js +252 -0
  20. package/lib/commonjs/components/biometrics/LivenessDetection.js.map +1 -0
  21. package/lib/commonjs/index.js +28 -0
  22. package/lib/commonjs/index.js.map +1 -1
  23. package/lib/module/components/OmnipayProvider.js +6 -56
  24. package/lib/module/components/OmnipayProvider.js.map +1 -1
  25. package/lib/module/components/biometrics/FaceVerification.js +429 -0
  26. package/lib/module/components/biometrics/FaceVerification.js.map +1 -0
  27. package/lib/module/components/biometrics/LivenessCameraView.js +38 -0
  28. package/lib/module/components/biometrics/LivenessCameraView.js.map +1 -0
  29. package/lib/module/components/biometrics/LivenessDetection.js +244 -0
  30. package/lib/module/components/biometrics/LivenessDetection.js.map +1 -0
  31. package/lib/module/index.js +5 -0
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/typescript/components/OmnipayProvider.d.ts.map +1 -1
  34. package/lib/typescript/components/biometrics/FaceVerification.d.ts +12 -0
  35. package/lib/typescript/components/biometrics/FaceVerification.d.ts.map +1 -0
  36. package/lib/typescript/components/biometrics/LivenessCameraView.d.ts +22 -0
  37. package/lib/typescript/components/biometrics/LivenessCameraView.d.ts.map +1 -0
  38. package/lib/typescript/components/biometrics/LivenessDetection.d.ts +73 -0
  39. package/lib/typescript/components/biometrics/LivenessDetection.d.ts.map +1 -0
  40. package/lib/typescript/index.d.ts +3 -0
  41. package/lib/typescript/index.d.ts.map +1 -1
  42. package/omnipay-reactnative-sdk.podspec +47 -0
  43. package/package.json +6 -11
  44. package/src/components/OmnipayProvider.tsx +8 -65
  45. package/src/components/biometrics/FaceVerification.tsx +484 -0
  46. package/src/components/biometrics/LivenessCameraView.tsx +61 -0
  47. package/src/components/biometrics/LivenessDetection.ts +305 -0
  48. package/src/index.tsx +18 -0
  49. package/lib/commonjs/components/FaceVerification.js +0 -755
  50. package/lib/commonjs/components/FaceVerification.js.map +0 -1
  51. package/lib/commonjs/types/faceVerification.js +0 -2
  52. package/lib/commonjs/types/faceVerification.js.map +0 -1
  53. package/lib/commonjs/types/index.js +0 -17
  54. package/lib/commonjs/types/index.js.map +0 -1
  55. package/lib/module/components/FaceVerification.js +0 -746
  56. package/lib/module/components/FaceVerification.js.map +0 -1
  57. package/lib/module/types/faceVerification.js +0 -2
  58. package/lib/module/types/faceVerification.js.map +0 -1
  59. package/lib/module/types/index.js +0 -2
  60. package/lib/module/types/index.js.map +0 -1
  61. package/lib/typescript/components/FaceVerification.d.ts +0 -10
  62. package/lib/typescript/components/FaceVerification.d.ts.map +0 -1
  63. package/lib/typescript/types/faceVerification.d.ts +0 -18
  64. package/lib/typescript/types/faceVerification.d.ts.map +0 -1
  65. package/lib/typescript/types/index.d.ts +0 -2
  66. package/lib/typescript/types/index.d.ts.map +0 -1
  67. package/src/components/FaceVerification.tsx +0 -884
  68. package/src/types/faceVerification.ts +0 -27
  69. package/src/types/index.ts +0 -1
@@ -0,0 +1,429 @@
1
+ import React, { useState, useEffect, useCallback } from 'react';
2
+ import { View, Text, Modal, Dimensions, Platform, StyleSheet, TouchableOpacity, ActivityIndicator } from 'react-native';
3
+ import { LivenessDetection } from './LivenessDetection';
4
+ import LivenessCameraView from './LivenessCameraView';
5
+ const FaceVerification = _ref => {
6
+ let {
7
+ onClose,
8
+ onSuccess,
9
+ primaryColor,
10
+ challenges = ['smile', 'blink', 'turn_left'],
11
+ timeout = 300000 // 5 minutes default
12
+ } = _ref;
13
+ const [detectionState, setDetectionState] = useState('idle');
14
+ const [currentChallenge, setCurrentChallenge] = useState('');
15
+ const [completedChallenges, setCompletedChallenges] = useState([]);
16
+ const [error, setError] = useState('');
17
+ const [isLoading, setIsLoading] = useState(false);
18
+
19
+ // Challenge instruction messages
20
+ const getChallengeInstruction = challenge => {
21
+ switch (challenge) {
22
+ case 'smile':
23
+ return 'Please smile naturally';
24
+ case 'blink':
25
+ return 'Please blink your eyes';
26
+ case 'turn_left':
27
+ return 'Please turn your head to the left';
28
+ case 'turn_right':
29
+ return 'Please turn your head to the right';
30
+ default:
31
+ return 'Please follow the instruction';
32
+ }
33
+ };
34
+ const startLivenessDetection = useCallback(async () => {
35
+ try {
36
+ setDetectionState('starting');
37
+ setIsLoading(true);
38
+ setError('');
39
+
40
+ // Check and request camera permission first
41
+ const hasPermission = await LivenessDetection.checkCameraPermission();
42
+ if (!hasPermission) {
43
+ const granted = await LivenessDetection.requestCameraPermission();
44
+ if (!granted) {
45
+ throw new Error('Camera permission is required for face verification');
46
+ }
47
+ }
48
+ const config = {
49
+ challenges,
50
+ timeout
51
+ };
52
+ await LivenessDetection.startLivenessDetection(config, {
53
+ onChallengeStart: challenge => {
54
+ setCurrentChallenge(challenge);
55
+ setDetectionState('active');
56
+ setIsLoading(false);
57
+ },
58
+ onChallengeSuccess: challenge => {
59
+ setCompletedChallenges(prev => [...prev, challenge]);
60
+ },
61
+ onChallengeFailure: (challenge, reason) => {
62
+ console.warn(`Challenge ${challenge} failed: ${reason}`);
63
+ // Continue with next challenge - the native module handles this
64
+ },
65
+
66
+ onAllChallengesComplete: result => {
67
+ setDetectionState('completed');
68
+ setCurrentChallenge('');
69
+ onSuccess(result);
70
+ }
71
+ });
72
+ } catch (err) {
73
+ console.error('Liveness detection error:', err);
74
+ setError(err instanceof Error ? err.message : 'Unknown error occurred');
75
+ setDetectionState('error');
76
+ setIsLoading(false);
77
+ }
78
+ }, [challenges, timeout, onSuccess]);
79
+ const handleClose = useCallback(() => {
80
+ if (detectionState === 'active' || detectionState === 'starting') {
81
+ LivenessDetection.stopDetection();
82
+ }
83
+ onClose();
84
+ }, [detectionState, onClose]);
85
+ const handleRetry = useCallback(() => {
86
+ setDetectionState('idle');
87
+ setError('');
88
+ setCompletedChallenges([]);
89
+ setCurrentChallenge('');
90
+ }, []);
91
+
92
+ // Auto-start detection when component mounts
93
+ useEffect(() => {
94
+ if (detectionState === 'idle') {
95
+ // Small delay to ensure UI is ready
96
+ const timer = setTimeout(() => {
97
+ startLivenessDetection();
98
+ }, 500);
99
+ return () => clearTimeout(timer);
100
+ }
101
+ return undefined;
102
+ }, [detectionState, startLivenessDetection]);
103
+
104
+ // Cleanup on unmount
105
+ useEffect(() => {
106
+ return () => {
107
+ LivenessDetection.cleanup();
108
+ };
109
+ }, []);
110
+ const renderContent = () => {
111
+ if (detectionState === 'error') {
112
+ return /*#__PURE__*/React.createElement(View, {
113
+ style: styles.errorContainer
114
+ }, /*#__PURE__*/React.createElement(Text, {
115
+ style: styles.errorTitle
116
+ }, "Detection Failed"), /*#__PURE__*/React.createElement(Text, {
117
+ style: styles.errorSubtitle
118
+ }, error), /*#__PURE__*/React.createElement(TouchableOpacity, {
119
+ style: [styles.button, {
120
+ backgroundColor: primaryColor
121
+ }],
122
+ onPress: handleRetry
123
+ }, /*#__PURE__*/React.createElement(Text, {
124
+ style: styles.buttonText
125
+ }, "Try Again")));
126
+ }
127
+ if (detectionState === 'completed') {
128
+ return /*#__PURE__*/React.createElement(View, {
129
+ style: styles.successContainer
130
+ }, /*#__PURE__*/React.createElement(Text, {
131
+ style: styles.successTitle
132
+ }, "Verification Complete!"), /*#__PURE__*/React.createElement(Text, {
133
+ style: styles.successSubtitle
134
+ }, "All challenges completed successfully"));
135
+ }
136
+ return /*#__PURE__*/React.createElement(View, {
137
+ style: styles.contentContainer
138
+ }, /*#__PURE__*/React.createElement(View, {
139
+ style: styles.cameraContainer
140
+ }, /*#__PURE__*/React.createElement(LivenessCameraView, {
141
+ style: styles.camera,
142
+ scaleType: "fillCenter",
143
+ onCameraReady: () => console.log('Camera ready'),
144
+ onCameraError: error => {
145
+ console.error('Camera error:', error);
146
+ setError('Camera initialization failed');
147
+ setDetectionState('error');
148
+ }
149
+ }), /*#__PURE__*/React.createElement(View, {
150
+ style: styles.overlay
151
+ }, isLoading ? /*#__PURE__*/React.createElement(View, {
152
+ style: styles.loadingContainer
153
+ }, /*#__PURE__*/React.createElement(ActivityIndicator, {
154
+ size: "large",
155
+ color: primaryColor
156
+ }), /*#__PURE__*/React.createElement(Text, {
157
+ style: styles.loadingText
158
+ }, "Initializing camera...")) : /*#__PURE__*/React.createElement(React.Fragment, null, currentChallenge && /*#__PURE__*/React.createElement(View, {
159
+ style: styles.instructionContainer
160
+ }, /*#__PURE__*/React.createElement(Text, {
161
+ style: styles.instructionText
162
+ }, getChallengeInstruction(currentChallenge))), /*#__PURE__*/React.createElement(View, {
163
+ style: styles.progressContainer
164
+ }, /*#__PURE__*/React.createElement(Text, {
165
+ style: styles.progressText
166
+ }, completedChallenges.length, " / ", challenges.length, " completed"), /*#__PURE__*/React.createElement(View, {
167
+ style: styles.progressBar
168
+ }, /*#__PURE__*/React.createElement(View, {
169
+ style: [styles.progressFill, {
170
+ width: `${completedChallenges.length / challenges.length * 100}%`,
171
+ backgroundColor: primaryColor
172
+ }]
173
+ })))))));
174
+ };
175
+ return /*#__PURE__*/React.createElement(Modal, {
176
+ visible: true,
177
+ transparent: true,
178
+ onRequestClose: handleClose,
179
+ style: styles.modal,
180
+ animationType: "slide"
181
+ }, /*#__PURE__*/React.createElement(View, {
182
+ style: styles.backdrop
183
+ }, /*#__PURE__*/React.createElement(View, {
184
+ style: styles.container
185
+ }, /*#__PURE__*/React.createElement(View, {
186
+ style: styles.header
187
+ }, /*#__PURE__*/React.createElement(Text, {
188
+ style: styles.title
189
+ }, "Face Verification"), /*#__PURE__*/React.createElement(TouchableOpacity, {
190
+ onPress: handleClose,
191
+ style: styles.closeButton
192
+ }, /*#__PURE__*/React.createElement(Text, {
193
+ style: styles.closeText
194
+ }, "\u2715"))), renderContent())));
195
+ };
196
+ export default FaceVerification;
197
+ const styles = StyleSheet.create({
198
+ hide: {
199
+ display: 'none'
200
+ },
201
+ full: {
202
+ flex: 1,
203
+ width: '100%',
204
+ height: '100%'
205
+ },
206
+ webview: {
207
+ flex: 1,
208
+ width: '100%',
209
+ height: Dimensions.get('window').height - 40,
210
+ backgroundColor: 'white',
211
+ borderTopRightRadius: 20,
212
+ borderTopLeftRadius: 20,
213
+ paddingTop: 150
214
+ },
215
+ webviewLoader: {
216
+ zIndex: 3,
217
+ backgroundColor: 'white',
218
+ alignItems: 'center',
219
+ justifyContent: 'center',
220
+ flex: 1,
221
+ width: '100%',
222
+ height: '100%',
223
+ position: 'absolute',
224
+ top: 0,
225
+ left: 0,
226
+ borderTopRightRadius: 20,
227
+ borderTopLeftRadius: 20
228
+ },
229
+ backdrop: {
230
+ backgroundColor: 'rgba(0,0,0,0.48)',
231
+ flex: 1,
232
+ justifyContent: 'flex-end',
233
+ position: 'relative',
234
+ height: '100%'
235
+ },
236
+ container: {
237
+ backgroundColor: 'white',
238
+ borderTopRightRadius: 20,
239
+ borderTopLeftRadius: 20,
240
+ maxHeight: Dimensions.get('window').height - 40,
241
+ flex: 1,
242
+ position: 'relative',
243
+ ...(Platform.OS === 'android' && {
244
+ overflow: 'hidden'
245
+ })
246
+ },
247
+ modal: {
248
+ flex: 1,
249
+ backgroundColor: 'rgba(0,0,0,0.48)',
250
+ height: '100%',
251
+ width: '100%'
252
+ },
253
+ header: {
254
+ flexDirection: 'row',
255
+ justifyContent: 'space-between',
256
+ alignItems: 'center',
257
+ padding: 16,
258
+ borderBottomWidth: 1,
259
+ borderBottomColor: '#f0f0f0'
260
+ },
261
+ title: {
262
+ fontSize: 18,
263
+ fontWeight: '600',
264
+ color: '#333'
265
+ },
266
+ closeButton: {
267
+ width: 30,
268
+ height: 30,
269
+ borderRadius: 15,
270
+ backgroundColor: '#f0f0f0',
271
+ alignItems: 'center',
272
+ justifyContent: 'center'
273
+ },
274
+ closeText: {
275
+ fontSize: 16,
276
+ color: '#666'
277
+ },
278
+ contentContainer: {
279
+ flex: 1
280
+ },
281
+ cameraContainer: {
282
+ flex: 1,
283
+ position: 'relative'
284
+ },
285
+ camera: {
286
+ flex: 1,
287
+ width: '100%',
288
+ height: '100%'
289
+ },
290
+ overlay: {
291
+ position: 'absolute',
292
+ top: 0,
293
+ left: 0,
294
+ right: 0,
295
+ bottom: 0,
296
+ justifyContent: 'space-between',
297
+ alignItems: 'center',
298
+ paddingVertical: 40,
299
+ paddingHorizontal: 20
300
+ },
301
+ loadingContainer: {
302
+ flex: 1,
303
+ justifyContent: 'center',
304
+ alignItems: 'center'
305
+ },
306
+ loadingText: {
307
+ color: 'white',
308
+ fontSize: 16,
309
+ marginTop: 12,
310
+ textAlign: 'center'
311
+ },
312
+ instructionContainer: {
313
+ backgroundColor: 'rgba(0,0,0,0.7)',
314
+ paddingHorizontal: 20,
315
+ paddingVertical: 12,
316
+ borderRadius: 8,
317
+ marginTop: 20
318
+ },
319
+ instructionText: {
320
+ color: 'white',
321
+ fontSize: 16,
322
+ fontWeight: '500',
323
+ textAlign: 'center'
324
+ },
325
+ progressContainer: {
326
+ backgroundColor: 'rgba(0,0,0,0.7)',
327
+ paddingHorizontal: 20,
328
+ paddingVertical: 12,
329
+ borderRadius: 8,
330
+ minWidth: 200
331
+ },
332
+ progressText: {
333
+ color: 'white',
334
+ fontSize: 14,
335
+ textAlign: 'center',
336
+ marginBottom: 8
337
+ },
338
+ progressBar: {
339
+ height: 4,
340
+ backgroundColor: 'rgba(255,255,255,0.3)',
341
+ borderRadius: 2,
342
+ overflow: 'hidden'
343
+ },
344
+ progressFill: {
345
+ height: '100%',
346
+ borderRadius: 2
347
+ },
348
+ errorContainer: {
349
+ flex: 1,
350
+ justifyContent: 'center',
351
+ alignItems: 'center',
352
+ paddingHorizontal: 20
353
+ },
354
+ errorTitle: {
355
+ fontSize: 20,
356
+ fontWeight: '600',
357
+ color: '#d32f2f',
358
+ marginBottom: 8,
359
+ textAlign: 'center'
360
+ },
361
+ errorSubtitle: {
362
+ textAlign: 'center',
363
+ fontSize: 14,
364
+ color: '#5e7079',
365
+ marginBottom: 20,
366
+ paddingHorizontal: 8
367
+ },
368
+ successContainer: {
369
+ flex: 1,
370
+ justifyContent: 'center',
371
+ alignItems: 'center',
372
+ paddingHorizontal: 20
373
+ },
374
+ successTitle: {
375
+ fontSize: 20,
376
+ fontWeight: '600',
377
+ color: '#2e7d32',
378
+ marginBottom: 8,
379
+ textAlign: 'center'
380
+ },
381
+ successSubtitle: {
382
+ textAlign: 'center',
383
+ fontSize: 14,
384
+ color: '#5e7079',
385
+ paddingHorizontal: 8
386
+ },
387
+ close: {
388
+ position: 'absolute',
389
+ top: 10,
390
+ right: 10,
391
+ backgroundColor: 'white',
392
+ height: 24,
393
+ width: 24,
394
+ borderRadius: 1000,
395
+ alignItems: 'center',
396
+ justifyContent: 'center',
397
+ zIndex: 2
398
+ },
399
+ closeIcon: {
400
+ height: 12,
401
+ width: 12
402
+ },
403
+ testContent: {
404
+ paddingTop: 30,
405
+ paddingLeft: 16
406
+ },
407
+ testTwoContent: {
408
+ paddingTop: 10,
409
+ paddingLeft: 16
410
+ },
411
+ retryButton: {
412
+ minWidth: 160,
413
+ marginHorizontal: 'auto'
414
+ },
415
+ button: {
416
+ borderRadius: 6,
417
+ paddingHorizontal: 20,
418
+ paddingVertical: 14,
419
+ alignItems: 'center',
420
+ justifyContent: 'center',
421
+ minWidth: 120
422
+ },
423
+ buttonText: {
424
+ color: 'white',
425
+ fontSize: 16,
426
+ fontWeight: '600'
427
+ }
428
+ });
429
+ //# sourceMappingURL=FaceVerification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","useState","useEffect","useCallback","View","Text","Modal","Dimensions","Platform","StyleSheet","TouchableOpacity","ActivityIndicator","LivenessDetection","LivenessCameraView","FaceVerification","onClose","onSuccess","primaryColor","challenges","timeout","detectionState","setDetectionState","currentChallenge","setCurrentChallenge","completedChallenges","setCompletedChallenges","error","setError","isLoading","setIsLoading","getChallengeInstruction","challenge","startLivenessDetection","hasPermission","checkCameraPermission","granted","requestCameraPermission","Error","config","onChallengeStart","onChallengeSuccess","prev","onChallengeFailure","reason","console","warn","onAllChallengesComplete","result","err","message","handleClose","stopDetection","handleRetry","timer","setTimeout","clearTimeout","undefined","cleanup","renderContent","styles","errorContainer","errorTitle","errorSubtitle","button","backgroundColor","buttonText","successContainer","successTitle","successSubtitle","contentContainer","cameraContainer","camera","log","overlay","loadingContainer","loadingText","instructionContainer","instructionText","progressContainer","progressText","length","progressBar","progressFill","width","modal","backdrop","container","header","title","closeButton","closeText","create","hide","display","full","flex","height","webview","get","borderTopRightRadius","borderTopLeftRadius","paddingTop","webviewLoader","zIndex","alignItems","justifyContent","position","top","left","maxHeight","OS","overflow","flexDirection","padding","borderBottomWidth","borderBottomColor","fontSize","fontWeight","color","borderRadius","right","bottom","paddingVertical","paddingHorizontal","marginTop","textAlign","minWidth","marginBottom","close","closeIcon","testContent","paddingLeft","testTwoContent","retryButton","marginHorizontal"],"sourceRoot":"../../src","sources":["FaceVerification.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,SAAS,EAA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AAC;IACfI,iBAAiB,EAAE,EAAE;IACrBD,eAAe,EAAE,EAAE;IACnBlB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE,QAAQ;IACxBqB,QAAQ,EAAE;EACZ,CAAC;EACD7D,UAAU,EAAE;IACVqD,KAAK,EAAE,OAAO;IACdF,QAAQ,EAAE,EAAE;IACZC,UAAU,EAAE;EACd;AACF,CAAC,CAAC"}
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import { requireNativeComponent, Platform } from 'react-native';
3
+
4
+ // Props for the native camera view
5
+
6
+ // Import native component based on platform
7
+ const NativeLivenessCameraView = Platform.select({
8
+ android: requireNativeComponent('LivenessCameraView'),
9
+ ios: requireNativeComponent('LivenessCameraView')
10
+ });
11
+
12
+ /**
13
+ * LivenessCameraView - Native camera component for liveness detection
14
+ *
15
+ * This component provides a camera preview that integrates with the
16
+ * liveness detection native module for real-time face analysis.
17
+ */
18
+ const LivenessCameraView = _ref => {
19
+ let {
20
+ style,
21
+ scaleType = 'fillCenter',
22
+ onCameraReady,
23
+ onCameraError
24
+ } = _ref;
25
+ // Platform check
26
+ if (!NativeLivenessCameraView) {
27
+ console.warn('LivenessCameraView is not available on this platform');
28
+ return null;
29
+ }
30
+ return /*#__PURE__*/React.createElement(NativeLivenessCameraView, {
31
+ style: style,
32
+ scaleType: scaleType,
33
+ onCameraReady: onCameraReady,
34
+ onCameraError: onCameraError
35
+ });
36
+ };
37
+ export default LivenessCameraView;
38
+ //# sourceMappingURL=LivenessCameraView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["React","requireNativeComponent","Platform","NativeLivenessCameraView","select","android","ios","LivenessCameraView","style","scaleType","onCameraReady","onCameraError","console","warn"],"sourceRoot":"../../src","sources":["LivenessCameraView.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,sBAAsB,EAAEC,QAAQ,QAAmB,cAAc;;AAE1E;;AAmBA;AACA,MAAMC,wBAAwB,GAAGD,QAAQ,CAACE,MAAM,CAAC;EAC/CC,OAAO,EACLJ,sBAAsB,CAAgC,oBAAoB,CAAC;EAC7EK,GAAG,EAAEL,sBAAsB,CACzB,oBAAoB;AAExB,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,kBAAqD,GAAG,QAKxD;EAAA,IALyD;IAC7DC,KAAK;IACLC,SAAS,GAAG,YAAY;IACxBC,aAAa;IACbC;EACF,CAAC;EACC;EACA,IAAI,CAACR,wBAAwB,EAAE;IAC7BS,OAAO,CAACC,IAAI,CAAC,sDAAsD,CAAC;IACpE,OAAO,IAAI;EACb;EAEA,oBACE,oBAAC,wBAAwB;IACvB,KAAK,EAAEL,KAAM;IACb,SAAS,EAAEC,SAAU;IACrB,aAAa,EAAEC,aAAc;IAC7B,aAAa,EAAEC;EAAc,EAC7B;AAEN,CAAC;AAED,eAAeJ,kBAAkB"}