@scandit/web-datacapture-barcode 8.3.1 → 8.4.0

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 (122) hide show
  1. package/build/js/{SparkScanView-Cwz62wQh.d.ts → SparkScanView-DA3lM65w.d.ts} +0 -12
  2. package/build/js/ar/BarcodeAr.js +1 -1
  3. package/build/js/ar/BarcodeArFeedback.js +1 -1
  4. package/build/js/ar/BarcodeArPresenter.d.ts +0 -2
  5. package/build/js/ar/BarcodeArPresenter.js +1 -1
  6. package/build/js/ar/BarcodeArView.d.ts +2 -4
  7. package/build/js/ar/BarcodeArView.js +1 -1
  8. package/build/js/chunks/chunk-4AF7CEVC.js +1 -0
  9. package/build/js/chunks/chunk-5A3VQBKX.js +1 -0
  10. package/build/js/chunks/chunk-BDVUCWIR.js +1 -0
  11. package/build/js/chunks/{chunk-AKBHAMGH.js → chunk-D3EYLYMV.js} +1 -1
  12. package/build/js/chunks/chunk-DLQZYEGL.js +1 -0
  13. package/build/js/chunks/chunk-E4E7YAFV.js +1 -0
  14. package/build/js/chunks/chunk-F4EPKG6F.js +1 -0
  15. package/build/js/chunks/chunk-GCXWZHE6.js +1 -0
  16. package/build/js/chunks/{chunk-MZI3LJ62.js → chunk-GEYDSROX.js} +1 -1
  17. package/build/js/chunks/chunk-H7B3Z5IN.js +1 -0
  18. package/build/js/chunks/{chunk-L7F6BIBX.js → chunk-IIKG5XTG.js} +1 -1
  19. package/build/js/chunks/chunk-IJOTIY4J.js +1 -0
  20. package/build/js/chunks/chunk-JT2GDIAM.js +2 -0
  21. package/build/js/chunks/chunk-M7SLG4OU.js +1 -0
  22. package/build/js/chunks/chunk-PIJI7RGW.js +2 -0
  23. package/build/js/chunks/chunk-PIREZFTI.js +2 -0
  24. package/build/js/chunks/chunk-PTXYWRIN.js +1 -0
  25. package/build/js/chunks/{chunk-EWBTYHV5.js → chunk-QGQK7I7Q.js} +1 -1
  26. package/build/js/chunks/chunk-S4QFMFLQ.js +1 -0
  27. package/build/js/chunks/chunk-SEKJJJ3O.js +1 -0
  28. package/build/js/chunks/{chunk-2C5FYNVC.js → chunk-TIIOVGLO.js} +1 -1
  29. package/build/js/chunks/{chunk-IRRLM7ZZ.js → chunk-VLLMY76J.js} +1 -1
  30. package/build/js/chunks/chunk-XKYLJ6V4.js +1 -0
  31. package/build/js/chunks/{chunk-2AKUWJW7.js → chunk-ZI65J3L4.js} +1 -1
  32. package/build/js/defaults/Defaults.js +1 -1
  33. package/build/js/find/BarcodeFind.js +1 -1
  34. package/build/js/find/BarcodeFindItem.d.ts +5 -0
  35. package/build/js/find/BarcodeFindItem.js +1 -1
  36. package/build/js/find/BarcodeFindPresenter.js +1 -1
  37. package/build/js/find/BarcodeFindView.d.ts +9 -0
  38. package/build/js/find/BarcodeFindView.js +1 -1
  39. package/build/js/find/BarcodeFindViewUiListener.d.ts +1 -0
  40. package/build/js/find/index.js +1 -1
  41. package/build/js/find/ui/atoms/Dot.d.ts +5 -1
  42. package/build/js/find/ui/atoms/Dot.js +1 -1
  43. package/build/js/index.d.ts +1 -1
  44. package/build/js/index.js +1 -1
  45. package/build/js/moduleLoader.js +1 -1
  46. package/build/js/spark/index.d.ts +1 -1
  47. package/build/js/spark/index.js +1 -1
  48. package/build/js/spark/ui/SparkScanCameraManager.d.ts +30 -0
  49. package/build/js/spark/ui/SparkScanCameraManager.js +1 -0
  50. package/build/js/spark/ui/SparkScanOverlayManager.d.ts +41 -0
  51. package/build/js/spark/ui/SparkScanOverlayManager.js +1 -0
  52. package/build/js/spark/ui/SparkScanTimeoutManager.d.ts +32 -0
  53. package/build/js/spark/ui/SparkScanTimeoutManager.js +1 -0
  54. package/build/js/spark/ui/SparkScanView.d.ts +1 -1
  55. package/build/js/spark/ui/SparkScanView.js +1 -1
  56. package/build/js/spark/ui/SparkScanViewIcon.d.ts +2 -0
  57. package/build/js/spark/ui/SparkScanViewIcon.js +1 -1
  58. package/build/js/spark/ui/SparkScanViewMiniPreview.d.ts +2 -0
  59. package/build/js/spark/ui/SparkScanViewMiniPreview.js +1 -1
  60. package/build/js/spark/ui/SparkScanViewPresenter.d.ts +12 -21
  61. package/build/js/spark/ui/SparkScanViewPresenter.js +1 -1
  62. package/build/js/spark/ui/SparkScanViewToast.d.ts +2 -0
  63. package/build/js/spark/ui/SparkScanViewToast.js +1 -1
  64. package/build/js/spark/ui/SparkScanViewToolbar.d.ts +2 -0
  65. package/build/js/spark/ui/SparkScanViewToolbar.js +1 -1
  66. package/build/js/spark/ui/SparkScanViewTriggerButton.d.ts +2 -0
  67. package/build/js/spark/ui/SparkScanViewTriggerButton.js +1 -1
  68. package/build/js/spark/ui/SparkScanViewUiListener.d.ts +1 -1
  69. package/build/js/spark/ui/SparkScanViewVisualFeedback.d.ts +2 -1
  70. package/build/js/spark/ui/SparkScanViewVisualFeedback.js +1 -1
  71. package/build/js/spark/ui/index.d.ts +3 -1
  72. package/build/js/spark/ui/index.js +1 -1
  73. package/build/js/worker/BarcodeArMode.d.ts +1 -1
  74. package/build/js/worker/BarcodeBatchMode.d.ts +1 -1
  75. package/build/js/worker/BarcodeCaptureMode.d.ts +1 -1
  76. package/build/js/worker/BarcodeCaptureWorkerManager.d.ts +1 -1
  77. package/build/js/worker/BarcodeCaptureWorkerManager.js +1 -1
  78. package/build/js/worker/BarcodeFindMode.d.ts +1 -1
  79. package/build/js/worker/SparkScanMode.d.ts +1 -1
  80. package/build/js/worker/WorkerMain.d.ts +1 -1
  81. package/build/js/worker/WorkerMain.js +1 -1
  82. package/build/js/worker/barcodeCapture.inlineWorker.js +1 -1
  83. package/build/js/worker/dataCaptureEngine.d.ts +1 -1
  84. package/build/js/worker/dataCaptureEngine.js +1 -1
  85. package/build/js/worker/dataCaptureWorkerRelated.d.ts +1 -1
  86. package/build/js/worker/index.d.ts +1 -1
  87. package/package.json +2 -2
  88. package/sdc-lib/resources/models/barcode_1d_scanlines_reconstruction.5c2e5da7e592.model +0 -0
  89. package/sdc-lib/resources/models/barcode_keypoints_oned.c499e5bd6ed4.model +0 -0
  90. package/sdc-lib/resources/models/barcode_label_localization_mslc_model_smartphone.29decf3dd9e6.model +0 -0
  91. package/sdc-lib/resources/models/id_outline_localization_model_kpts.b74ff5cc58cf.model +0 -0
  92. package/sdc-lib/resources/models/ocr_attention.dd4572d2c642.model +0 -0
  93. package/sdc-lib/resources/models/via_id_template_database.488e01f034cb.model +0 -0
  94. package/sdc-lib/scandit-datacapture-sdk-barcode-pthreads.js +1 -1
  95. package/sdc-lib/scandit-datacapture-sdk-barcode-pthreads.wasm +0 -0
  96. package/sdc-lib/scandit-datacapture-sdk-barcode-simd-pthreads.js +1 -1
  97. package/sdc-lib/scandit-datacapture-sdk-barcode-simd-pthreads.wasm +0 -0
  98. package/sdc-lib/scandit-datacapture-sdk-barcode-simd.js +1 -1
  99. package/sdc-lib/scandit-datacapture-sdk-barcode-simd.wasm +0 -0
  100. package/sdc-lib/scandit-datacapture-sdk-barcode.js +1 -1
  101. package/sdc-lib/scandit-datacapture-sdk-barcode.wasm +0 -0
  102. package/build/js/ar/ui/molecules/private/ZoomSwitchButton.d.ts +0 -26
  103. package/build/js/ar/ui/molecules/private/ZoomSwitchButton.js +0 -1
  104. package/build/js/chunks/chunk-3MEAY6PU.js +0 -2
  105. package/build/js/chunks/chunk-4UNEYE55.js +0 -1
  106. package/build/js/chunks/chunk-5JT5U4EK.js +0 -1
  107. package/build/js/chunks/chunk-5Q3AHWJL.js +0 -2
  108. package/build/js/chunks/chunk-6KDQGEUY.js +0 -1
  109. package/build/js/chunks/chunk-6KWMOMD7.js +0 -1
  110. package/build/js/chunks/chunk-EQ2LJAHI.js +0 -2
  111. package/build/js/chunks/chunk-HTKUJZG2.js +0 -1
  112. package/build/js/chunks/chunk-JZQPLDGE.js +0 -1
  113. package/build/js/chunks/chunk-LWUFGA5M.js +0 -1
  114. package/build/js/chunks/chunk-MHOUYN7K.js +0 -1
  115. package/build/js/chunks/chunk-PJKEAS4K.js +0 -1
  116. package/build/js/chunks/chunk-QXULNTBU.js +0 -1
  117. package/build/js/chunks/chunk-RLWDCJ7V.js +0 -1
  118. package/build/js/chunks/chunk-TYWXGGDK.js +0 -1
  119. package/sdc-lib/resources/models/barcode_keypoints_oned.6697cfdb9ce4.model +0 -0
  120. package/sdc-lib/resources/models/id_outline_localization_model_kpts.b7f16ab1f44c.model +0 -0
  121. package/sdc-lib/resources/models/via_id_template_database.578ae388d1d7.model +0 -0
  122. /package/build/js/chunks/{chunk-KHHN2PZL.js → chunk-F2FSFE64.js} +0 -0
