@ozdao/prometheus-framework 0.2.244 → 0.2.245
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs.map +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js.map +1 -1
- package/dist/prometheus-framework/src/modules/pages/pages.client.cjs +623 -623
- package/dist/prometheus-framework/src/modules/pages/pages.client.js +623 -623
- package/package.json +1 -1
- package/src/modules/events/components/elements/ButtonCheck.vue +3 -2
package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs
CHANGED
@@ -94,8 +94,8 @@ const _sfc_main = {
|
|
94
94
|
}, SCAN_TIMEOUT);
|
95
95
|
} catch (e) {
|
96
96
|
console.error(e);
|
97
|
-
alert(`Ticket is not found, already used or deactivated!`);
|
98
97
|
isProcessing.value = false;
|
98
|
+
alert(`Ticket is not found, already used or deactivated!`);
|
99
99
|
}
|
100
100
|
}
|
101
101
|
async function setZoomRatio(event) {
|
package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ButtonCheck.vue.cjs","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <div class=\"square\"></div>\n <div class=\"zoom-ratio-wrapper\" v-if=\"minZoomRatio !== undefined && maxZoomRatio !== undefined\">\n <input type=\"range\" :min=\"minZoomRatio\" :max=\"maxZoomRatio\" @input=\"setZoomRatio\" />\n </div>\n <Button @click=\"stopScan\" class=\"bg-white t-black stop-scan-button\">Stop Scan</Button>\n <Button v-if=\"isTorchAvailable\" @click=\"toggleTorch\" class=\"bg-white torch-button\">\n Toggle Torch\n </Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\nconst isTorchAvailable = ref(false)\nconst minZoomRatio = ref(undefined)\nconst maxZoomRatio = ref(undefined)\nconst isProcessing = ref(false)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n const { available } = await BarcodeScanner.isTorchAvailable()\n isTorchAvailable.value = available\n})\n\nonUnmounted(async () => {\n await stopScan()\n})\n\nconst SCAN_TIMEOUT = 5000 // 5 секунд (можно изменить по вашему усмотрению)\n\nasync function startScan() {\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n document.querySelector('html')?.classList.add('barcode-scanner-active-html')\n isScanning.value = true\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n if (!isProcessing.value) {\n await processBarcode(result.barcode)\n }\n })\n await BarcodeScanner.startScan()\n const { zoomRatio: min } = await BarcodeScanner.getMinZoomRatio()\n const { zoomRatio: max } = await BarcodeScanner.getMaxZoomRatio()\n minZoomRatio.value = min\n maxZoomRatio.value = max\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active')\n document.querySelector('html')?.classList.remove('barcode-scanner-active-html')\n isScanning.value = false\n await BarcodeScanner.stopScan()\n await BarcodeScanner.removeAllListeners()\n } catch (e) {\n error.value = e.message\n alert(`Error stopping scan: ${error.value}`)\n }\n}\n\nasync function processBarcode(barcode) {\n if (isProcessing.value) return\n isProcessing.value = true\n try {\n if (!barcode || !barcode.rawValue) {\n throw new Error('Invalid barcode data')\n }\n console.log('barcode is', barcode)\n\n const response = await tickets.actions.update({ _id: barcode.rawValue, status: 'used', check: true })\n alert(\"Ticket checked. And it's all right!\")\n emits('qrcodecheck')\n\n // Устанавливаем таймаут перед следующим сканированием\n setTimeout(() => {\n isProcessing.value = false\n }, SCAN_TIMEOUT)\n\n } catch (e) {\n console.error(e)\n alert(`Ticket is not found, already used or deactivated!`)\n // Сбрасываем флаг isProcessing в случае ошибки, чтобы можно было попробовать снова\n
|
1
|
+
{"version":3,"file":"ButtonCheck.vue.cjs","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <div class=\"square\"></div>\n <div class=\"zoom-ratio-wrapper\" v-if=\"minZoomRatio !== undefined && maxZoomRatio !== undefined\">\n <input type=\"range\" :min=\"minZoomRatio\" :max=\"maxZoomRatio\" @input=\"setZoomRatio\" />\n </div>\n <Button @click=\"stopScan\" class=\"bg-white t-black stop-scan-button\">Stop Scan</Button>\n <Button v-if=\"isTorchAvailable\" @click=\"toggleTorch\" class=\"bg-white torch-button\">\n Toggle Torch\n </Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\nconst isTorchAvailable = ref(false)\nconst minZoomRatio = ref(undefined)\nconst maxZoomRatio = ref(undefined)\nconst isProcessing = ref(false)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n const { available } = await BarcodeScanner.isTorchAvailable()\n isTorchAvailable.value = available\n})\n\nonUnmounted(async () => {\n await stopScan()\n})\n\nconst SCAN_TIMEOUT = 5000 // 5 секунд (можно изменить по вашему усмотрению)\n\nasync function startScan() {\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n document.querySelector('html')?.classList.add('barcode-scanner-active-html')\n isScanning.value = true\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n if (!isProcessing.value) {\n await processBarcode(result.barcode)\n }\n })\n await BarcodeScanner.startScan()\n const { zoomRatio: min } = await BarcodeScanner.getMinZoomRatio()\n const { zoomRatio: max } = await BarcodeScanner.getMaxZoomRatio()\n minZoomRatio.value = min\n maxZoomRatio.value = max\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active')\n document.querySelector('html')?.classList.remove('barcode-scanner-active-html')\n isScanning.value = false\n await BarcodeScanner.stopScan()\n await BarcodeScanner.removeAllListeners()\n } catch (e) {\n error.value = e.message\n alert(`Error stopping scan: ${error.value}`)\n }\n}\n\nasync function processBarcode(barcode) {\n if (isProcessing.value) return\n isProcessing.value = true\n try {\n if (!barcode || !barcode.rawValue) {\n throw new Error('Invalid barcode data')\n }\n console.log('barcode is', barcode)\n\n const response = await tickets.actions.update({ _id: barcode.rawValue, status: 'used', check: true })\n alert(\"Ticket checked. And it's all right!\")\n emits('qrcodecheck')\n\n // Устанавливаем таймаут перед следующим сканированием\n setTimeout(() => {\n isProcessing.value = false\n }, SCAN_TIMEOUT)\n\n } catch (e) {\n console.error(e)\n isProcessing.value = false\n alert(`Ticket is not found, already used or deactivated!`)\n // Сбрасываем флаг isProcessing в случае ошибки, чтобы можно было попробовать снова\n \n }\n}\n\nasync function setZoomRatio(event) {\n const zoomRatio = parseFloat(event.target.value)\n await BarcodeScanner.setZoomRatio({ zoomRatio })\n}\n\nasync function toggleTorch() {\n await BarcodeScanner.toggleTorch()\n}\n</script>\n\n<style>\n.barcode-scanner-modal {\n visibility: visible;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.square {\n width: 200px;\n height: 200px;\n border: 2px solid white;\n border-radius: 10px;\n}\n\n.zoom-ratio-wrapper {\n width: 80%;\n margin-top: 20px;\n}\n\n.stop-scan-button,\n.torch-button {\n margin-top: 20px;\n}\n\n/* Existing styles */\nbody.barcode-scanner-active {\n visibility: hidden !important;\n background: transparent !important;\n --background: transparent;\n --ion-background-color: transparent;\n}\n\nhtml.barcode-scanner-active-html {\n background: transparent !important;\n}\n</style>\n"],"names":["ref","onMounted","BarcodeScanner","onUnmounted","tickets.actions"],"mappings":";;;;;;;;;;;;;;;;AA6CA,MAAM,eAAe;;;;;AArBrB,UAAM,QAAQ;AACd,UAAM,QAAQA,IAAG,IAAC,EAAE;AACpB,UAAM,aAAaA,IAAG,IAAC,KAAK;AAC5B,UAAM,mBAAmBA,IAAG,IAAC,KAAK;AAClC,UAAM,eAAeA,IAAG,IAAC,MAAS;AAClC,UAAM,eAAeA,IAAG,IAAC,MAAS;AAClC,UAAM,eAAeA,IAAG,IAAC,KAAK;AAE9BC,QAAAA,UAAU,YAAY;AACpB,YAAM,EAAE,UAAS,IAAK,MAAMC,MAAAA,eAAe,YAAa;AACxD,UAAI,CAAC,WAAW;AACd,cAAM,QAAQ;AAAA,MACf;AACD,YAAM,EAAE,UAAS,IAAK,MAAMA,MAAAA,eAAe,iBAA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AAM,wBAAwB,MAAM,KAAK,EAAE;AAAA,MAC5C;AAAA,IACH;AAEA,mBAAe,eAAe,SAAS;AACrC,UAAI,aAAa,MAAO;AACxB,mBAAa,QAAQ;AACrB,UAAI;AACF,YAAI,CAAC,WAAW,CAAC,QAAQ,UAAU;AACjC,gBAAM,IAAI,MAAM,sBAAsB;AAAA,QACvC;AACD,gBAAQ,IAAI,cAAc,OAAO;AAEjC,cAAM,WAAW,MAAME,gBAAgB,OAAO,EAAE,KAAK,QAAQ,UAAU,QAAQ,QAAQ,OAAO,KAAI,CAAE;AACpG,cAAM,qCAAqC;AAC3C,cAAM,aAAa;AAGnB,mBAAW,MAAM;AACf,uBAAa,QAAQ;AAAA,QACtB,GAAE,YAAY;AAAA,MAEhB,SAAQ,GAAG;AACV,gBAAQ,MAAM,CAAC;AACf,qBAAa,QAAQ;AACrB,cAAM,mDAAmD;AAAA,MAG1D;AAAA,IACH;AAEA,mBAAe,aAAa,OAAO;AACjC,YAAM,YAAY,WAAW,MAAM,OAAO,KAAK;AAC/C,YAAMF,qBAAe,aAAa,EAAE,WAAW;AAAA,IACjD;AAEA,mBAAe,cAAc;AAC3B,YAAMA,MAAAA,eAAe,YAAa;AAAA,IACpC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -92,8 +92,8 @@ const _sfc_main = {
|
|
92
92
|
}, SCAN_TIMEOUT);
|
93
93
|
} catch (e) {
|
94
94
|
console.error(e);
|
95
|
-
alert(`Ticket is not found, already used or deactivated!`);
|
96
95
|
isProcessing.value = false;
|
96
|
+
alert(`Ticket is not found, already used or deactivated!`);
|
97
97
|
}
|
98
98
|
}
|
99
99
|
async function setZoomRatio(event) {
|
package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ButtonCheck.vue.js","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <div class=\"square\"></div>\n <div class=\"zoom-ratio-wrapper\" v-if=\"minZoomRatio !== undefined && maxZoomRatio !== undefined\">\n <input type=\"range\" :min=\"minZoomRatio\" :max=\"maxZoomRatio\" @input=\"setZoomRatio\" />\n </div>\n <Button @click=\"stopScan\" class=\"bg-white t-black stop-scan-button\">Stop Scan</Button>\n <Button v-if=\"isTorchAvailable\" @click=\"toggleTorch\" class=\"bg-white torch-button\">\n Toggle Torch\n </Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\nconst isTorchAvailable = ref(false)\nconst minZoomRatio = ref(undefined)\nconst maxZoomRatio = ref(undefined)\nconst isProcessing = ref(false)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n const { available } = await BarcodeScanner.isTorchAvailable()\n isTorchAvailable.value = available\n})\n\nonUnmounted(async () => {\n await stopScan()\n})\n\nconst SCAN_TIMEOUT = 5000 // 5 секунд (можно изменить по вашему усмотрению)\n\nasync function startScan() {\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n document.querySelector('html')?.classList.add('barcode-scanner-active-html')\n isScanning.value = true\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n if (!isProcessing.value) {\n await processBarcode(result.barcode)\n }\n })\n await BarcodeScanner.startScan()\n const { zoomRatio: min } = await BarcodeScanner.getMinZoomRatio()\n const { zoomRatio: max } = await BarcodeScanner.getMaxZoomRatio()\n minZoomRatio.value = min\n maxZoomRatio.value = max\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active')\n document.querySelector('html')?.classList.remove('barcode-scanner-active-html')\n isScanning.value = false\n await BarcodeScanner.stopScan()\n await BarcodeScanner.removeAllListeners()\n } catch (e) {\n error.value = e.message\n alert(`Error stopping scan: ${error.value}`)\n }\n}\n\nasync function processBarcode(barcode) {\n if (isProcessing.value) return\n isProcessing.value = true\n try {\n if (!barcode || !barcode.rawValue) {\n throw new Error('Invalid barcode data')\n }\n console.log('barcode is', barcode)\n\n const response = await tickets.actions.update({ _id: barcode.rawValue, status: 'used', check: true })\n alert(\"Ticket checked. And it's all right!\")\n emits('qrcodecheck')\n\n // Устанавливаем таймаут перед следующим сканированием\n setTimeout(() => {\n isProcessing.value = false\n }, SCAN_TIMEOUT)\n\n } catch (e) {\n console.error(e)\n alert(`Ticket is not found, already used or deactivated!`)\n // Сбрасываем флаг isProcessing в случае ошибки, чтобы можно было попробовать снова\n
|
1
|
+
{"version":3,"file":"ButtonCheck.vue.js","sources":["../../../../../../../src/modules/events/components/elements/ButtonCheck.vue"],"sourcesContent":["<template>\n <div>\n <Button @click=\"startScan\" class=\"bg-main button-small radius-extra button\">\n Check Tickets\n </Button>\n <div v-if=\"isScanning\" class=\"barcode-scanner-modal\">\n <div class=\"square\"></div>\n <div class=\"zoom-ratio-wrapper\" v-if=\"minZoomRatio !== undefined && maxZoomRatio !== undefined\">\n <input type=\"range\" :min=\"minZoomRatio\" :max=\"maxZoomRatio\" @input=\"setZoomRatio\" />\n </div>\n <Button @click=\"stopScan\" class=\"bg-white t-black stop-scan-button\">Stop Scan</Button>\n <Button v-if=\"isTorchAvailable\" @click=\"toggleTorch\" class=\"bg-white torch-button\">\n Toggle Torch\n </Button>\n </div>\n </div>\n</template>\n\n<script setup>\nimport { ref, onMounted, onUnmounted } from 'vue'\nimport { BarcodeScanner } from '@capacitor-mlkit/barcode-scanning'\nimport Button from '@pf/src/components/Button/Button.vue'\nimport * as tickets from '@pf/src/modules/events/store/tickets'\n\nconst emits = defineEmits(['qrcodecheck'])\nconst error = ref('')\nconst isScanning = ref(false)\nconst isTorchAvailable = ref(false)\nconst minZoomRatio = ref(undefined)\nconst maxZoomRatio = ref(undefined)\nconst isProcessing = ref(false)\n\nonMounted(async () => {\n const { supported } = await BarcodeScanner.isSupported()\n if (!supported) {\n error.value = 'Barcode scanning is not supported on this device'\n }\n const { available } = await BarcodeScanner.isTorchAvailable()\n isTorchAvailable.value = available\n})\n\nonUnmounted(async () => {\n await stopScan()\n})\n\nconst SCAN_TIMEOUT = 5000 // 5 секунд (можно изменить по вашему усмотрению)\n\nasync function startScan() {\n try {\n const { camera } = await BarcodeScanner.checkPermissions()\n if (camera !== 'granted') {\n const { camera: newStatus } = await BarcodeScanner.requestPermissions()\n if (newStatus !== 'granted') {\n throw new Error('Camera permission is required to scan barcodes')\n }\n }\n document.querySelector('body')?.classList.add('barcode-scanner-active')\n document.querySelector('html')?.classList.add('barcode-scanner-active-html')\n isScanning.value = true\n await BarcodeScanner.addListener('barcodeScanned', async (result) => {\n if (!isProcessing.value) {\n await processBarcode(result.barcode)\n }\n })\n await BarcodeScanner.startScan()\n const { zoomRatio: min } = await BarcodeScanner.getMinZoomRatio()\n const { zoomRatio: max } = await BarcodeScanner.getMaxZoomRatio()\n minZoomRatio.value = min\n maxZoomRatio.value = max\n } catch (e) {\n error.value = e.message\n alert(`Error: ${error.value}`)\n }\n}\n\nasync function stopScan() {\n try {\n document.querySelector('body')?.classList.remove('barcode-scanner-active')\n document.querySelector('html')?.classList.remove('barcode-scanner-active-html')\n isScanning.value = false\n await BarcodeScanner.stopScan()\n await BarcodeScanner.removeAllListeners()\n } catch (e) {\n error.value = e.message\n alert(`Error stopping scan: ${error.value}`)\n }\n}\n\nasync function processBarcode(barcode) {\n if (isProcessing.value) return\n isProcessing.value = true\n try {\n if (!barcode || !barcode.rawValue) {\n throw new Error('Invalid barcode data')\n }\n console.log('barcode is', barcode)\n\n const response = await tickets.actions.update({ _id: barcode.rawValue, status: 'used', check: true })\n alert(\"Ticket checked. And it's all right!\")\n emits('qrcodecheck')\n\n // Устанавливаем таймаут перед следующим сканированием\n setTimeout(() => {\n isProcessing.value = false\n }, SCAN_TIMEOUT)\n\n } catch (e) {\n console.error(e)\n isProcessing.value = false\n alert(`Ticket is not found, already used or deactivated!`)\n // Сбрасываем флаг isProcessing в случае ошибки, чтобы можно было попробовать снова\n \n }\n}\n\nasync function setZoomRatio(event) {\n const zoomRatio = parseFloat(event.target.value)\n await BarcodeScanner.setZoomRatio({ zoomRatio })\n}\n\nasync function toggleTorch() {\n await BarcodeScanner.toggleTorch()\n}\n</script>\n\n<style>\n.barcode-scanner-modal {\n visibility: visible;\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0, 0, 0, 0);\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n}\n\n.square {\n width: 200px;\n height: 200px;\n border: 2px solid white;\n border-radius: 10px;\n}\n\n.zoom-ratio-wrapper {\n width: 80%;\n margin-top: 20px;\n}\n\n.stop-scan-button,\n.torch-button {\n margin-top: 20px;\n}\n\n/* Existing styles */\nbody.barcode-scanner-active {\n visibility: hidden !important;\n background: transparent !important;\n --background: transparent;\n --ion-background-color: transparent;\n}\n\nhtml.barcode-scanner-active-html {\n background: transparent !important;\n}\n</style>\n"],"names":["tickets.actions"],"mappings":";;;;;;;;;;;;;;AA6CA,MAAM,eAAe;;;;;AArBrB,UAAM,QAAQ;AACd,UAAM,QAAQ,IAAI,EAAE;AACpB,UAAM,aAAa,IAAI,KAAK;AAC5B,UAAM,mBAAmB,IAAI,KAAK;AAClC,UAAM,eAAe,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