@@ -122,12 +122,6 @@ declare class SparkScanView extends ScanditHTMLElement {
122
122
  private _maybeAutoPrepareScanning;
123
123
  private connectedCallback;
124
124
  private disconnectedCallback;
125
- private setTorchAvailable;
126
- private setZoomAvailable;
127
- private switchToIdleState;
128
- private switchToActiveState;
129
- private switchToInactiveState;
130
- private switchToErrorState;
131
125
  private onMiniPreviewPointerUp;
132
126
  private onMiniPreviewPointerMove;
133
127
  private onMiniPreviewButtonTap;
@@ -150,10 +144,6 @@ declare class SparkScanView extends ScanditHTMLElement {
150
144
  private onTorchButtonTap;
151
145
  private onMiniPreviewTimeoutFinished;
152
146
  private onOrientationChange;
153
- private targetModeButtonTapped;
154
- private scanningBehaviorButtonTapped;
155
- private torchButtonTapped;
156
- private cameraSwitchButtonTapped;
157
147
  private getDefaultCssVariableValue;
158
148
  private setTriggerButtonPressedColor;
159
149
  private readonly miniPreviewListeners;
@@ -162,8 +152,6 @@ declare class SparkScanView extends ScanditHTMLElement {
162
152
  private removeMiniPreviewListeners;
163
153
  private addTriggerButtonListeners;
164
154
  private removeTriggerButtonListeners;
165
- private repositionElementsIfOutOfBounds;
166
- private repositionMiniPreviewIfOutOfBounds;
167
155
  private repositionTriggerButtonIfOutOfBounds;
168
156
  }
169
157
  declare global {
@@ -1 +1 @@
1
- export{a as BarcodeAr}from'../chunks/chunk-EWBTYHV5.js';
1
+ export{a as BarcodeAr}from'../chunks/chunk-QGQK7I7Q.js';
@@ -1 +1 @@
1
- export{a as BarcodeArFeedback}from'../chunks/chunk-KHHN2PZL.js';
1
+ export{a as BarcodeArFeedback}from'../chunks/chunk-F2FSFE64.js';
@@ -26,7 +26,6 @@ declare class BarcodeArPresenter implements BarcodeArListener {
26
26
  private readonly cameraSettings;
27
27
  private torchState;
28
28
  private cameraSupportMap;
29
- private zoomFactor;
30
29
  private cameras;
31
30
  readonly barcodeAr: BarcodeAr;
32
31
  constructor(view: BarcodeArView, context: DataCaptureContext, barcodeAr: BarcodeAr, viewSettings: BarcodeArViewSettings, cameraSettings: CameraSettings);
@@ -41,7 +40,6 @@ declare class BarcodeArPresenter implements BarcodeArListener {
41
40
  didUpdateSession(_: BarcodeAr, session: BarcodeArSession): void;
42
41
  private isTorchAvailableForCurrentCamera;
43
42
  onTorchButtonClicked(): Promise<void>;
44
- onZoomButtonClicked(): Promise<void>;
45
43
  onCameraSwitchButtonClicked(): Promise<void>;
46
44
  }
47
45
 
@@ -1 +1 @@
1
- export{a as BarcodeArPresenter}from'../chunks/chunk-5JT5U4EK.js';
1
+ export{a as BarcodeArPresenter}from'../chunks/chunk-E4E7YAFV.js';
@@ -28,12 +28,11 @@ declare class BarcodeArView extends ScanditHTMLElement {
28
28
  private layout;
29
29
  private torchSwitchIconButton;
30
30
  private cameraSwitchButton;
31
- private zoomButton;
31
+ private zoomSwitchControl;
32
32
  private _shouldShowTorchControl;
33
33
  private _isTorchAvailable;
34
34
  private onTorchButtonClickHandler;
35
35
  private onCameraSwitchButtonHandler;
36
- private onZoomButtonHandler;
37
36
  private onLayoutPointerDownHandler;
38
37
  private onInfoAnnotationTapHandler;
39
38
  private backdrop;
@@ -66,8 +65,7 @@ declare class BarcodeArView extends ScanditHTMLElement {
66
65
  private toggleTorchIcon;
67
66
  private onTorchButtonClick;
68
67
  private onCameraSwitchButtonClick;
69
- private onZoomButtonClick;
70
- private changeZoomButtonIcon;
68
+ private installZoomControl;
71
69
  private connectedCallback;
72
70
  private disconnectedCallback;
73
71
  private isPopoverAnnotation;
@@ -1 +1 @@
1
- export{a as BarcodeArView}from'../chunks/chunk-JZQPLDGE.js';
1
+ export{a as BarcodeArView}from'../chunks/chunk-H7B3Z5IN.js';
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-32CJYODR.js';import {a as a$1}from'./chunk-KGVFOBRT.js';var S=class{constructor(a){this.settings=a;}get isReady(){return this.sparkScanOverlay!=null&&this.smartScanSelectionOverlay!=null}async prepareScanning(a$2,r,s){var e;this.sparkScanOverlay=await a.withSparkScanForView(a$2,r),await this.sparkScanOverlay.setShouldRemoveLocationsAfterScan(s==="continuous"),this.smartScanSelectionOverlay=a$1.forMode(a$2),this.smartScanSelectionOverlay.setBrush((e=this.settings.smartSelectionCandidateBrush)!=null?e:this.sparkScanOverlay.getBrush()),this.smartScanSelectionOverlay.setErrorBrush(this.sparkScanOverlay.getErrorBrush());}async onSwitchToActiveState(a,r,s){var e,t,i;s&&await this.setBrushToOverlays(this.brushForFeedback(s)),await((e=this.sparkScanOverlay)==null?void 0:e.setShouldRemoveLocationsAfterScan(r)),a==="active"?await((t=this.sparkScanOverlay)==null?void 0:t.overlayReadyForDraw()):await((i=this.sparkScanOverlay)==null?void 0:i.discardEnqueuedData());}async onSwitchToIdleState(){var a;await((a=this.sparkScanOverlay)==null?void 0:a.overlayReadyForDraw());}async setBrushForFeedback(a){await this.setBrushToOverlays(this.brushForFeedback(a));}async overlayReadyForDraw(){var a;await((a=this.sparkScanOverlay)==null?void 0:a.overlayReadyForDraw());}async onSwitchToErrorState(a){var r,s,e,t;(r=this.smartScanSelectionOverlay)==null||r.setErrorBrush(a.brush),await((s=this.sparkScanOverlay)==null?void 0:s.setErrorBrush(a.brush)),await((e=this.sparkScanOverlay)==null?void 0:e.overlayReadyForDraw()),await((t=this.sparkScanOverlay)==null?void 0:t.setShouldRemoveLocationsAfterScan(a.resumeCapturingDelay===0));}async onSwitchedToSmartScanSelection(a){this.sparkScanOverlay&&this.smartScanSelectionOverlay&&(await(a==null?void 0:a.removeOverlay(this.sparkScanOverlay)),await(a==null?void 0:a.addOverlay(this.smartScanSelectionOverlay)));}async onSwitchedAwayFromSmartScanSelection(a){this.sparkScanOverlay&&this.smartScanSelectionOverlay&&(await(a==null?void 0:a.removeOverlay(this.smartScanSelectionOverlay)),await(a==null?void 0:a.addOverlay(this.sparkScanOverlay)));}async setShouldRemoveLocationsAfterScan(a){var r;await((r=this.sparkScanOverlay)==null?void 0:r.setShouldRemoveLocationsAfterScan(a));}async setShouldDrawViewfinder(a){var r;await((r=this.sparkScanOverlay)==null?void 0:r.setShouldDrawViewfinder(a));}setRadius(a){var r;(r=this.sparkScanOverlay)==null||r.setRadius(a);}async setBrushToOverlays(a){var r,s,e;(s=this.smartScanSelectionOverlay)==null||s.setBrush((r=this.settings.smartSelectionCandidateBrush)!=null?r:a),await((e=this.sparkScanOverlay)==null?void 0:e.setBrush(a));}brushForFeedback(a){return a.brush}};export{S as a};
@@ -0,0 +1 @@
1
+ import {Color}from'@scandit/web-datacapture-core';import {primaryTeal100,gray900}from'@scandit/web-datacapture-core/build/js/private/ui/colors.js';import {ScanditHTMLElement,html,defineCustomElements,css}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var e=class e extends ScanditHTMLElement{constructor(){var r;super();let t=this.attachShadow({mode:"open"});t.innerHTML=html`<div class="dot"><div class="inner-dot"></div></div>`,t.append(e.createStyleElement().cloneNode(true)),this.dot=(r=this.shadowRoot)==null?void 0:r.querySelector(".dot");}set size(t){this.render({propChanged:"size",value:String(t)});}get size(){return Number(this.getAttribute("size"))}get variant(){return this.getAttribute("variant")}set variant(t){this.render({propChanged:"variant",value:t});}get pulse(){return !!this.getAttribute("pulse")}set pulse(t){this.render({propChanged:"pulse",value:t.toString()});}static create(){return e.createWithColors(primaryTeal100,Color.fromHex("#ffff"))}static createWithColors(t,r){e.register();let o=document.createElement(e.tag);return o.setPrimaryColor(t),o.setSecondaryColor(r),o}static createWithBrush(t,r){e.register();let o=document.createElement(e.tag);return o.setPrimaryColor(t.fillColor),o.setSecondaryColor(r),o.setStrokeColor(t.strokeColor),o.setStrokeWidth(t.strokeWidth),o}static register(){defineCustomElements({[e.tag]:e});}static createStyleElement(){return css`:host{display:block;--size:14px}.dot{--primary:#${primaryTeal100.toJSON()};--secondary:#${primaryTeal100.toJSON()};--primary-no-opacity:#${primaryTeal100.withAlpha(0).toJSON()};background-color:#fff;border-radius:50%;box-shadow:0 1px 2px 0 #${gray900.withAlpha(.3).toJSON()};height:var(--size);position:relative;width:var(--size)}.dot.pulse{animation:pulse 2s infinite}.dot.target{height:calc(var(--size) + var(--size)*1/1.285);width:calc(var(--size) + var(--size)*1/1.285)}.dot.target .inner-dot{background-color:var(--primary);height:calc(var(--size) + var(--size)*1/3);width:calc(var(--size) + var(--size)*1/3)}.inner-dot{background-color:var(--secondary);border-radius:50%;height:var(--size);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--size)}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--primary)}70%{box-shadow:0 0 0 var(--size) var(--primary-no-opacity)}to{box-shadow:0 0 0 0 var(--primary-no-opacity)}}`}connectedCallback(){}setPrimaryColor(t){this.dot.style.setProperty("--primary",`#${t.toJSON()}`),this.dot.style.setProperty("--primary-no-opacity",`#${t.withAlpha(0).toJSON()}`);}setSecondaryColor(t){this.dot.style.setProperty("--secondary",`#${t.toJSON()}`);}setStrokeColor(t){this.dot.style.setProperty("border-color",`#${t.toJSON()}`),this.dot.style.setProperty("border-style","solid");}setStrokeWidth(t){this.dot.style.setProperty("border-width",`${t}px`);}render({propChanged:t,value:r}){switch(t){case "size":{this.dot.style.setProperty("--size",`${r}px`);break}case "variant":{this.dot.classList.toggle("target",r==="target");break}case "pulse":{this.dot.classList.toggle("pulse",r==="true"||this.hasAttribute("pulse"));break}}}attributeChangedCallback(t,r,o){this.render({propChanged:t,value:o});}};e.tag="scandit-find-dot",e.observedAttributes=["size","variant","pulse"];var s=e;export{s as a};
@@ -0,0 +1 @@
1
+ import {e}from'./chunk-YBD5JYCX.js';import {ScanditHTMLElement,css,defineCustomElements,Timeout,html}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var i=class i extends ScanditHTMLElement{get styleElement(){return (this._styleElement)!=null||(this._styleElement=css`${e}{min-width:calc(100% - 32px);opacity:0;pointer-events:none;transition:.3s ease;user-select:none;width:fit-content}${e}[visible]{opacity:1}.${e}{border-radius:4px;font-family:sans-serif;font-size:14px;font-weight:500;margin:0 auto;padding:8px 12px;width:fit-content}.${e}--${"info"}{background:#fff}.${e}--${"warning"}{background:#fbc02c}.${e}--${"error"}{background:#fa4446;color:#fff}`),this._styleElement}get type(){var e;return (e=this.getAttribute("type"))!=null?e:"info"}set type(e){this.setAttribute("type",e);}get message(){var e;return (e=this.getAttribute("message"))!=null?e:""}set message(e){this.setAttribute("message",e);}get visible(){return this.hasAttribute("visible")}set visible(e){this.toggleAttribute("visible",e);}static create(){return defineCustomElements({[e]:i}),document.createElement(e)}show(e,s,a){this.hide(),this.type=e,this.message=s,this.visible=true,this.timeout=new Timeout(a,this.hide.bind(this)),this.timeout.start();}hide(){var e;(e=this.timeout)==null||e.stop(),this.visible=false;}render(){this.innerHTML=html`<div class="${e} ${e}--${this.type}">${this.message}</div>`;}connectedCallback(){this.render(),this.append(this.styleElement);}disconnectedCallback(){this.hide();}attributeChangedCallback(e,s,a){a!==s&&(this.render(),this.append(this.styleElement));}};i.observedAttributes=["type","message"];var n=i;export{n as a};
@@ -1 +1 @@
1
- import {a as a$3}from'./chunk-55SHUUX6.js';import {a}from'./chunk-M4AENTE5.js';import {a as a$2,b}from'./chunk-HTKUJZG2.js';import {a as a$1}from'./chunk-DHKABHFE.js';import {CameraSettings,convertToPublicFrameData}from'@scandit/web-datacapture-core';import {warnMultithreadingUnavailable}from'@scandit/web-datacapture-core/build/js/private/utils/warnMultithreadingUnavailable.js';var l=class u{constructor(){this.feedback=a.createDefaultFeedback();this.skipSerialization=true;this.type="barcodeFind";this._isEnabled=true;this._context=null;this.listeners=new Set;this.privateListeners=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);this._transformer=null;}static get recommendedCameraSettings(){return new CameraSettings(a$1.CameraSettings.settings)}get context(){return this._context}get allListeners(){return [...this.privateListeners,...this.listeners]}static async forSettings(e){warnMultithreadingUnavailable();let a=new u;return a.settings=e,a}isEnabled(){return this._isEnabled}async setEnabled(e){var a;this._isEnabled=e,await this.workerCommand("barcodeFindSetEnabled",{enabled:e}),await((a=this.context)==null?void 0:a.update([{type:"modeEnabled",newValue:e}],{updateContext:false}));}async applySettings(e){this.settings=e,await this.workerCommand("barcodeFindApplySettings",{settings:e.toJSONObject()});}addListener(e){this.listeners.add(e);}removeListener(e){this.listeners.delete(e);}async setItemList(e){var a;for(let r of this.privateListeners)(a=r.onSetItemList)==null||a.call(r,e);return this.workerCommand("barcodeFindSetItemList",{itemList:e.map(r=>r.toJSONObject())})}async setBarcodeTransformer(e){var a;return this._transformer=e,this.workerCommand("barcodeFindSetTransformerFunction",{functionAsString:(a=this._transformer)==null?void 0:a.transformBarcodeData.toString()})}async start(){return this.workerCommand("barcodeFindSearchStart",{})}async stop(){return this.workerCommand("barcodeFindSearchStop",{})}async pause(){return this.workerCommand("barcodeFindSearchPause",{})}toJSONObject(){return {type:this.type,enabled:this.isEnabled(),settings:this.settings.toJSONObject()}}async workerCommand(e,a){this.context!=null&&await this.context.workerCommand(e,a);}async attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener),await this.workerCommand("barcodeFindForSettings",{settings:this.settings.toJSONObject()});}async detachedFromContext(){var e;await this.workerCommand("barcodeFindModeRemove",{}),(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}async onWorkerMessage(e){var a,r,d;switch(e.type){case "barcodeFindDidUpdateSession":{if(this._context==null)return;for(let t of this.allListeners)(a=t.onDidUpdateSession)==null||a.call(t,this,a$3.fromJSON(e.payload.session),convertToPublicFrameData(e.payload.frameData,this._context));break}case "barcodeFindSearchPaused":{for(let t of this.allListeners){let i=e.payload.foundItems.map(o=>new a$2(new b(o),null));t.didPauseSearch(i);}break}case "barcodeFindSearchStarted":{for(let t of this.allListeners)t.didStartSearch();break}case "barcodeFindSearchStopped":{for(let t of this.allListeners){let i=e.payload.foundItems.map(o=>new a$2(new b(o),null));t.didStopSearch(i);}break}case "barcodeFindListUpdatedFeedback":{for(let t of this.allListeners)(r=t.onFindListUpdatedFeedback)==null||r.call(t);break}case "barcodeFindFeedback":{for(let t of this.allListeners)(d=t.onFeedback)==null||d.call(t);break}}}addPrivateListener(e){this.privateListeners.add(e);}removePrivateListener(e){this.privateListeners.delete(e);}};export{l as a};
1
+ import {a as a$3}from'./chunk-55SHUUX6.js';import {a as a$2,b}from'./chunk-XKYLJ6V4.js';import {a}from'./chunk-M4AENTE5.js';import {a as a$1}from'./chunk-DHKABHFE.js';import {CameraSettings,convertToPublicFrameData}from'@scandit/web-datacapture-core';import {warnMultithreadingUnavailable}from'@scandit/web-datacapture-core/build/js/private/utils/warnMultithreadingUnavailable.js';var l=class u{constructor(){this.feedback=a.createDefaultFeedback();this.skipSerialization=true;this.type="barcodeFind";this._isEnabled=true;this._context=null;this.listeners=new Set;this.privateListeners=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);this._transformer=null;}static get recommendedCameraSettings(){return new CameraSettings(a$1.CameraSettings.settings)}get context(){return this._context}get allListeners(){return [...this.privateListeners,...this.listeners]}static async forSettings(e){warnMultithreadingUnavailable();let a=new u;return a.settings=e,a}isEnabled(){return this._isEnabled}async setEnabled(e){var a;this._isEnabled=e,await this.workerCommand("barcodeFindSetEnabled",{enabled:e}),await((a=this.context)==null?void 0:a.update([{type:"modeEnabled",newValue:e}],{updateContext:false}));}async applySettings(e){this.settings=e,await this.workerCommand("barcodeFindApplySettings",{settings:e.toJSONObject()});}addListener(e){this.listeners.add(e);}removeListener(e){this.listeners.delete(e);}async setItemList(e){var a;for(let r of this.privateListeners)(a=r.onSetItemList)==null||a.call(r,e);return this.workerCommand("barcodeFindSetItemList",{itemList:e.map(r=>r.toJSONObject())})}async setBarcodeTransformer(e){var a;return this._transformer=e,this.workerCommand("barcodeFindSetTransformerFunction",{functionAsString:(a=this._transformer)==null?void 0:a.transformBarcodeData.toString()})}async start(){return this.workerCommand("barcodeFindSearchStart",{})}async stop(){return this.workerCommand("barcodeFindSearchStop",{})}async pause(){return this.workerCommand("barcodeFindSearchPause",{})}toJSONObject(){return {type:this.type,enabled:this.isEnabled(),settings:this.settings.toJSONObject()}}async workerCommand(e,a){this.context!=null&&await this.context.workerCommand(e,a);}async attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener),await this.workerCommand("barcodeFindForSettings",{settings:this.settings.toJSONObject()});}async detachedFromContext(){var e;await this.workerCommand("barcodeFindModeRemove",{}),(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}async onWorkerMessage(e){var a,r,d;switch(e.type){case "barcodeFindDidUpdateSession":{if(this._context==null)return;for(let t of this.allListeners)(a=t.onDidUpdateSession)==null||a.call(t,this,a$3.fromJSON(e.payload.session),convertToPublicFrameData(e.payload.frameData,this._context));break}case "barcodeFindSearchPaused":{for(let t of this.allListeners){let i=e.payload.foundItems.map(o=>new a$2(new b(o),null));t.didPauseSearch(i);}break}case "barcodeFindSearchStarted":{for(let t of this.allListeners)t.didStartSearch();break}case "barcodeFindSearchStopped":{for(let t of this.allListeners){let i=e.payload.foundItems.map(o=>new a$2(new b(o),null));t.didStopSearch(i);}break}case "barcodeFindListUpdatedFeedback":{for(let t of this.allListeners)(r=t.onFindListUpdatedFeedback)==null||r.call(t);break}case "barcodeFindFeedback":{for(let t of this.allListeners)(d=t.onFeedback)==null||d.call(t);break}}}addPrivateListener(e){this.privateListeners.add(e);}removePrivateListener(e){this.privateListeners.delete(e);}};export{l as a};
@@ -0,0 +1 @@
1
+ import {a as a$1}from'./chunk-QCD3RIT4.js';import {a as a$5}from'./chunk-3OCPZ3OV.js';import {a as a$4}from'./chunk-4AF7CEVC.js';import {a as a$7}from'./chunk-S4QFMFLQ.js';import {a as a$6}from'./chunk-L6BUOAGT.js';import {a as a$3}from'./chunk-GCXWZHE6.js';import {b}from'./chunk-RU7XJPB3.js';import {a as a$2,b as b$1,c}from'./chunk-PMTVYYAY.js';import {c as c$1,b as b$2}from'./chunk-SZUPDKV5.js';import {a as a$8}from'./chunk-HDODW33D.js';import {a}from'./chunk-IIKG5XTG.js';import {Logger,DataCaptureView,Anchor,LogoStyle,TorchState,Color,NumberWithUnit,RadiusLocationSelection}from'@scandit/web-datacapture-core';import {SafeStorage}from'@scandit/web-datacapture-core/build/js/private/utils/safeStorage.js';function d(I,e,a){let t=a.value;return typeof t!="function"?(Logger.warn(`@afterPrepareScanning applied to non-function: ${e}`),a):t.constructor.name==="AsyncFunction"||t.constructor===(async()=>{}).constructor?(a.value=function(...n){return this._preparationPromise?this._preparationPromise.then(()=>t.apply(this,n)):Promise.reject(new Error(`prepare should be called before calling ${e} method`))},a):(Logger.warn(`@afterPrepareScanning applied to non-async method: ${e}`),a)}var s=class s{constructor(e,a){this._context=null;this._sparkScan=null;this._preparationPromise=null;this._stopScanningPromise=null;this._dataCaptureView=null;this.preferenceManager=new a$1(SafeStorage.getInstanceFor("localStorage"));this.defaultSuccessBrush=a$2.defaultSuccessBrush();this.defaultErrorBrush=a$2.defaultErrorBrush();this.sparkScanView=e,this.cameraManager=new a$3,this.setSparkScanViewSettings(a);}get camera(){return this.cameraManager.camera}set context(e){this._context!==e&&(this._preparationPromise=null,this._context=e,e&&(this.analyticsManager=b.forContext(e)));}get context(){return this._context}set sparkScan(e){this._sparkScan!==e&&(this._preparationPromise=null,this._sparkScan=e);}get sparkScan(){return this._sparkScan}get sparkScan$(){if(!this._sparkScan)throw new Error("SparkScan mode is required to be set before calling this method");return this._sparkScan}get context$(){if(!this._context)throw new Error("Context is required to be set before calling this method");return this._context}setSparkScanViewSettings(e){this.sparkScanViewSettings=e,this.overlayManager=new a$4(this.sparkScanViewSettings),this.stateManager=new a$5(this.sparkScanViewSettings,this.preferenceManager),this.feedbackManager=a$6.withDefaults(this.sparkScanViewSettings.soundEnabled,this.sparkScanViewSettings.hapticEnabled),this.timeoutManager=new a$7(this.sparkScanViewSettings,this);}get portraitOrientationTriggerButtonTranslateX(){var e;return (e=this.stateManager.portraitOrientationTriggerButtonTranslateX)!=null?e:this.defaultTriggerButtonTranslateX}get portraitOrientationTriggerButtonTranslateY(){var e;return (e=this.stateManager.portraitOrientationTriggerButtonTranslateY)!=null?e:this.defaultTriggerButtonTranslateY}get landscapeOrientationTriggerButtonTranslateX(){var e;return (e=this.stateManager.landscapeOrientationTriggerButtonTranslateX)!=null?e:this.defaultTriggerButtonTranslateX}get landscapeOrientationTriggerButtonTranslateY(){var e;return (e=this.stateManager.landscapeOrientationTriggerButtonTranslateY)!=null?e:this.defaultTriggerButtonTranslateY}get portraitOrientationMiniPreviewTranslateX(){var e;return (e=this.stateManager.portraitOrientationMiniPreviewTranslateX)!=null?e:this.defaultMiniPreviewTranslateX}get portraitOrientationMiniPreviewTranslateY(){var e;return (e=this.stateManager.portraitOrientationMiniPreviewTranslateY)!=null?e:this.defaultMiniPreviewTranslateY}get landscapeOrientationMiniPreviewTranslateX(){var e;return (e=this.stateManager.landscapeOrientationMiniPreviewTranslateX)!=null?e:this.defaultMiniPreviewTranslateX}get landscapeOrientationMiniPreviewTranslateY(){var e;return (e=this.stateManager.landscapeOrientationMiniPreviewTranslateY)!=null?e:this.defaultMiniPreviewTranslateY}get defaultTriggerButtonTranslateX(){return this.parentViewSizes.width-Math.min(this.parentViewSizes.width/3,110)-90/2}get defaultTriggerButtonTranslateY(){return this.parentViewSizes.height-Math.min(this.parentViewSizes.height/3,250)-90/2}get defaultMiniPreviewTranslateX(){return this.parentViewSizes.width-225-16}get parentViewSizes(){var e,a;return {width:(e=this.sparkScanView.parentElement.clientWidth)!=null?e:window.innerWidth,height:(a=this.sparkScanView.parentElement.clientHeight)!=null?a:window.innerHeight}}get defaultMiniPreviewTranslateY(){return 16}static forView(e,a){return new s(e,a)}async prepareScanning(e){if(this._preparationPromise)return this._preparationPromise;this._stopScanningPromise&&await this._stopScanningPromise,this._preparationPromise=this._internalPrepareScanning(e);try{await this._preparationPromise;}catch(a){throw this._preparationPromise=null,a}return this._preparationPromise}async _internalPrepareScanning(e){let a=this.context$,t=this.sparkScan$;this._dataCaptureView=await DataCaptureView.forContext(a),this._dataCaptureView.logoAnchor=Anchor.BottomCenter,this._dataCaptureView.logoStyle=LogoStyle.Minimal,this._dataCaptureView.setHiddenProperty("stopVideoTracksOnVisibilityChange",false),this._dataCaptureView.setHiddenProperty("freezeFrameWhenStoppingFrameSource",false),this._dataCaptureView.connectToElement(e);let i=await this.cameraManager.prepareScanning(a,this.sparkScanViewSettings);this.sparkScanView.setTorchAvailable(i.isTorchAvailable),this.sparkScanView.setZoomAvailable(i.isZoomAvailable),this.sparkScanView.cameraSwitchButtonTapped(i.isTorchAvailable,i.cameraPosition),await a.setMode(t),t.addListener(this),t.setDelegate(this),await this.overlayManager.prepareScanning(t,this._dataCaptureView,this.stateManager.scanningBehavior),this.analyticsManager.startSession({cameraPosition:this.camera.position,hapticEnabled:this.sparkScanViewSettings.hapticEnabled,scanningMode:this.stateManager.scanningMode,soundEnabled:this.sparkScanViewSettings.soundEnabled,torchState:this.camera.getDesiredTorchState()}),await this.applyPreferences(),await this.switchToIdleState();}async stopScanning(e){if(this._stopScanningPromise)return this._stopScanningPromise;if(this.stateManager.state!=="Initial"){this._preparationPromise=null,this._stopScanningPromise=this._internalStopScanning(e);try{await this._stopScanningPromise;}finally{this._stopScanningPromise=null;}}}async _internalStopScanning(e){var i;this.timeoutManager.stopCurrentTimeout();let a=this.context$,t=this.sparkScan$;await t.setEnabled(false),t.removeListener(this),t.setDelegate(void 0),await a.removeMode(t),await this.cameraManager.stopScanning(),(i=this._dataCaptureView)==null||i.detachFromElement(),this.analyticsManager.setSessionStopReason(e.sessionStopReason),this.setState("Initial");}async startScanning(){await this.switchToActiveState();}async pauseScanning(){await this.switchToInactiveState({sessionStopReason:"user"});}async onTriggerButtonPointerDown(){this.stateManager.triggerButtonPressed=true;}async onTriggerButtonTap(){switch(this.stateManager.state){case "Initial":{this.stateManager.triggerButtonPressed=false;return}case "idle":case "inactive":case "error":{await this.switchToActiveState({barcodeFeedback:this.tapBarcodeFeedback});return}case "active":{if(this.stateManager.inSmartScanSelection){this.timeoutManager.restartCurrentTimeout(),await this.sparkScan$.selectItemWithSmartScanSelection();return}await(this.stateManager.continuousModeEnabled?this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:this.silentBarcodeFeedback}):this.switchToActiveState({barcodeFeedback:this.tapBarcodeFeedback}));}}}async onTriggerButtonLongPressStart(){this.stateManager.triggerButtonPressed=true,this.sparkScanViewSettings.holdToScanEnabled&&(this.scanningBehaviorCache=this.stateManager.scanningBehavior,this.stateManager.scanningBehavior="continuous",this.stateManager.holdingToScan=true,await this.overlayManager.setShouldRemoveLocationsAfterScan(true),await this.switchToActiveState({barcodeFeedback:this.tapBarcodeFeedback}));}async onTriggerButtonLongPressEnd(){var e;this.sparkScanViewSettings.holdToScanEnabled&&this.stateManager.state!=="error"?(this.stateManager.scanningBehavior=(e=this.scanningBehaviorCache)!=null?e:"single",this.stateManager.holdingToScan=false,await this.overlayManager.setShouldRemoveLocationsAfterScan(this.stateManager.continuousModeEnabled),await this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:this.silentErrorBarcodeFeedback})):this.stateManager.triggerButtonPressed=false;}async onClickOutside(){this.stateManager.idleState||await this.switchToIdleState({emitTapFeedback:true});}async onVisibilityChange(){await this.switchToIdleState();}async onTargetModeButtonTap(e,a=this.feedbackManager.tapFeedback,t=true){var c,g;a.emit();let i=String(e),n={true:e&&this.stateManager.scanningMode instanceof b$2,false:!e&&this.stateManager.scanningMode instanceof c$1}[i];n&&(this.stateManager.scanningMode=this.stateManager.scanningMode.changeMode()),this.enableTargetModeLocationSelection(e),await this.overlayManager.setShouldDrawViewfinder(e),this.timeoutManager.restartCurrentTimeout(),this.sparkScanView.targetModeButtonTapped(e,t),n&&((g=(c=this.listener)==null?void 0:c.didChangeScanningMode)==null||g.call(c,this.stateManager.scanningMode),this.analyticsManager.setScanningMode(this.stateManager.scanningMode)),this.updateSizeControlVisibility();}async onScanningBehaviorButtonTap(e,a=this.feedbackManager.tapFeedback,t=true){a.emit(),this.stateManager.scanningMode=this.stateManager.scanningMode.copyWith(e?"continuous":"single"),await this.overlayManager.setShouldRemoveLocationsAfterScan(e),this.timeoutManager.restartCurrentTimeout(),this.sparkScanView.scanningBehaviorButtonTapped(e,t),this.analyticsManager.setScanningMode(this.stateManager.scanningMode);}async onBarcodeFindButtonTap(){var e,a;await this.switchToIdleState({sessionStopReason:"user",emitTapFeedback:true}),(a=(e=this.listener)==null?void 0:e.didTapBarcodeFindButton)==null||a.call(e,this.sparkScanView),this.timeoutManager.restartCurrentTimeout();}async onLabelCaptureButtonTap(){var e,a;await this.switchToIdleState({sessionStopReason:"user",emitTapFeedback:true}),(a=(e=this.listener)==null?void 0:e.didTapLabelCaptureButton)==null||a.call(e,this.sparkScanView),this.timeoutManager.restartCurrentTimeout();}async onCameraSwitchButtonTap(){if(this.feedbackManager.emitTapFeedback(),this.timeoutManager.restartCurrentTimeout(),!this.camera||this.stateManager.state==="error")return;let e=await this.cameraManager.onCameraSwitchButtonTap();e&&(this.sparkScanView.cameraSwitchButtonTapped(e.isTorchAvailable,e.cameraPosition),this.analyticsManager.setCameraPosition(e.cameraPosition));}async onTorchButtonTap(e,a=this.feedbackManager.tapFeedback,t=true){a.emit(),this.stateManager.torchState=e?TorchState.On:TorchState.Off,await this.cameraManager.onTorchButtonTap(this.stateManager.torchState),this.timeoutManager.restartCurrentTimeout(),this.sparkScanView.torchButtonTapped(e,t),this.analyticsManager.setTorchState(this.stateManager.torchState);}async onTriggerButtonCollapseTimeout(){this.stateManager.state!=="idle"&&this._preparationPromise&&await this.switchToIdleState({sessionStopReason:"timeout"});}async onInactiveStateTimeout(){this.stateManager.state!=="inactive"&&!this.stateManager.holdingToScan&&this._preparationPromise&&await this.switchToInactiveState({sessionStopReason:"timeout"});}async onResumeCapturingTimeout(){this.stateManager.state!=="active"&&this._preparationPromise&&await this.switchToActiveState();}async onMiniPreviewCloseButtonTap(){await this.switchToIdleState({sessionStopReason:"user",emitTapFeedback:true});}onMiniPreviewResizeButtonTap(){(this.stateManager.state==="active"||this.stateManager.state==="inactive")&&(this.feedbackManager.emitTapFeedback(),this.timeoutManager.restartCurrentTimeout());}async onMiniPreviewZoomButtonTap(e){this.feedbackManager.emitTapFeedback(),this.stateManager.zoomFactor=e,await this.cameraManager.onMiniPreviewZoomButtonTap(e),this.timeoutManager.restartCurrentTimeout();}async onMiniPreviewDrag(e,a){switch(this.stateManager.state==="active"&&await this.sparkScan$.setEnabled(false),a){case "landscape-primary":case "landscape-secondary":{this.stateManager.landscapeOrientationMiniPreviewTranslateX=e.x,this.stateManager.landscapeOrientationMiniPreviewTranslateY=e.y;break}case "portrait-primary":case "portrait-secondary":{this.stateManager.portraitOrientationMiniPreviewTranslateX=e.x,this.stateManager.portraitOrientationMiniPreviewTranslateY=e.y;break}}this.timeoutManager.restartCurrentTimeout();}onMiniPreviewPointerMove(){this.timeoutManager.restartCurrentTimeout();}async onMiniPreviewPointerUp(){await this.switchToActiveState();}async onMiniPreviewDragEnd(){this.stateManager.state==="active"&&await this.sparkScan$.setEnabled(true);}async onMiniPreviewVisibilityChange(e){e&&this.sparkScanView.repositionMiniPreviewIfOutOfBounds(),this.stateManager.inSmartScanSelection&&!e&&await this.onSwitchedAwayFromSmartScanSelection();}onTriggerButtonDrag(e,a){switch(a){case "landscape-primary":case "landscape-secondary":{this.stateManager.landscapeOrientationTriggerButtonTranslateX=e.x,this.stateManager.landscapeOrientationTriggerButtonTranslateY=e.y;break}case "portrait-primary":case "portrait-secondary":{this.stateManager.portraitOrientationTriggerButtonTranslateX=e.x,this.stateManager.portraitOrientationTriggerButtonTranslateY=e.y;break}}}async onOrientationChange(){if(this.stateManager.state==="active"&&this.stateManager.holdingToScan){this.timeoutManager.restartCurrentTimeout();return}this.stateManager.state==="error"&&await this.switchToInactiveState({sessionStopReason:"user"});}async didScan(e,a){if(!a.newlyRecognizedBarcode)return;let t=this.sparkScanView.feedbackDelegate.getFeedbackForBarcode(a.newlyRecognizedBarcode);if(t){if(t instanceof b$1){await this.switchToErrorState({barcodeFeedback:t}),this.timeoutManager.restartCurrentTimeout();return}if(t instanceof c){if(this.stateManager.continuousModeEnabled){await this.switchToActiveState({barcodeFeedback:t}),this.timeoutManager.restartCurrentTimeout();return}let i=true,n="user";await this.switchToInactiveState({barcodeFeedback:t,emitSuccessFeedback:i,sessionStopReason:n}),this.timeoutManager.restartCurrentTimeout();}}}setListener(e){this.listener=e;}async onSwitchedToSmartScanSelection(){this.overlayManager.isReady&&(this.stateManager.inSmartScanSelection=true,this.stateManager.miniPreviewSizeBeforeSmartScanSelection=this.sparkScanView.miniPreviewSize,this.stateManager.previewSizeControlVisibleBeforeSmartScanSelection=this.sparkScanView.previewSizeControlVisible,await this.overlayManager.onSwitchedToSmartScanSelection(this._dataCaptureView),this.stateManager.targetModeEnabled||(this.sparkScanView.miniPreviewSize="expanded"),this.updateSizeControlVisibility());}async onSwitchedAwayFromSmartScanSelection(){this.overlayManager.isReady&&this.stateManager.miniPreviewSizeBeforeSmartScanSelection&&(this.stateManager.inSmartScanSelection=false,await this.overlayManager.onSwitchedAwayFromSmartScanSelection(this._dataCaptureView),this.sparkScanView.miniPreviewSize=this.stateManager.miniPreviewSizeBeforeSmartScanSelection,this.stateManager.miniPreviewSizeBeforeSmartScanSelection=void 0,this.updateSizeControlVisibility());}get tapBarcodeFeedback(){return new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}get silentBarcodeFeedback(){return new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.noFeedback)}get silentErrorBarcodeFeedback(){return new b$1("",0,Color.fromRGBA(0,0,0,0),this.defaultErrorBrush,this.feedbackManager.noFeedback)}async switchToIdleState(e={}){await this.sparkScan$.setEnabled(false),await this.cameraManager.onSwitchToIdleState(),e.emitTapFeedback===true&&this.feedbackManager.emitTapFeedback(),await this.overlayManager.onSwitchToIdleState(),this.setState("idle"),this.timeoutManager.onSwitchToIdleState(),this.stateManager.triggerButtonPressed=false,this.sparkScanView.switchToIdleState(),e.sessionStopReason!=null&&this.analyticsManager.setSessionStopReason(e.sessionStopReason);}async switchToActiveState(e={}){var t;let a=this.stateManager.state;await this.cameraManager.onSwitchToActiveState(this.stateManager.torchState),await this.overlayManager.onSwitchToActiveState(a,this.stateManager.continuousModeEnabled,e.barcodeFeedback),this.feedbackManager.emitBarcodeFeedback(e.barcodeFeedback),this.timeoutManager.onSwitchToActiveState(this.stateManager.holdingToScan),await this.sparkScanView.switchToActiveState(this.sparkScanViewSettings.visualFeedbackEnabled&&e.barcodeFeedback instanceof c,this.stateManager.scanningBehavior,(t=e.barcodeFeedback)==null?void 0:t.visualFeedbackColor,this.stateManager.zoomedIn&&a!=="active"),await this.sparkScan$.setEnabled(true),this.setState("active");}async switchToInactiveState(e){var t;this.stateManager.inSmartScanSelection?await this.sparkScan$.setEnabled(false):this.stateManager.shouldEnableSuppression?await this.sparkScan$.setResultSuppressionEnabled(true):await this.sparkScan$.setEnabled(false),this.stateManager.triggerButtonPressed=false,this.stateManager.scanningMode.previewBehavior==="persistent"&&e.barcodeFeedback instanceof c&&await this.overlayManager.setShouldRemoveLocationsAfterScan(true),await this.cameraManager.onSwitchToInactiveState(this.stateManager.scanningMode.previewBehavior),(e.emitSuccessFeedback)!=null||(e.emitSuccessFeedback=true),this.setState("inactive"),e.barcodeFeedback&&await this.overlayManager.setBrushForFeedback(e.barcodeFeedback),this.feedbackManager.emitBarcodeFeedback(e.barcodeFeedback),await this.overlayManager.overlayReadyForDraw(),this.timeoutManager.onSwitchToInactiveState(),await this.sparkScanView.switchToInactiveState(this.sparkScanViewSettings.visualFeedbackEnabled&&e.barcodeFeedback instanceof c&&e.emitSuccessFeedback,this.stateManager.scanningBehavior,this.stateManager.previewBehavior,(t=e.barcodeFeedback)==null?void 0:t.visualFeedbackColor),this.analyticsManager.setSessionStopReason(e.sessionStopReason);}async switchToErrorState(e){let a=e.barcodeFeedback.resumeCapturingDelay>0;a&&(await this.sparkScan$.setEnabled(false),await this.cameraManager.onSwitchToErrorState(),this.setState("error"),this.stateManager.scanningBehavior="single"),this.timeoutManager.onSwitchToErrorState(a,e.barcodeFeedback.resumeCapturingDelay),await this.overlayManager.onSwitchToErrorState(e.barcodeFeedback),await this.sparkScan$.workerCommand("sparkScanEmitErrorFeedback",{shouldRemoveBrush:!a}),this.feedbackManager.emitBarcodeFeedback(e.barcodeFeedback),await this.sparkScanView.switchToErrorState(e.barcodeFeedback,this.sparkScanViewSettings.visualFeedbackEnabled);}enableTargetModeLocationSelection(e){let a=e?a$8.SparkScanSettings.targetModeLocationSelection.radius:a$8.SparkScanSettings.locationSelection.radius,t=e?a$8.SparkScanSettings.targetModeLocationSelection.unit:a$8.SparkScanSettings.locationSelection.unit,i=new NumberWithUnit(a,t);this.sparkScan$.settings.locationSelection=new RadiusLocationSelection(i),this.overlayManager.setRadius(i);}async applyPreferences(){await this.onTargetModeButtonTap(this.stateManager.targetModeEnabled,this.feedbackManager.noFeedback,false),await this.onScanningBehaviorButtonTap(this.stateManager.continuousModeEnabled,this.feedbackManager.noFeedback,false),await this.onTorchButtonTap(this.stateManager.torchEnabled,this.feedbackManager.noFeedback,false),this.sparkScanView.repositionElementsIfOutOfBounds();}setState(e){var a,t;e!==this.stateManager.state&&(this.stateManager.state=e,(t=(a=this.listener)==null?void 0:a.didChangeViewState)==null||t.call(a,e));}updateSizeControlVisibility(){if(!this.stateManager.inSmartScanSelection&&this.stateManager.previewSizeControlVisibleBeforeSmartScanSelection!==void 0){this.sparkScanView.previewSizeControlVisible=this.stateManager.previewSizeControlVisibleBeforeSmartScanSelection,this.stateManager.previewSizeControlVisibleBeforeSmartScanSelection=void 0;return}let e=this.stateManager.inSmartScanSelection&&!this.stateManager.targetModeEnabled,a=this.sparkScanView.previewSizeControlVisible;this.sparkScanView.previewSizeControlVisible=a&&!e;}};a([d],s.prototype,"switchToActiveState",1),a([d],s.prototype,"switchToInactiveState",1),a([d],s.prototype,"switchToErrorState",1);var V=s;export{V as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-F2FSFE64.js';import {TorchState,isCameraFrameSource,Camera,CameraPosition,FrameSourceState}from'@scandit/web-datacapture-core';var l=class{constructor(e,t,a,o,r){this.torchState=TorchState.Off;this.cameraSupportMap=new Map;this.cameras=[];this.view=e,this.context=t,this.barcodeAr=a,this.viewSettings=o,this.cameraSettings=r;}get currentCamera(){if(isCameraFrameSource(this.context.frameSource))return this.context.frameSource;throw new Error("The current frame source is not a Camera")}isCameraMirrored(){return this.currentCamera.getMirrorImageEnabled()}async prepare(){var a$1,o,r;await this.barcodeAr.setEnabled(false),this.barcodeAr.feedback=await a.createWithOptions(true,true),this.barcodeAr.addPrivateListener(this),this.cameras=await Camera.getAll(false,isCameraFrameSource(this.context.frameSource));let e=isCameraFrameSource(this.context.frameSource)?this.context.frameSource:(r=(o=(a$1=this.cameras.find(s=>s.position===this.viewSettings.defaultCameraPosition))!=null?a$1:this.cameras.find(s=>s.position===(this.viewSettings.defaultCameraPosition===CameraPosition.WorldFacing?CameraPosition.UserFacing:CameraPosition.WorldFacing)))!=null?o:this.cameras[0])!=null?r:Camera.pickBestGuess();await this.context.setFrameSource(e),await this.currentCamera.applySettings(this.cameraSettings),await this.currentCamera.switchToDesiredState(FrameSourceState.Standby);let t=await this.isTorchAvailableForCurrentCamera();this.view.setTorchAvailable(t);}async dispose(){var e;this.view.deleteAllViews(),await this.context.removeMode(this.barcodeAr),this.barcodeAr.removePrivateListener(this),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Off));}async startSearching(){var e;this.view.deleteAllViews(),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.On)),await this.barcodeAr.setEnabled(true),await this.barcodeAr.start();}async stopSearching(){var e;this.view.deleteAllViews(),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Off)),await this.barcodeAr.setEnabled(false),await this.barcodeAr.stop();}async pauseSearching(){var e;this.view.deletePendingViews(),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Standby)),await this.barcodeAr.setEnabled(false),await this.barcodeAr.pause();}emitTappedFeedback(){this.barcodeAr.feedback.tapped.emit();}didUpdateSession(e,t){Object.keys(t.addedTrackedBarcodes).length>0&&this.barcodeAr.feedback.scanned.emit(),this.view.render(t);}async isTorchAvailableForCurrentCamera(){let e=this.currentCamera.label,t=this.cameraSupportMap.get(e);if(t!==void 0)return t.torch;let a=await this.currentCamera.isTorchAvailable();return this.cameraSupportMap.set(e,{torch:a}),a}async onTorchButtonClicked(){let e=await this.isTorchAvailableForCurrentCamera();this.view.setTorchAvailable(e),e&&(await this.currentCamera.setDesiredTorchState(this.torchState===TorchState.Off?TorchState.On:TorchState.Off),this.torchState=this.torchState===TorchState.Off?TorchState.On:TorchState.Off,this.view.toggleTorchIcon(this.torchState));}async onCameraSwitchButtonClicked(){var r,s;let e=this.currentCamera.getCurrentState(),t=this.currentCamera.position===CameraPosition.UserFacing?CameraPosition.WorldFacing:CameraPosition.UserFacing,a=(s=(r=this.cameras.find(p=>p.position===t))!=null?r:this.cameras[0])!=null?s:Camera.pickBestGuessForPosition(t);await this.context.setFrameSource(a),await this.currentCamera.switchToDesiredState(e);let o=await this.isTorchAvailableForCurrentCamera();this.view.setTorchAvailable(o);}};export{l as a};
@@ -0,0 +1 @@
1
+ import {j,k}from'./chunk-DVHTYKDX.js';import {g}from'./chunk-YBD5JYCX.js';import {ScanditHTMLElement,css,defineCustomElements,safeAwaitAnimation}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var o=class c extends ScanditHTMLElement{get styleElement(){return (this._styleElement)!=null||(this._styleElement=css`${g}{height:var(--dvh);left:0;opacity:0;pointer-events:none;position:absolute;top:0;user-select:none;width:var(--dvw)}${g}[success]{background:var(${j})}${g}[error]{background:var(${k})}`),this._styleElement}get success(){return this.hasAttribute("success")}set success(e){this.toggleAttribute("error",!e),this.toggleAttribute("success",e);}get error(){return this.hasAttribute("error")}set error(e){this.toggleAttribute("error",e),this.toggleAttribute("success",!e);}static create(){return defineCustomElements({[g]:c}),document.createElement(g)}async fadeIn(e,a){let i=this.animate([{opacity:"0"},{opacity:e}],{duration:a,easing:"linear"});await safeAwaitAnimation(i);}async fadeOut(e,a){let i=this.animate([{opacity:e},{opacity:"0"}],{duration:a,easing:"linear"});await safeAwaitAnimation(i);}async emitSuccessFeedback(){this.success=true,await this.fadeIn("1",200),await this.fadeOut("1",0);}async emitErrorFeedback(){this.error=true,await this.fadeIn("1",100),await this.fadeOut("1",100),await this.fadeIn("0.5",100),await this.fadeOut("0.5",0);}connectedCallback(){this.append(this.styleElement);}};export{o as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-74NQM2AV.js';import {CameraPosition,isCameraFrameSource,Camera,FrameSourceState}from'@scandit/web-datacapture-core';var m=class{constructor(){this.toggleCameraPosition={[CameraPosition.WorldFacing]:CameraPosition.UserFacing,[CameraPosition.UserFacing]:CameraPosition.WorldFacing};}get camera(){var a;return (a=this.context)==null?void 0:a.frameSource}async prepareScanning(a$1,t){this.context=a$1;let e=isCameraFrameSource(a$1.frameSource)?a$1.frameSource:Camera.pickBestGuessForPosition(t.defaultCameraPosition);return await a$1.setFrameSource(e),await e.applySettings(a.recommendedCameraSettings),await e.switchToDesiredState(FrameSourceState.Standby),{isTorchAvailable:await e.isTorchAvailable(),isZoomAvailable:e.isZoomAvailable(),cameraPosition:e.position}}async onSwitchToActiveState(a){var t,e;await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.On)),await((e=this.camera)==null?void 0:e.setDesiredTorchState(a));}async onSwitchToInactiveState(a){var t;a!=="persistent"&&await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.Standby));}async onSwitchToIdleState(){var a;await((a=this.camera)==null?void 0:a.switchToDesiredState(FrameSourceState.Standby));}async onSwitchToErrorState(){var a;await((a=this.camera)==null?void 0:a.switchToDesiredState(FrameSourceState.Standby));}async stopScanning(){var a;await((a=this.camera)==null?void 0:a.switchToDesiredState(FrameSourceState.Off));}async onTorchButtonTap(a){var t,e;((t=this.camera)==null?void 0:t.getCurrentState())===FrameSourceState.On&&await((e=this.camera)==null?void 0:e.setDesiredTorchState(a));}async onCameraSwitchButtonTap(){var s;if(!this.camera)return;let a=this.camera,t=a.settings,e=this.toggleCameraPosition[this.camera.position],r=Camera.pickBestGuessForPosition(e);return await a.switchToDesiredState(FrameSourceState.Off),await r.applySettings(t),await((s=this.context)==null?void 0:s.setFrameSource(r)),await r.switchToDesiredState(FrameSourceState.On),{isTorchAvailable:await r.isTorchAvailable(),isZoomAvailable:r.isZoomAvailable(),cameraPosition:e}}async onMiniPreviewZoomButtonTap(a){this.camera&&(this.camera.settings.zoomFactor=a,await this.camera.applySettings(this.camera.settings));}};export{m as a};
@@ -1 +1 @@
1
- import {a}from'./chunk-2AKUWJW7.js';import {a as a$1}from'./chunk-TRITJ43A.js';import {unknownErrorToString}from'@scandit/web-datacapture-core/build/js/private/utils/unknownErrorToString.js';import {WorkerMain}from'@scandit/web-datacapture-core/build/js/worker/index.js';var i=class extends WorkerMain{constructor(t,a$1){super(t,a$1),this.dataCaptureInstance=new a(a$1,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)});}async respondWith(t,a,r){let d=null,e;try{e=r(),e instanceof Promise&&(e=await e);}catch(c){e=void 0,d=unknownErrorToString(c);}let s={type:"workerTaskId",command:t,id:a,payload:this.hasPayload(e)?e.payload:void 0};d!=null&&(s.error=d),this.postMessage(s,this.hasTransferables(e)?e.transferables:[]);}onMessage(t){switch(t.data.command){case "sparkScanEmitErrorFeedback":{let{data:a}=t;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(a.shouldRemoveBrush);}),true}case "sparkScanOverlayReadyForDraw":{let{data:a}=t;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw();}),true}case "sparkScanOverlayDiscardEnqueuedData":{let{data:a}=t;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.discardEnqueuedData();}),true}case "sparkScanAnalyticsManagerPropertyChanged":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(a.property);}),true}case "sparkScanSelectItemWithSmartScanSelection":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.selectItemWithSmartScanSelection();}),true}case "sparkScanModeRemove":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.sparkScanMode.removeMode()),true}case "barcodeFindForSettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(a.settings)),true}case "barcodeFindModeRemove":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.removeMode()),true}case "barcodeFindSearchStart":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.start();}),true;case "barcodeFindSearchPause":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.pause();}),true;case "barcodeFindSearchStop":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.stop();}),true;case "barcodeFindSetItemList":{let{data:a}=t;return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(a.itemList);}),true}case "barcodeFindSetEnabled":{let{data:a}=t;return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(a.enabled);}),true}case "barcodeFindApplySettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(a.settings)),true}case "barcodeFindAddBasicOverlay":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay();}),true}case "barcodeFindRemoveBasicOverlay":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay();}),true}case "barcodeFindUpdateBasicOverlay":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(a.jsonOverlay);}),true}case "barcodeFindSetTransformerFunction":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{let r=a$1(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r);}),true}case "barcodeArForSettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.forSettings(a.settings)),true}case "barcodeArModeRemove":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.removeMode()),true}case "barcodeArSearchStart":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.start();}),true;case "barcodeArSearchPause":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.pause();}),true;case "barcodeArSearchStop":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.stop();}),true;case "barcodeArSetEnabled":{let{data:a}=t;return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.setEnabled(a.enabled);}),true}case "barcodeArApplySettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeArMode.applySettings(a.settings);}),true}default:return super.onMessage(t)}}};export{i as a};
1
+ import {a}from'./chunk-ZI65J3L4.js';import {a as a$1}from'./chunk-TRITJ43A.js';import {unknownErrorToString}from'@scandit/web-datacapture-core/build/js/private/utils/unknownErrorToString.js';import {WorkerMain}from'@scandit/web-datacapture-core/build/js/worker/index.js';var i=class extends WorkerMain{constructor(t,a$1){super(t,a$1),this.dataCaptureInstance=new a(a$1,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)});}async respondWith(t,a,r){let d=null,e;try{e=r(),e instanceof Promise&&(e=await e);}catch(c){e=void 0,d=unknownErrorToString(c);}let s={type:"workerTaskId",command:t,id:a,payload:this.hasPayload(e)?e.payload:void 0};d!=null&&(s.error=d),this.postMessage(s,this.hasTransferables(e)?e.transferables:[]);}onMessage(t){switch(t.data.command){case "sparkScanEmitErrorFeedback":{let{data:a}=t;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(a.shouldRemoveBrush);}),true}case "sparkScanOverlayReadyForDraw":{let{data:a}=t;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw();}),true}case "sparkScanOverlayDiscardEnqueuedData":{let{data:a}=t;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.discardEnqueuedData();}),true}case "sparkScanAnalyticsManagerPropertyChanged":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(a.property);}),true}case "sparkScanSelectItemWithSmartScanSelection":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.selectItemWithSmartScanSelection();}),true}case "sparkScanModeRemove":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.sparkScanMode.removeMode()),true}case "barcodeFindForSettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(a.settings)),true}case "barcodeFindModeRemove":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.removeMode()),true}case "barcodeFindSearchStart":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.start();}),true;case "barcodeFindSearchPause":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.pause();}),true;case "barcodeFindSearchStop":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.stop();}),true;case "barcodeFindSetItemList":{let{data:a}=t;return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(a.itemList);}),true}case "barcodeFindSetEnabled":{let{data:a}=t;return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(a.enabled);}),true}case "barcodeFindApplySettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(a.settings)),true}case "barcodeFindAddBasicOverlay":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay();}),true}case "barcodeFindRemoveBasicOverlay":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay();}),true}case "barcodeFindUpdateBasicOverlay":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(a.jsonOverlay);}),true}case "barcodeFindSetTransformerFunction":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{let r=a$1(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r);}),true}case "barcodeArForSettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.forSettings(a.settings)),true}case "barcodeArModeRemove":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.removeMode()),true}case "barcodeArSearchStart":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.start();}),true;case "barcodeArSearchPause":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.pause();}),true;case "barcodeArSearchStop":return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.stop();}),true;case "barcodeArSetEnabled":{let{data:a}=t;return this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.barcodeArMode.setEnabled(a.enabled);}),true}case "barcodeArApplySettings":{let{data:a}=t;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeArMode.applySettings(a.settings);}),true}default:return super.onMessage(t)}}};export{i as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-HDLJOQJY.js';import {a as a$6}from'./chunk-ZPCWOA3Y.js';import {b}from'./chunk-OH47PSIL.js';import {a as a$8}from'./chunk-KMEGIFKL.js';import {a as a$5}from'./chunk-QRG4J3CL.js';import {b as b$1}from'./chunk-33EFB3RJ.js';import {a as a$7}from'./chunk-O5SUMSOC.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$2}from'./chunk-E4E7YAFV.js';import {a as a$4}from'./chunk-I3PK5YW4.js';import {a as a$3}from'./chunk-QGQK7I7Q.js';import {Anchor,DataCaptureView,ZoomSwitchControl,Direction,Point,Size}from'@scandit/web-datacapture-core';import {Backdrop}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/Backdrop.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {calculateArea,calculateWidth,calculateHeight}from'@scandit/web-datacapture-core/build/js/private/utils/quadrilateralUtils.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';import {TorchSwitchIconButton}from'@scandit/web-datacapture-core/build/js/private/ui/molecules/TorchSwitchIconButton.js';var W={async highlightForBarcode(k,y){let t=a$8.create(k);y(t);}},d=class d extends ScanditHTMLElement{constructor(){super(...arguments);this.torchSwitchIconButton=null;this.cameraSwitchButton=null;this.zoomSwitchControl=null;this._shouldShowTorchControl=false;this._isTorchAvailable=false;this.onTorchButtonClickHandler=this.onTorchButtonClick.bind(this);this.onCameraSwitchButtonHandler=this.onCameraSwitchButtonClick.bind(this);this.onLayoutPointerDownHandler=this.onLayoutPointerDown.bind(this);this.onInfoAnnotationTapHandler=this.onInfoAnnotationTap.bind(this);this.pendingDeletionTimeout=null;}set shouldShowZoomControl(t){var o;let e=(o=this.zoomSwitchControl)==null?void 0:o.zoomSwitchPill;e&&(e.hidden=!t);}get shouldShowZoomControl(){var e;let t=(e=this.zoomSwitchControl)==null?void 0:e.zoomSwitchPill;return t?!t.hidden:false}set shouldShowCameraSwitchControl(t){this.cameraSwitchButton&&(this.cameraSwitchButton.hidden=!t);}get shouldShowCameraSwitchControl(){return this.cameraSwitchButton===null?false:!this.cameraSwitchButton.hidden}set shouldShowTorchControl(t){this.torchSwitchIconButton!==null&&(this._shouldShowTorchControl=t,this.torchSwitchIconButton.hidden=!(t&&this._isTorchAvailable));}get shouldShowTorchControl(){return this._shouldShowTorchControl}set torchControlPosition(t){var e;(e=this.torchSwitchIconButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopLeft:t}`);}get torchControlPosition(){var e,o;let t=(o=(e=this.torchSwitchIconButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopLeft:t.replace("controls-","")}set zoomControlPosition(t){var o;let e=(o=this.zoomSwitchControl)==null?void 0:o.zoomSwitchPill;e==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.BottomRight:t}`);}get zoomControlPosition(){var o,i;let t=(o=this.zoomSwitchControl)==null?void 0:o.zoomSwitchPill,e=(i=t==null?void 0:t.getAttribute("slot"))!=null?i:"";return e===""?Anchor.BottomRight:e.replace("controls-","")}set cameraSwitchControlPosition(t){var e;(e=this.cameraSwitchButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopRight:t}`);}get cameraSwitchControlPosition(){var e,o;let t=(o=(e=this.cameraSwitchButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopRight:t.replace("controls-","")}static async createWithSettings(t,e,o,i,n){d.register();let r=document.createElement(d.tag);return r.barcodeArViewSettings=i,r.layout=a.create(),r.append(r.layout),a$1(t)?(r.dataCaptureView=t,r.dataCaptureView.containerElement.prepend(r),await t.setContext(e)):(r.dataCaptureView=await DataCaptureView.forContext(e),r.dataCaptureView.connectToElement(t),r.dataCaptureView.containerElement.prepend(r)),r.presenter=new a$2(r,e,o,i,n!=null?n:a$3.createRecommendedCameraSettings()),await r.presenter.prepare(),await r.installZoomControl(),r}static async create(t,e,o){return d.createWithSettings(t,e,o,new a$4)}static register(){defineCustomElements({[a.tag]:a,[a$6.tag]:a$6,[TorchSwitchIconButton.tag]:TorchSwitchIconButton,[d.tag]:d,[Backdrop.tag]:Backdrop,[a$5.tag]:a$5});}static createStyleElement(){return css`[data-could-be-deleted=true]{display:none!important}[data-on-foreground=true]{z-index:3}${d.tag}{inset:0;position:absolute;z-index:1}`}getHighlightForBarcode(t){return this.queryHighlightByDataId(a$7(t))}getAnnotationForBarcode(t){return this.queryAnnotationByDataId(a$7(t))}async start(){return this.presenter.startSearching()}async stop(){return this.presenter.stopSearching()}async pause(){return this.presenter.pauseSearching()}reset(){this.deletePendingViews(),this.deleteAllViews();}getNotificationPresenter(){return this.dataCaptureView.getNotificationPresenter()}setTorchAvailable(t){this._isTorchAvailable=t,this.torchSwitchIconButton!==null&&(this.torchSwitchIconButton.hidden=!(this._shouldShowTorchControl&&this._isTorchAvailable));}toggleTorchIcon(t){this.torchSwitchIconButton!==null&&(this.torchSwitchIconButton.state=t);}onTorchButtonClick(){this.presenter.onTorchButtonClicked();}onCameraSwitchButtonClick(){this.presenter.onCameraSwitchButtonClicked();}async installZoomControl(){this.zoomSwitchControl=new ZoomSwitchControl,await this.zoomSwitchControl.install(this.dataCaptureView);let t=this.zoomSwitchControl.zoomSwitchPill;t&&(t.setAttribute("slot",`controls-${Anchor.BottomRight}`),t.hidden=true,this.layout.append(t));}connectedCallback(){this.torchSwitchIconButton=TorchSwitchIconButton.create(),this.torchSwitchIconButton.shadow=true,this.torchSwitchIconButton.size=36,this.torchSwitchIconButton.slot=`controls-${this.torchControlPosition}`,this.torchSwitchIconButton.hidden=true,this.torchSwitchIconButton.addEventListener("pointerdown",this.onTorchButtonClickHandler),this.cameraSwitchButton=a$6.create(),this.cameraSwitchButton.slot=`controls-${this.cameraSwitchControlPosition}`,this.cameraSwitchButton.hidden=true,this.cameraSwitchButton.addEventListener("pointerdown",this.onCameraSwitchButtonHandler),this.layout.append(this.torchSwitchIconButton,this.cameraSwitchButton),this.layout.addEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.addEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.backdrop=Backdrop.create(),this.layout.append(this.backdrop),this.pendingDeletionTimeout=new Timeout(1e3,()=>{this.deletePendingViews();}),this.prepend(d.createStyleElement());}disconnectedCallback(){var t,e,o;this.deleteAllViews(),(t=this.torchSwitchIconButton)==null||t.removeEventListener("pointerdown",this.onTorchButtonClickHandler),(e=this.cameraSwitchButton)==null||e.removeEventListener("pointerdown",this.onCameraSwitchButtonHandler),(o=this.zoomSwitchControl)==null||o.remove(),this.layout.removeEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.removeEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler);}isPopoverAnnotation(t){return t instanceof b}isAnnotation(t){var e;return ((e=t.dataset)==null?void 0:e.identifier)==null?false:t.dataset.identifier.endsWith("-annotation")}areMultiplePopoverAllowed(){for(let t of this.layout.querySelectorAll("[data-identifier$='-annotation']"))if(t&&this.isPopoverAnnotation(t)&&t.annotationTrigger==="highlightTapAndBarcodeScan")return true;return false}async onLayoutPointerDown(t){let e=t.target,o=e==null?void 0:e.closest("[data-identifier$='-highlight']"),i=e==null?void 0:e.closest(b.tag);if((o==null?void 0:o.dataset.id)!=null){await this.handleHighlightClick(o);return}if((i==null?void 0:i.dataset.id)!=null){await this.handleAnnotationClick(i);return}await this.handleClickOutside();}async handleHighlightClick(t){var o;this.presenter.emitTappedFeedback(),(o=this.listener)==null||o.didTapHighlightForBarcode(this.presenter.barcodeAr,t.barcode,t);let e=this.queryAnnotationByDataIdentifier(t.dataset.identifier.replace("-highlight",""));!e||e.annotationTrigger==="barcodeScan"||(this.isPopoverAnnotation(e)?await this.handlePopoverHighlightClick(e,t):e.hidden=!e.hidden);}async handlePopoverHighlightClick(t,e){var o;if(!this.areMultiplePopoverAllowed()){let i=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`),n=(o=i==null?void 0:i.dataset.identifier)==null?void 0:o.replace("-annotation","-highlight"),r=this.layout.querySelector(`[data-identifier="${n}"]`);i!=null&&r!=null&&await this.hideBarcodeArPopover(i,r,false);}await this.toggleBarcodeArPopover(t,e);}async handleAnnotationClick(t){var i;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.toggleBarcodeArPopover(t,o);}async handleClickOutside(){var i;if(this.areMultiplePopoverAllowed())return;let t=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`);if(!t)return;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.hideBarcodeArPopover(t,o);}onInfoAnnotationTap(){this.presenter.emitTappedFeedback();}async showBarcodeArPopover(t,e){t.dataset.onForeground="true",t.hidden=false,e.dataset.onForeground="true",this.backdrop.open=true;}async hideBarcodeArPopover(t,e,o=true){t.dataset.onForeground="false",t.hidden=true,e&&(e.dataset.onForeground="false"),o&&this.hideBackdropIfNoPopovers();}hideBackdropIfNoPopovers(){[...this.layout.querySelectorAll(`${b.tag}`)].every(e=>e.hidden)&&(this.backdrop.open=false);}async toggleBarcodeArPopover(t,e){t.hidden?await this.showBarcodeArPopover(t,e):await this.hideBarcodeArPopover(t,e);}deleteAllViews(){for(let t of this.layout.querySelectorAll("[data-identifier]"))t.remove();}deletePendingViews(){for(let t of this.layout.querySelectorAll("[data-could-be-deleted='true']"))t.remove();this.hideBackdropIfNoPopovers();}identifierForHighlight(t){return `${t}-highlight`}identifierForAnnotation(t){return `${t}-annotation`}async onHighlightsOrAnnotationForTrackedBarcode(t){var e,o,i;await((o=(e=this.highlightProvider)!=null?e:W)==null?void 0:o.highlightForBarcode(t.barcode,async n=>this.onHighlight(t,n))),await((i=this.annotationProvider)==null?void 0:i.annotationForBarcode(t.barcode,async n=>this.onAnnotation(t,n)));}async onAnnotation(t,e){let o=e,i=a$7(t.barcode);this.updateExistingAnnotation(i)||(await this.setupNewAnnotation(o,i,t),this.updateAnnotationPosition(t,o));}updateExistingAnnotation(t){let e=this.queryAnnotationByDataId(t);return e?(e.dataset.couldBeDeleted="false",true):false}async setupNewAnnotation(t,e,o){if(t.dataset.id=e,t.dataset.identifier=this.identifierForAnnotation(o.identifier),t.hidden=true,this.layout.append(t),this.isPopoverAnnotation(t)){if(t.direction=Direction.Vertical,t.anchor==null&&(t.anchor="bottom-center"),this.areMultiplePopoverAllowed()||t.annotationTrigger==="highlightTapAndBarcodeScan"){let i=this.queryHighlightByDataId(e);i&&await this.showBarcodeArPopover(t,i);}}else t.hidden=t.annotationTrigger==="highlightTap";}getAnnotationVariationForQuad(t,e){let o=Math.max(0,Math.min(1,e)),i=t.anchorPositions,n=calculateArea(i),r=this.dataCaptureView.width,l=this.dataCaptureView.height,h=r*l;if(n<=0||h<=0)return 0;let u=n/h;return Math.max(0,Math.min(1,u))<=o?2:1}async onHighlight(t,e){let o=a$7(t.barcode),i=this.queryHighlightByDataId(o);i?i.dataset.couldBeDeleted="false":(e.dataset.id=o,e.dataset.identifier=this.identifierForHighlight(t.identifier),this.updateHighlightPosition(t,e),this.layout.append(e));}queryHighlightByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-highlight"]`)}queryAnnotationByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-annotation"]`)}queryHighlightByDataId(t){return this.layout.querySelector(`[data-identifier$="-highlight"][data-id="${t}"]`)}queryAnnotationByDataId(t){return this.layout.querySelector(`[data-identifier$="-annotation"][data-id="${t}"]`)}updateRemovedTrackedBarcodes(t){var i,n,r,l,h;let e=this.querySelectorAll("[data-identifier]");if(Object.keys(t.allTrackedBarcodes).length===0){for(let u of e)u.dataset.couldBeDeleted="true";(i=this.pendingDeletionTimeout)!=null&&i.running||(n=this.pendingDeletionTimeout)==null||n.start();return}let o=new Set(t.removedTrackedBarcodes);for(let u of e){let p=(r=u.dataset.identifier)==null?void 0:r.replace("-highlight","").replace("-annotation","");p!=null&&o.has(p)&&(u.dataset.couldBeDeleted="true");}(l=this.pendingDeletionTimeout)!=null&&l.running||(h=this.pendingDeletionTimeout)==null||h.start();}render(t){for(let[e,o]of Object.entries(t.allTrackedBarcodes)){t.addedTrackedBarcodes[e]!=null&&this.onHighlightsOrAnnotationForTrackedBarcode(o);let i=a$7(o.barcode),n=this.queryAnnotationByDataId(i),r=this.queryHighlightByDataId(i);r&&(this.updateBrushSize(r,o),this.updateHighlightPosition(o,r)),n&&this.updateAnnotationPosition(o,n,r);}this.updateRemovedTrackedBarcodes(t);}updateHighlightPosition(t,e,o="center"){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),n=this.normalizedViewPointFromFrameAnchorPositions(i,o);e.updatePosition(n,new Point(-50,-50),this.calculateRotationAngle(i.topLeft,i.topRight));}updateBrushSize(t,e){if(t.width==null||t.height==null)return;let o=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),i=Math.round(calculateWidth(o)),n=Math.round(calculateHeight(o));t.width!==i&&(t.width=i),t.height!==n&&(t.height=n);}getTransformOrigin(t){return {"top-center":new Point(-50,0),"bottom-center":new Point(-50,-100),"left-center":new Point(0,-50),"right-center":new Point(-100,-50)}[t]}calculateAnnotationPosition(t,e,o){var p,P;let n=t.orderVerticesByPosition(),r=this.normalizedViewPointFromFrameAnchorPositions(t,"center"),h={"bottom-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"topCenter");return new Point(s.x,s.y-7)},"top-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"bottomCenter");return new Point(s.x,s.y+7)},"right-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerLeft");return new Point(s.x-7,s.y)},"left-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerRight");return new Point(s.x+7,s.y)}}[e]();return o?o instanceof b$1?(p={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?p:h:(P={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?P:h:h}updateAnnotationPosition(t,e,o){let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions);if(e.anchor||(e.anchor="top-center"),e.annotationVariation!=null){let l=this.getAnnotationVariationForQuad(t,a$5.threshold);e.annotationVariation=l;}let n=this.getTransformOrigin(e.anchor),r=this.calculateAnnotationPosition(i,e.anchor,o);e.updatePosition(r,n,this.calculateRotationAngle(i.topLeft,i.topRight));}normalizedViewPointFromFrameAnchorPositions(t,e="center"){let o=this.presenter.currentCamera.getMirrorImageEnabled(),i=new Size(this.dataCaptureView.width,this.dataCaptureView.height);if(o){let r=t[{centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"}[e]];return Point.mirrorX(r,i)}return t[e]}calculateRotationAngle(t,e){let o=e.x-t.x,n=this.presenter.isCameraMirrored()?-(e.y-t.y):e.y-t.y,r=Math.atan2(n,o);return Math.round(r*(180/Math.PI))}};d.tag="scandit-barcode-ar-view";var R=d;export{R as a};
@@ -1 +1 @@
1
- var b=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var p=(r,d,t,s)=>{for(var a=s>1?void 0:s?i(d,t):d,e=r.length-1,c;e>=0;e--)(c=r[e])&&(a=(s?c(d,t,a):c(a))||a);return s&&a&&b(d,t,a),a};var o={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:8235252},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:7988723},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:8126829},"scandit-datacapture-sdk-barcode.wasm":{bytes:8097127}};export{p as a,o as b};
1
+ var b=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var p=(r,d,t,s)=>{for(var a=s>1?void 0:s?i(d,t):d,e=r.length-1,c;e>=0;e--)(c=r[e])&&(a=(s?c(d,t,a):c(a))||a);return s&&a&&b(d,t,a),a};var o={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:7334919},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:7221211},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:7268717},"scandit-datacapture-sdk-barcode.wasm":{bytes:7397834}};export{p as a,o as b};
@@ -0,0 +1 @@
1
+ import {a as a$6}from'./chunk-TKSABJXC.js';import {a}from'./chunk-HHYYL23G.js';import {a as a$9}from'./chunk-5A3VQBKX.js';import {a as a$1}from'./chunk-DDLFCE34.js';import {a as a$7}from'./chunk-ZPKXVCG3.js';import {b}from'./chunk-5V3FWMGO.js';import {b as b$1}from'./chunk-3N7HH72O.js';import {a as a$8}from'./chunk-RZWYP24A.js';import {a as a$3}from'./chunk-D3EYLYMV.js';import {a as a$4}from'./chunk-POONUNDO.js';import {b as b$2}from'./chunk-M7SLG4OU.js';import {a as a$5}from'./chunk-DHKABHFE.js';import {a as a$2}from'./chunk-I53W7VSB.js';import {Anchor,Localization,DataCaptureView,ZoomSwitchControl,Size,Point}from'@scandit/web-datacapture-core';import {ShutterButton}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/ShutterButton.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {html}from'@scandit/web-datacapture-core/build/js/private/utils/html.js';import {Card}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/Card.js';import {TorchSwitchIconButton}from'@scandit/web-datacapture-core/build/js/private/ui/molecules/TorchSwitchIconButton.js';var c={FinishButton:a$1.tag,ShutterButton:ShutterButton.tag,ProgressBarWithLabel:a.tag,CardListContainer:b$1.tag,TorchSwitchIconButton:TorchSwitchIconButton.tag},h=class h extends ScanditHTMLElement{constructor(){super(...arguments);this.shouldShowCarousel=true;this.shouldShowPauseButton=true;this.shouldShowFinishButton=true;this.shouldShowProgressBar=true;this.torchControlPosition=Anchor.TopLeft;this.zoomControlPosition=Anchor.TopRight;this.textForItemListUpdatedWhenPausedHint=null;this.textForItemListUpdatedHint=null;this.textForTapShutterToResumeSearchHint=null;this.textForTapShutterToPauseScreenHint=null;this.textForMoveCloserToBarcodesHint=null;this.textForPointAtBarcodesToSearchHint=null;this.textForAllItemsFoundSuccessfullyHint=null;this.textForCollapseCardsButton=Localization.getInstance().get("barcode.find.view.textForCollapseCardsButton");this.barcodeFindViewUiListener=null;this.shutterButton=null;this.finishButton=null;this.progressBar=null;this.cardList=null;this.onShutterButtonClickedHandler=this.onShutterButtonClicked.bind(this);this.onFinishButtonClickedHandler=this.onFinishButtonClicked.bind(this);this.onTorchButtonClickedHandler=this.onTorchButtonClicked.bind(this);this.torchSwitchIconButton=null;this._shouldShowTorchControl=false;this._isTorchAvailable=false;this.zoomSwitchControl=null;this._shouldShowZoomControl=false;this.onDotClickHandler=this.onDotClick.bind(this);}set shouldShowTorchControl(t){this._shouldShowTorchControl=t,this.torchSwitchIconButton!==null&&(this.torchSwitchIconButton.hidden=!(t&&this._isTorchAvailable));}get shouldShowTorchControl(){return this._shouldShowTorchControl}set shouldShowZoomControl(t){var e;this._shouldShowZoomControl=t;let o=(e=this.zoomSwitchControl)==null?void 0:e.zoomSwitchPill;o!=null&&(o.hidden=!t);}get shouldShowZoomControl(){return this._shouldShowZoomControl}get camera(){return this.presenter.context.frameSource}static async createWithSettings(t,o,e,n,s){let i=document.createElement(h.tag);i.barcodeFindViewSettings=n,i.layout=b.create(),i.layout.innerHTML=html`<${a.tag} slot="progress" value="0" max="1" ${i.shouldShowProgressBar?"":"hidden"}></${a.tag}><${TorchSwitchIconButton.tag} slot="top-controls-left" ${i.shouldShowTorchControl?"":"hidden"}></${TorchSwitchIconButton.tag}><${b$1.tag} slot="card-list" hidden text-for-collapse-cards-button=${i.textForCollapseCardsButton}></${b$1.tag}><${ShutterButton.tag} slot="bottom-controls-center" variant="play" ${i.shouldShowPauseButton?"":"hidden"}></${ShutterButton.tag}><${a$1.tag} slot="bottom-controls-right" ${i.shouldShowFinishButton?"":"hidden"}></${a$1.tag}>`,i.append(i.layout),a$2(t)?(i.dataCaptureView=t,t.htmlElement.prepend(i),await o.setMode(e),await t.setContext(o)):(i.dataCaptureView=await DataCaptureView.forContext(o),i.dataCaptureView.connectToElement(t),t.prepend(i));let a$5=s!=null?s:a$3.recommendedCameraSettings;return a$5.zoomLevels=[.5,1],i.presenter=new b$2(i,o,e,n,a$5),await i.presenter.prepare(),await i.installZoomControl(),i.barcodeFindBasicOverlay=await a$4.withBarcodeFind(e,i.dataCaptureView),i}static async create(t,o,e){return h.register(),h.createWithSettings(t,o,e,a$5.BarcodeFindViewSettings.settings,a$3.recommendedCameraSettings)}static register(){defineCustomElements({[h.tag]:h,[TorchSwitchIconButton.tag]:TorchSwitchIconButton,[ShutterButton.tag]:ShutterButton,[a.tag]:a,[b$1.tag]:b$1,[a$1.tag]:a$1,[b.tag]:b});}async startSearching(){return this.onShutterButtonClickedHandler()}async stopSearching(){return this.presenter.stopSearching()}async pauseSearching(){return this.onShutterButtonClickedHandler()}setListener(t){this.barcodeFindViewUiListener=t,this.presenter.barcodeFindViewUiListener=this.barcodeFindViewUiListener;}async setShouldShowUserGuidanceView(t){return this.shouldShowUserGuidance=t,this.barcodeFindBasicOverlay.setUserGuidanceEnabled(this.shouldShowUserGuidance)}async setShouldShowHints(t){return this.shouldShowHints=t,this.barcodeFindBasicOverlay.setShouldShowHint(this.shouldShowHints)}setShouldShowCarousel(t){this.shouldShowCarousel=t,this.layout.toggleVisibility(c.CardListContainer,t);}setShouldShowPauseButton(t){this.shouldShowPauseButton=t,this.layout.toggleVisibility(c.ShutterButton,t);}setShouldShowFinishButton(t){this.shouldShowFinishButton=t,this.layout.toggleVisibility(c.FinishButton,t);}setShouldShowProgressBar(t){this.shouldShowProgressBar=t,this.layout.toggleVisibility(c.ProgressBarWithLabel,t);}setShouldShowTorchControl(t){this.shouldShowTorchControl=t;}setShouldShowZoomControl(t){this.shouldShowZoomControl=t;}setTorchAvailable(t){this._isTorchAvailable=t,this.torchSwitchIconButton!==null&&(this.torchSwitchIconButton.hidden=!(this._shouldShowTorchControl&&this._isTorchAvailable));}setTorchControlPosition(t){var e;this.torchControlPosition=t,[Anchor.TopCenter,Anchor.TopLeft,Anchor.TopRight,Anchor.BottomLeft].includes(t)||(this.torchControlPosition=Anchor.TopLeft);let o={[Anchor.TopCenter]:"top-controls-center",[Anchor.TopLeft]:"top-controls-left",[Anchor.TopRight]:"top-controls-right",[Anchor.BottomLeft]:"bottom-controls-left"}[this.torchControlPosition];(e=this.torchSwitchIconButton)==null||e.setAttribute("slot",o);}setZoomControlPosition(t){var n;this.zoomControlPosition=t,[Anchor.TopCenter,Anchor.TopLeft,Anchor.TopRight,Anchor.BottomLeft].includes(t)||(this.zoomControlPosition=Anchor.TopRight);let o={[Anchor.TopCenter]:"top-controls-center",[Anchor.TopLeft]:"top-controls-left",[Anchor.TopRight]:"top-controls-right",[Anchor.BottomLeft]:"bottom-controls-left"}[this.zoomControlPosition],e=(n=this.zoomSwitchControl)==null?void 0:n.zoomSwitchPill;e==null||e.setAttribute("slot",o);}setTextForCollapseCardsButton(t){this.textForCollapseCardsButton=t,this.cardList!=null&&(this.cardList["text-for-collapse-cards-button"]=t);}async setTextForAllItemsFoundSuccessfullyHint(t){return this.textForAllItemsFoundSuccessfullyHint=t,this.barcodeFindBasicOverlay.setTextForAllItemsFoundSuccessfullyHint(this.textForAllItemsFoundSuccessfullyHint)}async setTextForPointAtBarcodesToSearchHint(t){return this.textForPointAtBarcodesToSearchHint=t,this.barcodeFindBasicOverlay.setTextForPointAtBarcodesToSearchHint(this.textForPointAtBarcodesToSearchHint)}async setTextForMoveCloserToBarcodesHint(t){return this.textForMoveCloserToBarcodesHint=t,this.barcodeFindBasicOverlay.setTextForMoveCloserToBarcodesHint(this.textForMoveCloserToBarcodesHint)}async setTextForTapShutterToPauseScreenHint(t){return this.textForTapShutterToPauseScreenHint=t,this.barcodeFindBasicOverlay.setTextForTapShutterToPauseScreenHint(this.textForTapShutterToPauseScreenHint)}async setTextForTapShutterToResumeSearchHint(t){return this.textForTapShutterToResumeSearchHint=t,this.barcodeFindBasicOverlay.setTextForTapShutterToResumeScreenHint(this.textForTapShutterToResumeSearchHint)}async setTextForItemListUpdatedWhenPausedHint(t){return this.textForItemListUpdatedWhenPausedHint=t,this.barcodeFindBasicOverlay.setTextForItemListUpdatedWhenPausedHint(this.textForItemListUpdatedWhenPausedHint)}async setTextForItemListUpdatedHint(t){return this.textForItemListUpdatedHint=t,this.barcodeFindBasicOverlay.setTextForItemListUpdatedHint(this.textForItemListUpdatedHint)}connectedCallback(){var t,o,e;this.shutterButton=this.layout.querySelector(c.ShutterButton),this.finishButton=this.layout.querySelector(c.FinishButton),this.progressBar=this.layout.querySelector(c.ProgressBarWithLabel),this.cardList=this.layout.querySelector(c.CardListContainer),this.torchSwitchIconButton=this.layout.querySelector(c.TorchSwitchIconButton),(t=this.torchSwitchIconButton)==null||t.addEventListener("pointerdown",this.onTorchButtonClickedHandler),(o=this.shutterButton)==null||o.addEventListener("pointerdown",this.onShutterButtonClickedHandler),(e=this.finishButton)==null||e.addEventListener("pointerdown",this.onFinishButtonClickedHandler),this.layout.addEventListener("onlayouttap",this.onDotClickHandler);}disconnectedCallback(){var t,o,e,n;(t=this.shutterButton)==null||t.removeEventListener("pointerdown",this.onShutterButtonClickedHandler),(o=this.torchSwitchIconButton)==null||o.addEventListener("pointerdown",this.onTorchButtonClickedHandler),(e=this.finishButton)==null||e.removeEventListener("pointerdown",this.onFinishButtonClickedHandler),this.layout.removeEventListener("onlayouttap",this.onDotClickHandler),(n=this.zoomSwitchControl)==null||n.remove(),this.presenter.dispose();}async installZoomControl(){this.zoomSwitchControl=new ZoomSwitchControl,await this.zoomSwitchControl.install(this.dataCaptureView);let t=this.zoomSwitchControl.zoomSwitchPill;t!=null&&(t.setAttribute("slot","top-controls-right"),t.hidden=!this._shouldShowZoomControl,this.layout.append(t));}async onShutterButtonClicked(){this.presenter.onShutterButtonClicked();}async onTorchButtonClicked(){this.presenter.onTorchButtonClicked();}updateProgressBar(t,o){this.progressBar&&(this.progressBar.value!==t&&(this.progressBar.value=t),o!=null&&this.progressBar.max!==o&&(this.progressBar.max=o));}setShutterButtonPulse(t){this.shutterButton!=null&&(this.shutterButton.pulse=t);}switchToPaused(t,o){var n,s,i,a,u,p,m,y,L,P,H,x;let e=[];for(let d of t){let w=Card.create();w.id=`${String(d.uid)}`;let B=a$6.create();if(w.append(B),B.title=(s=(n=d.content)==null?void 0:n.info)!=null?s:d.searchOptions.barcodeData,((i=d.content)==null?void 0:i.additionalInfo)!=null&&(B.subtitle=(u=(a=d.content)==null?void 0:a.additionalInfo)!=null?u:""),o.find(l=>l.searchOptions.barcodeData===d.searchOptions.barcodeData)!=null){let l=a$7.create();l.slot="right",B.append(l);}if(((p=d.content)==null?void 0:p.image)==null){let l=a$8.create();l.slot="image-left",B.append(l);}else {let l=document.createElement("img");l.slot="image-left",l.src=(y=(m=d.content)==null?void 0:m.image)!=null?y:"",l.alt=(P=(L=d.content)==null?void 0:L.additionalInfo)!=null?P:"",B.append(l);}e.push(w);}(H=this.cardList)==null||H.renderCards(e),(x=this.cardList)==null||x.removeAttribute("hidden"),this.shutterButton.variant="play",this.shutterButton.pulse=false,this.toggleDotPulse(false);}moveCardOnTheFront(t){var e,n;if(!t)return;let o=(e=this.cardList)==null?void 0:e.getCardBySelector(`${Card.tag}#${t.uid}`);o!=null&&((n=this.cardList)==null||n.unshiftCard(o));}switchToStarted(){var t;this.clearDots(),(t=this.cardList)==null||t.setAttribute("hidden",""),this.shutterButton.variant="pause";}toggleTorchIcon(t){this.torchSwitchIconButton&&(this.torchSwitchIconButton.state=t);}onFinishButtonClicked(){this.presenter.onFinishButtonClicked();}clearDots(){let t=this.layout.querySelectorAll("[data-identifier]");for(let o of t)o.remove();}toggleDotPulse(t){let o=[...this.layout.querySelectorAll("[data-identifier]")];for(let e of o)e.pulse=t;}pointTransformation(t){return `translate3d(calc(${t.x}px - 50%), calc(${t.y}px - 50%), 0px)`}onDotClick(t){let o=t.detail.target;if(o.dataset.identifier!=null){for(let e of this.layout.querySelectorAll(a$9.tag))e.pulse=false,o===e&&o.variant==="target"&&(o.pulse=true);this.presenter.onDotClick(o.dataset.identifier);}}createDotForTrackedBarcode(t,o,e){var u,p,m;let n=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),s=t.barcode.data!=null&&((u=o.foundTrackedBarcodesInLastProcessedFrame[`${t.identifier}`])==null?void 0:u.barcode.data)===t.barcode.data,i=s?(m=e==null?void 0:e[(p=t.barcode.data)!=null?p:""])==null?void 0:m.searchOptions.brush:void 0,a=i?a$9.createWithBrush(i,this.barcodeFindViewSettings.notInListItemColor):a$9.createWithColors(this.barcodeFindViewSettings.inListItemColor,this.barcodeFindViewSettings.notInListItemColor);return a.style.setProperty("position","absolute"),a.style.setProperty("transform",this.pointTransformation(n.center)),a.dataset.identifier=`${t.identifier}`,s&&(a.setAttribute("variant","target"),a.pulse=true),a}renderDots(t,o){var e,n;for(let s of t.removedTrackedBarcodes){let i=this.layout.querySelector(`[data-identifier="${s}"]`);i==null||i.remove();}if(t.addedTrackedBarcodes.length>0){let s=document.createDocumentFragment();for(let i of t.addedTrackedBarcodes)s.append(this.createDotForTrackedBarcode(i,t,o));this.layout.append(s);}for(let s of t.updatedTrackedBarcodes){let i=this.layout.querySelector(`[data-identifier="${s.identifier}"]`),{center:a}=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(s.anchorPositions);if(i){let u=(n=(e=this.camera)==null?void 0:e.getMirrorImageEnabled())!=null?n:false,p=new Size(this.dataCaptureView.width,this.dataCaptureView.height);i.style.setProperty("position","absolute");let m=u?Point.mirrorX(a,p):a;i.style.setProperty("transform",this.pointTransformation(m));}}}};h.tag="scandit-barcode-find-view";var M=h;export{M as a};
@@ -0,0 +1,2 @@
1
+ import {h as h$1}from'./chunk-4JEIREAU.js';import {a}from'./chunk-YBD5JYCX.js';import {ScanditHTMLElement,html,css,defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var C=class C extends ScanditHTMLElement{constructor(){super(...arguments);this.icons={scanner:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(32,32)}" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.69858 5.22983C3.69858 4.55065 4.263 4.00006 4.95924 4.00006H10.055C10.7512 4.00006 11.3156 4.55065 11.3156 5.22983C11.3156 5.90902 10.7512 6.45961 10.055 6.45961H6.2199V10.2007C6.2199 10.8799 5.65549 11.4305 4.95924 11.4305C4.263 11.4305 3.69858 10.8799 3.69858 10.2007V5.22983ZM20.6844 5.22983C20.6844 4.55065 21.2488 4.00006 21.945 4.00006H27.0408C27.737 4.00006 28.3014 4.55065 28.3014 5.22983V10.2007C28.3014 10.8799 27.737 11.4305 27.0408 11.4305C26.3445 11.4305 25.7801 10.8799 25.7801 10.2007V6.45961H21.945C21.2488 6.45961 20.6844 5.90902 20.6844 5.22983ZM2 16.0001C2 15.3209 2.56442 14.7703 3.26066 14.7703H28.7393C29.4356 14.7703 30 15.3209 30 16.0001C30 16.6792 29.4356 17.2298 28.7393 17.2298H3.26066C2.56442 17.2298 2 16.6792 2 16.0001ZM4.95924 20.5696C5.65549 20.5696 6.2199 21.1202 6.2199 21.7994V25.5405H10.055C10.7512 25.5405 11.3156 26.0911 11.3156 26.7703C11.3156 27.4495 10.7512 28.0001 10.055 28.0001H4.95924C4.263 28.0001 3.69858 27.4495 3.69858 26.7703V21.7994C3.69858 21.1202 4.263 20.5696 4.95924 20.5696ZM27.0408 20.5696C27.737 20.5696 28.3014 21.1202 28.3014 21.7994V26.7703C28.3014 27.4495 27.737 28.0001 27.0408 28.0001H21.945C21.2488 28.0001 20.6844 27.4495 20.6844 26.7703C20.6844 26.0911 21.2488 25.5405 21.945 25.5405H25.7801V21.7994C25.7801 21.1202 26.3445 20.5696 27.0408 20.5696Z" fill="${this.fill}" style=""/></svg>`,expand:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(14,14)}" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M5.46232 7.53028C5.75521 7.23738 6.23008 7.23738 6.52298 7.53028C6.81587 7.82317 6.81587 8.29804 6.52298 8.59094L2.86397 12.2499H5.5C5.91421 12.2499 6.25 12.5857 6.25 12.9999C6.25 13.4142 5.91421 13.7499 5.5 13.7499H1C0.948223 13.7499 0.897672 13.7447 0.848849 13.7347C0.507086 13.6648 0.25 13.3624 0.25 12.9999V8.49995C0.25 8.08573 0.585786 7.74995 1 7.74995C1.41421 7.74995 1.75 8.08573 1.75 8.49995V11.2426L5.46232 7.53028Z" fill="${this.fill}" style=""/><path fill-rule="evenodd" clip-rule="evenodd" d="M8.84283 6.08313C8.54994 6.37602 8.07506 6.37602 7.78217 6.08313C7.48928 5.79023 7.48928 5.31536 7.78217 5.02246L11.0545 1.75017L8.5 1.75017C8.08579 1.75017 7.75 1.41439 7.75 1.00017C7.75 0.58596 8.08579 0.250174 8.5 0.250174L13 0.250174C13.4142 0.250174 13.75 0.58596 13.75 1.00017L13.75 5.50017C13.75 5.91439 13.4142 6.25017 13 6.25017C12.5858 6.25017 12.25 5.91439 12.25 5.50017L12.25 2.67596L8.84283 6.08313Z" fill="${this.fill}" style=""/></svg>`,shrink:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(18,18)}" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" style=""><path fill-rule="evenodd" clip-rule="evenodd" d="M1.70694 17.7096C1.31642 18.1002 0.683255 18.1002 0.29273 17.7096C-0.0977935 17.3191 -0.0977935 16.6859 0.29273 16.2954L5.17662 11.4115L1.65674 11.4115C1.10445 11.4115 0.656738 10.9638 0.656738 10.4115C0.656738 9.85925 1.10445 9.41154 1.65674 9.41154L7.65674 9.41154C8.20902 9.41154 8.65674 9.85925 8.65674 10.4115C8.65674 10.4124 8.65674 10.4133 8.65674 10.4141C8.65674 10.415 8.65674 10.4159 8.65674 10.4167L8.65674 16.4167C8.65674 16.969 8.20902 17.4167 7.65674 17.4167C7.10445 17.4167 6.65674 16.969 6.65674 16.4167L6.65674 12.7598L1.70694 17.7096Z" fill="${this.fill}" style=""/><path fill-rule="evenodd" clip-rule="evenodd" d="M16.2929 0.290513C16.6834 -0.100011 17.3166 -0.100012 17.7071 0.290513C18.0976 0.681037 18.0976 1.3142 17.7071 1.70473L13.3388 6.07299L16.75 6.07299C17.3023 6.07299 17.75 6.5207 17.75 7.07299C17.75 7.62527 17.3023 8.07299 16.75 8.07299H10.75C10.1977 8.07299 9.75 7.62527 9.75 7.07299V1.07299C9.75 0.520705 10.1977 0.0729893 10.75 0.0729893C11.3023 0.0729893 11.75 0.520705 11.75 1.07299V4.83341L16.2929 0.290513Z" fill="${this.fill}" style=""/></svg>`,aimer:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(24,24)}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12 6.10352e-05C11.1716 6.10352e-05 10.5 0.671634 10.5 1.50006V6.50006C10.5 7.32849 11.1716 8.00006 12 8.00006C12.8284 8.00006 13.5 7.32849 13.5 6.50006V1.50006C13.5 0.671634 12.8284 6.10352e-05 12 6.10352e-05ZM16 11.5001C16 12.3285 16.6716 13.0001 17.5 13.0001H22.5C23.3284 13.0001 24 12.3285 24 11.5001C24 10.6716 23.3284 10.0001 22.5 10.0001H17.5C16.6716 10.0001 16 10.6716 16 11.5001ZM10.5 17.5001C10.5 16.6716 11.1716 16.0001 12 16.0001C12.8284 16.0001 13.5 16.6716 13.5 17.5001V22.5001C13.5 23.3285 12.8284 24.0001 12 24.0001C11.1716 24.0001 10.5 23.3285 10.5 22.5001V17.5001ZM0 11.5001C0 12.3285 0.671573 13.0001 1.5 13.0001H6.5C7.32843 13.0001 8 12.3285 8 11.5001C8 10.6716 7.32843 10.0001 6.5 10.0001H1.5C0.671573 10.0001 0 10.6716 0 11.5001Z" fill="${this.fill}" style=""/></svg>`,torchOff:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(18,25)}" viewBox="0 0 18 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.99965 24.5001C5.85357 24.4995 5.70938 24.467 5.57725 24.4046C5.44513 24.3423 5.32828 24.2518 5.23496 24.1394C5.14164 24.027 5.07411 23.8955 5.03714 23.7541C5.00017 23.6128 4.99466 23.4651 5.02099 23.3214L6.80765 13.4987H2.00765C1.85299 13.5004 1.70007 13.4659 1.56102 13.3982C1.42197 13.3305 1.3006 13.2313 1.20654 13.1085C1.11248 12.9857 1.0483 12.8427 1.01911 12.6908C0.989907 12.5389 0.996486 12.3823 1.03832 12.2334L2.61432 6.45739L0.292987 4.13739C0.105391 3.9498 -2.7954e-09 3.69536 0 3.43006C2.79541e-09 3.16476 0.105391 2.91032 0.292987 2.72273C0.480584 2.53513 0.735019 2.42974 1.00032 2.42974C1.26562 2.42974 1.52006 2.53513 1.70765 2.72273L17.2637 18.2774C17.3619 18.3689 17.4407 18.4793 17.4954 18.602C17.55 18.7247 17.5794 18.8571 17.5818 18.9914C17.5841 19.1256 17.5594 19.259 17.5092 19.3835C17.4589 19.508 17.384 19.6212 17.289 19.7161C17.1941 19.8111 17.081 19.8859 16.9565 19.9362C16.8319 19.9865 16.6986 20.0112 16.5643 20.0089C16.43 20.0065 16.2976 19.9771 16.1749 19.9224C16.0523 19.8678 15.9419 19.789 15.8503 19.6907L12.1863 16.0281L6.83565 24.0534C6.74421 24.1913 6.61994 24.3043 6.47402 24.3822C6.3281 24.4602 6.1651 24.5007 5.99965 24.5001ZM14.4503 12.6334L3.82899 2.01206L4.04099 1.23873C4.0984 1.02666 4.22406 0.839402 4.39854 0.70589C4.57302 0.572378 4.78662 0.500042 5.00632 0.500061L11.9997 0.500061C12.1547 0.501379 12.3073 0.538102 12.446 0.607427C12.5846 0.676752 12.7056 0.776844 12.7997 0.900061C12.893 1.02388 12.9564 1.16772 12.9846 1.32021C13.0128 1.47271 13.0052 1.62968 12.9623 1.77873L11.333 7.50006H15.9997C16.1807 7.50033 16.3583 7.54963 16.5136 7.64271C16.6689 7.7358 16.7961 7.8692 16.8817 8.02876C16.9673 8.18832 17.0081 8.36808 16.9998 8.54895C16.9914 8.72983 16.9342 8.90506 16.8343 9.05606L14.453 12.6334H14.4503Z" fill="${this.fill}" style=""/></svg>`,torchOn:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(16,25)}" viewBox="0 0 16 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M15.0072 7.00265H10.3321L11.9687 1.27515C12.0113 1.12618 12.0187 0.969359 11.9903 0.817052C11.9619 0.664746 11.8985 0.521115 11.8051 0.397482C11.7118 0.273849 11.5909 0.173593 11.4522 0.104616C11.3135 0.0356387 11.1606 -0.000174023 11.0057 6.35801e-07H4.00306C3.78345 -9.74579e-05 3.5699 0.0720732 3.39538 0.205378C3.22085 0.338682 3.09504 0.525713 3.03736 0.737613L0.0362252 11.7378C-0.00491183 11.8864 -0.0111074 12.0426 0.0181227 12.1941C0.0473529 12.3456 0.111217 12.4882 0.204723 12.6109C0.298228 12.7336 0.418842 12.833 0.557137 12.9014C0.695432 12.9697 0.84766 13.0052 1.00192 13.0049H5.80374L4.01906 22.83C3.97674 23.0569 4.01421 23.2915 4.12511 23.494C4.23602 23.6964 4.41353 23.8543 4.62756 23.9408C4.84158 24.0273 5.07894 24.0372 5.29939 23.9687C5.51984 23.9002 5.70981 23.7575 5.83708 23.5649L15.8409 8.55924C15.9417 8.40847 15.9997 8.23313 16.0085 8.05196C16.0174 7.87079 15.9769 7.69062 15.8912 7.53073C15.8056 7.37083 15.6781 7.23723 15.5224 7.14421C15.3667 7.05119 15.1886 7.00226 15.0072 7.00265Z" fill="${this.fill}" style=""/></svg>`,handle:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(14,6)}" viewBox="0 0 14 6" fill="none" xmlns="http://www.w3.org/2000/svg"><circle cx="1" cy="1" r="1" fill="${this.fill}" style=""/><circle cx="5" cy="1" r="1" fill="${this.fill}" style=""/><circle cx="9" cy="1" r="1" fill="${this.fill}" style=""/><circle cx="13" cy="1" r="1" fill="${this.fill}" style=""/><circle cx="1" cy="5" r="1" fill="${this.fill}" style=""/><circle cx="5" cy="5" r="1" fill="${this.fill}" style=""/><circle cx="9" cy="5" r="1" fill="${this.fill}" style=""/><circle cx="13" cy="5" r="1" fill="${this.fill}" style=""/></svg>`,continuous:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(32,32)}" viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.42499 3.93896C5.21585 3.93896 3.42499 5.72983 3.42499 7.93896V11.2723C3.42499 12.0087 4.02194 12.6056 4.75832 12.6056C5.4947 12.6056 6.09165 12.0087 6.09165 11.2723V7.93896C6.09165 7.20259 6.68861 6.60563 7.42499 6.60563H23.425C24.1614 6.60563 24.7583 7.20259 24.7583 7.93896V11.7876H22.8274C22.2742 11.7876 21.9617 12.4225 22.2991 12.8609L25.5634 17.1013C25.8303 17.448 26.3531 17.448 26.62 17.1013L29.8843 12.8609C30.2217 12.4225 29.9092 11.7876 29.356 11.7876H27.425V7.93896C27.425 5.72983 25.6341 3.93896 23.425 3.93896H7.42499Z" fill="${this.fill}" style=""/><path d="M23.5988 28.0001C25.808 28.0001 27.5988 26.2093 27.5988 24.0001V20.6668C27.5988 19.9304 27.0019 19.3335 26.2655 19.3335C25.5291 19.3335 24.9321 19.9304 24.9321 20.6668V24.0001C24.9321 24.7365 24.3352 25.3335 23.5988 25.3335L7.59882 25.3335C6.86244 25.3335 6.26548 24.7365 6.26548 24.0001L6.26548 19.3335H8.19646C8.74969 19.3335 9.06219 18.6985 8.72473 18.2601L5.46045 14.0197C5.19358 13.673 4.67078 13.673 4.40391 14.0197L1.13962 18.2601C0.802159 18.6985 1.11467 19.3335 1.66789 19.3335H3.59882L3.59882 24.0001C3.59882 26.2093 5.38968 28.0001 7.59882 28.0001L23.5988 28.0001Z" fill="${this.fill}" style=""/><path d="M12.6468 18.728C13.669 18.728 14.4697 18.2723 15.3942 17.133L15.4854 17.0288L15.5765 17.133C16.501 18.2723 17.3018 18.728 18.3239 18.728C19.9059 18.728 21.0843 17.5561 21.0843 16.0067V15.9936C21.0843 14.4442 19.9059 13.2723 18.3239 13.2723C17.3018 13.2723 16.501 13.7345 15.5765 14.8673L15.4854 14.978L15.3942 14.8673C14.4697 13.7345 13.669 13.2723 12.6468 13.2723C11.0648 13.2723 9.88641 14.4442 9.88641 15.9936V16.0067C9.88641 17.5561 11.0648 18.728 12.6468 18.728ZM12.738 17.3804C11.9242 17.3804 11.3447 16.8009 11.3447 16.0067V15.9936C11.3447 15.2059 11.9242 14.6199 12.738 14.6199C13.376 14.6199 13.8382 14.9585 14.5934 15.896L14.6781 16.0001L14.5934 16.1043C13.8382 17.0418 13.376 17.3804 12.738 17.3804ZM18.2328 17.3804C17.5947 17.3804 17.1325 17.0418 16.3773 16.1043L16.2927 16.0001L16.3773 15.896C17.1325 14.9585 17.5947 14.6199 18.2328 14.6199C19.0466 14.6199 19.626 15.2059 19.626 15.9936V16.0067C19.626 16.8009 19.0466 17.3804 18.2328 17.3804Z" fill="${this.fill}" style=""/></svg>`,close:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(10,10)}" viewBox="0 0 10 10" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L5 5L9 9" stroke="${this.fill}" stroke-width="2" stroke-linecap="round" style=""/><path d="M1 9L5 5L9 1" stroke="${this.fill}" stroke-width="2" stroke-linecap="round" style=""/></svg>`,find:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(22,22)}" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 2C3.34315 2 2 3.34315 2 5V8H4V5C4 4.44772 4.44772 4 5 4H8V2H5Z" fill="${this.fill}" style=""/><path d="M14 2V4H17C17.5523 4 18 4.44772 18 5V8H20V5C20 3.34315 18.6569 2 17 2H14Z" fill="${this.fill}" style=""/><path d="M8 18H5C4.44772 18 4 17.5523 4 17V14H2V17C2 18.6569 3.34315 20 5 20H8V18Z" fill="${this.fill}" style=""/><path d="M14 20H17C18.6569 20 20 18.6569 20 17V14H18V17C18 17.5523 17.5523 18 17 18H14V20Z" fill="${this.fill}" style=""/><path fill-rule="evenodd" clip-rule="evenodd" d="M12.5215 14.5215C11.9137 14.8276 11.227 15 10.5 15C8.01472 15 6 12.9853 6 10.5C6 8.01472 8.01472 6 10.5 6C11.1815 6 11.8276 6.1515 12.4066 6.42266C13.9387 7.14034 15 8.69623 15 10.5C15 11.5315 14.653 12.4819 14.0693 13.2409L15.6426 14.8142C16.0332 15.2047 16.0332 15.8379 15.6426 16.2284C15.2521 16.6189 14.6189 16.6189 14.2284 16.2284L12.5215 14.5215ZM13 10.5C13 11.8807 11.8807 13 10.5 13C9.11929 13 8 11.8807 8 10.5C8 9.11929 9.11929 8 10.5 8C10.8823 8 11.2393 8.08445 11.5582 8.23382C12.414 8.63468 13 9.50094 13 10.5Z" fill="${this.fill}" style=""/></svg>`,camera:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(25,25)}" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.0397 10.8609C11.3009 10.8609 10.7019 11.4687 10.7019 12.2185C10.7019 12.9683 11.3009 13.5761 12.0397 13.5761C12.7785 13.5761 13.3775 12.9683 13.3775 12.2185C13.3775 11.4687 12.7785 10.8609 12.0397 10.8609ZM8.02637 12.2185C8.02637 9.9691 9.8232 8.14563 12.0397 8.14563C14.2562 8.14563 16.053 9.9691 16.053 12.2185C16.053 14.4678 14.2562 16.2913 12.0397 16.2913C9.8232 16.2913 8.02637 14.4678 8.02637 12.2185Z" fill="${this.fill}" style=""/><path fill-rule="evenodd" clip-rule="evenodd" d="M18.0166 8.84792C18.4042 9.24131 19.0374 9.24596 19.4308 8.85832C19.8242 8.47068 19.8288 7.83754 19.4412 7.44415L18.7949 6.78827H20.0666C20.8054 6.78827 21.4044 7.39609 21.4044 8.14588V17.6492C21.4044 18.399 20.8054 19.0068 20.0666 19.0068H12.0399C11.3011 19.0068 10.7021 19.6146 10.7021 20.3644C10.7021 21.1142 11.3011 21.722 12.0399 21.722H20.0666C22.2831 21.722 24.08 19.8985 24.08 17.6492V8.14588C24.08 5.89651 22.2831 4.07304 20.0666 4.07304H18.7952L19.4412 3.41746C19.8288 3.02407 19.8242 2.39093 19.4308 2.00329C19.0374 1.61565 18.4042 1.6203 18.0166 2.01369L15.341 4.72892C14.9574 5.11822 14.9574 5.74339 15.341 6.13269L18.0166 8.84792Z" fill="${this.fill}" style=""/><path fill-rule="evenodd" clip-rule="evenodd" d="M8.02668 3.39404C8.02668 3.01914 8.32615 2.71523 8.69557 2.71523H14.7156C15.4544 2.71523 16.0534 2.1074 16.0534 1.35761C16.0534 0.607825 15.4544 0 14.7156 0H8.69557C6.84848 0 5.35112 1.51956 5.35112 3.39404C5.35112 3.76893 5.05165 4.07284 4.68223 4.07284H4.01334C1.79683 4.07284 0 5.89632 0 8.14569V17.649C0 19.8984 1.79683 21.7218 4.01334 21.7218H5.28453L4.63866 22.3773C4.25102 22.7707 4.25568 23.4038 4.64907 23.7915C5.04245 24.1791 5.6756 24.1744 6.06324 23.781L8.7388 21.0658C9.12242 20.6765 9.12242 20.0513 8.7388 19.662L6.06324 16.9468C5.6756 16.5534 5.04245 16.5488 4.64907 16.9364C4.25568 17.3241 4.25102 17.9572 4.63866 18.3506L5.28509 19.0066H4.01334C3.2745 19.0066 2.67556 18.3988 2.67556 17.649V8.14569C2.67556 7.3959 3.2745 6.78807 4.01334 6.78807H4.68223C6.52932 6.78807 8.02668 5.26851 8.02668 3.39404Z" fill="${this.fill}" style=""/></svg>`,label:()=>html`<svg width="${this.size}" height="${this.heightForViewbox(24,24)}" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 3C4.34315 3 3 4.34315 3 6V9H5V6C5 5.44772 5.44772 5 6 5H9V3H6Z" fill="${this.fill}" style=""/><path d="M15 3V5H18C18.5523 5 19 5.44772 19 6V9H21V6C21 4.34315 19.6569 3 18 3H15Z" fill="${this.fill}" style=""/><path d="M9 19H6C5.44772 19 5 18.5523 5 18V15H3V18C3 19.6569 4.34315 21 6 21H9V19Z" fill="${this.fill}" style=""/><path d="M15 21H18C19.6569 21 21 19.6569 21 18V15H19V18C19 18.5523 18.5523 19 18 19H15V21Z" fill="${this.fill}" style=""/><path d="M13.1538 17H9C7.89543 17 7 16.1046 7 15V9C7 7.89543 7.89543 7 9 7H15C16.1046 7 17 7.89543 17 9V13.6667V14.9999C17 16.1045 16.1046 16.9999 15.0001 16.9999L13.1538 17Z" stroke="${this.fill}" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M10.1426 11H13.1426" stroke="#3D4852" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 14H11.4286" stroke="#3D4852" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>`};}get styleElement(){return (this._styleElement)!=null||(this._styleElement=css`${a}{display:flex}`),this._styleElement}get icon(){var i;return (i=this.getAttribute("icon"))!=null?i:"scanner"}set icon(i){this.setAttribute("icon",i);}get fill(){var i;return (i=this.getAttribute("fill"))!=null?i:"black"}set fill(i){this.setAttribute("fill",i);}get size(){var i;return Number((i=this.getAttribute("size"))!=null?i:"32")}set size(i){this.setAttribute("size",i.toString());}get[h$1](){return this.getAttribute(h$1)}set[h$1](i){i==null?this.removeAttribute(h$1):this.setAttribute(h$1,i);}static create(){return defineCustomElements({[a]:C}),document.createElement(a)}render(){this.innerHTML=html`${this.icons[this.icon]()}`;}aspectRatioForViewbox(i,l){return l/i}heightForViewbox(i,l){return this.size*this.aspectRatioForViewbox(i,l)}connectedCallback(){this.render(),this.append(this.styleElement);}attributeChangedCallback(i,l,r){r!==l&&(this.render(),this.append(this.styleElement));}};C.observedAttributes=["icon","fill","size",h$1];var h=C;
2
+ export{h as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-M4AENTE5.js';import {TorchState,Camera,isCameraFrameSource,FrameSourceState}from'@scandit/web-datacapture-core';var m=(t=>(t.Started="started",t.Paused="paused",t.Stopped="stopped",t))(m||{}),h=class{constructor(e,i,t,s,r){this.viewState="paused";this.barcodeFindViewUiListener=null;this.torchState=TorchState.Off;this.sessionState=null;this.barcodeFindView=e,this.barcodeFind=t,this.context=i,this.viewSettings=s,this.cameraSettings=r,t.feedback=a.createWithOptions(this.viewSettings.soundEnabled,this.viewSettings.hapticEnabled);}async prepare(){var t;await this.barcodeFind.setEnabled(false),this.barcodeFind.addPrivateListener(this);let e=await Camera.getAll(false,isCameraFrameSource(this.context.frameSource)),i=isCameraFrameSource(this.context.frameSource)?this.context.frameSource:(t=e[0])!=null?t:Camera.pickBestGuess();await this.context.setFrameSource(i),await this.context.frameSource.applySettings(this.cameraSettings),this.isTorchAvailable=await i.isTorchAvailable(),this.barcodeFindView.setTorchAvailable(this.isTorchAvailable);}async dispose(){await this.context.removeMode(this.barcodeFind),this.barcodeFind.removePrivateListener(this);}async didPauseSearch(e){this.barcodeFindView.switchToPaused(Object.values(this.customerItemsListState),e);}async didStartSearch(){this.barcodeFindView.switchToStarted();}async didStopSearch(e){var i;(i=this.barcodeFindViewUiListener)==null||i.didTapFinishButton(e);}async onSetItemList(e){this.customerItemsListState=e.reduce((i,t)=>(i[t.searchOptions.barcodeData]=t,i),{}),this.barcodeFind.feedback.itemListUpdated.emit(),this.barcodeFindView.updateProgressBar(0,Object.values(this.customerItemsListState).length);}onDidUpdateSession(e,i,t){this.sessionState=i,this.barcodeFindView.updateProgressBar(this.sessionState.allFoundItems.length),this.barcodeFindView.renderDots(this.sessionState,this.customerItemsListState);}async onShutterButtonClicked(){this.viewState==="paused"||this.viewState==="stopped"?await this.startSearching():await this.pauseSearching();}async onTorchButtonClicked(){this.isTorchAvailable&&(await this.context.frameSource.setDesiredTorchState(this.torchState===TorchState.Off?TorchState.On:TorchState.Off),this.torchState=this.torchState===TorchState.Off?TorchState.On:TorchState.Off,this.barcodeFindView.toggleTorchIcon(this.torchState));}onDotClick(e){var t,s;let i=(t=this.sessionState)==null?void 0:t.trackedBarcodes[e];if(i!=null){let r=this.customerItemsListState[(s=i.barcode.data)!=null?s:""];this.barcodeFindView.moveCardOnTheFront(r);}}onFinishButtonClicked(){this.stopSearching();}onFindListUpdatedFeedback(){this.barcodeFind.feedback.itemListUpdated.emit();}onFeedback(){this.barcodeFind.feedback.found.emit(),this.barcodeFindView.setShutterButtonPulse(true);}async pauseSearching(){var e;this.viewState="paused",await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Standby)),await this.barcodeFind.setEnabled(false),await this.barcodeFind.pause(),this.barcodeFindView.setShutterButtonPulse(false);}async startSearching(){var e;this.viewState="started",await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.On)),await this.barcodeFind.setEnabled(true),await this.barcodeFind.start();}async stopSearching(){var e;this.viewState="stopped",await this.barcodeFind.setEnabled(false),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Off)),await this.barcodeFind.stop(),this.barcodeFindView.setShutterButtonPulse(false),this.sessionState=null;}};export{m as a,h as b};
@@ -0,0 +1,2 @@
1
+ import {b as b$3}from'./chunk-NZCSU4S2.js';import {b}from'./chunk-LGPC7KMW.js';import {a as a$2}from'./chunk-T2Y2C76P.js';import {a as a$1,b as b$2}from'./chunk-OPL5NVVM.js';import {a,b as b$1,d,c as c$1,e,f as f$1}from'./chunk-DVHTYKDX.js';import {f}from'./chunk-YBD5JYCX.js';import {Point}from'@scandit/web-datacapture-core';import {ScanditHTMLElement,css,defineCustomElements,safeCancelAnimation,html}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var c=class b$4 extends ScanditHTMLElement{constructor(){super(...arguments);this._pointerDownListener=this.onPointerDown.bind(this);this._pointerUpListener=this.onPointerUp.bind(this);this._longPressController=new b(this);this._longPressStartListener=this.onLongPressStart.bind(this);}get styleElement(){return (this._styleElement)!=null||(this._styleElement=css`${f}{background:#0000;border-radius:50%;display:none;height:90px;left:0;position:absolute;top:0;width:90px;z-index:10}${f}[unconstrained]{position:fixed;z-index:9999}${f}[expanded]{height:220px;margin-left:-65px;margin-top:-65px;width:220px}${f}[visible]{align-items:center;display:flex;justify-content:center}${f} div{background:var(${a});border-radius:50%;filter:drop-shadow(0 2px 6px #${a$1.toJSON()}) drop-shadow(0 1px 2px #${b$2.toJSON()});height:90px;position:relative;transition:filter .3s ease;width:90px}${f} div .pulse{background:#0000;height:100%;left:50%;opacity:.3;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%;z-index:-1}${f}[pressed] div{background:var(${b$1});filter:drop-shadow(0 4px 4px #${a$1.toJSON()}) drop-shadow(0 8px 12px #${b$2.toJSON()})}${f}[pressed][expanded] div{background:var(${d})}${f}[expanded] div{background:var(${c$1});height:200px;width:200px}${f} div img,${f} div svg{height:auto;left:50%;max-height:48px;max-width:48px;position:absolute;top:50%;transform:translate(-50%,-50%);width:100%}${f}[expanded] div img,${f}[expanded] div svg{max-height:64px;max-width:64px}`),this._styleElement}get minimized(){return !this.hasAttribute("expanded")}set minimized(t){this.toggleAttribute("minimized",!t);}get expanded(){return this.hasAttribute("expanded")}set expanded(t){this.toggleAttribute("expanded",t),this._dragController&&(this._dragController.margin=t?new Point(-65,-65):new Point(0,0),this._dragController.repositionIfOutOfBounds());}get pressed(){return this.hasAttribute("pressed")}set pressed(t){this.toggleAttribute("pressed",t);}get visible(){return this.hasAttribute("visible")}set visible(t){this.toggleAttribute("visible",t);}set useViewportBounds(t){this._dragController&&(this._dragController.useViewportBounds=t);}static create(){return defineCustomElements({[f]:b$4}),document.createElement(f)}connectedCallback(){var t;this.render(),this.append(this.styleElement),this._dragController=new b$3(this,(t=this.parentElement)==null?void 0:t.parentElement),this._dragController.connect(),this.addEventListener("pointerdown",this._pointerDownListener),this.addEventListener("pointerup",this._pointerUpListener),this.addEventListener("longpressstart",this._longPressStartListener),this._longPressController.connect(),this._longPressController.elementsAllowedToTriggerLongPressEvents.add(this),this._pulse=this.querySelector(".pulse"),this._pulseAnimation=new Animation(new KeyframeEffect(this._pulse,[{background:"rgba(0, 0, 0, 0)"},{background:`var(${e})`,transform:"translate(-50%, -50%) scale(1.1)"},{background:"rgba(0, 0, 0, 0)"}],{duration:1100,easing:"ease-out",iterations:Number.POSITIVE_INFINITY}));}disconnectedCallback(){var t;this.removeEventListener("pointerdown",this._pointerDownListener),this.removeEventListener("pointerup",this._pointerUpListener),this.removeEventListener("longpressstart",this._longPressStartListener),(t=this._dragController)==null||t.disconnect(),this._longPressController.disconnect(),this.innerHTML="";}repositionIfOutOfBounds(){var t;(t=this._dragController)==null||t.repositionIfOutOfBounds();}translateTo(t){var i;(i=this._dragController)==null||i.translateTo(t,false);}setImage(t){var n;let i=this.querySelector("div");(n=i.firstElementChild)==null||n.remove(),t&&i.append(t);}startPulsating(){var t;(t=this._pulseAnimation)==null||t.play();}stopPulsating(){this._pulseAnimation&&(safeCancelAnimation(this._pulseAnimation),this._pulseAnimation.currentTime=0);}render(){this.innerHTML=html`<div><div class="pulse"></div><svg width="49" height="26" viewBox="0 0 49 26" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="7.57422" y="-0.00390625" width="3.20017" height="25.7171" rx="0.5" fill="white" style="fill:var(${f$1})"/><path d="M44.8418 0.496094C44.8418 0.219952 45.0657 -0.00390625 45.3418 -0.00390625H48.001C48.2771 -0.00390625 48.501 0.219951 48.501 0.496094V25.2132C48.501 25.4894 48.2771 25.7132 48.001 25.7132H45.3418C45.0657 25.7132 44.8418 25.4894 44.8418 25.2132V0.496094Z" fill="white" style="fill:var(${f$1})"/><path d="M33.8271 0.896094C33.8271 0.399038 34.2301 -0.00390625 34.7271 -0.00390625H39.1368C39.6338 -0.00390625 40.0368 0.399038 40.0368 0.896094V24.8132C40.0368 25.3103 39.6338 25.7132 39.1368 25.7132H34.7271C34.2301 25.7132 33.8271 25.3103 33.8271 24.8132V0.896094Z" fill="white" style="fill:var(${f$1})"/><path d="M16.3154 0.746095C16.3154 0.331881 16.6512 -0.00390625 17.0654 -0.00390625H20.1879C20.6021 -0.00390625 20.9379 0.33188 20.9379 0.746094V24.9632C20.9379 25.3774 20.6021 25.7132 20.1879 25.7132H17.0654C16.6512 25.7132 16.3154 25.3774 16.3154 24.9632V0.746095Z" fill="white" style="fill:var(${f$1})"/><path d="M0.5 0.246094C0.5 0.108023 0.611929 -0.00390625 0.75 -0.00390625H2.2897C2.42777 -0.00390625 2.5397 0.108023 2.5397 0.246094V25.4632C2.5397 25.6013 2.42777 25.7132 2.2897 25.7132H0.75C0.611929 25.7132 0.5 25.6013 0.5 25.4632V0.246094Z" fill="white" style="fill:var(${f$1})"/><rect x="25.9688" y="-0.00390625" width="3.05794" height="25.7171" rx="0.5" fill="white" style="fill:var(${f$1})"/></svg></div>`;}onPointerDown(t){t instanceof PointerEvent&&(this._dragController&&(this._dragController.draggable=this.minimized),this._holdStart=Date.now(),this.setPointerCapture(t.pointerId));}onPointerUp(t){var i;if(t instanceof PointerEvent){let n=this._holdStart!=null&&Date.now()-this._holdStart<400,f=!((i=this._dragController)!=null&&i.pointerDownEvent)||!a$2(this._dragController.pointerDownEvent,t);n&&f&&this.dispatchEvent(new CustomEvent("tap")),this.pressed=false,this._holdStart=void 0,this.releasePointerCapture(t.pointerId);}}onLongPressStart(){this._dragController&&(this._dragController.draggable=true),this.pressed=true,this._holdStart=void 0;}};
2
+ export{c as a};
@@ -0,0 +1,2 @@
1
+ import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function d(r){let n=URL.createObjectURL(new Blob(['"use strict";(()=>{var u={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:7334919},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:7221211},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:7268717},"scandit-datacapture-sdk-barcode.wasm":{bytes:7397834}};function M(t){return typeof t=="object"&&t!=null}function C(t){if(typeof t=="string")return t;if(M(t)){if(typeof t.message=="string")return t.message}else if(typeof(t==null?void 0:t.toString)=="function")return t.toString();return"unknown error"}var d;(t=>{(l=>(l.Debug="debug",l.Info="info",l.Warn="warn",l.Error="error",l.Quiet="quiet"))(t.Level||(t.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),a="debug";function r(l){a=l}t.setLevel=r;function i(l,...h){if(!(e.get(a)>e.get(l)))switch(l){case"debug":{console.debug(...h);break}case"info":{console.log(...h);break}case"warn":{console.warn(...h);break}case"error":{console.error(...h);break}}}t.log=i;function n(...l){i("warn",...l)}t.warn=n;function o(...l){i("debug",...l)}t.debug=o;function s(...l){i("info",...l)}t.info=s;function c(...l){i("error",...l)}t.error=c})(d||(d={}));var ke=class{constructor(t){if(typeof t!="function")throw new TypeError("FinalizationRegistry callback must be a function")}register(t,e,a){}unregister(t){return!1}};function X(t){typeof t.FinalizationRegistry>"u"&&(t.FinalizationRegistry=ke)}function K(t,e,a){let r=e*a,i=new Uint8ClampedArray(r*4),n=new Uint32Array(i.buffer);for(let o=0;o<r;o++){let s=t[o];n[o]=4278190080|s<<16|s<<8|s}return i}var P=class Z extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,Z.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};async function De(t){let e;try{let a=new Promise((i,n)=>{e=setTimeout(()=>{d.debug(`IndexedDB database is blocked (timed out after ${t}ms). If you are running a Debug wasm build, things are slower and the timeout can be configured via IndexedDBBlockedTimeoutMs in localStorage (requires page reload).`),n(new P({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},t)}),r=new Promise((i,n)=>{FS.syncfs(!0,o=>{o!=null?n(o):i()})});await Promise.race([r,a])}finally{e!==void 0&&clearTimeout(e)}}async function Q(t){try{FS.mkdir(t.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw e}return FS.mount(IDBFS,{autoPersist:!0},t.writableDataPath),De(t.indexedDBTimeoutMs)}var ee={};function Ie(t){return[...new Uint8Array(t)].map(e=>{let a=e.toString(16);return a.length===1?`0${a}`:a}).join("")}async function*Pe(t){let e=t.getReader();try{for(;;){let{done:a,value:r}=await e.read();if(a)return;yield r}}finally{e.releaseLock()}}async function Be(t){let e=[],a=0,r=0;for await(let n of Pe(t))e.push(n),a+=n.length;let i=new Uint8Array(a);for(let n of e)i.set(n,r),r+=n.length;return i.buffer}var xe=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(xe||{});async function Te(t,e,a){if(typeof crypto.subtle.digest!="function")return d.log(d.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${a} could not be verified`),"NOT_VERIFIABLE";try{let r=t instanceof Promise?await t:t,i=await crypto.subtle.digest("SHA-256",r),n=Ie(i);return e==null?(d.log(d.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):n===e?(d.log(d.Level.Debug,`Data Capture library WASM integrity found at ${a} has been verified correctly.`),"VALID"):(d.log(d.Level.Warn,`The Scandit Data Capture library WASM file found at ${a} seems invalid: expected file hash doesn\'t match (received: ${n}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(r){return d.log(d.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var J=new Map([["br",4.4],["gzip",2.9],["none",1]]);function Ae(t){var e;let a="content-encoding";if(t==null||t.get(a)==null)return J.get("none");let r=new Set(((e=t.get(a))!=null?e:"").split(",").map(i=>i.trim()));for(let[i,n]of J)if(r.has(i))return n;return J.get("none")}function Oe(t){var e,a;if(t==null)return 0;let r=(e=Ae(t))!=null?e:1,i=Number.parseInt((a=t.get("content-length"))!=null?a:"0",10);return Number.isNaN(i)?0:Math.floor(i*r*100)/100}function Re(t){let{pathname:e}=new URL(t);for(let[a,r]of Object.entries(ee))if(e.endsWith(a))return r.bytes;return 0}function te(t){ee=t}var Ee=(t,e)=>{let a=Oe(e);return a===0?Re(t):a};function Le(t,e,a,{onProgress:r,onError:i,onComplete:n}){if(!e.body)return[e];let o=Ee(t,e.headers),s=0,c=0;if(typeof TransformStream>"u")return d.warn("TransformStream is not supported in this environment. Progress tracking will be disabled."),[e];let[l,h]=a?e.body.tee():[e.body],m=l.pipeThrough(new TransformStream({async transform(g,f){try{s+=g.length,c=Number((s/o*100).toFixed(2)),o>0&&g.length>0&&c<100?r==null||r({percentage:c,loadedBytes:s,privateUri:t}):o===0&&g.length>0&&(r==null||r({percentage:null,loadedBytes:s,privateUri:t})),f.enqueue(g)}catch(b){f.error(b),i==null||i({error:b})}},flush(g){r==null||r({percentage:100,loadedBytes:s,privateUri:t}),n==null||n({percentage:100,loadedBytes:s,privateUri:t}),g.terminate()}}));return[new Response(m,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),h]}async function U({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,onComplete:i,onError:n,referredOrigin:o}){let s=await fetch(t,{referrerPolicy:"origin",referrer:o!=null?o:""});if(!s.ok)throw new Error(`HTTP status code is not ok: ${s.status}, ${s.statusText}`);let[c,l]=Le(t,s,a,{onProgress:r,onError:n,onComplete:i});return l!=null&&Te(Be(l),e,t),c}function ae({wasmURI:t,expectedHash:e,verifyResponseHash:a,progressCallback:r,successCallback:i,errorCallback:n,importObject:o,referredOrigin:s}){async function c(h){try{let m=await U({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:s}),g=await(h!=null?h:m).arrayBuffer(),f=await self.WebAssembly.instantiate(g,o);i(f.instance,f.module)}catch(m){d.log(d.Level.Error,m),d.log(d.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`),n==null||n(m)}}async function l(){let h;try{h=await U({wasmURI:t,expectedHash:e,verifyResponseHash:a,onProgress:r,referredOrigin:s});let m=await self.WebAssembly.instantiateStreaming(h,o);i(m.instance,m.module)}catch(m){d.log(d.Level.Warn,m),d.log(d.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),c((h==null?void 0:h.bodyUsed)===!0?void 0:h)}}typeof self.WebAssembly.instantiateStreaming=="function"?l():c()}async function $(t,e,a,r){return new Promise((i,n)=>{t().then(i).catch(o=>{let s=e*2;if(s>a){n(o);return}r(o),self.setTimeout(()=>{$(t,s,a,r).then(i).catch(n)},e)})})}function G(t){var e,a;let r="unknown";if((e=t.href)!=null&&e.startsWith("blob:null/"))r="localhost";else{let i=((a=t.pathname)==null?void 0:a.length)>1&&!t.pathname.startsWith("/");r=new URL(i?t.pathname:t.origin).hostname}return r.startsWith("[")&&r.endsWith("]")?(r=r.slice(1,-1),r):(/^(\\d{1,3}\\.){3}\\d{1,3}$/.test(r)&&(r=r.split(".").map(i=>Number.parseInt(i,10).toString()).join(".")),r)}async function re(t,e){async function a(){return importScripts(t)}try{await $(a,250,4e3,i=>{d.log(d.Level.Warn,i),d.log(d.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${t}, retrying...`)}),self.Module.mainScriptUrlOrBlob=t;let r=self.SDC_WASM_JS_VERSION;return r!==e&&d.log(d.Level.Warn,`The Scandit Data Capture library JS file found at ${t} seems invalid: expected version doesn\'t match (received: ${r}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(r){return d.log(d.Level.Error,r),!1}}var ie=class{constructor(t){this.viewInfo=null,this.viewInfo=this.cloneViewInfo(t)}isSame(t){return this.viewInfo==null&&t==null?!0:this.viewInfo==null&&t!=null||this.viewInfo!=null&&t==null?!1:this.viewInfo.width===t.width&&this.viewInfo.height===t.height&&this.viewInfo.orientation===t.orientation&&this.viewInfo.viewFinderRect.origin.x===t.viewFinderRect.origin.x&&this.viewInfo.viewFinderRect.origin.y===t.viewFinderRect.origin.y&&this.viewInfo.viewFinderRect.size.width===t.viewFinderRect.size.width&&this.viewInfo.viewFinderRect.size.height===t.viewFinderRect.size.height}update(t){this.viewInfo=this.cloneViewInfo(t)}cloneViewInfo(t){return t?{...t,viewFinderRect:{origin:{...t.viewFinderRect.origin},size:{...t.viewFinderRect.size}}}:null}};var B=class{constructor(){this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};var j=class{constructor(t,e){this.workerFunctions=t,this.options=e,this.imageIdCounter=0,this.conversions=new Map}convertToJpeg(t,e){let a=this.imageIdCounter++,r=new B;this.conversions.set(a,r);let i=t.toBitmap();return this.workerFunctions.postMessage({type:"convertToJPEG",imageId:a,width:t.getWidth(),height:t.getHeight(),data:i,planes:t.getPlanes(),orientation:e,quality:this.options.quality},Array.from(new Set([i.buffer]))),r.promise}convertToBitmap(t){return{data:t.toBitmap(),byteOrder:1}}onConvertToJPEGResult(t,e){let a=this.conversions.get(t);a?(a.resolve(e),this.conversions.delete(t)):d.warn(`ImageConverterForwarder: Conversion for imageId ${t} not found in Map`)}};var x=class{constructor(t){this.options=t}get quality(){return this.options.quality}async convertToJpeg(t,e){try{let{width:a,height:r,planes:i}=this.validateAndExtractImageData(t);this.prepareCanvas(a,r);let n=this.processImageData(t,i,a,r);return await this.convertToJpegBytes(n,e)}catch(a){throw d.warn(`Failed to convert image to JPEG: ${a}`),a instanceof Error?a:new Error("Failed to convert image to JPEG")}}convertToBitmap(t){return{data:t.toBitmap(),byteOrder:1}}validateAndExtractImageData(t){let e=t.getWidth(),a=t.getHeight(),r=t.getPlanes();if(e<=0||a<=0)throw d.warn(`Invalid image dimensions: ${e}x${a}`),new Error(`Invalid image dimensions: ${e}x${a}`);if(!r||r.length===0)throw d.warn("ImageBuffer has no planes"),new Error("ImageBuffer has no planes");return{width:e,height:a,planes:r}}prepareCanvas(t,e){if(!this.ensureCanvas(t,e))throw new Error("Failed to create OffscreenCanvas");if(!this.canvas||!this.context)throw new Error("Canvas or context not properly initialized")}processImageData(t,e,a,r){let i=this.createImageDataFromBuffer(t,e,a,r);if(i===null)throw new Error("Failed to create ImageData");return this.validateImageData(i,a,r),i}validateImageData(t,e,a){var r;if(t.width!==e||t.height!==a)throw d.warn(`ImageData dimensions mismatch: expected ${e}x${a}, got ${t.width}x${t.height}`),new Error("ImageData dimensions mismatch");if(!t.data||t.data.length!==e*a*4)throw d.warn(`ImageData has invalid data length: expected ${e*a*4}, got ${((r=t.data)==null?void 0:r.length)||0}`),new Error("ImageData has invalid data length")}async convertToJpegBytes(t,e){if(!this.context||!this.canvas)throw new Error("Canvas or context not available");try{this.context.putImageData(t,0,0)}catch(n){throw d.warn(`Failed to put image data on canvas: ${n}`),new Error(`Failed to put image data on canvas: ${n}`)}let a=e!==0?this.applyRotation(this.canvas,e):this.canvas,r;try{r=await this.canvasToBlob(a)}catch(n){throw d.warn(`Failed to convert canvas to blob: ${n}`),new Error(`Failed to convert canvas to blob: ${n}`)}if(!r||r.size===0)throw d.warn("Canvas convertToBlob returned empty or null blob"),new Error("Failed to create JPEG blob");let i;try{i=await r.arrayBuffer()}catch(n){throw d.warn(`Failed to get array buffer from blob: ${n}`),new Error(`Failed to get array buffer from blob: ${n}`)}if(!i||i.byteLength===0)throw d.warn("Blob arrayBuffer returned empty or null buffer"),new Error("Failed to get array buffer from blob");return new Uint8Array(i)}ensureCanvas(t,e){try{return(!this.canvas||this.canvas.width!==t||this.canvas.height!==e)&&(this.canvas=this.getNewCanvas(t,e),this.context=this.canvas.getContext("2d")),this.context!==null}catch(a){return d.warn("Failed to create HTMLCanvasElement",a),!1}}createImageDataFromBuffer(t,e,a,r){let i=new Set(e.map(n=>n.channel));try{if(this.isYUVFormat(i)){let s=t.toBitmap();return!s||s.length!==a*r*4?(d.warn(`Invalid bitmap data from toBitmap(): expected ${a*r*4} bytes, got ${(s==null?void 0:s.length)||0}`),null):new ImageData(new Uint8ClampedArray(s),a,r)}if(this.isRGBAFormat(i))return this.createImageDataFromRGBAPlanes(e,a,r);if(this.isRGBFormat(i))return this.createImageDataFromRGBPlanes(e,a,r);if(this.isGrayscaleFormat(i))return this.createImageDataFromGrayscalePlanes(e,a,r);d.warn(`Unknown image format with channels: ${Array.from(i).join(", ")}, falling back to toBitmap()`);let n=t.toBitmap();if(!n||n.length===0)return d.warn("toBitmap() returned empty or null data"),null;let o=n.length/(a*r);return o===4?new ImageData(new Uint8ClampedArray(n),a,r):(d.warn(`Unsupported format: ${o} bytes per pixel`),null)}catch(n){return d.warn(`Failed to create ImageData: ${n}`),null}}isYUVFormat(t){return t.has(0)&&t.has(1)&&t.has(2)}isRGBAFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&t.has(6)}isRGBFormat(t){return t.has(3)&&t.has(4)&&t.has(5)&&!t.has(6)}isGrayscaleFormat(t){return t.has(0)&&!t.has(1)&&!t.has(2)}createImageDataFromRGBAPlanes(t,e,a){let r=t.find(c=>c.channel===3),i=t.find(c=>c.channel===4),n=t.find(c=>c.channel===5),o=t.find(c=>c.channel===6);if(!r||!i||!n||!o)return d.warn("Missing RGBA planes"),null;let s=new Uint8ClampedArray(e*a*4);for(let c=0;c<a;c++)for(let l=0;l<e;l++){let h=(c*e+l)*4;s[h]=this.getPixelFromPlane(r,l,c),s[h+1]=this.getPixelFromPlane(i,l,c),s[h+2]=this.getPixelFromPlane(n,l,c),s[h+3]=this.getPixelFromPlane(o,l,c)}return new ImageData(s,e,a)}createImageDataFromRGBPlanes(t,e,a){let r=t.find(s=>s.channel===3),i=t.find(s=>s.channel===4),n=t.find(s=>s.channel===5);if(!r||!i||!n)return d.warn("Missing RGB planes"),null;let o=new Uint8ClampedArray(e*a*4);for(let s=0;s<a;s++)for(let c=0;c<e;c++){let l=(s*e+c)*4;o[l]=this.getPixelFromPlane(r,c,s),o[l+1]=this.getPixelFromPlane(i,c,s),o[l+2]=this.getPixelFromPlane(n,c,s),o[l+3]=255}return new ImageData(o,e,a)}createImageDataFromGrayscalePlanes(t,e,a){let r=t.find(n=>n.channel===0);if(!r)return d.warn("Missing Y plane for grayscale"),null;let i=new Uint8ClampedArray(e*a*4);for(let n=0;n<a;n++)for(let o=0;o<e;o++){let s=(n*e+o)*4,c=this.getPixelFromPlane(r,o,n);i[s]=c,i[s+1]=c,i[s+2]=c,i[s+3]=255}return new ImageData(i,e,a)}getPixelFromPlane(t,e,a){let r=Math.floor(e/(t.subsamplingX||1)),i=Math.floor(a/(t.subsamplingY||1)),n=t.rowStride,o=t.pixelStride,s=i*n+r*o,c=t.data;return s<c.length?c[s]:0}applyRotation(t,e){let a=e*Math.PI/180,r=e===90||e===270||e===-90||e===-270,i=r?t.height:t.width,n=r?t.width:t.height,o=this.getNewCanvas(i,n),s=o.getContext("2d");if(!s)throw new Error("Failed to get 2D context for rotated canvas");return s.translate(i/2,n/2),s.rotate(a),s.translate(-t.width/2,-t.height/2),s.drawImage(t,0,0),o}};x.JPEG_IMAGE_MIME_TYPE="image/jpeg";var ne=class extends x{getNewCanvas(t,e){return new OffscreenCanvas(t,e)}canvasToBlob(t){return t.convertToBlob({type:x.JPEG_IMAGE_MIME_TYPE,quality:this.options.quality})}};var T;(t=>{function e(){return"8.4.0"}t.sdkVersion=e})(T||(T={}));function We(t){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(t)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(t)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function Ne(t){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(t);return e?e[0]:null}function se(t,e,a){let r=e,i=We(r);if(i.result){let o=Ne(r);o!=null&&(r=`${i.cdnBaseURL}${o}@${t}/sdc-lib/`)}let n=a.replace(".wasm","");return i.result?{jsURI:`${r}${n}.js`,wasmURI:`${r}${n}.wasm`}:{jsURI:`${r}${n}.js?v=${t}`,wasmURI:`${r}${n}.wasm?v=${t}`}}var oe=class de{constructor(e,a){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=5,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameColorType="RGBA",this.lastFrameId=null,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.lastMetricsReportTime=0,this.metricsReportInterval=1e3,this.performanceMetrics={frameDataPoolSize:0,cameraOutputFrames:0,redrawRequestsCount:0,actualRedrawsCount:0,frameProcessingStartedCount:0,frameProcessedCount:0,frameSkippedCount:0},this.frameProcessingStartedCount=0,this.frameProcessingFinishedCount=0,this.gestureListener=null,this.webPlatformHintPresenter=null,this.deviceInstance=null,this.deviceInfo=null,this.lastViewInfo=new ie(null),this.lastFrameProcessingStartedCount=0,this.lastFrameProcessingFinishedCount=0,this.moduleHandler=e,this.workerFunctions=a,this._loadProgressCallback=this._loadProgressCallback.bind(this),te(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}prepareFrameForListener(e){let a=this.lastFrameId;if(this.frameDataPool.size>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL){let o=this.frameDataPool.keys().next().value;o!=null&&this.frameDataPool.delete(o)}let r=e.getFrameData(),i=new Uint8ClampedArray(r);this.frameDataPool.set(a,{data:i,colorType:this.lastFrameColorType,frameId:a,width:e.getWidth(),height:e.getHeight()});let n=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:a,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:n,colorType:this.lastFrameColorType}}createContext(e){var a,r,i,n,o;let s=this.getModeDeserializers(),c=G(location);(c==="localhost"||c==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(c+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,c,this.parentDomain,s,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let l=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(l==null){let p=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${p}`)}let h=l.getView();this.context=l.getContext(),l.delete(),this.setupDeviceInterface(e.isTablet,e.batteryInfo);let m=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(p,y)=>{this.contextDidChangeStatus(JSON.parse(y.toJson())),p.delete()},didStartObservingContext:p=>{this.didStartObservingContext(),p.delete()},didStopObservingContext:p=>{p.delete()}}),g=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:p=>{p.delete()},onObservationStopped:p=>{p.delete()},onFrameProcessingStarted:(p,y)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),y.delete(),p.delete()},onFrameProcessingFinished:(p,y)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),y.delete(),p.delete()},onFrameSkipped:(p,y)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),y.delete(),p.delete()}}),f=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(p,y)=>{var v;(v=this.gestureListener)==null||v.delete(),this.gestureListener=p.clone(),p.delete()}});(a=this.gestureRecognizer)==null||a.delete(),this.gestureRecognizer=new f;let b=new m;this.context.addListener(b),b.delete();let D=new g;this.context.addFrameListener(D),D.delete(),this.setView(h),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let F=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:p=>{p.delete()},showToast:p=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(p)})},hideToast:p=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(p)})},showGuidance:p=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(p)})},hideGuidance:p=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(p)})},startUpdateTimer:p=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:p}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(i=this.hintPresenterV2)==null||i.delete(),this.hintPresenterV2=null,(n=this.webPlatformHintPresenter)==null||n.delete(),this.webPlatformHintPresenter=null,this.webPlatformHintPresenter=new F,this.view&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(o=this.view)==null||o.setHintPresenterV2(this.hintPresenterV2)),this.webImageConverterInstance=this.getImageConverterInstance({quality:1}),this.Module.ImageConverter.setInstance(this.webImageConverterInstance)}convertToJPEGResult(e,a){this.webImageConverterInstance instanceof j&&this.webImageConverterInstance.onConvertToJPEGResult(e,a)}getImageConverterInstance(e){return this.workerFunctions.getOffscreenCanvas()!=null?new ne(e):new j(this.workerFunctions,e)}onTap(e){var a;(a=this.gestureListener)==null||a.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.lastMetricsReportTime=performance.now(),this.scheduleMetricsReporting())}scheduleMetricsReporting(){this.performanceMetricsReporterTimer=setTimeout(()=>{this.checkAndReportMetrics()},100)}checkAndReportMetrics(){let e=performance.now();e-this.lastMetricsReportTime>=this.metricsReportInterval&&(this.reportPerformanceMetrics(),this.performanceMetrics.cameraOutputFrames=0,this.performanceMetrics.redrawRequestsCount=0,this.performanceMetrics.actualRedrawsCount=0,this.lastMetricsReportTime=e),this._isDrawLoopRunning&&this.scheduleMetricsReporting()}async reportPerformanceMetrics(){let e=this.frameProcessingStartedCount-this.lastFrameProcessingStartedCount,a=this.frameProcessingFinishedCount-this.lastFrameProcessingFinishedCount;this.lastFrameProcessingStartedCount=this.frameProcessingStartedCount,this.lastFrameProcessingFinishedCount=this.frameProcessingFinishedCount;let r={cameraOutputFrames:this.performanceMetrics.cameraOutputFrames,redrawRequestsCount:this.performanceMetrics.redrawRequestsCount,actualRedrawsCount:this.performanceMetrics.actualRedrawsCount,frameDataPoolSize:this.performanceMetrics.frameDataPoolSize,frameProcessingStartedCount:e,frameProcessedCount:a,frameSkippedCount:this.performanceMetrics.frameSkippedCount};this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:r})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,a,r,i,n;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.cleanupMetricsReporting(),(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(a=this.gestureListener)==null||a.delete(),this.gestureListener=null,(r=this.hintPresenterV2)==null||r.delete(),this.hintPresenterV2=null,(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=null,(n=this.deviceInstance)==null||n.delete(),this.deviceInstance=null,this.deviceInfo=null}cleanupMetricsReporting(){this.performanceMetricsReporterTimer!=null&&(typeof this.performanceMetricsReporterTimer=="number"?cancelAnimationFrame(this.performanceMetricsReporterTimer):clearTimeout(this.performanceMetricsReporterTimer),this.performanceMetricsReporterTimer=void 0)}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[de.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var a;if(this.context==null)return d.debug("[processFrame] Context is null, returning frame without processing"),{payload:e,transferables:[e.data.buffer]};this.lastFrameId=e.frameId;let r=e.data,i=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888;this.lastFrameColorType=e.colorType==="GRAYSCALE"?"GRAYSCALE":"RGBA";let n=this.Module.allocateUint8Array(r.byteLength);return this.Module.HEAPU8.set(r,n),(a=this.imageFrameSource)==null||a.outputFrame(n,e.width,e.height,i),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus)}requestFrameData(e){let a=this.frameDataPool.get(e);if(a==null)return{payload:{data:null,frameId:null,colorType:null}};if(a.data.buffer.byteLength===0)return this.frameDataPool.delete(e),{payload:{data:null,frameId:null,colorType:null}};let r=a.data;a.colorType==="GRAYSCALE"&&(r=K(a.data,a.width,a.height));let i={payload:{data:r,frameId:a.frameId,colorType:a.colorType},transferables:[r.buffer]};return this.frameDataPool.delete(e),i}scheduleRedraw(e,a){this.addRedrawRequest(a),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,a){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,a,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let a=n=>this.redrawRequests.length>0&&this.redrawRequests[0]<=n,r=n=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=n;)this.redrawRequests.shift()},i=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let n=performance.now();if(a(n)){r(n),e.draw();let o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o))}i()},this.redrawInterval)};i()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let a=this.onBeforeUpdateContextHook(e),r=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(a.context));if(r==null){let n=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${n}`)}this.context.delete(),this.context=r.getContext();let i=r.getView();r.delete(),i!=null&&a.view!=null&&(i.setViewSize(a.view.width,a.view.height,a.view.orientation),i.draw()),!this.hintPresenterV2&&this.webPlatformHintPresenter&&(this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter)),i!=null&&this.hintPresenterV2&&i.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&(i==null||i.setGestureRecognizer(this.gestureRecognizer)),this.setView(i),this.notifyMainThreadOnViewInfoChanged(i),d.debug("context updated",a)}}notifyMainThreadOnViewInfoChanged(e){let a=this.getViewInfo(e);this.lastViewInfo.isSame(a)||(this.lastViewInfo.update(a),this.workerFunctions.postMessage({type:"viewSizeChanged",payload:a}))}getViewInfo(e){if(e!=null)try{let a=JSON.parse(e.getViewInfo());if(a!=null){let r=this.getOrientationFromNumber(a.orientation);return{...a,orientation:r}}}catch(a){d.error("Failed to get view size",a)}return null}getOrientationFromNumber(e){switch(e){case 90:return"landscapeRight";case 180:return"portraitUpsideDown";case 270:return"landscapeLeft";default:return"portrait"}}onBeforeUpdateContextHook(e){return e}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,a;return{payload:{isDisplayingViewfinder:(a=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?a:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,a){return a?e?"a6fdbd54509d0430486d3f8db30e9cd9b56c776e13f950afd7f748c3a766fcce":"b199954cae14b20468d2e8073423068c9034ef5d083526f99470ed954a0a8153":e?"baaf12e7f85c82d6890e099664d15bc8bee1b913ad7b8871c4d023d931171977":""}getWasmCoreFileName(e,a){return a?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":""}getWasmMetadata(){return u}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((a,r)=>a-r)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${G(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}addNativeOverlay(e){d.warn("addNativeOverlay has not been implemented for this module",e)}removeNativeOverlay(e){d.warn("removeNativeOverlay has not been implemented for this module",e)}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let a=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new a;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),a=e.DataDecoding.extend("DataDecoding",{decode(r,i){try{let n=JSON.parse(i),o=[];for(let s of n){let c=new TextDecoder(s.ianaName,{fatal:!0});o.push(c.decode(r.slice(s.startIndex,s.endIndex)))}return o.join("")}catch{return""}}});e.setDataDecoding(new a)}getBatteryData(){var e,a;let r=(a=(e=this.deviceInfo)==null?void 0:e.batteryInfo)==null?void 0:a.percentage;if(r!=null)return{percentage:r}}isTablet(){var e,a;return(a=(e=this.deviceInfo)==null?void 0:e.isTablet)!=null?a:!1}setupDeviceInterface(e,a){this.deviceInfo={isTablet:e,batteryInfo:a};let r=this.moduleHandler.get(),i=r.DeviceInterface.extend("DeviceInterface",{getBatteryData:this.getBatteryData.bind(this),isTablet:this.isTablet.bind(this)});this.deviceInstance=new i,r.DeviceHolder.setCurrentDevice(this.deviceInstance)}updateBatteryInfo(e){this.deviceInfo&&(this.deviceInfo.batteryInfo=e)}start(e,a,r){e&&a&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||r())}getWritableDataPath(e){return e!=null?(d.debug(`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:a,writableDataPathOverride:r,indexedDBTimeoutMs:i,verifyResponseHash:n,referredOrigin:o,fixedWasmMemory:s,simdSupport:c,threadsSupport:l}){var h;let m=!1,g=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,self.path=a;let{resolve:f,reject:b,promise:D}=new B,F=T.sdkVersion();if(F==="")throw new P({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let p=this.getWasmCoreFileName(c,l),y=se(F,e,p),{jsURI:v,wasmURI:Y}=y,ve={instantiateWasm:(S,Fe)=>(ae({importObject:S,wasmURI:Y,expectedHash:this.getWasmCoreExpectedHash(c,l),verifyResponseHash:n,successCallback:Fe,progressCallback:this._loadProgressCallback,errorCallback:Me=>{b(Me)},referredOrigin:o}),{})},I=s===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(s),maximum:this.numOfMBToPages(300),shared:l});return I!==null&&d.log(d.Level.Debug,"Fixed wasmMemory set",I),this.moduleHandler.set({...I?{wasmMemory:I}:{},mainScriptUrlOrBlob:v,canvas:(h=this.workerFunctions.getOffscreenCanvas())!=null?h:{getContext:()=>null},...ve,dynamicLibraries:this.getWasmDynamicLibraries(Y),locateFile:S=>e+S,noInitialRun:!0,preRun:[async()=>{try{await Q({writableDataPath:this.writableDataPath,indexedDBTimeoutMs:i})}catch(S){if(S.name==="BlockedIndexedDB"){b(S.toString());return}d.log(d.Level.Debug,"No IndexedDB support, some data will not be persisted:",S)}g=!0,this.start(g,m,f)}],onMainComplete:()=>{if([m,g].includes(!1)){d.log(d.Level.Warn,{runtimeLoaded:m,fileSystemSynced:g},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),b("onMainComplete has been called but runtime or file system was not ready.");return}f()},onRuntimeInitialized:()=>{m=!0,this.start(g,m,f)},print:S=>{d.info(S)}}),await re(v,F)||b(`Couldn\'t retrieve Scandit Data Capture library at ${v}, did you configure the path for it correctly?`),D}};oe.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var k=oe;function ce(t){return typeof t=="object"&&t!=null&&t.document==null&&"addEventListener"in t&&typeof t.importScripts=="function"}function le(t){console.warn("Reached unexpected case",t)}var q=class{constructor(t,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=t,this.dataCaptureInstance=new k(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ce(t)&&(X(t),this.listenToMessages())}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",t=>{d.log(d.Level.Error,t)}),this.workerSelf.addEventListener("messageerror",t=>{d.log(d.Level.Error,t)})}postMessage(t,e){this.workerSelf.postMessage(t,e!=null?e:[])}getOffscreenCanvas(){if(this.isOffscreenCanvasSupported())return new this.workerSelf.OffscreenCanvas(32,32)}isOffscreenCanvasSupported(){return typeof this.workerSelf.OffscreenCanvas=="function"}hasPayload(t){return M(t)&&"payload"in t}hasTransferables(t){return M(t)&&Array.isArray(t.transferables)}async respondWith(t,e,a){let r=null,i;try{i=a(),i instanceof Promise&&(i=await i)}catch(o){i=void 0,r=C(o)}let n={type:"workerTaskId",command:t,id:e,payload:this.hasPayload(i)?i.payload:void 0};r!=null&&(n.error=r),this.postMessage(n,this.hasTransferables(i)?i.transferables:[])}onMessage(t){switch(t.data.command){case"loadLibrary":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,threadsSupport:e.threadsSupport,simdSupport:e.simdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory,indexedDBTimeoutMs:e.indexedDBTimeoutMs}))}break}case"onTap":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point)})}break}case"hintPresenterV2update":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain,isTablet:e.isTablet,batteryInfo:e.batteryInfo}))}break}case"setFrameSource":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource))}break}case"processFrame":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,frameId:e.frameId,width:e.width,height:e.height,colorType:e.colorType}))}break}case"requestFrameData":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId))}break}case"deleteFrameData":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId)})}break}case"updateContext":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e))}break}case"dispose":{this.respondWith(t.data.command,t.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e))}break}case"setLogLevel":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{d.setLevel(e.level)})}break}case"updateBatteryInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.updateBatteryInfo(e.batteryInfo)})}break}case"extractCentaurusLicense":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}case"addNativeOverlay":this.dataCaptureInstance.addNativeOverlay(t);break;case"removeNativeOverlay":this.dataCaptureInstance.removeNativeOverlay(t);break;case"convertToJPEGResult":{{let{data:e}=t;this.dataCaptureInstance.convertToJPEGResult(e.imageId,e.result)}break}default:return le(t.data),!1}return!0}};var ue=(t=>(t.Body="body",t.Footnote="footnote",t))(ue||{}),A=(t=>(t.Start="start",t.Center="center",t.End="end",t))(A||{}),pe=(t=>(t.Normal="normal",t.Wider="wider",t.FitText="fitText",t))(pe||{}),he=(t=>(t.Normal="normal",t.Taller="taller",t))(he||{}),me=(t=>(t.Square="square",t.Rounded="rounded",t))(me||{}),O=(t=>(t.None="none",t.Check="check",t.ExclamationMark="exclamationMark",t))(O||{}),R=(t=>(t.Top="top",t.Center="center",t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(R||{}),ge=(t=>(t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(ge||{}),fe=(t=>(t.BlackOnWhite="blackOnWhite",t.WhiteOnBlack="whiteOnBlack",t.Transparent="transparent",t))(fe||{}),be=(t=>(t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Notification="notification",t))(be||{}),ye=(t=>(t[t.Ocr=0]="Ocr",t[t.HideLogo=1]="HideLogo",t[t.ShowTestLicenseMessage=2]="ShowTestLicenseMessage",t[t.AugmentedReality=5]="AugmentedReality",t[t.ActivityPingStatsAddon=8]="ActivityPingStatsAddon",t[t.ActivityPing=9]="ActivityPing",t[t.Registration=10]="Registration",t[t.Parser=11]="Parser",t[t.BarcodeCapture=14]="BarcodeCapture",t[t.Analytics=17]="Analytics",t[t.AnalyticsBatchMode=18]="AnalyticsBatchMode",t[t.AnalyticsScanContent=19]="AnalyticsScanContent",t[t.AnalyticsOnlineVerification=20]="AnalyticsOnlineVerification",t[t.SparkScan=21]="SparkScan",t[t.AamvaIdBarcodeVerification=22]="AamvaIdBarcodeVerification",t[t.MappingForTracking=23]="MappingForTracking",t[t.BarcodeFind=24]="BarcodeFind",t[t.MandatoryRegistration=25]="MandatoryRegistration",t[t.FeatureTracking=26]="FeatureTracking",t[t.IdCaptureViz=27]="IdCaptureViz",t[t.IdCaptureMrz=28]="IdCaptureMrz",t[t.IdCaptureBarcode=29]="IdCaptureBarcode",t[t.BarcodeSelectionAimToScan=30]="BarcodeSelectionAimToScan",t[t.BarcodeSelectionTapToScan=31]="BarcodeSelectionTapToScan",t[t.BarcodeCount=32]="BarcodeCount",t[t.BarcodePick=33]="BarcodePick",t[t.IdVerificationDataComparison=34]="IdVerificationDataComparison",t[t.SmartLabelBarcode=35]="SmartLabelBarcode",t[t.SmartLabelText=36]="SmartLabelText",t[t.VoidedIdDetection=37]="VoidedIdDetection",t[t.BarcodeArFull=38]="BarcodeArFull",t[t.BarcodeSequence=39]="BarcodeSequence",t))(ye||{});var E=class{constructor(e,a,r){this.barcodeAr=null;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){var r;(r=this.barcodeAr)==null||r.delete(),this.barcodeAr=new this.Module.BarcodeAr(this.coreEngine.context,JSON.stringify(e));let a=this.Module.BarcodeArListener.extend("BarcodeArListener",{didUpdateSession:(i,n,o)=>{let s=this.coreEngine.prepareFrameForListener(o);this.workerFunctions.postMessage({type:"barcodeArDidUpdateSession",payload:{session:JSON.parse(n.toJson()),frameData:s}}),i.delete(),n.delete(),o.delete()}});this.barcodeAr.addListener(new a,1),this.Module.addBarcodeArToContext(this.coreEngine.context,this.barcodeAr)}start(){var e;(e=this.barcodeAr)==null||e.start()}pause(){var e;(e=this.barcodeAr)==null||e.pause()}stop(){var e;(e=this.barcodeAr)==null||e.stop()}setEnabled(e){var a;(a=this.barcodeAr)==null||a.setEnabled(e)}async removeMode(){this.barcodeAr!=null&&this.Module.removeBarcodeArFromContext(this.coreEngine.context,this.barcodeAr)}applySettings(e){var a;(a=this.barcodeAr)==null||a.applySettings(JSON.stringify(e))}};var L=class{constructor(e,a,r){this.trackingListenerSet=!1;this.coreEngine=e,this.Module=a,this.workerFunctions=r,this.setup()}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getBatchDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeBatchListener.extend("BarcodeTrackingListener",{didUpdateSession:(r,i,n)=>{this.barcodeBatchDidUpdateSession(i),r.delete(),i.delete(),n.delete()},onTrackedBarcodeTapped:(r,i)=>{this.onTrackedBarcodeTapped(i),r.delete(),i.delete()}}),a=this.Module.BarcodeBatchDeserializerListener.extend("BarcodeTrackingDeserializerListener",{onModeDeserializationFinished:(r,i,n)=>{this.trackingListenerSet||(i.addListener(new e,1),this.trackingListenerSet=!0),r.delete(),i.delete(),n.delete()},onModeDeserializationStarted(r,i,n){r.delete(),i.delete(),n.delete()},onSettingsDeserializationStarted(r,i,n){r.delete(),i.delete(),n.delete()},onSettingsDeserializationFinished(r,i,n){r.delete(),i.delete(),n.delete()}});this.barcodeBatchDeserializer=new this.Module.BarcodeBatchDeserializer,this.barcodeBatchDeserializer.setListener(new a)}onTrackedBarcodeTapped(e){this.workerFunctions.postMessage({type:"didTapTrackedBarcode",payload:JSON.parse(e.toJson())})}};var W=class{constructor(e,a,r){this.captureListenerSet=!1;this.coreEngine=e,this.Module=a,this.workerFunctions=r,this.setup()}barcodeCaptureDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeCaptureDidUpdateSession",payload:JSON.parse(e.toJson())})}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getCaptureDeserializer(){return this.barcodeCaptureDeserializer}getTrackingDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeCaptureListener.extend("BarcodeCaptureListener",{didScan:(o,s,c)=>{this.barcodeCaptureDidScan(s,c),o.delete(),c.delete(),s.delete()},didUpdateSession:(o,s,c)=>{this.barcodeCaptureDidUpdateSession(s),o.delete(),c.delete(),s.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=new e,i=new a,n=this.Module.BarcodeCaptureDeserializerListener.extend("BarcodeCaptureDeserializerListener",{onModeDeserializationFinished:(o,s,c)=>{s.addListener(r,1),s.setSuccessFeedback(i),o.delete(),s.delete(),c.delete()},onModeDeserializationStarted(o,s,c){o.delete(),s.delete(),c.delete()},onSettingsDeserializationStarted(o,s,c){o.delete(),s.delete(),c.delete()},onSettingsDeserializationFinished(o,s,c){o.delete(),s.delete(),c.delete()}});this.barcodeCaptureDeserializer=new this.Module.BarcodeCaptureDeserializer,this.barcodeCaptureDeserializer.setListener(new n)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}barcodeCaptureDidScan(e,a){let r=this.coreEngine.prepareFrameForListener(a);this.workerFunctions.postMessage({type:"barcodeCaptureDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};function He(t){return t.charAt(0).toUpperCase()+t.slice(1)}function Se(t){return t}var N=class{constructor(e,a,r){this.barcodeFind=null;this.basicOverlay=null;this.transparentGuidanceHintStyle={backgroundColor:"00000000",cornerRadius:4,fitToText:!1,isAnimatedToView:!1,textAlignment:A.Center,hintIcon:O.None,hintAnchor:R.Center,hintAnchorOffset:0,horizontalMargin:0,iconColor:"00000000",lineHeight:-1,maxLines:1,maxWidthFraction:.8,textColor:"ffffffff",textSize:15,textWeight:600};this.customerTransformation=Se;this.coreEngine=e,this.Module=a,this.workerFunctions=r}async forSettings(e){var o;(o=this.barcodeFind)==null||o.delete(),this.barcodeFind=new this.Module.BarcodeFind(this.coreEngine.context,JSON.stringify(e));let a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.listUpdatedFeedback()}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.barcodeFindFeedback()}}),i=this.Module.BarcodeFindTransformer.extend("BarcodeFindTransformer",{transformBarcodeData:s=>this.customerTransformation(s)}),n=this.Module.BarcodeFindListener.extend("BarcodeFindListener",{didUpdateSession:(s,c,l)=>{let h=this.coreEngine.prepareFrameForListener(l);this.workerFunctions.postMessage({type:"barcodeFindDidUpdateSession",payload:{session:JSON.parse(c.toJson()),frameData:h}}),s.delete(),c.delete(),l.delete()},onSearchPaused:s=>{let c=[];for(let l=0;l<s.size();l++)c.push(s.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchPaused",payload:{foundItems:c}})},onSearchStopped:s=>{let c=[];for(let l=0;l<s.size();l++)c.push(s.get(l));this.workerFunctions.postMessage({type:"barcodeFindSearchStopped",payload:{foundItems:c}})},onSearchStarted:()=>{this.workerFunctions.postMessage({type:"barcodeFindSearchStarted",payload:{}})}});this.barcodeFind.setBarcodeFindTransformer(new i),this.barcodeFind.addListener(new n,1),this.barcodeFind.setItemListUpdatedFeedback(new a),this.barcodeFind.setFeedback(new r),this.Module.addBarcodeFindToContext(this.coreEngine.context,this.barcodeFind)}barcodeFindFeedback(){this.workerFunctions.postMessage({type:"barcodeFindFeedback",payload:{}})}start(){var e;(e=this.barcodeFind)==null||e.start()}stop(){var e;(e=this.barcodeFind)==null||e.stop()}pause(){var e;(e=this.barcodeFind)==null||e.pause()}setEnabled(e){var a;(a=this.barcodeFind)==null||a.setEnabled(e)}setItemList(e){var a;(a=this.barcodeFind)==null||a.setItemList(JSON.stringify(e))}async removeMode(){this.barcodeFind!=null&&this.Module.removeBarcodeFindFromContext(this.coreEngine.context,this.barcodeFind)}addBasicOverlay(){var e;(e=this.basicOverlay)==null||e.delete(),this.basicOverlay=null,this.barcodeFind!=null&&(this.basicOverlay=new this.Module.BarcodeFindBasicOverlay(this.barcodeFind)),this.coreEngine.view!=null&&this.basicOverlay!=null&&(this.basicOverlay.setGuidanceHandler(this.createWebFindGuidanceHandler()),this.Module.addBarcodeFindBasicOverlayToView(this.coreEngine.view,this.basicOverlay))}removeBasicOverlay(){this.coreEngine.view!=null&&this.basicOverlay!=null&&this.Module.removeBarcodeFindBasicOverlayFromView(this.coreEngine.view,this.basicOverlay)}async applySettings(e){var a;(a=this.barcodeFind)==null||a.applySettings(JSON.stringify(e))}updateBasicOverlay(e){let a=Object.entries(e).filter(([r,i])=>r!=="type");for(let[r,i]of a){let n=`set${He(r)}`;this.basicOverlay!=null&&typeof this.basicOverlay[n]=="function"&&i!=null&&this.basicOverlay[n](i)}}setTransformerFunction(e){this.customerTransformation=e!=null?e:Se}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}listUpdatedFeedback(){this.workerFunctions.postMessage({type:"barcodeFindListUpdatedFeedback",payload:{}})}setToast(e,a){let r=this.coreEngine.hintPresenterV2;e?r==null||r.showToast(JSON.stringify(a)):r==null||r.hideToast(a.tag)}setGuidance(e,a,r){let i={tag:r,text:a,hintStyle:this.transparentGuidanceHintStyle};this.workerFunctions.postMessage({type:e?"showGuidance":"hideGuidance",payload:i})}createWebFindGuidanceHandler(){let e=this.Module.BarcodeFindGuidanceHandler.extend("BarcodeFindGuidanceHandler",{setInitialGuidance:(a,r)=>{this.setGuidance(a,r,"InitialGuidance")},setMoveCloserGuidance:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"MoveCloserGuidance")},setTapShutterToPause:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"TapShutterToPause")},setTapShutterToResume:(a,r)=>{this.setGuidance(!1,r,"InitialGuidance"),this.setGuidance(a,r,"TapShutterResume")}});return new e}};var w=class{constructor(e){this.subscribers=new Set;this.property={key:e,value:null}}addSubscriber(e){var a;this.subscribers.add(e),(a=e.onPropertyChanged)==null||a.call(e,this.property)}removeSubscriber(e){this.subscribers.delete(e)}setProperty(e){var a;if(this.property.value!==e.value){this.property={key:this.property.key,value:e.value};for(let r of this.subscribers)(a=r.onPropertyChanged)==null||a.call(r,this.property)}}};var _e={torch_state:new w("torch_state"),scanning_mode:new w("scanning_mode"),sound_enabled:new w("sound_enabled"),haptic_enabled:new w("haptic_enabled"),session_stop_reason:new w("session_stop_reason"),camera_position:new w("camera_position")},H=class{getBehaviorSubject(e){return _e[e]}};var _=class{constructor(e,a,r){this.captureListenerSet=!1;this.propertyPushSource=new H;this.coreEngine=e,this.Module=a,this.workerFunctions=r,this.setup()}sparkScanDidUpdateSession(e){this.workerFunctions.postMessage({type:"sparkScanDidUpdateSession",payload:JSON.parse(e.toJson())})}getSparkScanDeserializer(){return this.sparkScanDeserializer}setup(){let e=this.Module.SparkScanListener.extend("SparkScanListener",{didScan:(i,n,o)=>{this.sparkScanDidScan(n,o),i.delete(),n.delete(),o.delete()},didUpdateSession:(i,n,o)=>{this.sparkScanDidUpdateSession(n),i.delete(),n.delete(),o.delete()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),r=this.Module.SparkScanDeserializerListener.extend("SparkScanDeserializerListener",{onModeDeserializationFinished:(i,n,o)=>{if(!this.captureListenerSet){n.addListener(new e,1),n.setSuccessFeedback(new a),n.setPropertyPushSource(this.propertyPushSource);let s=this.Module.SparkScanViewHandlerDelegate.extend("SparkScanViewHandlerDelegate",{onSwitchedAwayFromSmartScanSelection:()=>{this.workerFunctions.postMessage({type:"sparkScanSwitchedAwayFromSmartScanSelection"})},onSwitchedToSmartScanSelection:()=>{this.workerFunctions.postMessage({type:"sparkScanSwitchedToSmartScanSelection"})},enableHapticWhenOverlapping:()=>{},onStateTransition:()=>{},resetAllTimers:()=>{}}),c=new s,l=n.getStateMachine();l.setViewHandlerDelegate(c),c.delete(),l.delete(),this.sparkScan=n.clone(),this.captureListenerSet=!0}i.delete(),o.delete(),n.delete()},onModeDeserializationStarted(i,n,o){i.delete(),n.delete(),o.delete()},onSettingsDeserializationStarted(i,n,o){i.delete(),n.delete(),o.delete()},onSettingsDeserializationFinished(i,n,o){i.delete(),n.delete(),o.delete()},onOverlayDeserializationStarted(i,n,o){i.delete(),n.delete(),o.delete()},onOverlayDeserializationFinished:(i,n,o)=>{var s;(s=this.sparkScanOverlay)==null||s.delete(),this.sparkScanOverlay=n,i.delete(),o.delete()}});this.sparkScanDeserializer=new this.Module.SparkScanDeserializer,this.sparkScanDeserializer.setListener(new r)}emitErrorFeedback(e){var a;(a=this.sparkScanOverlay)==null||a.onErrorFeedbackEmitted(e)}overlayReadyForDraw(){var e;(e=this.sparkScanOverlay)==null||e.onReadyForNewData()}discardEnqueuedData(){var e;(e=this.sparkScanOverlay)==null||e.discardEnqueuedData()}analyticsManagerPropertyChanged(e){this.propertyPushSource.getBehaviorSubject(e.key).setProperty(e)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}selectItemWithSmartScanSelection(){var e;(e=this.sparkScan)==null||e.selectItemWithSmartScanSelectionAsync()}async removeMode(){var e,a;this.captureListenerSet=!1,(e=this.sparkScan)==null||e.delete(),this.sparkScan=void 0,(a=this.sparkScanOverlay)==null||a.delete(),this.sparkScanOverlay=void 0}sparkScanDidScan(e,a){let r=this.coreEngine.prepareFrameForListener(a);this.workerFunctions.postMessage({type:"sparkScanDidScan",payload:{session:JSON.parse(e.toJson()),frameData:r}})}};var z=class extends k{constructor(e,a){super(e,a)}getModeDeserializers(){this.barcodeCaptureMode=new W(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new L(this,this.Module,this.workerFunctions),this.sparkScanMode=new _(this,this.Module,this.workerFunctions),this.barcodeFindMode=new N(this,this.Module,this.workerFunctions),this.barcodeArMode=new E(this,this.Module,this.workerFunctions);let e=super.getModeDeserializers();return e.push_back(this.barcodeCaptureMode.getCaptureDeserializer()),e.push_back(this.barcodeBatchMode.getBatchDeserializer()),e.push_back(this.sparkScanMode.getSparkScanDeserializer()),e}getWasmSideModuleFileName(){return""}getWasmCoreFileName(e,a){return a?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":"scandit-datacapture-sdk-barcode.wasm"}getWasmCoreExpectedHash(e,a){return a?e?"a6fdbd54509d0430486d3f8db30e9cd9b56c776e13f950afd7f748c3a766fcce":"b199954cae14b20468d2e8073423068c9034ef5d083526f99470ed954a0a8153":e?"baaf12e7f85c82d6890e099664d15bc8bee1b913ad7b8871c4d023d931171977":"44e7416a3ba85f1439e67914e7aab3cdd6ea9eda484ab9fb3eebed50866b167b"}getWasmMetadata(){return u}};function ze(t){return(a=>/^[$A-Z_a-z][\\w$]*\\s*\\(.*\\)\\s*\\{/.test(a)&&!a.startsWith("function"))(t)?`function ${t}`:t}var Ve=["fetch","XMLHttpRequest","eval","Function","self","globalThis","Module","importScripts","this","console","window","document","import","Worker","ServiceWorker"];function Je(t){return Ve.map(a=>new RegExp(`\\\\b${a}\\\\b`,"g")).some(a=>a.test(t))}function we(t){if(t==null)return null;let e=ze(t);if(Je(e))throw new Error("Function should be pure. Shouldn\'t introduce side effects, or rely on global scope");let a=`\'use strict\';\n return (${e});`;try{return new Function(a)()}catch{return null}}var V=class extends q{constructor(e,a){super(e,a),this.dataCaptureInstance=new z(a,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,a,r){let i=null,n;try{n=r(),n instanceof Promise&&(n=await n)}catch(s){n=void 0,i=C(s)}let o={type:"workerTaskId",command:e,id:a,payload:this.hasPayload(n)?n.payload:void 0};i!=null&&(o.error=i),this.postMessage(o,this.hasTransferables(n)?n.transferables:[])}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(a.shouldRemoveBrush)}),!0}case"sparkScanOverlayReadyForDraw":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw()}),!0}case"sparkScanOverlayDiscardEnqueuedData":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.discardEnqueuedData()}),!0}case"sparkScanAnalyticsManagerPropertyChanged":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(a.property)}),!0}case"sparkScanSelectItemWithSmartScanSelection":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.selectItemWithSmartScanSelection()}),!0}case"sparkScanModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.sparkScanMode.removeMode()),!0}case"barcodeFindForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(a.settings)),!0}case"barcodeFindModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.removeMode()),!0}case"barcodeFindSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.start()}),!0;case"barcodeFindSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.pause()}),!0;case"barcodeFindSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.stop()}),!0;case"barcodeFindSetItemList":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(a.itemList)}),!0}case"barcodeFindSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(a.enabled)}),!0}case"barcodeFindApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(a.settings)),!0}case"barcodeFindAddBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay()}),!0}case"barcodeFindRemoveBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay()}),!0}case"barcodeFindUpdateBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(a.jsonOverlay)}),!0}case"barcodeFindSetTransformerFunction":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{let r=we(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r)}),!0}case"barcodeArForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.forSettings(a.settings)),!0}case"barcodeArModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeArMode.removeMode()),!0}case"barcodeArSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.start()}),!0;case"barcodeArSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.pause()}),!0;case"barcodeArSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.stop()}),!0;case"barcodeArSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeArMode.setEnabled(a.enabled)}),!0}case"barcodeArApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeArMode.applySettings(a.settings)}),!0}default:return super.onMessage(e)}}};var lr=new V(self,{get:()=>self.Module,set:t=>{self.Module=t}});function ur(t){}})();\n'],{type:"application/javascript"})),e=new Worker(n,r);return URL.revokeObjectURL(n),e}var l=class r extends DataCaptureLoader{constructor(){super(...arguments);this._name="BarcodeCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=d({name:this.name})),this._dataCaptureWorker}get name(){return this._name}static async create(e){var a;let t=new r(e);return await t.workerCommand("setLogLevel",{level:(a=e.logLevel)!=null?a:Logger.Level.Debug}),await t.load(),t}async workerCommand(e,t,a){return new Promise((c,o)=>{let i=this.workerCommandId++;this.workerTasks.set(i,{resolve:c,reject:o,command:e});let s={...t,command:e,id:i};this.dataCaptureWorker.postMessage(s,a);})}};
2
+ export{l as a};
@@ -0,0 +1 @@
1
+ import {b as b$1,a as a$2}from'./chunk-4PYZSS3H.js';import {i,h}from'./chunk-DVHTYKDX.js';import {a}from'./chunk-JT2GDIAM.js';import {d,c,k,l,m,e,b}from'./chunk-4JEIREAU.js';import {c as c$1,a as a$1}from'./chunk-YBD5JYCX.js';import {ScanditHTMLElement,css,defineCustomElements,renderIf,html}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var S=class S extends ScanditHTMLElement{constructor(){super(...arguments);this.targetModeButtonTapListener=this.onTargetModeButtonTap.bind(this);this.scanningBehaviorButtonTapListener=this.onScanningBehaviorButtonTap.bind(this);this.barcodeFindButtonTapListener=this.onBarcodeFindButtonTap.bind(this);this.labelCaptureButtonTapListener=this.onLabelCaptureButtonTap.bind(this);this.cameraSwitchButtonTapListener=this.onCameraSwitchButtonTap.bind(this);this.computedStyle=getComputedStyle(this);}get styleElement(){return (this._styleElement)!=null||(this._styleElement=css`.${c$1}{align-items:center;box-sizing:border-box;display:flex;gap:12px;height:48px;padding:6.75px 12px;position:relative;width:100%}${c$1} .container{border-bottom-left-radius:16px;border-bottom-right-radius:16px;overflow-x:scroll;-ms-overflow-style:none;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior:contain}.${c$1}::-webkit-scrollbar{display:none}.${c$1}__button{align-items:center;background:none;border:none;cursor:pointer;display:flex;flex-shrink:0;height:40px;justify-content:center;width:40px}.${c$1}__separator{background:var(${i});flex-shrink:0;height:32px;width:1px}.${c$1}__button--mode{background:#f1f5f8;border-radius:50%}`),this._styleElement}get[d](){return this.hasAttribute(d)}set[d](t){this.toggleAttribute(d,t);}get[c](){return this.hasAttribute(c)}set[c](t){this.toggleAttribute(c,t);}get[k](){return this.hasAttribute(k)}set[k](t){this.toggleAttribute(k,t);}get[l](){return this.hasAttribute(l)}set[l](t){this.toggleAttribute(l,t);}get[m](){return this.hasAttribute(m)}set[m](t){this.toggleAttribute(m,t);}get[e](){return this.hasAttribute(e)}set[e](t){this.toggleAttribute(e,t),this.targetModeButtonIcon&&(this.targetModeButtonIcon.fill=t?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i));}get[b](){var t;return (t=this.getAttribute(b))!=null?t:"single"}set[b](t){this.setAttribute(b,t),this.scanningBehaviorButtonIcon&&(this.scanningBehaviorButtonIcon.fill=t==="continuous"?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i));}get visibleButtonCount(){return [c,d,m].filter(t=>this[t]===true).length}get visibleModeButtonCount(){return [k,l].filter(t=>this[t]===true).length}get allVisibleButtonsCount(){return this.visibleButtonCount+this.visibleModeButtonCount}static create(){return defineCustomElements({[c$1]:S,[a$1]:a}),document.createElement(c$1)}enableCameraSwitchButton(t){this.cameraSwitchButtonIcon&&(this.cameraSwitchButtonIcon.fill=t?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i));}render(){var y,w,E,C,f,L,k$1,M;let t=this[e]?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i),p=this[b]==="continuous"?this.computedStyle.getPropertyValue(h):this.computedStyle.getPropertyValue(i),h$1=renderIf(this[k],html`<button id="barcodeFindButton" class="${c$1}__button ${c$1}__button--mode"><spark-scan-view-icon icon="find" fill="#3D4852" size="21.6"></spark-scan-view-icon></button>`),b$1=renderIf(this[l],html`<button id="labelCaptureButton" class="${c$1}__button ${c$1}__button--mode"><spark-scan-view-icon icon="label" fill="#3D4852" size="21.6"></spark-scan-view-icon></button>`),m$1=renderIf(this.visibleButtonCount>0&&this.visibleModeButtonCount>0,html`<div class="${c$1}__separator"></div>`),A=renderIf(this[d],html`<button id="targetModeButton" class="${c$1}__button"><spark-scan-view-icon icon="aimer" fill="${t}" size="18"></spark-scan-view-icon></button>`),I=renderIf(this[m],html`<button id="cameraSwitchButton" class="${c$1}__button"><spark-scan-view-icon icon="camera" fill="white" size="24.08"></spark-scan-view-icon></button>`),x=renderIf(this[c],html`<button id="scanningBehaviorButton" class="${c$1}__button"><spark-scan-view-icon icon="continuous" fill="${p}" size="24"></spark-scan-view-icon></button>`),H=this.allVisibleButtonsCount<=3?"center":"flex-start";this.innerHTML=html`<div class="container"><div class="${c$1}">${h$1} ${b$1} ${m$1} ${A} ${I} ${x}</div></div>`;let T=this.querySelector(`.${c$1}`);T&&(T.style.justifyContent=H),this.targetModeButton=this.querySelector("#targetModeButton"),(y=this.targetModeButton)==null||y.addEventListener("pointerup",this.targetModeButtonTapListener),this.targetModeButtonIcon=(w=this.targetModeButton)==null?void 0:w.querySelector(a$1),this.scanningBehaviorButton=this.querySelector("#scanningBehaviorButton"),(E=this.scanningBehaviorButton)==null||E.addEventListener("pointerup",this.scanningBehaviorButtonTapListener),this.scanningBehaviorButtonIcon=(C=this.scanningBehaviorButton)==null?void 0:C.querySelector(a$1),this.barcodeFindButton=this.querySelector("#barcodeFindButton"),(f=this.barcodeFindButton)==null||f.addEventListener("pointerup",this.barcodeFindButtonTapListener),this.labelCaptureButton=this.querySelector("#labelCaptureButton"),(L=this.labelCaptureButton)==null||L.addEventListener("pointerup",this.labelCaptureButtonTapListener),this.cameraSwitchButton=this.querySelector("#cameraSwitchButton"),(k$1=this.cameraSwitchButton)==null||k$1.addEventListener("pointerup",this.cameraSwitchButtonTapListener),this.cameraSwitchButtonIcon=(M=this.cameraSwitchButton)==null?void 0:M.querySelector(a$1);}connectedCallback(){this[d]=true,this[m]=true,this.render(),this.append(this.styleElement);}disconnectedCallback(){var t,p,h,b,m;(t=this.targetModeButton)==null||t.removeEventListener("pointerup",this.targetModeButtonTapListener),(p=this.scanningBehaviorButton)==null||p.removeEventListener("pointerup",this.scanningBehaviorButtonTapListener),(h=this.barcodeFindButton)==null||h.removeEventListener("pointerup",this.barcodeFindButtonTapListener),(b=this.labelCaptureButton)==null||b.removeEventListener("pointerup",this.labelCaptureButtonTapListener),(m=this.cameraSwitchButton)==null||m.removeEventListener("pointerup",this.cameraSwitchButtonTapListener);}attributeChangedCallback(t,p,h){if(h!==p){this.render(),this.append(this.styleElement);let b=this.hidden;this.hidden=this.visibleModeButtonCount+this.allVisibleButtonsCount===0,this.hidden!==b&&this.dispatchEvent(new CustomEvent(b$1));}}onTargetModeButtonTap(t){t.stopPropagation(),this[e]=!this[e],this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"targetModeButton",enabled:this[e]}}));}onScanningBehaviorButtonTap(t){t.stopPropagation(),this[b]=this[b]==="continuous"?"single":"continuous",this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"scanningBehaviorButton",enabled:this[b]==="continuous"}}));}onBarcodeFindButtonTap(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"barcodeFindButton"}}));}onLabelCaptureButtonTap(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"labelCaptureButton"}}));}onCameraSwitchButtonTap(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(a$2,{bubbles:true,detail:{tapped:"cameraSwitchButton"}}));}};S.observedAttributes=[d,c,k,l,m];var _=S;export{_ as a};