@scandit/web-datacapture-core 7.1.0 → 7.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/build/electron/common.cjs +1 -1
  2. package/build/electron/constants.cjs +1 -1
  3. package/build/electron/main.cjs +1 -1
  4. package/build/electron/preload.cjs +1 -1
  5. package/build/js/{Camera-DsOMNsZu.d.ts → Camera-Ds4oKYkb.d.ts} +1 -1
  6. package/build/js/Camera.d.ts +1 -1
  7. package/build/js/Camera.js +1 -1
  8. package/build/js/CameraAccess.d.ts +1 -1
  9. package/build/js/CameraRelated.d.ts +1 -1
  10. package/build/js/DataCaptureContext.d.ts +1 -1
  11. package/build/js/DataCaptureContext.js +1 -1
  12. package/build/js/DataCaptureContextRelated.d.ts +1 -1
  13. package/build/js/DataCaptureVersion.js +1 -1
  14. package/build/js/DataCaptureView.d.ts +1 -1
  15. package/build/js/DataCaptureView.js +1 -1
  16. package/build/js/Defaults.d.ts +1 -1
  17. package/build/js/FrameData.d.ts +1 -1
  18. package/build/js/ImageFrameSource.d.ts +1 -1
  19. package/build/js/ScanditIconBuilder.js +1 -1
  20. package/build/js/SingleImageUploader.d.ts +1 -1
  21. package/build/js/chunks/{chunk-ULRY4SXF.js → chunk-3GBK675W.js} +1 -1
  22. package/build/js/chunks/{chunk-FHGLVS66.js → chunk-4ZZSBGI6.js} +1 -1
  23. package/build/js/chunks/{chunk-QK3D2DQM.js → chunk-6FUMB5HV.js} +1 -1
  24. package/build/js/chunks/{chunk-KRWPFM7Z.js → chunk-BN7NK5YK.js} +1 -1
  25. package/build/js/chunks/{chunk-EFNSFA3N.js → chunk-GU7XEWRV.js} +1 -1
  26. package/build/js/chunks/{chunk-GZ4F55TI.js → chunk-J4YMMETW.js} +1 -1
  27. package/build/js/chunks/chunk-NVEOQW6Q.js +1 -0
  28. package/build/js/chunks/{chunk-4YVKSEZS.js → chunk-O7A2DQPJ.js} +1 -1
  29. package/build/js/chunks/chunk-RIW5A253.js +1 -0
  30. package/build/js/chunks/{chunk-U2GDN6EV.js → chunk-RNFMG4PS.js} +1 -1
  31. package/build/js/chunks/{chunk-7B2VPGLP.js → chunk-VLBC3MNR.js} +1 -1
  32. package/build/js/index.d.ts +2 -2
  33. package/build/js/index.js +1 -1
  34. package/build/js/private/CameraAccess.d.ts +1 -1
  35. package/build/js/private/CameraManager.d.ts +1 -1
  36. package/build/js/private/CameraManager.js +1 -1
  37. package/build/js/private/CanvasDrawerWithMetrics.d.ts +1 -1
  38. package/build/js/private/CoreModuleLicenseTextProvider.d.ts +1 -1
  39. package/build/js/private/DataCaptureContextRelated.d.ts +1 -1
  40. package/build/js/private/FrameReaders/FrameReader.d.ts +1 -1
  41. package/build/js/private/FrameReaders/FrameReader.js +1 -1
  42. package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +1 -1
  43. package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +1 -1
  44. package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
  45. package/build/js/private/FrameReaders/index.d.ts +1 -1
  46. package/build/js/private/FrameReaders/index.js +1 -1
  47. package/build/js/private/NormalizedConfigureOptions.d.ts +1 -1
  48. package/build/js/private/ViewControls+related.js +1 -1
  49. package/build/js/private/ViewControls_related.d.ts +1 -1
  50. package/build/js/private/ViewsRegistry.d.ts +1 -1
  51. package/build/js/private/ui/atoms/Toast.d.ts +1 -1
  52. package/build/js/private/ui/molecules/HintPresenter.d.ts +1 -1
  53. package/build/js/sdk.d.ts +1 -1
  54. package/build/js/worker/WorkerMain.d.ts +1 -1
  55. package/build/js/worker/WorkerMain.js +1 -1
  56. package/build/js/worker/dataCapture.inlineWorker.d.ts +1 -1
  57. package/build/js/worker/dataCapture.inlineWorker.js +1 -1
  58. package/build/js/worker/dataCaptureEngine.d.ts +1 -1
  59. package/build/js/worker/dataCaptureEngine.js +1 -1
  60. package/build/js/worker/dataCaptureLoader.d.ts +1 -1
  61. package/build/js/worker/dataCaptureWorkerRelated.d.ts +1 -1
  62. package/build/js/worker/index.d.ts +1 -1
  63. package/build/js/worker/index.js +1 -1
  64. package/package.json +1 -1
  65. package/build/js/chunks/chunk-A4OAOJ72.js +0 -1
  66. package/build/js/chunks/chunk-BOCQXSFU.js +0 -1
  67. /package/build/js/chunks/{chunk-7LG2KINM.js → chunk-NNPSKKZQ.js} +0 -0
@@ -1 +1 @@
1
- var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty;module.exports=(e={},((e,n,c,l)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let a of o(n))p.call(e,a)||a===c||t(e,a,{get:()=>n[a],enumerable:!(l=r(n,a))||l.enumerable});return e})(t({},"__esModule",{value:!0}),e));
1
+ "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty;module.exports=(e={},((e,c,n,l)=>{if(c&&"object"==typeof c||"function"==typeof c)for(let u of o(c))p.call(e,u)||u===n||t(e,u,{get:()=>c[u],enumerable:!(l=r(c,u))||l.enumerable});return e})(t({},"__esModule",{value:!0}),e));
@@ -1 +1 @@
1
- var e,r=Object.defineProperty,t=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,p={};((e,t)=>{for(var o in t)r(e,o,{get:t[o],enumerable:!0})})(p,{CHN:()=>y,Id:()=>i,K:()=>l}),module.exports=(e=p,((e,p,a,l)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let i of o(p))n.call(e,i)||i===a||r(e,i,{get:()=>p[i],enumerable:!(l=t(p,i))||l.enumerable});return e})(r({},"__esModule",{value:!0}),e));var a=String.fromCodePoint,l=a.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),i=a.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57]),y=a.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);
1
+ "use strict";var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,p={};((e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})})(p,{CHN:()=>y,Id:()=>i,K:()=>l}),module.exports=(e=p,((e,p,a,l)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let i of o(p))n.call(e,i)||i===a||t(e,i,{get:()=>p[i],enumerable:!(l=r(p,i))||l.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a=String.fromCodePoint,l=a.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),i=a.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57]),y=a.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);
@@ -1 +1 @@
1
- var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,p={};((e,n)=>{for(var a in n)t(e,a,{get:n[a],enumerable:!0})})(p,{register:()=>u,unregister:()=>f}),module.exports=(e=p,((e,p,s,o)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let i of a(p))r.call(e,i)||i===s||t(e,i,{get:()=>p[i],enumerable:!(o=n(p,i))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s=String.fromCodePoint,o=(s.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),s.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57])),i=s.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);function c(e,t){return async function(n,a){if(function(e,t){const n=new URL(e.url);return t.senderId===o&&"localhost"===n.hostname||""===n.hostname}(n.senderFrame,a))switch(a.type){case"get-license-key":if(null!=a.payload)try{const r=await async function(e,t){const{fs:n,crypto:a,path:r,app:p}=e,[s,o]=t.publicKey.split(":"),i=r.join(p.getAppPath(),t.licenseDataPath);return function(e,t,n){const r=a.createDecipheriv("aes-256-cbc",t,n);let p=r.update(e,"hex","utf8");return p+=r.final("utf8"),p}((await n.readFile(i)).toString("utf8"),Buffer.from(s,"base64"),Buffer.from(o,"base64"))}(e,{licenseDataPath:a.payload.licenseDataPath,publicKey:t});n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{licenseKey:r??""}})}catch(e){n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{error:e}})}break;case"get-app-info":try{const t=await async function(e){const{fs:t,path:n,app:a}=e;let r=process.cwd();a.isPackaged&&(r=a.getAppPath());const p=await t.readFile(n.join(r,"package.json"),"utf8"),s=JSON.parse(p);return{appId:s.build?.appId??s.appId,name:s.name,version:s.version}}(e);n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{isPackaged:e.app.isPackaged,version:t.version??e.app.getVersion(),appName:t.name??e.app.getName(),appId:t.appId??""}})}catch(e){n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{error:e}})}}}}var d=null,l=null;function u(e,t){l=e,d=c(e,t),l.ipcMain.on(i,d)}function f(){null!=d&&null!=l&&l.ipcMain.off(i,d)}
1
+ "use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,p={};((e,n)=>{for(var a in n)t(e,a,{get:n[a],enumerable:!0})})(p,{register:()=>u,unregister:()=>f}),module.exports=(e=p,((e,p,s,o)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let i of a(p))r.call(e,i)||i===s||t(e,i,{get:()=>p[i],enumerable:!(o=n(p,i))||o.enumerable});return e})(t({},"__esModule",{value:!0}),e));var s=String.fromCodePoint,o=(s.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),s.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57])),i=s.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);function c(e,t){return async function(n,a){if(function(e,t){const n=new URL(e.url);return t.senderId===o&&"localhost"===n.hostname||""===n.hostname}(n.senderFrame,a))switch(a.type){case"get-license-key":if(null!=a.payload)try{const r=await async function(e,t){const{fs:n,crypto:a,path:r,app:p}=e,[s,o]=t.publicKey.split(":"),i=r.join(p.getAppPath(),t.licenseDataPath);return function(e,t,n){const r=a.createDecipheriv("aes-256-cbc",t,n);let p=r.update(e,"hex","utf8");return p+=r.final("utf8"),p}((await n.readFile(i)).toString("utf8"),Buffer.from(s,"base64"),Buffer.from(o,"base64"))}(e,{licenseDataPath:a.payload.licenseDataPath,publicKey:t});n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{licenseKey:r??""}})}catch(e){n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{error:e}})}break;case"get-app-info":try{const t=await async function(e){const{fs:t,path:n,app:a}=e;let r=process.cwd();a.isPackaged&&(r=a.getAppPath());const p=await t.readFile(n.join(r,"package.json"),"utf8"),s=JSON.parse(p);return{appId:s.build?.appId??s.appId,name:s.name,version:s.version}}(e);n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{isPackaged:e.app.isPackaged,version:t.version??e.app.getVersion(),appName:t.name??e.app.getName(),appId:t.appId??""}})}catch(e){n.sender.send(i,{type:a.type,senderId:a.senderId,payload:{error:e}})}}}}var d=null,l=null;function u(e,t){l=e,d=c(e,t),l.ipcMain.on(i,d)}function f(){null!=d&&null!=l&&l.ipcMain.off(i,d)}
@@ -1 +1 @@
1
- var e,r=Object.defineProperty,n=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,p={};((e,n)=>{for(var t in n)r(e,t,{get:n[t],enumerable:!0})})(p,{preloadBindings:()=>s}),module.exports=(e=p,((e,p,a,l)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let y of t(p))o.call(e,y)||y===a||r(e,y,{get:()=>p[y],enumerable:!(l=n(p,y))||l.enumerable});return e})(r({},"__esModule",{value:!0}),e));var a=require("electron"),l=String.fromCodePoint,y=l.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),i=l.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57]),c=l.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);function d(e){return null!=e.payload.error}function s(e){a.contextBridge.exposeInMainWorld(y,Object.freeze(function(e){return{getAppInfo:async()=>new Promise(((r,n)=>{e.once(c,((e,t)=>{d(t)&&n(t.payload.error),"get-app-info"===t.type&&r(t.payload)})),e.send(c,{type:"get-app-info",senderId:i})})),getKey:async r=>new Promise(((n,t)=>{e.once(c,((e,r)=>{d(r)&&t(r.payload.error),"get-license-key"===r.type&&n(r.payload)})),e.send(c,{type:"get-license-key",senderId:i,payload:r})}))}}(e)))}
1
+ "use strict";var e,r=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,p={};((e,t)=>{for(var n in t)r(e,n,{get:t[n],enumerable:!0})})(p,{preloadBindings:()=>s}),module.exports=(e=p,((e,p,a,i)=>{if(p&&"object"==typeof p||"function"==typeof p)for(let l of n(p))o.call(e,l)||l===a||r(e,l,{get:()=>p[l],enumerable:!(i=t(p,l))||i.enumerable});return e})(r({},"__esModule",{value:!0}),e));var a=require("electron"),i=String.fromCodePoint,l=i.apply(String,[119,101,98,107,105,116,84,114,97,110,115,112,111,114,116,68,117,112,108,101,120,67,104,97,110,110,101,108]),y=i.apply(String,[53,65,41,124,75,47,108,120,50,48,115,62,66,60,107,57]),c=i.apply(String,[111,74,88,52,51,101,51,112,66,79,38,88,40,65,36,94]);function d(e){return null!=e.payload.error}function s(e){a.contextBridge.exposeInMainWorld(l,Object.freeze(function(e){return{getAppInfo:async()=>new Promise(((r,t)=>{e.once(c,((e,n)=>{d(n)&&t(n.payload.error),"get-app-info"===n.type&&r(n.payload)})),e.send(c,{type:"get-app-info",senderId:y})})),getKey:async r=>new Promise(((t,n)=>{e.once(c,((e,r)=>{d(r)&&n(r.payload.error),"get-license-key"===r.type&&t(r.payload)})),e.send(c,{type:"get-license-key",senderId:y,payload:r})}))}}(e)))}
@@ -1718,4 +1718,4 @@ declare class Camera implements FrameSource, Serializable<CameraJSON> {
1718
1718
  private isZoomAvailable;
1719
1719
  }
1720
1720
 
1721
- export { type ModuleHandler as $, type PrivateFrameHandler as A, DataCaptureContext$1 as B, CameraPosition as C, DataCaptureLoader as D, type DataCaptureContextListener as E, FocusGestureStrategy as F, type ContextStatusJSON as G, ContextStatus as H, PrivateMirrorAxis as I, type DataCaptureOverlay as J, type DataCaptureViewListener as K, type DataCaptureViewJSON as L, DataCaptureView$1 as M, type FrameData as N, type PrivateLoadableFrameData as O, type PrivateChangeSet as P, convertToPublicFrameData as Q, type DataCaptureLoaderOptions as R, type PerformanceMetrics as S, TorchState as T, DataCaptureEngine as U, VideoResolution as V, type Module as W, type DataCaptureCallbackMessage as X, type GenericHint as Y, type AnyDataCaptureActionMessage as Z, type AugmentedWorker as _, type FrameSource as a, HintIcon as a$, type DataCaptureActionMessageKey as a0, type EngineWorkerResponse as a1, type ExtractCentaurusLicenseResponse as a2, type RequestFrameDataResponse as a3, type IsFeatureSupportedResponse as a4, type GetViewfinderInfo as a5, type GetOpenSourceSoftwareLicenseInfoResponse as a6, type WorkerResponse as a7, type LoadLibraryDataCaptureAction as a8, type CreateContextDataCaptureAction as a9, type OnFrameSkippedMessage as aA, type ShowToastMessage as aB, type HideToastMessage as aC, type ShowGuidanceMessage as aD, type HideGuidanceMessage as aE, type StartUpdateTimerMessage as aF, type StopUpdateTimerMessage as aG, type PayloadForCommand as aH, type DataCaptureWorker as aI, type EmscriptenClassHandle as aJ, type DataCaptureContext as aK, type DataCaptureImageBufferFrameSource as aL, type GestureListener as aM, type GestureRecognizer as aN, type DataCaptureView as aO, type JSONParseable as aP, type DataCaptureContextDeserializerResult as aQ, type DataCaptureContextDeserializer as aR, type CaptureModeDeserializerInstance as aS, type ModuleMirrorAxis as aT, type Vector as aU, type WasmFrameData as aV, HintFont as aW, HintTextAlignment as aX, HintWidth as aY, HintHeight as aZ, HintCornerStyle as a_, type SetFrameSourceDataCaptureAction as aa, type ProcessFrameDataCaptureAction as ab, type RequestFrameDataDataCaptureAction as ac, type DeleteFrameDataDataCaptureAction as ad, type VisibilityChangeAction as ae, type IsFeatureSupportedAction as af, type UpdateContextDataCaptureAction as ag, type DisposeDataCaptureAction as ah, type FlushAnalyticsDataCaptureAction as ai, type ReportCameraPropertiesDataCaptureAction as aj, type SetLogLevelDataCaptureAction as ak, type ExtractCentaurusLicenseDataCaptureAction as al, type OnTapAction as am, type HintPresenterV2updateAction as an, type GetViewfinderInfoAction as ao, type GetOpenSourceSoftwareLicenseInfoAction as ap, type DataCaptureCallbackMessageKeys as aq, type SuccessFeedbackWorkerMessage as ar, type ShowHintWorkerMessage as as, type UpdateHintWorkerMessage as at, type IsFeatureSupportedMessage as au, type HideHintWorkerMessage as av, type PerformanceMetricsReportMessage as aw, type DidTapTrackedBarcode as ax, type OnFrameProcessingStartedMessage as ay, type OnFrameProcessingFinishedMessage as az, FrameSourceState as b, HintAnchor as b0, type HintStyle as b1, GuidanceHintAnchor as b2, GuidanceHintStyle as b3, type GuidanceHint as b4, ToastHintStyle as b5, type ToastHint as b6, LicensedFeature as b7, type HintPresenterV2 as b8, type PlatformHintPresenter as b9, type LoadLibraryParameters as ba, type CreateContextParameters as bb, type UpdateContextParameters as bc, type SetFrameSourceParameters as bd, type ProcessFrameParameters as be, type ReportCameraPropertiesParameters as bf, type WorkerFunctions as bg, FrameReaderAbstract as bh, ColorType as bi, type PoolCapacityOptions as bj, type FrameCapture as bk, FrameReader as bl, CameraPosition$1 as bm, CameraResolutionConstraint$1 as bn, AspectRatio as bo, type DeviceCamera$1 as bp, CameraAccess$1 as bq, MeteringMode as br, CameraResolutionConstraint as bs, type ExtendedMediaTrackCapabilities as bt, type ExtendedMediaTrackConstraintSet as bu, type GUI as bv, CameraManagerEvent as bw, type CameraManagerEventParameters as bx, CameraManager as by, type FrameSourceListener as c, type FrameSourceJSON as d, type CameraJSON as e, type VideoFrameResolution as f, Camera as g, type CameraSettingsJSONBase as h, type CameraSettingsFromJSON as i, type CameraSettingsJSON as j, isCameraFrameSource as k, CameraSettings as l, CameraAccess as m, type DeviceCamera as n, type Change as o, type PrivateDataCaptureMode as p, type DataCaptureMode as q, type DataCaptureModeJSON as r, type PrivateDataCaptureComponent as s, type DataCaptureComponentJSON as t, type DataCaptureComponent as u, type PrivateDataCaptureContextOptions as v, type PrivateDataCaptureContext as w, type DataCaptureContextCreationOptions as x, type DataCaptureContextJSON as y, type PrivateFrameHandlerResponse as z };
1721
+ export { type ModuleHandler as $, type PrivateFrameHandler as A, DataCaptureContext$1 as B, CameraPosition as C, DataCaptureLoader as D, type DataCaptureContextListener as E, FocusGestureStrategy as F, type ContextStatusJSON as G, ContextStatus as H, PrivateMirrorAxis as I, type DataCaptureOverlay as J, type DataCaptureViewListener as K, type DataCaptureViewJSON as L, DataCaptureView$1 as M, type FrameData as N, type PrivateLoadableFrameData as O, type PrivateChangeSet as P, convertToPublicFrameData as Q, type DataCaptureLoaderOptions as R, type PerformanceMetrics as S, TorchState as T, DataCaptureEngine as U, VideoResolution as V, type Module as W, type GenericHint as X, type DataCaptureCallbackMessage as Y, type AnyDataCaptureActionMessage as Z, type AugmentedWorker as _, type FrameSource as a, HintIcon as a$, type DataCaptureActionMessageKey as a0, type EngineWorkerResponse as a1, type ExtractCentaurusLicenseResponse as a2, type RequestFrameDataResponse as a3, type IsFeatureSupportedResponse as a4, type GetViewfinderInfo as a5, type GetOpenSourceSoftwareLicenseInfoResponse as a6, type WorkerResponse as a7, type LoadLibraryDataCaptureAction as a8, type CreateContextDataCaptureAction as a9, type OnFrameSkippedMessage as aA, type ShowToastMessage as aB, type HideToastMessage as aC, type ShowGuidanceMessage as aD, type HideGuidanceMessage as aE, type StartUpdateTimerMessage as aF, type StopUpdateTimerMessage as aG, type PayloadForCommand as aH, type DataCaptureWorker as aI, type EmscriptenClassHandle as aJ, type DataCaptureContext as aK, type DataCaptureImageBufferFrameSource as aL, type GestureListener as aM, type GestureRecognizer as aN, type DataCaptureView as aO, type JSONParseable as aP, type DataCaptureContextDeserializerResult as aQ, type DataCaptureContextDeserializer as aR, type CaptureModeDeserializerInstance as aS, type ModuleMirrorAxis as aT, type Vector as aU, type WasmFrameData as aV, HintFont as aW, HintTextAlignment as aX, HintWidth as aY, HintHeight as aZ, HintCornerStyle as a_, type SetFrameSourceDataCaptureAction as aa, type ProcessFrameDataCaptureAction as ab, type RequestFrameDataDataCaptureAction as ac, type DeleteFrameDataDataCaptureAction as ad, type VisibilityChangeAction as ae, type IsFeatureSupportedAction as af, type UpdateContextDataCaptureAction as ag, type DisposeDataCaptureAction as ah, type FlushAnalyticsDataCaptureAction as ai, type ReportCameraPropertiesDataCaptureAction as aj, type SetLogLevelDataCaptureAction as ak, type ExtractCentaurusLicenseDataCaptureAction as al, type OnTapAction as am, type HintPresenterV2updateAction as an, type GetViewfinderInfoAction as ao, type GetOpenSourceSoftwareLicenseInfoAction as ap, type DataCaptureCallbackMessageKeys as aq, type SuccessFeedbackWorkerMessage as ar, type ShowHintWorkerMessage as as, type UpdateHintWorkerMessage as at, type IsFeatureSupportedMessage as au, type HideHintWorkerMessage as av, type PerformanceMetricsReportMessage as aw, type DidTapTrackedBarcode as ax, type OnFrameProcessingStartedMessage as ay, type OnFrameProcessingFinishedMessage as az, FrameSourceState as b, HintAnchor as b0, type HintStyle as b1, GuidanceHintAnchor as b2, GuidanceHintStyle as b3, type GuidanceHint as b4, ToastHintStyle as b5, type ToastHint as b6, LicensedFeature as b7, type HintPresenterV2 as b8, type PlatformHintPresenter as b9, type LoadLibraryParameters as ba, type CreateContextParameters as bb, type UpdateContextParameters as bc, type SetFrameSourceParameters as bd, type ProcessFrameParameters as be, type ReportCameraPropertiesParameters as bf, type WorkerFunctions as bg, FrameReaderAbstract as bh, ColorType as bi, type PoolCapacityOptions as bj, type FrameCapture as bk, FrameReader as bl, CameraPosition$1 as bm, CameraResolutionConstraint$1 as bn, AspectRatio as bo, type DeviceCamera$1 as bp, CameraAccess$1 as bq, MeteringMode as br, CameraResolutionConstraint as bs, type ExtendedMediaTrackCapabilities as bt, type ExtendedMediaTrackConstraintSet as bu, type GUI as bv, CameraManagerEvent as bw, type CameraManagerEventParameters as bx, CameraManager as by, type FrameSourceListener as c, type FrameSourceJSON as d, type CameraJSON as e, type VideoFrameResolution as f, Camera as g, type CameraSettingsJSONBase as h, type CameraSettingsFromJSON as i, type CameraSettingsJSON as j, isCameraFrameSource as k, CameraSettings as l, CameraAccess as m, type DeviceCamera as n, type Change as o, type PrivateDataCaptureMode as p, type DataCaptureMode as q, type DataCaptureModeJSON as r, type PrivateDataCaptureComponent as s, type DataCaptureComponentJSON as t, type DataCaptureComponent as u, type PrivateDataCaptureContextOptions as v, type PrivateDataCaptureContext as w, type DataCaptureContextCreationOptions as x, type DataCaptureContextJSON as y, type PrivateFrameHandlerResponse as z };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { g as Camera, e as CameraJSON, f as VideoFrameResolution } from './Camera-DsOMNsZu.js';
2
+ export { g as Camera, e as CameraJSON, f as VideoFrameResolution } from './Camera-Ds4oKYkb.js';
3
3
  import './private/Serializable.js';
4
4
  import './private/FrameReaders/WatermarkStack.js';
5
5
  import './tsHelper.js';
@@ -1 +1 @@
1
- export{a as Camera}from'./chunks/chunk-GZ4F55TI.js';
1
+ export{a as Camera}from'./chunks/chunk-J4YMMETW.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { m as CameraAccess, n as DeviceCamera } from './Camera-DsOMNsZu.js';
2
+ export { m as CameraAccess, n as DeviceCamera } from './Camera-Ds4oKYkb.js';
3
3
  import './private/Serializable.js';
4
4
  import './private/FrameReaders/WatermarkStack.js';
5
5
  import './tsHelper.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { C as CameraPosition, l as CameraSettings, i as CameraSettingsFromJSON, j as CameraSettingsJSON, h as CameraSettingsJSONBase, F as FocusGestureStrategy, a as FrameSource, d as FrameSourceJSON, c as FrameSourceListener, b as FrameSourceState, T as TorchState, V as VideoResolution, k as isCameraFrameSource } from './Camera-DsOMNsZu.js';
2
+ export { C as CameraPosition, l as CameraSettings, i as CameraSettingsFromJSON, j as CameraSettingsJSON, h as CameraSettingsJSONBase, F as FocusGestureStrategy, a as FrameSource, d as FrameSourceJSON, c as FrameSourceListener, b as FrameSourceState, T as TorchState, V as VideoResolution, k as isCameraFrameSource } from './Camera-Ds4oKYkb.js';
3
3
  import './private/Serializable.js';
4
4
  import './private/FrameReaders/WatermarkStack.js';
5
5
  import './tsHelper.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { o as Change, u as DataCaptureComponent, t as DataCaptureComponentJSON, B as DataCaptureContext, x as DataCaptureContextCreationOptions, y as DataCaptureContextJSON, q as DataCaptureMode, r as DataCaptureModeJSON, P as PrivateChangeSet, s as PrivateDataCaptureComponent, w as PrivateDataCaptureContext, v as PrivateDataCaptureContextOptions, p as PrivateDataCaptureMode, A as PrivateFrameHandler, z as PrivateFrameHandlerResponse } from './Camera-DsOMNsZu.js';
2
+ export { o as Change, u as DataCaptureComponent, t as DataCaptureComponentJSON, B as DataCaptureContext, x as DataCaptureContextCreationOptions, y as DataCaptureContextJSON, q as DataCaptureMode, r as DataCaptureModeJSON, P as PrivateChangeSet, s as PrivateDataCaptureComponent, w as PrivateDataCaptureContext, v as PrivateDataCaptureContextOptions, p as PrivateDataCaptureMode, A as PrivateFrameHandler, z as PrivateFrameHandlerResponse } from './Camera-Ds4oKYkb.js';
3
3
  import './Common.js';
4
4
  import './DataCaptureContextSettings.js';
5
5
  import './license/OpenSourceSoftwareLicenseInfo.js';
@@ -1 +1 @@
1
- export{a as DataCaptureContext}from'./chunks/chunk-QK3D2DQM.js';
1
+ export{a as DataCaptureContext}from'./chunks/chunk-6FUMB5HV.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { H as ContextStatus, G as ContextStatusJSON, E as DataCaptureContextListener, I as PrivateMirrorAxis } from './Camera-DsOMNsZu.js';
2
+ export { H as ContextStatus, G as ContextStatusJSON, E as DataCaptureContextListener, I as PrivateMirrorAxis } from './Camera-Ds4oKYkb.js';
3
3
  import './ScanditIcon.js';
4
4
  import './private/Serializable.js';
5
5
  import './private/FrameReaders/WatermarkStack.js';
@@ -1 +1 @@
1
- export{a as DataCaptureVersion}from'./chunks/chunk-A4OAOJ72.js';
1
+ export{a as DataCaptureVersion}from'./chunks/chunk-RIW5A253.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  import './Common.js';
3
- export { J as DataCaptureOverlay, M as DataCaptureView, L as DataCaptureViewJSON, K as DataCaptureViewListener } from './Camera-DsOMNsZu.js';
3
+ export { J as DataCaptureOverlay, M as DataCaptureView, L as DataCaptureViewJSON, K as DataCaptureViewListener } from './Camera-Ds4oKYkb.js';
4
4
  import './DataCaptureViewPlusRelated.js';
5
5
  import './ViewControls.js';
6
6
  import './private/CustomLocationsView.js';
@@ -1 +1 @@
1
- export{a as DataCaptureView}from'./chunks/chunk-EFNSFA3N.js';
1
+ export{a as DataCaptureView}from'./chunks/chunk-GU7XEWRV.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  import * as CSS from 'csstype';
3
- import { V as VideoResolution, F as FocusGestureStrategy, C as CameraPosition } from './Camera-DsOMNsZu.js';
3
+ import { V as VideoResolution, F as FocusGestureStrategy, C as CameraPosition } from './Camera-Ds4oKYkb.js';
4
4
  import { MarginsWithUnit, PointWithUnit, Anchor, Color } from './Common.js';
5
5
  import { FocusGestureJSON, FocusGesture, ZoomGestureJSON, ZoomGesture, LogoStyle } from './DataCaptureViewPlusRelated.js';
6
6
  import { RectangularViewfinderStyle, PrivateRectangularViewfinderDefault } from './ViewfinderPlusRelated.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { N as FrameData, O as PrivateLoadableFrameData, Q as convertToPublicFrameData } from './Camera-DsOMNsZu.js';
2
+ export { N as FrameData, O as PrivateLoadableFrameData, Q as convertToPublicFrameData } from './Camera-Ds4oKYkb.js';
3
3
  import './ScanditIcon.js';
4
4
  import './private/Serializable.js';
5
5
  import './private/FrameReaders/WatermarkStack.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { a as FrameSource, b as FrameSourceState, c as FrameSourceListener } from './Camera-DsOMNsZu.js';
2
+ import { a as FrameSource, b as FrameSourceState, c as FrameSourceListener } from './Camera-Ds4oKYkb.js';
3
3
  import { Serializable } from './private/Serializable.js';
4
4
  import './private/FrameReaders/WatermarkStack.js';
5
5
  import './tsHelper.js';
@@ -1 +1 @@
1
- export{c as ScanditIconBuilder,b as ScanditIconForIconType,a as ScanditIconType}from'./chunks/chunk-7LG2KINM.js';export{a as ScanditIconShape}from'./chunks/chunk-AD3CNBDO.js';
1
+ export{c as ScanditIconBuilder,b as ScanditIconForIconType,a as ScanditIconType}from'./chunks/chunk-NNPSKKZQ.js';export{a as ScanditIconShape}from'./chunks/chunk-AD3CNBDO.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { d as FrameSourceJSON, b as FrameSourceState, a as FrameSource, c as FrameSourceListener } from './Camera-DsOMNsZu.js';
2
+ import { d as FrameSourceJSON, b as FrameSourceState, a as FrameSource, c as FrameSourceListener } from './Camera-Ds4oKYkb.js';
3
3
  import { SingleImageUploaderSettingsJSON, SingleImageUploaderSettings } from './SingleImageUploaderSettings.js';
4
4
  import { Serializable } from './private/Serializable.js';
5
5
  import './private/FrameReaders/WatermarkStack.js';
@@ -1 +1 @@
1
- import {a}from'./chunk-MW5PTAU7.js';import {a as a$2}from'./chunk-QHBIT2WY.js';import {a as a$1}from'./chunk-XR65N6EG.js';var s=(e=>(e.RGBA="RGBA",e.GRAYSCALE="GRAYSCALE",e))(s||{}),n=class extends a{constructor(){super(...arguments);this.colorType="RGBA";}get _initialized(){return this._texture!=null&&this._framebuffer!=null}readFromSource(e){this._initialized||this.setup(),this.updateFrameSizeIfNeeded();let i=this._framePool.pop();return this._contextWebGL.texImage2D(this._contextWebGL.TEXTURE_2D,0,this._contextWebGL.RGBA,this._contextWebGL.RGBA,this._contextWebGL.UNSIGNED_BYTE,e),this._contextWebGL.readPixels(0,0,this._contextWebGL.drawingBufferWidth,this._contextWebGL.drawingBufferHeight,this._contextWebGL.RGBA,this._contextWebGL.UNSIGNED_BYTE,i),{width:this._contextWebGL.drawingBufferWidth,height:this._contextWebGL.drawingBufferHeight,data:i,colorType:this.colorType}}setup(){this._texture=this._contextWebGL.createTexture(),this._texture==null&&a$1.log(a$1.Level.Warn,"Could not create texture from WebGLRenderingContext"),this._contextWebGL.bindTexture(this._contextWebGL.TEXTURE_2D,this._texture),this._framebuffer=this._contextWebGL.createFramebuffer(),this._framebuffer==null&&a$1.log(a$1.Level.Warn,"Could not create frameBuffer from WebGLRenderingContext"),this._contextWebGL.bindFramebuffer(this._contextWebGL.FRAMEBUFFER,this._framebuffer),this._contextWebGL.framebufferTexture2D(this._contextWebGL.FRAMEBUFFER,this._contextWebGL.COLOR_ATTACHMENT0,this._contextWebGL.TEXTURE_2D,this._texture,0),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_WRAP_S,this._contextWebGL.CLAMP_TO_EDGE),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_WRAP_T,this._contextWebGL.CLAMP_TO_EDGE),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_MIN_FILTER,this._contextWebGL.NEAREST),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_MAG_FILTER,this._contextWebGL.NEAREST);}dispose(){var e;this._texture!=null&&(this._contextWebGL.deleteTexture(this._texture),this._texture=null),this._framebuffer!=null&&(this._contextWebGL.deleteFramebuffer(this._framebuffer),this._framebuffer=null),(e=this._framePool)==null||e.empty();}updateFrameSizeIfNeeded(){var o;let{drawingBufferWidth:e,drawingBufferHeight:i}=this._contextWebGL,r=e*i*4;this._frameSize!==r&&(this._frameSize=r,(o=this._framePool)==null||o.empty(),this._framePool=new a$2({capacity:this._maxPoolCapacity,lowWaterMark:this._minPoolCapacity,createItem:()=>new Uint8ClampedArray(this._frameSize)}));}};export{s as a,n as b};
1
+ import {a as a$2}from'./chunk-QHBIT2WY.js';import {a}from'./chunk-MW5PTAU7.js';import {a as a$1}from'./chunk-XR65N6EG.js';var s=(e=>(e.RGBA="RGBA",e.GRAYSCALE="GRAYSCALE",e))(s||{}),n=class extends a{constructor(){super(...arguments);this.colorType="RGBA";}get _initialized(){return this._texture!=null&&this._framebuffer!=null}readFromSource(e){this._initialized||this.setup(),this.updateFrameSizeIfNeeded();let i=this._framePool.pop();return this._contextWebGL.texImage2D(this._contextWebGL.TEXTURE_2D,0,this._contextWebGL.RGBA,this._contextWebGL.RGBA,this._contextWebGL.UNSIGNED_BYTE,e),this._contextWebGL.readPixels(0,0,this._contextWebGL.drawingBufferWidth,this._contextWebGL.drawingBufferHeight,this._contextWebGL.RGBA,this._contextWebGL.UNSIGNED_BYTE,i),{width:this._contextWebGL.drawingBufferWidth,height:this._contextWebGL.drawingBufferHeight,data:i,colorType:this.colorType}}setup(){this._texture=this._contextWebGL.createTexture(),this._texture==null&&a$1.log(a$1.Level.Warn,"Could not create texture from WebGLRenderingContext"),this._contextWebGL.bindTexture(this._contextWebGL.TEXTURE_2D,this._texture),this._framebuffer=this._contextWebGL.createFramebuffer(),this._framebuffer==null&&a$1.log(a$1.Level.Warn,"Could not create frameBuffer from WebGLRenderingContext"),this._contextWebGL.bindFramebuffer(this._contextWebGL.FRAMEBUFFER,this._framebuffer),this._contextWebGL.framebufferTexture2D(this._contextWebGL.FRAMEBUFFER,this._contextWebGL.COLOR_ATTACHMENT0,this._contextWebGL.TEXTURE_2D,this._texture,0),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_WRAP_S,this._contextWebGL.CLAMP_TO_EDGE),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_WRAP_T,this._contextWebGL.CLAMP_TO_EDGE),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_MIN_FILTER,this._contextWebGL.NEAREST),this._contextWebGL.texParameteri(this._contextWebGL.TEXTURE_2D,this._contextWebGL.TEXTURE_MAG_FILTER,this._contextWebGL.NEAREST);}dispose(){var e;this._texture!=null&&(this._contextWebGL.deleteTexture(this._texture),this._texture=null),this._framebuffer!=null&&(this._contextWebGL.deleteFramebuffer(this._framebuffer),this._framebuffer=null),(e=this._framePool)==null||e.empty();}updateFrameSizeIfNeeded(){var o;let{drawingBufferWidth:e,drawingBufferHeight:i}=this._contextWebGL,r=e*i*4;this._frameSize!==r&&(this._frameSize=r,(o=this._framePool)==null||o.empty(),this._framePool=new a$2({capacity:this._maxPoolCapacity,lowWaterMark:this._minPoolCapacity,createItem:()=>new Uint8ClampedArray(this._frameSize)}));}};export{s as a,n as b};
@@ -1 +1 @@
1
- import {a}from'./chunk-U2GDN6EV.js';import {a as a$1}from'./chunk-QCRFVRSS.js';import {a as a$4}from'./chunk-AIRWHLJH.js';import {a as a$3}from'./chunk-FGO2SSRS.js';import {b}from'./chunk-FTD535WI.js';import {a as a$2}from'./chunk-XR65N6EG.js';var h=class{constructor(a$2,e){this.onMessageListener=this.onMessage.bind(this);this.workerSelf=a$2,this.dataCaptureInstance=new a(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),a$1(a$2)&&this.listenToMessages();}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{a$2.log(a$2.Level.Error,a);}),this.workerSelf.addEventListener("messageerror",a=>{a$2.log(a$2.Level.Error,a);});}postMessage(a,e){this.workerSelf.postMessage(a,e!=null?e:[]);}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return a$3(a)&&"payload"in a}hasTransferables(a){return a$3(a)&&Array.isArray(a.transferables)}async respondWith(a,e,u){let r=null,t;try{t=u(),t instanceof Promise&&(t=await t);}catch(l){t=void 0,r=a$4(l);}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(t)?t.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(t)?t.transferables:[]);}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}));}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point);});}break}case"hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update();});}break}case"createContext":{{let{data:e}=a;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}));}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource));}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}));}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId));}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId);});}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e));}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics();});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e));}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{a$2.setLevel(e.level);});}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey));}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state);});}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature));}break}case"getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo());}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo());}break}default:return b(a.data),!1}return !0}};export{h as a};
1
+ import {a}from'./chunk-RNFMG4PS.js';import {a as a$1}from'./chunk-QCRFVRSS.js';import {a as a$4}from'./chunk-AIRWHLJH.js';import {a as a$3}from'./chunk-FGO2SSRS.js';import {b}from'./chunk-FTD535WI.js';import {a as a$2}from'./chunk-XR65N6EG.js';var h=class{constructor(a$2,e){this.onMessageListener=this.onMessage.bind(this);this.workerSelf=a$2,this.dataCaptureInstance=new a(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),a$1(a$2)&&this.listenToMessages();}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{a$2.log(a$2.Level.Error,a);}),this.workerSelf.addEventListener("messageerror",a=>{a$2.log(a$2.Level.Error,a);});}postMessage(a,e){this.workerSelf.postMessage(a,e!=null?e:[]);}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return a$3(a)&&"payload"in a}hasTransferables(a){return a$3(a)&&Array.isArray(a.transferables)}async respondWith(a,e,u){let r=null,t;try{t=u(),t instanceof Promise&&(t=await t);}catch(l){t=void 0,r=a$4(l);}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(t)?t.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(t)?t.transferables:[]);}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}));}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point);});}break}case"hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update();});}break}case"createContext":{{let{data:e}=a;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}));}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource));}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}));}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId));}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId);});}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e));}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics();});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e));}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{a$2.setLevel(e.level);});}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey));}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state);});}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature));}break}case"getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo());}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo());}break}default:return b(a.data),!1}return !0}};export{h as a};
@@ -1,4 +1,4 @@
1
- import {a as a$5,b as b$1}from'./chunk-EHMSDFH7.js';import {a as a$1}from'./chunk-KCNXUTBL.js';import {a as a$4}from'./chunk-JS3T7K2Z.js';import {a as a$3}from'./chunk-NMROJLGQ.js';import {a as a$2}from'./chunk-7SW2PEHB.js';import {a as a$6}from'./chunk-FGO2SSRS.js';import {d}from'./chunk-KRWPFM7Z.js';import {a as a$7}from'./chunk-XR65N6EG.js';import {a}from'./chunk-MU4VAJIM.js';import {f}from'./chunk-NQC64CT7.js';import {a as a$8}from'./chunk-WUHKODFA.js';var b,D,x,i=class i{constructor(e,t){this.framework="web";this.runtimeEnvironment={deviceOS:(b=a.getUserAgentInfo().getOS().name)!=null?b:"",browser:(D=a.getUserAgentInfo().getBrowser().name)!=null?D:"",browserVersion:(x=a.getUserAgentInfo().getBrowser().version)!=null?x:"",get deviceModelName(){let{model:e,vendor:t}=a.getUserAgentInfo().getDevice();return (t==null||t==="")&&(t="Unknown"),(e==null||e==="")&&(e="Unknown"),[t,e].join(" ")}};this.settings=new a$2;this._frameSource=null;this._view=null;this.modes=new Set;this.components=[];this.listeners=[];this.updateListeners=new Set;this.cameraPropertiesReportListener=this.reportCameraProperties.bind(this);this.cameraAccessErrorListener=this.onCameraAccessError.bind(this);this.onWorkerMessageListener=this.onWorkerMessage.bind(this);this.onVisibilityChangeListener=this.onVisibilityChange.bind(this);this._frameHandlers=[];this._useSynchronousFrameFlow=!1;var a$1,r,p,l,c,C;this.licenseKey=e,this.deviceName=(a$1=t.deviceName)!=null?a$1:"",this.dataCaptureInstance=(r=t.dataCaptureInstance)!=null?r:a$3.mainDataCaptureLoader,this.delayedRegistration=(p=t.delayedRegistration)!=null?p:!1,this.highEndBlurryRecognition=(C=(c=(l=t.dataCaptureInstance)==null?void 0:l.highEndBlurryRecognition)!=null?c:a$3.mainDataCaptureLoader.highEndBlurryRecognition)!=null?C:!1;}get frameSource(){return this._frameSource}get workerCommand(){return this.dataCaptureInstance.workerCommand.bind(this.dataCaptureInstance)}static async create(){return i.createWithOptions({})}static async createWithOptions(e){var a;let t=new i((a=e.licenseKey)!=null?a:a$3.userLicenseKey,{deviceName:e.deviceName});return e.settings!=null&&await t.applySettings(e.settings),await t.initialize(),t}static async getOpenSourceSoftwareLicenseInfo(){let e=[];for(let a of i.moduleLicenseTextProviders){let r=await a.getLicenseText();e.push(r);}let t=e.join(`
1
+ import {a as a$5,b as b$1}from'./chunk-EHMSDFH7.js';import {a as a$1}from'./chunk-KCNXUTBL.js';import {a as a$4}from'./chunk-JS3T7K2Z.js';import {a as a$3}from'./chunk-NMROJLGQ.js';import {a as a$2}from'./chunk-7SW2PEHB.js';import {a as a$6}from'./chunk-FGO2SSRS.js';import {d}from'./chunk-BN7NK5YK.js';import {a as a$7}from'./chunk-XR65N6EG.js';import {a}from'./chunk-MU4VAJIM.js';import {f}from'./chunk-NQC64CT7.js';import {a as a$8}from'./chunk-WUHKODFA.js';var b,D,x,i=class i{constructor(e,t){this.framework="web";this.runtimeEnvironment={deviceOS:(b=a.getUserAgentInfo().getOS().name)!=null?b:"",browser:(D=a.getUserAgentInfo().getBrowser().name)!=null?D:"",browserVersion:(x=a.getUserAgentInfo().getBrowser().version)!=null?x:"",get deviceModelName(){let{model:e,vendor:t}=a.getUserAgentInfo().getDevice();return (t==null||t==="")&&(t="Unknown"),(e==null||e==="")&&(e="Unknown"),[t,e].join(" ")}};this.settings=new a$2;this._frameSource=null;this._view=null;this.modes=new Set;this.components=[];this.listeners=[];this.updateListeners=new Set;this.cameraPropertiesReportListener=this.reportCameraProperties.bind(this);this.cameraAccessErrorListener=this.onCameraAccessError.bind(this);this.onWorkerMessageListener=this.onWorkerMessage.bind(this);this.onVisibilityChangeListener=this.onVisibilityChange.bind(this);this._frameHandlers=[];this._useSynchronousFrameFlow=!1;var a$1,r,p,l,c,C;this.licenseKey=e,this.deviceName=(a$1=t.deviceName)!=null?a$1:"",this.dataCaptureInstance=(r=t.dataCaptureInstance)!=null?r:a$3.mainDataCaptureLoader,this.delayedRegistration=(p=t.delayedRegistration)!=null?p:!1,this.highEndBlurryRecognition=(C=(c=(l=t.dataCaptureInstance)==null?void 0:l.highEndBlurryRecognition)!=null?c:a$3.mainDataCaptureLoader.highEndBlurryRecognition)!=null?C:!1;}get frameSource(){return this._frameSource}get workerCommand(){return this.dataCaptureInstance.workerCommand.bind(this.dataCaptureInstance)}static async create(){return i.createWithOptions({})}static async createWithOptions(e){var a;let t=new i((a=e.licenseKey)!=null?a:a$3.userLicenseKey,{deviceName:e.deviceName});return e.settings!=null&&await t.applySettings(e.settings),await t.initialize(),t}static async getOpenSourceSoftwareLicenseInfo(){let e=[];for(let a of i.moduleLicenseTextProviders){let r=await a.getLicenseText();e.push(r);}let t=e.join(`
2
2
 
3
3
  `);return new a$4(t)}async setFrameSource(e){let t=e!==this._frameSource;if(this._frameSource!==null&&(this._frameSource.context=null),this._frameSource=e!=null?e:null,e&&(e.context=this,await this.workerCommand("setFrameSource",{mirrorAxis:this.getMirrorAxisForFrameSource(e),isCameraFrameSource:f(e)})),await this.update([{type:"frameSourceState",newValue:this.frameSource}]),t)for(let a of this.listeners)a.didChangeFrameSource&&a.didChangeFrameSource(this,this._frameSource);}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}async flushAnalytics(){await this.workerCommand("flushAnalytics",{});}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async addMode(e){this.modes.add(e),await e.attachedToContext(this),this.updateCameraFrameFlow(),await this.update();}async removeMode(e){this.modes.delete(e),await e.detachedFromContext(),this.updateCameraFrameFlow(),await this.update();}async removeAllModes(){for(let e of this.modes)await this.removeMode(e);}async dispose(){d.instance().removeListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().removeListener("cameraAccessError",this.cameraAccessErrorListener),this.unsubscribeToVisibilityChange(this.onVisibilityChangeListener),await this.workerCommand("dispose",{});}async applySettings(e){this.settings=e,await this.update();}toJSONObject(){var e,t;return {licenseKey:this.licenseKey,framework:this.framework,deviceName:this.deviceName,...this.runtimeEnvironment,modes:[...this.modes].filter(a=>!a.skipSerialization).map(a=>a.toJSONObject()),components:this.components.map(a=>a.toJSONObject()),frameSource:this.frameSource?this.frameSource.toJSONObject():null,settings:this.settings.toJSONObject(),view:(t=(e=this._view)==null?void 0:e.toJSONObject())!=null?t:null}}getView(){return this._view}async setView(e){return this._view=e,this.update([{type:"viewSet",newValue:e}])}async getAppName(){let e=null;if(a$5()){let t=await b$1();if((t==null?void 0:t.appName)==null||t.appName==="")throw new Error("Cannot retrieve electron appName. Did you set it up in package.json? https://www.electronjs.org/docs/latest/api/app#appgetname");e=t.appName;}return e}urlToHostname(e){try{return new URL(e!=null?e:"").hostname}catch(t){return ""}}getParentDomain(){var t;let e="";return parent!==window&&(e||(e=this.urlToHostname((t=location.ancestorOrigins)==null?void 0:t[0])),e||(e=this.urlToHostname(document.referrer)),e||(e="")),e.startsWith("[")&&e.at(-1)==="]"&&(e=e.slice(1,-1)),e}async initialize(e=!0){await this.workerCommand("createContext",{context:this.toJSONObject(),deviceId:i.deviceID,delayedRegistration:this.delayedRegistration,highEndBlurryRecognition:this.highEndBlurryRecognition,appName:await this.getAppName(),parentDomain:this.getParentDomain()}),this.subscribeToWorkerMessages(this.onWorkerMessageListener),e&&(this.subscribeToCameraManagerEvents(),this.subscribeToVisibilityChange(this.onVisibilityChangeListener));}subscribeToVisibilityChange(e){document.addEventListener("visibilitychange",e);}unsubscribeToVisibilityChange(e){document.removeEventListener("visibilitychange",e);}async requestFrameData(e){return this.workerCommand("requestFrameData",{frameId:e})}performanceMark(e){a$6(globalThis.performance)&&typeof globalThis.performance.mark=="function"&&performance.mark(e);}async sendFrameToProcessor(e){let t=e instanceof ImageData?{data:e.data,width:e.width,height:e.height}:e;return await this.sendFrameToHandlers(t)?(this.performanceMark("processFrameBeforeSDC"),this.sendFrameToSDC(t)):e}async sendFrameToHandlers(e){for(let t of this._frameHandlers)if(await t(e)==="skip")return !1;return !0}async sendFrameToSDC(e){return this.workerCommand("processFrame",e,[e.data.buffer])}registerFrameHandler(e){this._frameHandlers.includes(e)||this._frameHandlers.push(e);}unregisterFrameHandler(e){this._frameHandlers.includes(e)&&this._frameHandlers.splice(this._frameHandlers.indexOf(e),1);}onVisibilityChange(){this.workerCommand("documentVisibility",{state:document.visibilityState});}onWorkerMessage(e){if(e.type==="contextDidChangeStatus"){e.payload.isValid||a$7.log(a$7.Level.Error,e.payload);for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$8.fromJSON(e.payload));}if(e.type==="didStartObservingContext")for(let t of this.listeners)t.didStartObservingContext&&t.didStartObservingContext(this);e.type==="onFrameProcessingFinished"&&this.performanceMark("processFrameAfterSDC");}subscribeToCameraManagerEvents(){d.instance().addListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().addListener("cameraAccessError",this.cameraAccessErrorListener);}async reportCameraProperties(e){return this.workerCommand("reportCameraProperties",e)}onCameraAccessError(e){for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$8.fromJSON({code:33794,isValid:!0,message:e.toString()}));}async update(e=[]){var t,a;await this.updateContext();for(let r of e){switch(r.type){case"frameSourceState":{await((t=this._view)==null?void 0:t.onFrameSourceChange(this.frameSource));break}case"singleImageModeUploaderSettings":{(a=this._view)==null||a.onSingleImageUploaderSettingsChange(r.newValue);break}}for(let p of this.updateListeners)p(r);}}async updateContext(){await this.workerCommand("updateContext",{context:this.toJSONObject(),...this.getViewInfo()}).catch(e=>{a$7.log(a$7.Level.Warn,"Error while updating context:",e);});}getViewInfo(){return this._view!=null?{view:{width:this._view.width,height:this._view.height,visible:this._view.width>0&&this._view.height>0,orientation:this._view.orientation}}:{view:null}}getMirrorAxisForFrameSource(e){let t="None";return f(e)&&e.getMirrorImageEnabled()&&(t="Y"),t}async addComponent(e){if(!this.components.includes(e))return this.components.push(e),e._context=this,this.update()}subscribeToWorkerMessages(e){this.dataCaptureInstance.addWorkerListener(e);}unsubscribeToWorkerMessages(e){this.dataCaptureInstance.removeWorkerListener(e);}hasEnabledMode(){return [...this.modes].some(e=>e.isEnabled())}updateCameraFrameFlow(){let e=[...this.modes].some(t=>t._synchronousFrameFlow===!0);d.instance().setFrameHandling(e);}async isFeatureSupported(e){return (await this.workerCommand("isFeatureSupported",{feature:e})).supported}};i.deviceID=a.getDeviceId(),i.moduleLicenseTextProviders=[new a$1];var w=i;
4
4
  export{w as a};
@@ -1 +1 @@
1
- import {a as a$5}from'./chunk-7B2VPGLP.js';import {b as b$1}from'./chunk-ULRY4SXF.js';import {b}from'./chunk-FTD535WI.js';import {a as a$1}from'./chunk-R6E4CT22.js';import {a}from'./chunk-JKL2W65E.js';import {d}from'./chunk-BIGR7VVJ.js';import {a as a$3}from'./chunk-XR65N6EG.js';import {a as a$4}from'./chunk-QCZSSQAQ.js';import {a as a$2}from'./chunk-MU4VAJIM.js';var w=(r=>(r.CONTINUOUS="continuous",r.MANUAL="manual",r.NONE="none",r.SINGLE_SHOT="single-shot",r))(w||{}),R=(s=>(s[s.ULTRA_HD=0]="ULTRA_HD",s[s.FULL_HD=1]="FULL_HD",s[s.HD=2]="HD",s[s.SD=3]="SD",s[s.NONE=4]="NONE",s))(R||{}),L=(t=>(t.CAMERA_PROPERTIES="cameraProperties",t.CAMERA_ACCESS_ERROR="cameraAccessError",t))(L||{}),n=class n{constructor(){this.checkCameraVideoStreamAccessIfVisibleListener=this.checkCameraVideoStreamAccessIfVisible.bind(this);this.handleWebGLContextLostListener=this.handleWebGLContextLost.bind(this);this.listeners=new Map;this.mirrorImageOverrides=new Map;this.postStreamInitializationListener=this.postStreamInitialization.bind(this);this.triggerManualFocusListener=this.triggerManualFocus.bind(this);this.triggerZoomMoveListener=this.triggerZoomMove.bind(this);this.triggerZoomStartListener=this.triggerZoomStart.bind(this);this.videoResizeListener=a$1(this.handleVideoResize.bind(this),500);this.videoTrackEndedListener=this.videoTrackEndedRecovery.bind(this);this.videoTrackMuteListener=this.videoTrackMuteRecovery.bind(this);this._synchronousFrameHandling=!1;this._glFrameReaders={GRAYSCALE:null,RGBA:null};this._frameReaderType="RGBA";this.cameraPosition="worldFacing",this.gui={isCameraRecoveryVisible:()=>!1,setCameraRecoveryVisible:()=>{}},this.isWebGLSupported=!a$2.checkBrowserCompatibility().missingFeatures.includes("webGL"),this.videoElement=document.createElement("video"),this.canvas=document.createElement("canvas"),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener);}get mediaStream(){return this._mediaStream}set mediaStream(e){this._mediaStream=e,e&&(this.mediaTrackCapabilitiesPromise=new Promise(t=>{this.mediaTrackCapabilitiesPromiseResolver=t;}));}get synchronousFrameHandling(){return this._synchronousFrameHandling}get canvas2dContext(){return this._canvas2dContext||(this._canvas2dContext=this.canvas.getContext("2d",{willReadFrequently:!0}),this._canvas2dContext==null&&a$3.log(a$3.Level.Warn,"Unable to get 2d canvas context"),this.handleVideoResize()),this._canvas2dContext}get canvasWebGLContext(){var e;if(!this._canvas2dContext&&!this._canvasWebGLContext){if(!this.isWebGLSupported){a$3.log(a$3.Level.Warn,"WebGL context not supported, falling back to 2d canvas context. This may impact the scanning performance.");return}let t=(e=this.canvas.getContext("webgl",{alpha:!1,antialias:!1}))!=null?e:this.canvas.getContext("experimental-webgl",{alpha:!1,antialias:!1});t!=null&&(this._canvasWebGLContext=t,this.handleVideoResize());}return this._canvasWebGLContext}static instance(){return n._instance==null&&(n._instance=new n),n._instance}recycle(e){var t;(t=this.getFrameReader())==null||t.recycle(e);}getCurrentFrame(){var e;return (e=this._glFrameReaders.RGBA)==null?void 0:e.readFromSource(this.videoElement)}requestVideoFrame(e){return "requestVideoFrameCallback"in HTMLVideoElement.prototype?this.videoElement.requestVideoFrameCallback(e):requestAnimationFrame(e)}cancelVideoFrame(e){if("cancelVideoFrameCallback"in HTMLVideoElement.prototype){this.videoElement.cancelVideoFrameCallback(e);return}cancelAnimationFrame(e);}addListener(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];i.includes(t)||this.listeners.set(e,[...i,t]);}async applyCameraSettings(e){if(this.selectedCameraSettings=e,this.activeCamera==null)throw new a$4(n.noCameraErrorParameters);return this.initializeCameraWithSettings(this.activeCamera,e)}captureImage(){var e;if(((e=this.mediaStream)==null?void 0:e.active)!=null){if(this.canvasWebGLContext!=null)return this.captureImageForWebGLContext();if(this.canvas2dContext!=null)return this.captureImageFor2dContext()}return null}async initializeCameraWithSettings(e,t){if(this.cameraInitializationPromise&&await this.cameraInitializationPromise,e==null)throw new a$4(n.noCameraErrorParameters);return this.setSelectedCamera(e),this.selectedCameraSettings=t,this.activeCameraSettings=t,this.cameraInitializationPromise=this.initializeCameraAndCheckUpdatedSettings(e),this.cameraInitializationPromise}isMirrorImageEnabled(){if(this.selectedCamera&&this.activeCamera){let e=this.mirrorImageOverrides.get(this.activeCamera);return e!=null?e:this.activeCamera.position==="userFacing"}return !1}isPinchToZoomEnabled(){return this.pinchToZoomEnabled}isTapToFocusEnabled(){return this.tapToFocusEnabled}async isTorchAvailable(){var e;return this.mediaStream?(await this.waitForCapabilities(),((e=this.mediaTrackCapabilities)==null?void 0:e.torch)===!0):!1}async playVideo(){return new Promise(e=>{this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height);let t=this.videoElement.play();t==null?e():t.then(e).catch(()=>{e();});})}async reinitializeCamera(){if(this.activeCamera==null)a$3.log(a$3.Level.Debug,"Camera reinitialization delayed");else {a$3.log(a$3.Level.Debug,"Reinitialize camera:",this.activeCamera);try{let e=this.activeCamera;await this.stopStream(),await this.initializeCameraWithSettings(e,this.activeCameraSettings);}catch(e){throw a$3.log(a$3.Level.Warn,"Couldn't access camera:",this.activeCamera,e),this.emit("cameraAccessError",e),e}}}removeListener(e,t){var s;let r=((s=this.listeners.get(e))!=null?s:[]).filter(o=>o!==t);this.listeners.set(e,r);}async setCameraPosition(e){var i;this.setInitialCameraPosition(e);let t=d.getMainCameraForPosition(await d.getCameras(),e);if(t&&t.deviceId!==((i=this.selectedCamera)==null?void 0:i.deviceId))return this.initializeCameraWithSettings(t,this.selectedCameraSettings)}async setExposure(e){var r,s,o,m,d,l,v,p;let t=(s=(r=this.mediaStream)==null?void 0:r.getVideoTracks())!=null?s:[];if(t.length===0||typeof t[0].applyConstraints!="function")return;await this.waitForCapabilities();let i=e.time!=null&&e.time>0?"manual":"continuous";if(((m=(o=this.mediaTrackCapabilities)==null?void 0:o.exposureMode)==null?void 0:m.includes(i))===!0){if(await t[0].applyConstraints({advanced:[{exposureMode:i}]}),e.time!=null&&e.time>0&&this.mediaTrackCapabilities.exposureTime){let u=Math.max((d=this.mediaTrackCapabilities.exposureTime.min)!=null?d:.01,Math.min(e.time,(l=this.mediaTrackCapabilities.exposureTime.max)!=null?l:1e5));await t[0].applyConstraints({advanced:[{exposureTime:u}]});}else if(e.compensation!=null&&i==="continuous"&&this.mediaTrackCapabilities.exposureCompensation){let u=Math.max((v=this.mediaTrackCapabilities.exposureCompensation.min)!=null?v:-10,Math.min(e.compensation,(p=this.mediaTrackCapabilities.exposureCompensation.max)!=null?p:10));await t[0].applyConstraints({advanced:[{exposureCompensation:u}]});}}}async setFocus(e){var i,r,s,o,m;if(!this.mediaStream)return;let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function"){await this.waitForCapabilities();let d=e>=0?"manual":"continuous";if(((r=(i=this.mediaTrackCapabilities)==null?void 0:i.focusMode)==null?void 0:r.includes(d))===!0&&(await t[0].applyConstraints({advanced:[{focusMode:d}]}),d==="manual"&&this.mediaTrackCapabilities.focusDistance)){let l=Math.max(0,Math.min(e,1))*(((s=this.mediaTrackCapabilities.focusDistance.max)!=null?s:1e3)-((o=this.mediaTrackCapabilities.focusDistance.min)!=null?o:.01))+((m=this.mediaTrackCapabilities.focusDistance.min)!=null?m:.01);await t[0].applyConstraints({advanced:[{focusDistance:l}]});}}}async setFrameRate(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.frameRate)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let o=Math.min((i=this.mediaTrackCapabilities.frameRate.max)!=null?i:240,(r=e.max)!=null?r:240);await s[0].applyConstraints({advanced:[{frameRate:o}]});}}}setInitialCameraPosition(e){this.cameraPosition=e;}setInteractionOptions(e,t,i){this.torchToggleEnabled=e,this.tapToFocusEnabled=t,this.pinchToZoomEnabled=i;}setMirrorImageEnabled(e,t){this.selectedCamera&&(e?(this.videoElement.classList.add(n.MIRRORED_CLASS_NAME),this.canvas.classList.add(n.MIRRORED_CLASS_NAME)):(this.videoElement.classList.remove(n.MIRRORED_CLASS_NAME),this.canvas.classList.remove(n.MIRRORED_CLASS_NAME)),t&&this.mirrorImageOverrides.set(this.selectedCamera,e));}setPinchToZoomEnabled(e){this.pinchToZoomEnabled=e,this.mediaStream&&(this.pinchToZoomEnabled?this.enablePinchToZoomListeners():this.disablePinchToZoomListeners());}setSelectedCamera(e){this.selectedCamera=e;}setSelectedCameraSettings(e){this.selectedCameraSettings=e;}setTapToFocusEnabled(e){this.tapToFocusEnabled=e,this.mediaStream&&(this.tapToFocusEnabled?this.enableTapToFocusListeners():this.disableTapToFocusListeners());}async setTorchEnabled(e){var t;if(this.mediaStream&&((t=this.mediaTrackCapabilities)==null?void 0:t.torch)===!0){this.torchEnabled=e;let i=this.mediaStream.getVideoTracks();i.length>0&&typeof i[0].applyConstraints=="function"&&await i[0].applyConstraints({advanced:[{torch:e}]});}}async setZoom(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.zoom)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let o=Math.max((i=this.mediaTrackCapabilities.zoom.min)!=null?i:1,Math.min(e,(r=this.mediaTrackCapabilities.zoom.max)!=null?r:16));await s[0].applyConstraints({advanced:[{zoom:o}]});}}}async setupCameras(){return this.cameraSetupPromise?this.cameraSetupPromise:(this.cameraSetupPromise=this.setupCamerasAndStream(),this.cameraSetupPromise)}pauseStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!1,a$3.log(a$3.Level.Debug,"Pause camera video stream",this.mediaStream);}resumeStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!0,a$3.log(a$3.Level.Debug,"Resume camera video stream",this.mediaStream);}async stopStream(e=!1){this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=!1,this.mediaStream&&(a$3.log(a$3.Level.Debug,`Stop camera video stream access${e?" (abort access detection)":""}:`,this.mediaStream),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),window.clearTimeout(this.cameraAccessTimeout),window.clearInterval(this.videoMetadataCheckInterval),window.clearTimeout(this.getCapabilitiesTimeout),window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),window.clearInterval(this.autofocusInterval),this.videoElement.pause(),await new Promise(t=>{setTimeout(()=>{var i,r,s;for(let o of (r=(i=this.mediaStream)==null?void 0:i.getVideoTracks())!=null?r:[])o.removeEventListener("ended",this.videoTrackEndedListener),o.stop();this.videoElement.srcObject=null,this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.mediaStream=void 0,this.mediaTrackCapabilities=void 0,this.mediaTrackCapabilitiesPromise=void 0,this.mediaTrackCapabilitiesPromiseResolver=void 0,e||(s=this.abortedCameraInitializationResolveCallback)==null||s.call(this),t();},0);}));}stopVideoTracks(){if(this.mediaStream!=null)for(let e of this.mediaStream.getVideoTracks())e.stop();}async toggleTorch(){this.torchEnabled=!this.torchEnabled,await this.setTorchEnabled(this.torchEnabled);}updateCanvasVideoImage(){this.canvas2dContext.drawImage(this.videoElement,0,0);}async waitForCapabilities(){var e;return (e=this.mediaTrackCapabilitiesPromise)!=null?e:Promise.resolve()}setFrameReaderType(e){e!==this._frameReaderType&&(this._frameReaderType=e,a$3.log(a$3.Level.Debug,`Change frame reader type to ${this._frameReaderType} mode`));}async allowPictureInPicture(e){e?(this.videoElement.disablePictureInPicture=!1,this.videoElement.removeAttribute("controlslist"),this.videoElement.removeAttribute("disablepictureinpicture")):(this.videoElement.disablePictureInPicture=!0,this.videoElement.setAttribute("controlslist","nodownload"),this.videoElement.setAttribute("disablepictureinpicture","true")),await this.reinitializeCamera();}setFrameHandling(e){var t;this._synchronousFrameHandling=e,this._frameReaderOptions=this.getFrameReaderOptions(e),(t=this._glFrameReaders[this._frameReaderType])==null||t.dispose(),delete this._glFrameReaders[this._frameReaderType];}async accessAutoselectedCamera(e){let t=d.sortCamerasForCameraPosition(e,this.cameraPosition),i=t.shift();for(;i;)try{await this.initializeCameraWithSettings(i,this.selectedCameraSettings);return}catch(r){if(this.setSelectedCamera(),t.length>0){a$3.log(a$3.Level.Warn,"Couldn't access camera:",i,r),i=t.shift();continue}throw r}throw new a$4(n.noCameraErrorParameters)}getFrameReaderOptions(e){return e?{minPoolCapacity:0,maxPoolCapacity:1}:a$2.isDesktopDevice()?{maxPoolCapacity:2,minPoolCapacity:1}:{maxPoolCapacity:10,minPoolCapacity:3}}getFrameReader(){var t;if(this._glFrameReaders[this._frameReaderType])return this._glFrameReaders[this._frameReaderType];if(!this._canvasWebGLContext)return null;let e=(t=this._frameReaderOptions)!=null?t:this.getFrameReaderOptions(this._synchronousFrameHandling);switch(this._frameReaderType){case"GRAYSCALE":{this._glFrameReaders.GRAYSCALE=new a$5(this._canvasWebGLContext,e),this._glFrameReaders.RGBA=new b$1(this._canvasWebGLContext,{minPoolCapacity:1,maxPoolCapacity:2});break}case"RGBA":{this._glFrameReaders.RGBA=new b$1(this._canvasWebGLContext,e);break}default:b(this._frameReaderType);}return a$3.debug(`Created frame reader ${this._frameReaderType}`,e),this._glFrameReaders[this._frameReaderType]}async accessInitialCamera(){let e={position:this.cameraPosition,deviceId:"",label:""};try{await this.initializeCameraWithSettings(e,this.selectedCameraSettings);}catch(t){}finally{this.setSelectedCamera();}return e}recreateCanvas(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this._canvasWebGLContext=void 0,this._canvas2dContext=void 0;for(let t of Object.values(this._glFrameReaders))t==null||t.dispose();let e=document.createElement("canvas");e.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),e.width=this.canvas.width,e.height=this.canvas.height,e.className=this.canvas.className,this.canvas=e;}captureImageFor2dContext(){if(!this.isVideoAndContextStateValid())return null;let{width:e,height:t}=this.canvas;return {colorType:"RGBA",data:this.canvas2dContext.getImageData(0,0,e,t).data,width:e,height:t}}areVideoAndWebGLSizeMismatching(){return this.canvasWebGLContext?this.canvasWebGLContext.drawingBufferWidth!==this.videoElement.videoWidth||this.canvasWebGLContext.drawingBufferHeight!==this.videoElement.videoHeight:!0}captureImageForWebGLContext(){if(!this.isVideoAndContextStateValid()||!this.canvasWebGLContext||this.canvasWebGLContext.drawingBufferWidth<=2||this.canvasWebGLContext.drawingBufferHeight<=2||this.areVideoAndWebGLSizeMismatching()||this.getFrameReader()==null)return null;let e=this.getFrameReader().readFromSource(this.videoElement);if(e.data[3]!==255&&e.colorType==="RGBA"){if(a$3.log(a$3.Level.Warn,"Detected incorrect GPU accelerated WebGL image processing, switching to canvas mode"),this.recreateCanvas(),this.canvas2dContext==null)throw new Error("Unable to get 2d canvas context");return this.captureImage()}return e}async checkCameraAccess(e){return new Promise((t,i)=>{this.cameraAccessRejectCallback=r=>{a$3.log(a$3.Level.Debug,"Camera video stream access failure (video data load timeout):",e),this.gui.setCameraRecoveryVisible(!0),i(r);},this.setCameraAccessTimeout();})}checkCameraVideoStreamAccessIfVisible(){document.visibilityState==="visible"&&(a$3.log(a$3.Level.Debug,"Page is visible again, waiting for camera video stream start..."),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),this.setCameraAccessTimeout());}async checkVideoMetadata(e){return new Promise((t,i)=>{this.videoElement.onloadeddata=()=>{if(this.videoElement.onloadeddata=null,window.clearTimeout(this.cameraAccessTimeout),this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.videoElement.currentTime>0){this.updateActiveCameraCurrentResolution(e),a$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();return}let r=performance.now();window.clearInterval(this.videoMetadataCheckInterval),this.videoMetadataCheckInterval=window.setInterval(async()=>{if(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2||this.videoElement.currentTime===0){if(performance.now()-r>n.videoMetadataCheckTimeoutMs){a$3.log(a$3.Level.Warn,"Camera video stream access failure (valid video metadata timeout):",e),window.clearInterval(this.videoMetadataCheckInterval),await this.stopStream(!0),i(new a$4(n.notReadableErrorParameters));return}return}window.clearInterval(this.videoMetadataCheckInterval),this.updateActiveCameraCurrentResolution(e),a$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();},n.videoMetadataCheckIntervalMs);};})}disablePinchToZoomListeners(){this.videoElement.removeEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.removeEventListener("touchmove",this.triggerZoomMoveListener);}disableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.removeEventListener(e,this.triggerManualFocusListener);}emit(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];for(let s of i)s(t);}enablePinchToZoomListeners(){this.videoElement.addEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.addEventListener("touchmove",this.triggerZoomMoveListener);}enableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.addEventListener(e,this.triggerManualFocusListener);}getActiveCamera(e,t,i){return e.length===1?e[0]:e.find(r=>r.deviceId===i||r.label!==""&&r.label===t)}getInitialCameraResolutionConstraint(e){var i;let t;switch((i=this.activeCameraSettings)==null?void 0:i.preferredResolution){case"uhd4k":{t=0;break}case"fullHd":{t=1;break}case"hd":default:{t=2;break}}return t}async handleCameraInitializationError(e,t,i){if(!["OverconstrainedError","NotReadableError"].includes(i.name)||i.name==="NotReadableError"&&t===4)throw a$3.log(a$3.Level.Debug,"Camera video stream access failure (unrecoverable error)",e,i),i.name!=="NotAllowedError"&&d.markCameraAsInaccessible(e),i;if(i.name==="OverconstrainedError"&&t===4){if(e.deviceId==="")throw a$3.log(a$3.Level.Warn,"Camera video stream access failure (no camera with such type error)",e,i),i;a$3.log(a$3.Level.Warn,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",e,i);let r=e.deviceId;if(await d.getCameras(!0),r===e.deviceId)throw a$3.log(a$3.Level.Warn,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",e,i),d.markCameraAsInaccessible(e),i;return a$3.log(a$3.Level.Warn,"Updated camera found (recovered from non-existent deviceId error), attempt to access it",e),this.initializeCameraForResolution(e)}return this.initializeCameraForResolution(e,t+1)}handleVideoResize(){if(!(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2)){if(this.activeCamera&&this.updateActiveCameraCurrentResolution(this.activeCamera),this.canvasWebGLContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight,this.canvasWebGLContext.viewport(0,0,this.canvasWebGLContext.drawingBufferWidth,this.canvasWebGLContext.drawingBufferHeight);}else if(this.canvas2dContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight;}}}handleWebGLContextLost(){a$3.log(a$3.Level.Warn,"WebGL context has been lost, restoring..."),this._canvasWebGLContext=void 0,this.canvasWebGLContext?(this.handleVideoResize(),a$3.log(a$3.Level.Warn,"WebGL context restored")):a$3.log(a$3.Level.Error,"WebGL context restore failed");}async initializeCameraAndCheckUpdatedSettings(e){var t,i,r,s,o;try{if(await this.initializeCameraForResolution(e),this.selectedCameraSettings!==this.activeCameraSettings&&(this.selectedCameraSettings==null||this.activeCameraSettings==null||Object.keys(this.selectedCameraSettings).some(u=>{var b,f;return ((b=this.selectedCameraSettings)==null?void 0:b[u])!==((f=this.activeCameraSettings)==null?void 0:f[u])}))){this.activeCameraSettings=this.selectedCameraSettings,await this.initializeCameraAndCheckUpdatedSettings(e);return}this.activeCameraSettings&&this.activeCameraSettings.zoomFactor>1&&await this.setZoom(this.activeCameraSettings.zoomFactor);let m=(t=this.activeCameraSettings)==null?void 0:t.getProperty("minFrameRate"),d=(i=this.activeCameraSettings)==null?void 0:i.getProperty("maxFrameRate");(m!=null||d!=null)&&await this.setFrameRate({min:m,max:d});let l=(r=this.activeCameraSettings)==null?void 0:r.getProperty("manualLensPosition");l!=null&&await this.setFocus(l);let v=(s=this.activeCameraSettings)==null?void 0:s.getProperty("exposureTargetBias"),p=(o=this.activeCameraSettings)==null?void 0:o.getProperty("exposureDuration");(v!=null||p!=null)&&await this.setExposure({compensation:v,time:p});}finally{this.cameraInitializationPromise=void 0;}}async initializeCameraForResolution(e,t){var r;this.gui.setCameraRecoveryVisible(!1);let i=t!=null?t:this.getInitialCameraResolutionConstraint(e);this.mediaStream!=null&&e.deviceId!==""&&((r=this.activeCamera)==null?void 0:r.deviceId)===e.deviceId?await(a$2.isIPhone()?this.initializeStreamForResolution(e,i):this.updateStreamForResolution(e,i)):await this.initializeStreamForResolution(e,i);}async initializeStreamForResolution(e,t){var i;await this.stopStream();try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio"),s=await d.accessCameraStream(e,t,r);if(a$3.log(a$3.Level.Debug,"Camera accessed, waiting for camera video stream start..."),typeof s.getVideoTracks()[0].getSettings=="function"){let o=s.getVideoTracks()[0].getSettings();if(o.width!=null&&o.height!=null&&(o.width===2||o.height===2)){if(a$3.log(a$3.Level.Debug,"Camera video stream access failure (invalid video metadata):",e),t===4)throw new a$4(n.notReadableErrorParameters);return await this.stopStream(),this.initializeStreamForResolution(e,t+1)}}this.mediaStream=s;for(let o of this.mediaStream.getVideoTracks())o.addEventListener("ended",this.videoTrackEndedListener),o.addEventListener("mute",this.videoTrackMuteListener),o.addEventListener("unmute",this.videoTrackMuteListener);try{await this.setupCameraStreamVideo(e,s);}catch(o){if(t===4)throw o;return this.initializeStreamForResolution(e,t+1)}}catch(r){return this.handleCameraInitializationError(e,t,r)}}isVideoAndContextStateValid(){return this.videoElement.readyState===4&&this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.canvas.width>2&&this.canvas.height>2}postStreamInitialization(){window.clearTimeout(this.getCapabilitiesTimeout),this.getCapabilitiesTimeout=window.setTimeout(()=>{this.storeStreamCapabilities(),this.setupAutofocus();},n.getCapabilitiesTimeoutMs);}async recoverStreamIfNeeded(){var t,i;let e=(t=this.mediaStream)==null?void 0:t.getVideoTracks();((i=e==null?void 0:e[0])==null?void 0:i.readyState)==="ended"&&await this.reinitializeCamera();}reportCameraProperties(e,t,i=!0){this.emit("cameraProperties",{deviceId:e,isFrontFacing:t==="userFacing",hasAutofocus:i});}setCameraAccessTimeout(){window.clearTimeout(this.cameraAccessTimeout),this.cameraAccessTimeout=window.setTimeout(async()=>{var e;document.visibilityState==="visible"?(await this.stopStream(!0),(e=this.cameraAccessRejectCallback)==null||e.call(this,new a$4(n.notReadableErrorParameters))):(a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera video stream access detection"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener));},n.cameraAccessTimeoutMs);}setupAutofocus(){if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),this.mediaStream&&this.mediaTrackCapabilities){let e=this.mediaTrackCapabilities.focusMode;Array.isArray(e)&&!e.includes("continuous")&&e.includes("single-shot")&&(window.clearInterval(this.autofocusInterval),this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),n.autofocusIntervalMs));}}async setupCameraStreamVideo(e,t){this.videoElement.addEventListener("loadedmetadata",this.postStreamInitializationListener),this.videoElement.addEventListener("resize",this.videoResizeListener),this.tapToFocusEnabled&&this.enableTapToFocusListeners(),this.pinchToZoomEnabled&&this.enablePinchToZoomListeners();let i=Promise.race([this.checkCameraAccess(e),this.checkVideoMetadata(e),new Promise(r=>{this.abortedCameraInitializationResolveCallback=r;})]);return this.videoElement.srcObject=t,this.videoElement.load(),await this.playVideo(),this.handleVideoResize(),this.reportCameraProperties(e.deviceId,e.position),i}async setupCamerasAndStream(){var e,t;try{let i;this.selectedCamera==null&&(i=await this.accessInitialCamera());let r=await d.getCameras(!1,!0),s=(t=(e=this.mediaStream)==null?void 0:e.getVideoTracks()[0])==null?void 0:t.getSettings().deviceId;if(this.mediaStream&&i){let o=this.getActiveCamera(r,i.label,s);if(o){if(d.adjustCameraFromMediaStream(this.mediaStream,o),a$2.isDesktopDevice()&&(d.setMainCameraForPositionOverridesOnDesktop(this.cameraPosition,o),d.setMainCameraForPositionOverridesOnDesktop(o.position,o)),r.length===1||d.getMainCameraForPosition(r,this.cameraPosition)===o){a$3.log(a$3.Level.Debug,"Initial camera access was correct (main camera), keep camera:",o),this.setSelectedCamera(o),this.updateActiveCameraCurrentResolution(o),await this.recoverStreamIfNeeded();return}a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (not main camera), change camera",{...i,deviceId:s});}else a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (unknown camera), change camera",{...i,deviceId:s});}if(this.selectedCamera==null){await this.accessAutoselectedCamera(r);return}await this.initializeCameraWithSettings(this.selectedCamera,this.selectedCameraSettings);}finally{this.cameraSetupPromise=void 0;}}storeStreamCapabilities(){var e;if(this.mediaStream){let t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getCapabilities=="function"&&(this.mediaTrackCapabilities=t[0].getCapabilities()),this.mediaTrackCapabilitiesPromiseResolver&&this.mediaTrackCapabilitiesPromiseResolver();}this.activeCamera&&this.reportCameraProperties(this.activeCamera.deviceId,this.activeCamera.position,((e=this.mediaTrackCapabilities)==null?void 0:e.focusMode)==null||this.mediaTrackCapabilities.focusMode.includes("continuous"));}async triggerAutoFocus(){await this.triggerFocusMode("single-shot");}async triggerFocusMode(e){if(this.mediaStream){let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function")try{await t[0].applyConstraints({advanced:[{focusMode:e}]});}catch(i){}}}async triggerManualFocus(e){if(e){if(e.preventDefault(),e.type==="touchend"&&e.touches.length>0)return;if(this.pinchToZoomDistance!=null){this.pinchToZoomDistance=void 0;return}}if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),!this.mediaStream||!this.mediaTrackCapabilities)return;let t=this.mediaTrackCapabilities.focusMode;Array.isArray(t)&&t.includes("single-shot")&&(t.includes("continuous")&&t.includes("manual")?await this.triggerManualFocusForContinuous():t.includes("continuous")||await this.triggerManualFocusForSingleShot());}async triggerManualFocusForContinuous(){var i;if(!this.mediaStream)return;this.manualToAutofocusResumeTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("continuous");},n.manualToAutofocusResumeTimeoutMs);let e=!0,t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getConstraints=="function"&&(e=((i=t[0].getConstraints().advanced)==null?void 0:i.some(r=>r.focusMode==="manual"))===!0),e?(await this.triggerFocusMode("continuous"),this.manualFocusWaitTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("manual");},n.manualFocusWaitTimeoutMs)):await this.triggerFocusMode("manual");}async triggerManualFocusForSingleShot(){window.clearInterval(this.autofocusInterval),this.manualToAutofocusResumeTimeout=window.setTimeout(()=>{this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),n.autofocusIntervalMs);},n.manualToAutofocusResumeTimeoutMs);try{await this.triggerFocusMode("single-shot");}catch(e){}}async triggerZoomMove(e){this.pinchToZoomDistance==null||(e==null?void 0:e.touches.length)!==2||e.preventDefault();}triggerZoomStart(e){var r,s,o,m;if((e==null?void 0:e.touches.length)!==2||(e.preventDefault(),this.pinchToZoomDistance=Math.hypot((e.touches[1].screenX-e.touches[0].screenX)/screen.width,(e.touches[1].screenY-e.touches[0].screenY)/screen.height),!this.mediaStream||!((r=this.mediaTrackCapabilities)!=null&&r.zoom)))return;let t=this.mediaStream.getVideoTracks();if(t.length===0||typeof t[0].getConstraints!="function")return;this.pinchToZoomInitialZoom=(s=this.mediaTrackCapabilities.zoom.min)!=null?s:1;let i=t[0].getConstraints();if(i.advanced){let d=(o=i.advanced.find(l=>"zoom"in l))==null?void 0:o.zoom;d!=null&&(this.pinchToZoomInitialZoom=typeof d=="number"?d:(m=d.ideal)!=null?m:1);}}updateActiveCameraCurrentResolution(e){this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&(e.currentResolution={width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}),e.deviceId!==""&&(this.activeCamera=e,this.setMirrorImageEnabled(this.isMirrorImageEnabled(),!1));}async updateStreamForResolution(e,t){var i;if(this.mediaStream==null)await this.initializeCameraForResolution(e,t);else try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio");a$3.log(a$3.Level.Debug,"Setting new resolution for active camera video stream..."),await this.mediaStream.getVideoTracks()[0].applyConstraints(d.getUserMediaVideoParameters(t,r)),await new Promise(o=>{this.videoElement.addEventListener("timeupdate",()=>{o();},{once:!0});});let s=this.mediaStream.getVideoTracks()[0].getSettings();a$3.log(a$3.Level.Debug,"New active camera video stream resolution set",{width:s.width,height:s.height});}catch(r){if(t===4)throw r;await this.updateStreamForResolution(e,t+1);}}async videoTrackEndedRecovery(){if(document.visibilityState==="visible")try{a$3.log(a$3.Level.Debug,'Detected video track "ended" event, try to reinitialize camera'),await this.reinitializeCamera();}catch(e){}else a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener);}videoTrackMuteRecovery(e){if(this.videoElement.onloadeddata!=null){a$3.log(a$3.Level.Debug,`Detected video track "${e.type}" event, delay camera video stream access detection`),this.setCameraAccessTimeout();return}let t=e.type==="mute";t!==this.gui.isCameraRecoveryVisible()&&(a$3.log(a$3.Level.Debug,`Detected video track "${e.type}" event, ${t?"enable":"disable"} camera recovery`),this.gui.setCameraRecoveryVisible(t));}};n.autofocusIntervalMs=1500,n.cameraAccessTimeoutMs=4e3,n.getCapabilitiesTimeoutMs=500,n.manualFocusWaitTimeoutMs=400,n.manualToAutofocusResumeTimeoutMs=5e3,n.noCameraErrorParameters={name:"NoCameraAvailableError",message:"No camera available"},n.notReadableErrorParameters={name:"NotReadableError",message:"Could not initialize camera correctly"},n.videoMetadataCheckIntervalMs=50,n.videoMetadataCheckTimeoutMs=4e3,n.MIRRORED_CLASS_NAME=a.MIRRORED_CLASS_NAME,n._instance=null;var y=n;export{w as a,R as b,L as c,y as d};
1
+ import {a as a$5}from'./chunk-VLBC3MNR.js';import {b as b$1}from'./chunk-3GBK675W.js';import {b}from'./chunk-FTD535WI.js';import {a as a$1}from'./chunk-R6E4CT22.js';import {a}from'./chunk-JKL2W65E.js';import {d}from'./chunk-BIGR7VVJ.js';import {a as a$3}from'./chunk-XR65N6EG.js';import {a as a$4}from'./chunk-QCZSSQAQ.js';import {a as a$2}from'./chunk-MU4VAJIM.js';var w=(r=>(r.CONTINUOUS="continuous",r.MANUAL="manual",r.NONE="none",r.SINGLE_SHOT="single-shot",r))(w||{}),R=(s=>(s[s.ULTRA_HD=0]="ULTRA_HD",s[s.FULL_HD=1]="FULL_HD",s[s.HD=2]="HD",s[s.SD=3]="SD",s[s.NONE=4]="NONE",s))(R||{}),L=(t=>(t.CAMERA_PROPERTIES="cameraProperties",t.CAMERA_ACCESS_ERROR="cameraAccessError",t))(L||{}),n=class n{constructor(){this.checkCameraVideoStreamAccessIfVisibleListener=this.checkCameraVideoStreamAccessIfVisible.bind(this);this.handleWebGLContextLostListener=this.handleWebGLContextLost.bind(this);this.listeners=new Map;this.mirrorImageOverrides=new Map;this.postStreamInitializationListener=this.postStreamInitialization.bind(this);this.triggerManualFocusListener=this.triggerManualFocus.bind(this);this.triggerZoomMoveListener=this.triggerZoomMove.bind(this);this.triggerZoomStartListener=this.triggerZoomStart.bind(this);this.videoResizeListener=a$1(this.handleVideoResize.bind(this),500);this.videoTrackEndedListener=this.videoTrackEndedRecovery.bind(this);this.videoTrackMuteListener=this.videoTrackMuteRecovery.bind(this);this._synchronousFrameHandling=!1;this._glFrameReaders={GRAYSCALE:null,RGBA:null};this._frameReaderType="RGBA";this.cameraPosition="worldFacing",this.gui={isCameraRecoveryVisible:()=>!1,setCameraRecoveryVisible:()=>{}},this.isWebGLSupported=!a$2.checkBrowserCompatibility().missingFeatures.includes("webGL"),this.videoElement=document.createElement("video"),this.canvas=document.createElement("canvas"),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener);}get mediaStream(){return this._mediaStream}set mediaStream(e){this._mediaStream=e,e&&(this.mediaTrackCapabilitiesPromise=new Promise(t=>{this.mediaTrackCapabilitiesPromiseResolver=t;}));}get synchronousFrameHandling(){return this._synchronousFrameHandling}get canvas2dContext(){return this._canvas2dContext||(this._canvas2dContext=this.canvas.getContext("2d",{willReadFrequently:!0}),this._canvas2dContext==null&&a$3.log(a$3.Level.Warn,"Unable to get 2d canvas context"),this.handleVideoResize()),this._canvas2dContext}get canvasWebGLContext(){var e;if(!this._canvas2dContext&&!this._canvasWebGLContext){if(!this.isWebGLSupported){a$3.log(a$3.Level.Warn,"WebGL context not supported, falling back to 2d canvas context. This may impact the scanning performance.");return}let t=(e=this.canvas.getContext("webgl",{alpha:!1,antialias:!1}))!=null?e:this.canvas.getContext("experimental-webgl",{alpha:!1,antialias:!1});t!=null&&(this._canvasWebGLContext=t,this.handleVideoResize());}return this._canvasWebGLContext}static instance(){return n._instance==null&&(n._instance=new n),n._instance}recycle(e){var t;(t=this.getFrameReader())==null||t.recycle(e);}getCurrentFrame(){var e;return (e=this._glFrameReaders.RGBA)==null?void 0:e.readFromSource(this.videoElement)}requestVideoFrame(e){return "requestVideoFrameCallback"in HTMLVideoElement.prototype?this.videoElement.requestVideoFrameCallback(e):requestAnimationFrame(e)}cancelVideoFrame(e){if("cancelVideoFrameCallback"in HTMLVideoElement.prototype){this.videoElement.cancelVideoFrameCallback(e);return}cancelAnimationFrame(e);}addListener(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];i.includes(t)||this.listeners.set(e,[...i,t]);}async applyCameraSettings(e){if(this.selectedCameraSettings=e,this.activeCamera==null)throw new a$4(n.noCameraErrorParameters);return this.initializeCameraWithSettings(this.activeCamera,e)}captureImage(){var e;if(((e=this.mediaStream)==null?void 0:e.active)!=null){if(this.canvasWebGLContext!=null)return this.captureImageForWebGLContext();if(this.canvas2dContext!=null)return this.captureImageFor2dContext()}return null}async initializeCameraWithSettings(e,t){if(this.cameraInitializationPromise&&await this.cameraInitializationPromise,e==null)throw new a$4(n.noCameraErrorParameters);return this.setSelectedCamera(e),this.selectedCameraSettings=t,this.activeCameraSettings=t,this.cameraInitializationPromise=this.initializeCameraAndCheckUpdatedSettings(e),this.cameraInitializationPromise}isMirrorImageEnabled(){if(this.selectedCamera&&this.activeCamera){let e=this.mirrorImageOverrides.get(this.activeCamera);return e!=null?e:this.activeCamera.position==="userFacing"}return !1}isPinchToZoomEnabled(){return this.pinchToZoomEnabled}isTapToFocusEnabled(){return this.tapToFocusEnabled}async isTorchAvailable(){var e;return this.mediaStream?(await this.waitForCapabilities(),((e=this.mediaTrackCapabilities)==null?void 0:e.torch)===!0):!1}async playVideo(){return new Promise(e=>{this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height);let t=this.videoElement.play();t==null?e():t.then(e).catch(()=>{e();});})}async reinitializeCamera(){if(this.activeCamera==null)a$3.log(a$3.Level.Debug,"Camera reinitialization delayed");else {a$3.log(a$3.Level.Debug,"Reinitialize camera:",this.activeCamera);try{let e=this.activeCamera;await this.stopStream(),await this.initializeCameraWithSettings(e,this.activeCameraSettings);}catch(e){throw a$3.log(a$3.Level.Warn,"Couldn't access camera:",this.activeCamera,e),this.emit("cameraAccessError",e),e}}}removeListener(e,t){var s;let r=((s=this.listeners.get(e))!=null?s:[]).filter(o=>o!==t);this.listeners.set(e,r);}async setCameraPosition(e){var i;this.setInitialCameraPosition(e);let t=d.getMainCameraForPosition(await d.getCameras(),e);if(t&&t.deviceId!==((i=this.selectedCamera)==null?void 0:i.deviceId))return this.initializeCameraWithSettings(t,this.selectedCameraSettings)}async setExposure(e){var r,s,o,m,d,l,v,p;let t=(s=(r=this.mediaStream)==null?void 0:r.getVideoTracks())!=null?s:[];if(t.length===0||typeof t[0].applyConstraints!="function")return;await this.waitForCapabilities();let i=e.time!=null&&e.time>0?"manual":"continuous";if(((m=(o=this.mediaTrackCapabilities)==null?void 0:o.exposureMode)==null?void 0:m.includes(i))===!0){if(await t[0].applyConstraints({advanced:[{exposureMode:i}]}),e.time!=null&&e.time>0&&this.mediaTrackCapabilities.exposureTime){let u=Math.max((d=this.mediaTrackCapabilities.exposureTime.min)!=null?d:.01,Math.min(e.time,(l=this.mediaTrackCapabilities.exposureTime.max)!=null?l:1e5));await t[0].applyConstraints({advanced:[{exposureTime:u}]});}else if(e.compensation!=null&&i==="continuous"&&this.mediaTrackCapabilities.exposureCompensation){let u=Math.max((v=this.mediaTrackCapabilities.exposureCompensation.min)!=null?v:-10,Math.min(e.compensation,(p=this.mediaTrackCapabilities.exposureCompensation.max)!=null?p:10));await t[0].applyConstraints({advanced:[{exposureCompensation:u}]});}}}async setFocus(e){var i,r,s,o,m;if(!this.mediaStream)return;let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function"){await this.waitForCapabilities();let d=e>=0?"manual":"continuous";if(((r=(i=this.mediaTrackCapabilities)==null?void 0:i.focusMode)==null?void 0:r.includes(d))===!0&&(await t[0].applyConstraints({advanced:[{focusMode:d}]}),d==="manual"&&this.mediaTrackCapabilities.focusDistance)){let l=Math.max(0,Math.min(e,1))*(((s=this.mediaTrackCapabilities.focusDistance.max)!=null?s:1e3)-((o=this.mediaTrackCapabilities.focusDistance.min)!=null?o:.01))+((m=this.mediaTrackCapabilities.focusDistance.min)!=null?m:.01);await t[0].applyConstraints({advanced:[{focusDistance:l}]});}}}async setFrameRate(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.frameRate)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let o=Math.min((i=this.mediaTrackCapabilities.frameRate.max)!=null?i:240,(r=e.max)!=null?r:240);await s[0].applyConstraints({advanced:[{frameRate:o}]});}}}setInitialCameraPosition(e){this.cameraPosition=e;}setInteractionOptions(e,t,i){this.torchToggleEnabled=e,this.tapToFocusEnabled=t,this.pinchToZoomEnabled=i;}setMirrorImageEnabled(e,t){this.selectedCamera&&(e?(this.videoElement.classList.add(n.MIRRORED_CLASS_NAME),this.canvas.classList.add(n.MIRRORED_CLASS_NAME)):(this.videoElement.classList.remove(n.MIRRORED_CLASS_NAME),this.canvas.classList.remove(n.MIRRORED_CLASS_NAME)),t&&this.mirrorImageOverrides.set(this.selectedCamera,e));}setPinchToZoomEnabled(e){this.pinchToZoomEnabled=e,this.mediaStream&&(this.pinchToZoomEnabled?this.enablePinchToZoomListeners():this.disablePinchToZoomListeners());}setSelectedCamera(e){this.selectedCamera=e;}setSelectedCameraSettings(e){this.selectedCameraSettings=e;}setTapToFocusEnabled(e){this.tapToFocusEnabled=e,this.mediaStream&&(this.tapToFocusEnabled?this.enableTapToFocusListeners():this.disableTapToFocusListeners());}async setTorchEnabled(e){var t;if(this.mediaStream&&((t=this.mediaTrackCapabilities)==null?void 0:t.torch)===!0){this.torchEnabled=e;let i=this.mediaStream.getVideoTracks();i.length>0&&typeof i[0].applyConstraints=="function"&&await i[0].applyConstraints({advanced:[{torch:e}]});}}async setZoom(e){var t,i,r;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.zoom)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let o=Math.max((i=this.mediaTrackCapabilities.zoom.min)!=null?i:1,Math.min(e,(r=this.mediaTrackCapabilities.zoom.max)!=null?r:16));await s[0].applyConstraints({advanced:[{zoom:o}]});}}}async setupCameras(){return this.cameraSetupPromise?this.cameraSetupPromise:(this.cameraSetupPromise=this.setupCamerasAndStream(),this.cameraSetupPromise)}pauseStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!1,a$3.log(a$3.Level.Debug,"Pause camera video stream",this.mediaStream);}resumeStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!0,a$3.log(a$3.Level.Debug,"Resume camera video stream",this.mediaStream);}async stopStream(e=!1){this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=!1,this.mediaStream&&(a$3.log(a$3.Level.Debug,`Stop camera video stream access${e?" (abort access detection)":""}:`,this.mediaStream),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),window.clearTimeout(this.cameraAccessTimeout),window.clearInterval(this.videoMetadataCheckInterval),window.clearTimeout(this.getCapabilitiesTimeout),window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),window.clearInterval(this.autofocusInterval),this.videoElement.pause(),await new Promise(t=>{setTimeout(()=>{var i,r,s;for(let o of (r=(i=this.mediaStream)==null?void 0:i.getVideoTracks())!=null?r:[])o.removeEventListener("ended",this.videoTrackEndedListener),o.stop();this.videoElement.srcObject=null,this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.mediaStream=void 0,this.mediaTrackCapabilities=void 0,this.mediaTrackCapabilitiesPromise=void 0,this.mediaTrackCapabilitiesPromiseResolver=void 0,e||(s=this.abortedCameraInitializationResolveCallback)==null||s.call(this),t();},0);}));}stopVideoTracks(){if(this.mediaStream!=null)for(let e of this.mediaStream.getVideoTracks())e.stop();}async toggleTorch(){this.torchEnabled=!this.torchEnabled,await this.setTorchEnabled(this.torchEnabled);}updateCanvasVideoImage(){this.canvas2dContext.drawImage(this.videoElement,0,0);}async waitForCapabilities(){var e;return (e=this.mediaTrackCapabilitiesPromise)!=null?e:Promise.resolve()}setFrameReaderType(e){e!==this._frameReaderType&&(this._frameReaderType=e,a$3.log(a$3.Level.Debug,`Change frame reader type to ${this._frameReaderType} mode`));}async allowPictureInPicture(e){e?(this.videoElement.disablePictureInPicture=!1,this.videoElement.removeAttribute("controlslist"),this.videoElement.removeAttribute("disablepictureinpicture")):(this.videoElement.disablePictureInPicture=!0,this.videoElement.setAttribute("controlslist","nodownload"),this.videoElement.setAttribute("disablepictureinpicture","true")),await this.reinitializeCamera();}setFrameHandling(e){var t;this._synchronousFrameHandling=e,this._frameReaderOptions=this.getFrameReaderOptions(e),(t=this._glFrameReaders[this._frameReaderType])==null||t.dispose(),delete this._glFrameReaders[this._frameReaderType];}async accessAutoselectedCamera(e){let t=d.sortCamerasForCameraPosition(e,this.cameraPosition),i=t.shift();for(;i;)try{await this.initializeCameraWithSettings(i,this.selectedCameraSettings);return}catch(r){if(this.setSelectedCamera(),t.length>0){a$3.log(a$3.Level.Warn,"Couldn't access camera:",i,r),i=t.shift();continue}throw r}throw new a$4(n.noCameraErrorParameters)}getFrameReaderOptions(e){return e?{minPoolCapacity:0,maxPoolCapacity:1}:a$2.isDesktopDevice()?{maxPoolCapacity:2,minPoolCapacity:1}:{maxPoolCapacity:10,minPoolCapacity:3}}getFrameReader(){var t;if(this._glFrameReaders[this._frameReaderType])return this._glFrameReaders[this._frameReaderType];if(!this._canvasWebGLContext)return null;let e=(t=this._frameReaderOptions)!=null?t:this.getFrameReaderOptions(this._synchronousFrameHandling);switch(this._frameReaderType){case"GRAYSCALE":{this._glFrameReaders.GRAYSCALE=new a$5(this._canvasWebGLContext,e),this._glFrameReaders.RGBA=new b$1(this._canvasWebGLContext,{minPoolCapacity:1,maxPoolCapacity:2});break}case"RGBA":{this._glFrameReaders.RGBA=new b$1(this._canvasWebGLContext,e);break}default:b(this._frameReaderType);}return a$3.debug(`Created frame reader ${this._frameReaderType}`,e),this._glFrameReaders[this._frameReaderType]}async accessInitialCamera(){let e={position:this.cameraPosition,deviceId:"",label:""};try{await this.initializeCameraWithSettings(e,this.selectedCameraSettings);}catch(t){}finally{this.setSelectedCamera();}return e}recreateCanvas(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this._canvasWebGLContext=void 0,this._canvas2dContext=void 0;for(let t of Object.values(this._glFrameReaders))t==null||t.dispose();let e=document.createElement("canvas");e.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),e.width=this.canvas.width,e.height=this.canvas.height,e.className=this.canvas.className,this.canvas=e;}captureImageFor2dContext(){if(!this.isVideoAndContextStateValid())return null;let{width:e,height:t}=this.canvas;return {colorType:"RGBA",data:this.canvas2dContext.getImageData(0,0,e,t).data,width:e,height:t}}areVideoAndWebGLSizeMismatching(){return this.canvasWebGLContext?this.canvasWebGLContext.drawingBufferWidth!==this.videoElement.videoWidth||this.canvasWebGLContext.drawingBufferHeight!==this.videoElement.videoHeight:!0}captureImageForWebGLContext(){if(!this.isVideoAndContextStateValid()||!this.canvasWebGLContext||this.canvasWebGLContext.drawingBufferWidth<=2||this.canvasWebGLContext.drawingBufferHeight<=2||this.areVideoAndWebGLSizeMismatching()||this.getFrameReader()==null)return null;let e=this.getFrameReader().readFromSource(this.videoElement);if(e.data[3]!==255&&e.colorType==="RGBA"){if(a$3.log(a$3.Level.Warn,"Detected incorrect GPU accelerated WebGL image processing, switching to canvas mode"),this.recreateCanvas(),this.canvas2dContext==null)throw new Error("Unable to get 2d canvas context");return this.captureImage()}return e}async checkCameraAccess(e){return new Promise((t,i)=>{this.cameraAccessRejectCallback=r=>{a$3.log(a$3.Level.Debug,"Camera video stream access failure (video data load timeout):",e),this.gui.setCameraRecoveryVisible(!0),i(r);},this.setCameraAccessTimeout();})}checkCameraVideoStreamAccessIfVisible(){document.visibilityState==="visible"&&(a$3.log(a$3.Level.Debug,"Page is visible again, waiting for camera video stream start..."),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),this.setCameraAccessTimeout());}async checkVideoMetadata(e){return new Promise((t,i)=>{this.videoElement.onloadeddata=()=>{if(this.videoElement.onloadeddata=null,window.clearTimeout(this.cameraAccessTimeout),this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.videoElement.currentTime>0){this.updateActiveCameraCurrentResolution(e),a$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();return}let r=performance.now();window.clearInterval(this.videoMetadataCheckInterval),this.videoMetadataCheckInterval=window.setInterval(async()=>{if(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2||this.videoElement.currentTime===0){if(performance.now()-r>n.videoMetadataCheckTimeoutMs){a$3.log(a$3.Level.Warn,"Camera video stream access failure (valid video metadata timeout):",e),window.clearInterval(this.videoMetadataCheckInterval),await this.stopStream(!0),i(new a$4(n.notReadableErrorParameters));return}return}window.clearInterval(this.videoMetadataCheckInterval),this.updateActiveCameraCurrentResolution(e),a$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();},n.videoMetadataCheckIntervalMs);};})}disablePinchToZoomListeners(){this.videoElement.removeEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.removeEventListener("touchmove",this.triggerZoomMoveListener);}disableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.removeEventListener(e,this.triggerManualFocusListener);}emit(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];for(let s of i)s(t);}enablePinchToZoomListeners(){this.videoElement.addEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.addEventListener("touchmove",this.triggerZoomMoveListener);}enableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.addEventListener(e,this.triggerManualFocusListener);}getActiveCamera(e,t,i){return e.length===1?e[0]:e.find(r=>r.deviceId===i||r.label!==""&&r.label===t)}getInitialCameraResolutionConstraint(e){var i;let t;switch((i=this.activeCameraSettings)==null?void 0:i.preferredResolution){case"uhd4k":{t=0;break}case"fullHd":{t=1;break}case"hd":default:{t=2;break}}return t}async handleCameraInitializationError(e,t,i){if(!["OverconstrainedError","NotReadableError"].includes(i.name)||i.name==="NotReadableError"&&t===4)throw a$3.log(a$3.Level.Debug,"Camera video stream access failure (unrecoverable error)",e,i),i.name!=="NotAllowedError"&&d.markCameraAsInaccessible(e),i;if(i.name==="OverconstrainedError"&&t===4){if(e.deviceId==="")throw a$3.log(a$3.Level.Warn,"Camera video stream access failure (no camera with such type error)",e,i),i;a$3.log(a$3.Level.Warn,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",e,i);let r=e.deviceId;if(await d.getCameras(!0),r===e.deviceId)throw a$3.log(a$3.Level.Warn,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",e,i),d.markCameraAsInaccessible(e),i;return a$3.log(a$3.Level.Warn,"Updated camera found (recovered from non-existent deviceId error), attempt to access it",e),this.initializeCameraForResolution(e)}return this.initializeCameraForResolution(e,t+1)}handleVideoResize(){if(!(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2)){if(this.activeCamera&&this.updateActiveCameraCurrentResolution(this.activeCamera),this.canvasWebGLContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight,this.canvasWebGLContext.viewport(0,0,this.canvasWebGLContext.drawingBufferWidth,this.canvasWebGLContext.drawingBufferHeight);}else if(this.canvas2dContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight;}}}handleWebGLContextLost(){a$3.log(a$3.Level.Warn,"WebGL context has been lost, restoring..."),this._canvasWebGLContext=void 0,this.canvasWebGLContext?(this.handleVideoResize(),a$3.log(a$3.Level.Warn,"WebGL context restored")):a$3.log(a$3.Level.Error,"WebGL context restore failed");}async initializeCameraAndCheckUpdatedSettings(e){var t,i,r,s,o;try{if(await this.initializeCameraForResolution(e),this.selectedCameraSettings!==this.activeCameraSettings&&(this.selectedCameraSettings==null||this.activeCameraSettings==null||Object.keys(this.selectedCameraSettings).some(u=>{var b,f;return ((b=this.selectedCameraSettings)==null?void 0:b[u])!==((f=this.activeCameraSettings)==null?void 0:f[u])}))){this.activeCameraSettings=this.selectedCameraSettings,await this.initializeCameraAndCheckUpdatedSettings(e);return}this.activeCameraSettings&&this.activeCameraSettings.zoomFactor>1&&await this.setZoom(this.activeCameraSettings.zoomFactor);let m=(t=this.activeCameraSettings)==null?void 0:t.getProperty("minFrameRate"),d=(i=this.activeCameraSettings)==null?void 0:i.getProperty("maxFrameRate");(m!=null||d!=null)&&await this.setFrameRate({min:m,max:d});let l=(r=this.activeCameraSettings)==null?void 0:r.getProperty("manualLensPosition");l!=null&&await this.setFocus(l);let v=(s=this.activeCameraSettings)==null?void 0:s.getProperty("exposureTargetBias"),p=(o=this.activeCameraSettings)==null?void 0:o.getProperty("exposureDuration");(v!=null||p!=null)&&await this.setExposure({compensation:v,time:p});}finally{this.cameraInitializationPromise=void 0;}}async initializeCameraForResolution(e,t){var r;this.gui.setCameraRecoveryVisible(!1);let i=t!=null?t:this.getInitialCameraResolutionConstraint(e);this.mediaStream!=null&&e.deviceId!==""&&((r=this.activeCamera)==null?void 0:r.deviceId)===e.deviceId?await(a$2.isIPhone()?this.initializeStreamForResolution(e,i):this.updateStreamForResolution(e,i)):await this.initializeStreamForResolution(e,i);}async initializeStreamForResolution(e,t){var i;await this.stopStream();try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio"),s=await d.accessCameraStream(e,t,r);if(a$3.log(a$3.Level.Debug,"Camera accessed, waiting for camera video stream start..."),typeof s.getVideoTracks()[0].getSettings=="function"){let o=s.getVideoTracks()[0].getSettings();if(o.width!=null&&o.height!=null&&(o.width===2||o.height===2)){if(a$3.log(a$3.Level.Debug,"Camera video stream access failure (invalid video metadata):",e),t===4)throw new a$4(n.notReadableErrorParameters);return await this.stopStream(),this.initializeStreamForResolution(e,t+1)}}this.mediaStream=s;for(let o of this.mediaStream.getVideoTracks())o.addEventListener("ended",this.videoTrackEndedListener),o.addEventListener("mute",this.videoTrackMuteListener),o.addEventListener("unmute",this.videoTrackMuteListener);try{await this.setupCameraStreamVideo(e,s);}catch(o){if(t===4)throw o;return this.initializeStreamForResolution(e,t+1)}}catch(r){return this.handleCameraInitializationError(e,t,r)}}isVideoAndContextStateValid(){return this.videoElement.readyState===4&&this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.canvas.width>2&&this.canvas.height>2}postStreamInitialization(){window.clearTimeout(this.getCapabilitiesTimeout),this.getCapabilitiesTimeout=window.setTimeout(()=>{this.storeStreamCapabilities(),this.setupAutofocus();},n.getCapabilitiesTimeoutMs);}async recoverStreamIfNeeded(){var t,i;let e=(t=this.mediaStream)==null?void 0:t.getVideoTracks();((i=e==null?void 0:e[0])==null?void 0:i.readyState)==="ended"&&await this.reinitializeCamera();}reportCameraProperties(e,t,i=!0){this.emit("cameraProperties",{deviceId:e,isFrontFacing:t==="userFacing",hasAutofocus:i});}setCameraAccessTimeout(){window.clearTimeout(this.cameraAccessTimeout),this.cameraAccessTimeout=window.setTimeout(async()=>{var e;document.visibilityState==="visible"?(await this.stopStream(!0),(e=this.cameraAccessRejectCallback)==null||e.call(this,new a$4(n.notReadableErrorParameters))):(a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera video stream access detection"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener));},n.cameraAccessTimeoutMs);}setupAutofocus(){if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),this.mediaStream&&this.mediaTrackCapabilities){let e=this.mediaTrackCapabilities.focusMode;Array.isArray(e)&&!e.includes("continuous")&&e.includes("single-shot")&&(window.clearInterval(this.autofocusInterval),this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),n.autofocusIntervalMs));}}async setupCameraStreamVideo(e,t){this.videoElement.addEventListener("loadedmetadata",this.postStreamInitializationListener),this.videoElement.addEventListener("resize",this.videoResizeListener),this.tapToFocusEnabled&&this.enableTapToFocusListeners(),this.pinchToZoomEnabled&&this.enablePinchToZoomListeners();let i=Promise.race([this.checkCameraAccess(e),this.checkVideoMetadata(e),new Promise(r=>{this.abortedCameraInitializationResolveCallback=r;})]);return this.videoElement.srcObject=t,this.videoElement.load(),await this.playVideo(),this.handleVideoResize(),this.reportCameraProperties(e.deviceId,e.position),i}async setupCamerasAndStream(){var e,t;try{let i;this.selectedCamera==null&&(i=await this.accessInitialCamera());let r=await d.getCameras(!1,!0),s=(t=(e=this.mediaStream)==null?void 0:e.getVideoTracks()[0])==null?void 0:t.getSettings().deviceId;if(this.mediaStream&&i){let o=this.getActiveCamera(r,i.label,s);if(o){if(d.adjustCameraFromMediaStream(this.mediaStream,o),a$2.isDesktopDevice()&&(d.setMainCameraForPositionOverridesOnDesktop(this.cameraPosition,o),d.setMainCameraForPositionOverridesOnDesktop(o.position,o)),r.length===1||d.getMainCameraForPosition(r,this.cameraPosition)===o){a$3.log(a$3.Level.Debug,"Initial camera access was correct (main camera), keep camera:",o),this.setSelectedCamera(o),this.updateActiveCameraCurrentResolution(o),await this.recoverStreamIfNeeded();return}a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (not main camera), change camera",{...i,deviceId:s});}else a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (unknown camera), change camera",{...i,deviceId:s});}if(this.selectedCamera==null){await this.accessAutoselectedCamera(r);return}await this.initializeCameraWithSettings(this.selectedCamera,this.selectedCameraSettings);}finally{this.cameraSetupPromise=void 0;}}storeStreamCapabilities(){var e;if(this.mediaStream){let t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getCapabilities=="function"&&(this.mediaTrackCapabilities=t[0].getCapabilities()),this.mediaTrackCapabilitiesPromiseResolver&&this.mediaTrackCapabilitiesPromiseResolver();}this.activeCamera&&this.reportCameraProperties(this.activeCamera.deviceId,this.activeCamera.position,((e=this.mediaTrackCapabilities)==null?void 0:e.focusMode)==null||this.mediaTrackCapabilities.focusMode.includes("continuous"));}async triggerAutoFocus(){await this.triggerFocusMode("single-shot");}async triggerFocusMode(e){if(this.mediaStream){let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function")try{await t[0].applyConstraints({advanced:[{focusMode:e}]});}catch(i){}}}async triggerManualFocus(e){if(e){if(e.preventDefault(),e.type==="touchend"&&e.touches.length>0)return;if(this.pinchToZoomDistance!=null){this.pinchToZoomDistance=void 0;return}}if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),!this.mediaStream||!this.mediaTrackCapabilities)return;let t=this.mediaTrackCapabilities.focusMode;Array.isArray(t)&&t.includes("single-shot")&&(t.includes("continuous")&&t.includes("manual")?await this.triggerManualFocusForContinuous():t.includes("continuous")||await this.triggerManualFocusForSingleShot());}async triggerManualFocusForContinuous(){var i;if(!this.mediaStream)return;this.manualToAutofocusResumeTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("continuous");},n.manualToAutofocusResumeTimeoutMs);let e=!0,t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getConstraints=="function"&&(e=((i=t[0].getConstraints().advanced)==null?void 0:i.some(r=>r.focusMode==="manual"))===!0),e?(await this.triggerFocusMode("continuous"),this.manualFocusWaitTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("manual");},n.manualFocusWaitTimeoutMs)):await this.triggerFocusMode("manual");}async triggerManualFocusForSingleShot(){window.clearInterval(this.autofocusInterval),this.manualToAutofocusResumeTimeout=window.setTimeout(()=>{this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),n.autofocusIntervalMs);},n.manualToAutofocusResumeTimeoutMs);try{await this.triggerFocusMode("single-shot");}catch(e){}}async triggerZoomMove(e){this.pinchToZoomDistance==null||(e==null?void 0:e.touches.length)!==2||e.preventDefault();}triggerZoomStart(e){var r,s,o,m;if((e==null?void 0:e.touches.length)!==2||(e.preventDefault(),this.pinchToZoomDistance=Math.hypot((e.touches[1].screenX-e.touches[0].screenX)/screen.width,(e.touches[1].screenY-e.touches[0].screenY)/screen.height),!this.mediaStream||!((r=this.mediaTrackCapabilities)!=null&&r.zoom)))return;let t=this.mediaStream.getVideoTracks();if(t.length===0||typeof t[0].getConstraints!="function")return;this.pinchToZoomInitialZoom=(s=this.mediaTrackCapabilities.zoom.min)!=null?s:1;let i=t[0].getConstraints();if(i.advanced){let d=(o=i.advanced.find(l=>"zoom"in l))==null?void 0:o.zoom;d!=null&&(this.pinchToZoomInitialZoom=typeof d=="number"?d:(m=d.ideal)!=null?m:1);}}updateActiveCameraCurrentResolution(e){this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&(e.currentResolution={width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}),e.deviceId!==""&&(this.activeCamera=e,this.setMirrorImageEnabled(this.isMirrorImageEnabled(),!1));}async updateStreamForResolution(e,t){var i;if(this.mediaStream==null)await this.initializeCameraForResolution(e,t);else try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio");a$3.log(a$3.Level.Debug,"Setting new resolution for active camera video stream..."),await this.mediaStream.getVideoTracks()[0].applyConstraints(d.getUserMediaVideoParameters(t,r)),await new Promise(o=>{this.videoElement.addEventListener("timeupdate",()=>{o();},{once:!0});});let s=this.mediaStream.getVideoTracks()[0].getSettings();a$3.log(a$3.Level.Debug,"New active camera video stream resolution set",{width:s.width,height:s.height});}catch(r){if(t===4)throw r;await this.updateStreamForResolution(e,t+1);}}async videoTrackEndedRecovery(){if(document.visibilityState==="visible")try{a$3.log(a$3.Level.Debug,'Detected video track "ended" event, try to reinitialize camera'),await this.reinitializeCamera();}catch(e){}else a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener);}videoTrackMuteRecovery(e){if(this.videoElement.onloadeddata!=null){a$3.log(a$3.Level.Debug,`Detected video track "${e.type}" event, delay camera video stream access detection`),this.setCameraAccessTimeout();return}let t=e.type==="mute";t!==this.gui.isCameraRecoveryVisible()&&(a$3.log(a$3.Level.Debug,`Detected video track "${e.type}" event, ${t?"enable":"disable"} camera recovery`),this.gui.setCameraRecoveryVisible(t));}};n.autofocusIntervalMs=1500,n.cameraAccessTimeoutMs=4e3,n.getCapabilitiesTimeoutMs=500,n.manualFocusWaitTimeoutMs=400,n.manualToAutofocusResumeTimeoutMs=5e3,n.noCameraErrorParameters={name:"NoCameraAvailableError",message:"No camera available"},n.notReadableErrorParameters={name:"NotReadableError",message:"Could not initialize camera correctly"},n.videoMetadataCheckIntervalMs=50,n.videoMetadataCheckTimeoutMs=4e3,n.MIRRORED_CLASS_NAME=a.MIRRORED_CLASS_NAME,n._instance=null;var y=n;export{w as a,R as b,L as c,y as d};
@@ -1,4 +1,4 @@
1
- import {b as b$3}from'./chunk-64US32RY.js';import {a as a$6}from'./chunk-7ALHRD5L.js';import {a as a$c}from'./chunk-46WJFV3I.js';import {d as d$2,c,b as b$4}from'./chunk-4YVKSEZS.js';import {a as a$e}from'./chunk-FNFCPBQI.js';import {a as a$2}from'./chunk-N5YZEC56.js';import {a as a$a}from'./chunk-JRBLEJMD.js';import {b,a as a$3}from'./chunk-5S537AFM.js';import {a as a$f}from'./chunk-DMOXDUF6.js';import {b as b$1}from'./chunk-457L5N2F.js';import {a as a$7}from'./chunk-GAVFMG2G.js';import {a as a$b}from'./chunk-RIMH6UPR.js';import {a as a$8}from'./chunk-KYNYQBNF.js';import {a as a$h}from'./chunk-ZKROZLQ4.js';import {a as a$5}from'./chunk-6MF4F3EH.js';import {a as a$1}from'./chunk-VJB527QZ.js';import {a as a$9}from'./chunk-NMX4VHW2.js';import {a}from'./chunk-7XQ3GHYH.js';import {d as d$1}from'./chunk-KRWPFM7Z.js';import {a as a$d}from'./chunk-XR65N6EG.js';import {d}from'./chunk-CAIEX6BZ.js';import {a as a$4,b as b$2,i,f}from'./chunk-LDJ53PEJ.js';import {a as a$g}from'./chunk-WUHKODFA.js';var w="core.camera.recovery",B=class q{constructor(){this.focusGesture=d.DataCaptureView.focusGesture;this.zoomGesture=d.DataCaptureView.zoomGesture;this._scanAreaMargins=d.DataCaptureView.scanAreaMargins;this._pointOfInterest=d.DataCaptureView.pointOfInterest;this._logoStyle=d.DataCaptureView.logoStyle;this._logoAnchor=d.DataCaptureView.logoAnchor;this._logoOffset=d.DataCaptureView.logoOffset;this._context=null;this.overlays=[];this.controls=[];this.controlWidgets=new WeakMap;this.frozenFrameCanvas=document.createElement("canvas");this.listeners=[];this.isVideoElementDetached=!1;this.orientation="portrait";this.hiddenProperties={stopVideoTracksOnVisibilityChange:!0,freezeFrameWhenStoppingFrameSource:!0};this.orientationObserver=new b;this.onOrientationChangeListener=this.onOrientationChange.bind(this);this.onHintPresenterUpdateHandler=this.onHintPresenterUpdate.bind(this);this.onBeforeShowToastsHandler=this.onBeforeShowToasts.bind(this);this.onWorkerMessageHandler=this.onWorkerMessage.bind(this);this.visibilityListener=this.onVisibilityChange.bind(this),this.cameraRecoveryListener=this.cameraRecovery.bind(this),a.getInstance().updateIfMissing(a$1);}get scanAreaMargins(){return this._scanAreaMargins}set scanAreaMargins(e){var t;this._scanAreaMargins=e,(t=this.privateContext)==null||t.update();}get pointOfInterest(){return this._pointOfInterest}set pointOfInterest(e){var t;this._pointOfInterest=e,(t=this.privateContext)==null||t.update();}get logoStyle(){return this._logoStyle}set logoStyle(e){var t;this._logoStyle=e,(t=this.privateContext)==null||t.update();}get logoAnchor(){return this._logoAnchor}set logoAnchor(e){var t;this._logoAnchor=e,(t=this.privateContext)==null||t.update();}get logoOffset(){return this._logoOffset}set logoOffset(e){var t;this._logoOffset=e,(t=this.privateContext)==null||t.update();}get cameraRecoveryText(){return a.getInstance().get(w)}get width(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.width)!=null?t:0)}get height(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.height)!=null?t:0)}get canvasDrawer(){return !this._canvasDrawer&&this.canvasElement!=null&&(this._canvasDrawer=new b$1(this.canvasElement),this._canvasDrawer.startObservingCanvasResize()),this._canvasDrawer}get privateContext(){return this._context}static async forContext(e){let t=new q;return await t.setContext(e),t}showProgressBar(){var e;(e=this.loadingOverlay)==null||e.show();}hideProgressBar(){var e;(e=this.loadingOverlay)==null||e.hide();}setProgressBarPercentage(e){this.loadingOverlay&&(this.loadingOverlay.progress=e);}setProgressBarMessage(e){this.loadingOverlay&&(this.loadingOverlay.message=e);}getContext(){return this._context}async setContext(e){var t,i,n;if(this._context=e,e){if(this.overlays.length>0&&((t=this.privateContext)==null?void 0:t.modes.size)===0)throw new Error(["Cannot assign this view to this context. This view has overlays but the context does not have any mode attached matching these overlays.","Remove the overlays first before attaching the view to the context, or add the corresponding mode to the context before attaching this view."].join(" "));await e.setView(this),(i=this.privateContext)==null||i.subscribeToWorkerMessages(this.onWorkerMessageHandler),(n=this._context)!=null&&n.frameSource&&await this.onFrameSourceChange(this._context.frameSource);}}connectToElement(e){var t,i,n;this.orientationObserver.register(),this.setupHtmlElement(e),(t=this.canvasDrawer)==null||t.startObservingCanvasResize(),this.htmlElementDidChange(),a$2.add(this),this.orientation=this.orientationObserver.orientation.value,this.orientationObserver.addEventListener(a$3,this.onOrientationChangeListener),(i=this.hintPresenter)==null||i.addEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(n=this.hintPresenter)==null||n.addEventListener("willshow",this.onBeforeShowToastsHandler),this.localizationSubscription=a.getInstance().subscribe(a=>{a[w]!=null&&(this.cameraRecoveryElement.textContent=a[w]);});}detachFromElement(){var e,t,i,n,a,o,l,m;(e=this.htmlElementState)==null||e.removeListeners(),this.removeStyles(),(t=this.canvasDrawer)==null||t.endObservingCanvasResize(),document.removeEventListener("visibilitychange",this.visibilityListener);for(let h of ["touchend","mousedown"])this.cameraRecoveryElement.removeEventListener(h,this.cameraRecoveryListener);(i=this.loadingOverlay)==null||i.remove(),(n=this.customLocationsView)==null||n.unmount(),this.htmlElementDidChange(),(a=this.gestureRecognizer)==null||a.removeAllListeners(),this.clearHtmlElementContent(),a$2.delete(this),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(a$3,this.onOrientationChangeListener),(o=this.hintPresenter)==null||o.removeEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(l=this.hintPresenter)==null||l.removeEventListener("willshow",this.onBeforeShowToastsHandler),(m=this.localizationSubscription)==null||m.cancel();}async addOverlay(e){var t;this.overlays.includes(e)||(this.overlays.push(e),await((t=this.privateContext)==null?void 0:t.update([{type:"addOverlay",newValue:e}])));}async removeOverlay(e){var t;this.overlays.includes(e)&&(this.overlays.splice(this.overlays.indexOf(e),1),await((t=this.privateContext)==null?void 0:t.update([{type:"removeOverlay",newValue:e}])));}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}viewPointForFramePoint(e){var v,b,O,P,L,V,D,A;let t={width:(b=(v=this.htmlElementState)==null?void 0:v.width)!=null?b:0,height:(P=(O=this.htmlElementState)==null?void 0:O.height)!=null?P:0},i={width:(V=(L=this.videoElement)==null?void 0:L.videoWidth)!=null?V:0,height:(A=(D=this.videoElement)==null?void 0:D.videoHeight)!=null?A:0},n=t.width/t.height,a=i.width/i.height,o=n>a?t.width/i.width:t.height/i.height,l={x:e.x*o,y:e.y*o},m=(i.width*o-t.width)/2,h=(i.height*o-t.height)/2;return new a$4(l.x-m,l.y-h)}viewQuadrilateralForFrameQuadrilateral(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),n=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight);return new b$2(t,i,a,n)}addControl(e){var t;this.controls.includes(e)||(e.view=this,this.controls.push(e),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"addControl",newValue:e}]));}removeControl(e){var t;if(this.controls.includes(e)){e.view=null;let i=this.controls.splice(this.controls.indexOf(e),1);this.getControlWidget(i[0]).remove(!0),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"removeControl",newValue:e}]);}}toJSONObject(){var e;return {scanAreaMargins:this.scanAreaMargins.toJSONObject(),pointOfInterest:this.pointOfInterest.toJSONObject(),logoAnchor:this.logoAnchor,logoOffset:this.logoOffset.toJSONObject(),logoHidden:(e=this.logoHidden)!=null?e:!1,logoStyle:this.logoStyle,overlays:this.overlays.map(t=>t.toJSONObject()),controls:this.controls.map(t=>t.toJSONObject()),focusGesture:this.focusGesture?this.focusGesture.toJSONObject():null,zoomGesture:this.zoomGesture?this.zoomGesture.toJSONObject():null}}isCameraRecoveryVisible(){return !this.cameraRecoveryElement.hidden}setCameraRecoveryVisible(e){this.cameraRecoveryElement.hidden=!e;}async allowPictureInPicture(e){await d$1.instance().allowPictureInPicture(e);}viewAnchorPositionsForFrameAnchorPositions(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),n=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight),o=this.viewPointForFramePoint(e.centerLeft),l=this.viewPointForFramePoint(e.centerRight),m=this.viewPointForFramePoint(e.topCenter),h=this.viewPointForFramePoint(e.bottomCenter),v=this.viewPointForFramePoint(e.center);return new a$5(t,i,a,n,o,m,l,h,v)}setDidTapCustomLocationsViewListener(e){this.customLocationsView&&this.customLocationsView.listener===null&&(this.customLocationsView.listener=e);}renderCustomLocationsView(e){this.customLocationsView!=null&&(this.customLocationsView.setMirrored(d$1.instance().isMirrorImageEnabled()),this.customLocationsView.render(e));}removeStyles(){for(let e of document.querySelectorAll("style[scandit]"))e.remove();}onHintPresenterUpdate(e){var t;(t=this.privateContext)==null||t.workerCommand("hintPresenterV2update",{});}clearHtmlElementContent(){var e;this.htmlElement&&((e=this.canvasDrawer)==null||e.endObservingCanvasResize(),this.htmlElement.innerHTML="",this.cameraPaintboardElement=void 0,this.singleImageUploaderPaintboardElement=void 0,this.htmlElement=void 0);}setupHtmlElement(e){var o,l,m;this.createStyles(),this.htmlElement=e,b$3.register();let t=`
1
+ import {b as b$3}from'./chunk-64US32RY.js';import {a as a$6}from'./chunk-7ALHRD5L.js';import {a as a$c}from'./chunk-46WJFV3I.js';import {d as d$2,c,b as b$4}from'./chunk-O7A2DQPJ.js';import {a as a$e}from'./chunk-FNFCPBQI.js';import {a as a$2}from'./chunk-N5YZEC56.js';import {a as a$a}from'./chunk-JRBLEJMD.js';import {b,a as a$3}from'./chunk-5S537AFM.js';import {a as a$f}from'./chunk-DMOXDUF6.js';import {b as b$1}from'./chunk-457L5N2F.js';import {a as a$7}from'./chunk-GAVFMG2G.js';import {a as a$b}from'./chunk-RIMH6UPR.js';import {a as a$8}from'./chunk-KYNYQBNF.js';import {a as a$h}from'./chunk-ZKROZLQ4.js';import {a as a$5}from'./chunk-6MF4F3EH.js';import {a as a$1}from'./chunk-VJB527QZ.js';import {a as a$9}from'./chunk-NMX4VHW2.js';import {a}from'./chunk-7XQ3GHYH.js';import {d as d$1}from'./chunk-BN7NK5YK.js';import {a as a$d}from'./chunk-XR65N6EG.js';import {d}from'./chunk-CAIEX6BZ.js';import {a as a$4,b as b$2,i,f}from'./chunk-LDJ53PEJ.js';import {a as a$g}from'./chunk-WUHKODFA.js';var w="core.camera.recovery",B=class q{constructor(){this.focusGesture=d.DataCaptureView.focusGesture;this.zoomGesture=d.DataCaptureView.zoomGesture;this._scanAreaMargins=d.DataCaptureView.scanAreaMargins;this._pointOfInterest=d.DataCaptureView.pointOfInterest;this._logoStyle=d.DataCaptureView.logoStyle;this._logoAnchor=d.DataCaptureView.logoAnchor;this._logoOffset=d.DataCaptureView.logoOffset;this._context=null;this.overlays=[];this.controls=[];this.controlWidgets=new WeakMap;this.frozenFrameCanvas=document.createElement("canvas");this.listeners=[];this.isVideoElementDetached=!1;this.orientation="portrait";this.hiddenProperties={stopVideoTracksOnVisibilityChange:!0,freezeFrameWhenStoppingFrameSource:!0};this.orientationObserver=new b;this.onOrientationChangeListener=this.onOrientationChange.bind(this);this.onHintPresenterUpdateHandler=this.onHintPresenterUpdate.bind(this);this.onBeforeShowToastsHandler=this.onBeforeShowToasts.bind(this);this.onWorkerMessageHandler=this.onWorkerMessage.bind(this);this.visibilityListener=this.onVisibilityChange.bind(this),this.cameraRecoveryListener=this.cameraRecovery.bind(this),a.getInstance().updateIfMissing(a$1);}get scanAreaMargins(){return this._scanAreaMargins}set scanAreaMargins(e){var t;this._scanAreaMargins=e,(t=this.privateContext)==null||t.update();}get pointOfInterest(){return this._pointOfInterest}set pointOfInterest(e){var t;this._pointOfInterest=e,(t=this.privateContext)==null||t.update();}get logoStyle(){return this._logoStyle}set logoStyle(e){var t;this._logoStyle=e,(t=this.privateContext)==null||t.update();}get logoAnchor(){return this._logoAnchor}set logoAnchor(e){var t;this._logoAnchor=e,(t=this.privateContext)==null||t.update();}get logoOffset(){return this._logoOffset}set logoOffset(e){var t;this._logoOffset=e,(t=this.privateContext)==null||t.update();}get cameraRecoveryText(){return a.getInstance().get(w)}get width(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.width)!=null?t:0)}get height(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.height)!=null?t:0)}get canvasDrawer(){return !this._canvasDrawer&&this.canvasElement!=null&&(this._canvasDrawer=new b$1(this.canvasElement),this._canvasDrawer.startObservingCanvasResize()),this._canvasDrawer}get privateContext(){return this._context}static async forContext(e){let t=new q;return await t.setContext(e),t}showProgressBar(){var e;(e=this.loadingOverlay)==null||e.show();}hideProgressBar(){var e;(e=this.loadingOverlay)==null||e.hide();}setProgressBarPercentage(e){this.loadingOverlay&&(this.loadingOverlay.progress=e);}setProgressBarMessage(e){this.loadingOverlay&&(this.loadingOverlay.message=e);}getContext(){return this._context}async setContext(e){var t,i,n;if(this._context=e,e){if(this.overlays.length>0&&((t=this.privateContext)==null?void 0:t.modes.size)===0)throw new Error(["Cannot assign this view to this context. This view has overlays but the context does not have any mode attached matching these overlays.","Remove the overlays first before attaching the view to the context, or add the corresponding mode to the context before attaching this view."].join(" "));await e.setView(this),(i=this.privateContext)==null||i.subscribeToWorkerMessages(this.onWorkerMessageHandler),(n=this._context)!=null&&n.frameSource&&await this.onFrameSourceChange(this._context.frameSource);}}connectToElement(e){var t,i,n;this.orientationObserver.register(),this.setupHtmlElement(e),(t=this.canvasDrawer)==null||t.startObservingCanvasResize(),this.htmlElementDidChange(),a$2.add(this),this.orientation=this.orientationObserver.orientation.value,this.orientationObserver.addEventListener(a$3,this.onOrientationChangeListener),(i=this.hintPresenter)==null||i.addEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(n=this.hintPresenter)==null||n.addEventListener("willshow",this.onBeforeShowToastsHandler),this.localizationSubscription=a.getInstance().subscribe(a=>{a[w]!=null&&(this.cameraRecoveryElement.textContent=a[w]);});}detachFromElement(){var e,t,i,n,a,o,l,m;(e=this.htmlElementState)==null||e.removeListeners(),this.removeStyles(),(t=this.canvasDrawer)==null||t.endObservingCanvasResize(),document.removeEventListener("visibilitychange",this.visibilityListener);for(let h of ["touchend","mousedown"])this.cameraRecoveryElement.removeEventListener(h,this.cameraRecoveryListener);(i=this.loadingOverlay)==null||i.remove(),(n=this.customLocationsView)==null||n.unmount(),this.htmlElementDidChange(),(a=this.gestureRecognizer)==null||a.removeAllListeners(),this.clearHtmlElementContent(),a$2.delete(this),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(a$3,this.onOrientationChangeListener),(o=this.hintPresenter)==null||o.removeEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(l=this.hintPresenter)==null||l.removeEventListener("willshow",this.onBeforeShowToastsHandler),(m=this.localizationSubscription)==null||m.cancel();}async addOverlay(e){var t;this.overlays.includes(e)||(this.overlays.push(e),await((t=this.privateContext)==null?void 0:t.update([{type:"addOverlay",newValue:e}])));}async removeOverlay(e){var t;this.overlays.includes(e)&&(this.overlays.splice(this.overlays.indexOf(e),1),await((t=this.privateContext)==null?void 0:t.update([{type:"removeOverlay",newValue:e}])));}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}viewPointForFramePoint(e){var v,b,O,P,L,V,D,A;let t={width:(b=(v=this.htmlElementState)==null?void 0:v.width)!=null?b:0,height:(P=(O=this.htmlElementState)==null?void 0:O.height)!=null?P:0},i={width:(V=(L=this.videoElement)==null?void 0:L.videoWidth)!=null?V:0,height:(A=(D=this.videoElement)==null?void 0:D.videoHeight)!=null?A:0},n=t.width/t.height,a=i.width/i.height,o=n>a?t.width/i.width:t.height/i.height,l={x:e.x*o,y:e.y*o},m=(i.width*o-t.width)/2,h=(i.height*o-t.height)/2;return new a$4(l.x-m,l.y-h)}viewQuadrilateralForFrameQuadrilateral(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),n=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight);return new b$2(t,i,a,n)}addControl(e){var t;this.controls.includes(e)||(e.view=this,this.controls.push(e),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"addControl",newValue:e}]));}removeControl(e){var t;if(this.controls.includes(e)){e.view=null;let i=this.controls.splice(this.controls.indexOf(e),1);this.getControlWidget(i[0]).remove(!0),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"removeControl",newValue:e}]);}}toJSONObject(){var e;return {scanAreaMargins:this.scanAreaMargins.toJSONObject(),pointOfInterest:this.pointOfInterest.toJSONObject(),logoAnchor:this.logoAnchor,logoOffset:this.logoOffset.toJSONObject(),logoHidden:(e=this.logoHidden)!=null?e:!1,logoStyle:this.logoStyle,overlays:this.overlays.map(t=>t.toJSONObject()),controls:this.controls.map(t=>t.toJSONObject()),focusGesture:this.focusGesture?this.focusGesture.toJSONObject():null,zoomGesture:this.zoomGesture?this.zoomGesture.toJSONObject():null}}isCameraRecoveryVisible(){return !this.cameraRecoveryElement.hidden}setCameraRecoveryVisible(e){this.cameraRecoveryElement.hidden=!e;}async allowPictureInPicture(e){await d$1.instance().allowPictureInPicture(e);}viewAnchorPositionsForFrameAnchorPositions(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),n=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight),o=this.viewPointForFramePoint(e.centerLeft),l=this.viewPointForFramePoint(e.centerRight),m=this.viewPointForFramePoint(e.topCenter),h=this.viewPointForFramePoint(e.bottomCenter),v=this.viewPointForFramePoint(e.center);return new a$5(t,i,a,n,o,m,l,h,v)}setDidTapCustomLocationsViewListener(e){this.customLocationsView&&this.customLocationsView.listener===null&&(this.customLocationsView.listener=e);}renderCustomLocationsView(e){this.customLocationsView!=null&&(this.customLocationsView.setMirrored(d$1.instance().isMirrorImageEnabled()),this.customLocationsView.render(e));}removeStyles(){for(let e of document.querySelectorAll("style[scandit]"))e.remove();}onHintPresenterUpdate(e){var t;(t=this.privateContext)==null||t.workerCommand("hintPresenterV2update",{});}clearHtmlElementContent(){var e;this.htmlElement&&((e=this.canvasDrawer)==null||e.endObservingCanvasResize(),this.htmlElement.innerHTML="",this.cameraPaintboardElement=void 0,this.singleImageUploaderPaintboardElement=void 0,this.htmlElement=void 0);}setupHtmlElement(e){var o,l,m;this.createStyles(),this.htmlElement=e,b$3.register();let t=`
2
2
  <div class="${a$9.CONTAINER_CLASS_NAME}">
3
3
  <div class="${a$9.PAINTBOARDS_CONTAINER_CLASS_NAME}">
4
4
  <div data-js-id="loading-overlay"></div>
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-5TKCHVG2.js';import {d}from'./chunk-KRWPFM7Z.js';import {a}from'./chunk-XR65N6EG.js';import {a as a$2}from'./chunk-MU4VAJIM.js';import {g as g$1}from'./chunk-NQC64CT7.js';import {d as d$1}from'./chunk-CAIEX6BZ.js';var g=class n{constructor(e){this.deviceId="";this.type="camera";this._currentState="off";this._settings=new g$1;this._desiredTorchState="off";this._desiredState="off";this.listeners=[];this._context=null;this.stateTransitionStrategyMap={off:{on:this.transitionFromStateOffToOn.bind(this),standby:this.transitionFromStateOffToStandby.bind(this)},on:{off:this.transitionFromStateOnToOff.bind(this),standby:this.transitionFromStateOnToStandby.bind(this)},standby:{off:this.transitionFromStateStandbyToOff.bind(this),on:this.transitionFromStateStandbyToOn.bind(this)}};this.cameraManager=e!=null?e:d.instance(),this.updateCanvasVideoImage=this.updateCanvasVideoImage.bind(this),this.captureAndSend=this.captureAndSend.bind(this);}static get default(){let e=new n;return e.position="worldFacing",e}get desiredState(){return this._desiredState}get settings(){return this._settings}get currentResolution(){var e;return (e=this._currentResolution)!=null?e:null}get context(){return this._context}set context(e){this._context=e,this._context&&this.currentState==="on"&&this.startSendingCapturesToWorker();}get currentState(){return this._currentState}static atPosition(e){if(d$1.Camera.availablePositions.includes(e)){let t=new n;return t.position=e,t}return a.log(a.Level.Warn,`invalid CameraPosition: "${e}"`),null}static fromDeviceCamera(e){let t=n.atPosition(e.position);return t.deviceId=e.deviceId,t.label=e.label,t}async switchToDesiredState(e){var t,i;return this.currentTransitionStrategyPromise&&await this.currentTransitionStrategyPromise,this.currentTransitionStrategyPromise=(i=(t=this.stateTransitionStrategyMap[this.currentState])==null?void 0:t[e])==null?void 0:i.call(t).catch(r=>{if(r instanceof DOMException&&r.message==="The associated Track is in an invalid state"){a.log(a.Level.Warn,r);return}throw r}),this.currentTransitionStrategyPromise}getDesiredTorchState(){return this._desiredTorchState}async setDesiredTorchState(e){this._desiredTorchState=e,await this.cameraManager.setTorchEnabled(this._desiredTorchState==="on"),await this.notifyContext({type:"torchState",newValue:this._desiredTorchState});}async isTorchAvailable(){return this.cameraManager.isTorchAvailable()}addListener(e){e!=null&&(this.listeners.includes(e)||this.listeners.push(e));}removeListener(e){e!=null&&this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async applySettings(e){var i;this._settings=new g$1(e);let t=this.settings.getProperty("grayScaleFrameReader");if(this.cameraManager.setFrameReaderType(t===!0?"GRAYSCALE":"RGBA"),this.currentState==="on"||this.currentState==="standby"){let r=this.cameraManager.activeCameraSettings;(r==null?void 0:r.preferredResolution)!==this.settings.preferredResolution&&(await this.cameraManager.applyCameraSettings(this.settings),(i=this.cameraManager.activeCamera)!=null&&i.currentResolution&&(this._currentResolution={width:this.cameraManager.activeCamera.currentResolution.width,height:this.cameraManager.activeCamera.currentResolution.height})),await this.cameraManager.setZoom(this.settings.zoomFactor);let o=this.settings.getProperty("minFrameRate"),c=this.settings.getProperty("maxFrameRate");(o!=null||c!=null)&&await this.cameraManager.setFrameRate({min:o,max:c});let m=this.settings.getProperty("manualLensPosition");m!=null&&await this.cameraManager.setFocus(m);let u=this.settings.getProperty("exposureTargetBias"),d=this.settings.getProperty("exposureDuration");(u!=null||d!=null)&&await this.cameraManager.setExposure({compensation:u,time:d});}return this.notifyContext({type:"cameraSettings",newValue:this.settings})}toJSONObject(){return {type:this.type,position:this.position,settings:this.settings.toJSONObject(),desiredState:this.desiredState,desiredTorchState:this._desiredTorchState}}getMirrorImageEnabled(){var e;return (e=this._desiredMirrorImageEnabled)!=null?e:this.cameraManager.isMirrorImageEnabled()}async setMirrorImageEnabled(e){this._desiredMirrorImageEnabled=e,this.cameraManager.setMirrorImageEnabled(e,!0),this.context&&await this.context.setFrameSource(this);}getCurrentState(){return this._currentState}async setCurrentState(e){if(e!==this._currentState){this._currentState=e,this.notifyListeners();try{await this.notifyContext({type:"frameSourceState",newValue:e}),e==="on"&&this.startSendingCapturesToWorker();}catch(t){a.log(a.Level.Warn,"Error while notifying context about new state of Camera");}}}async setupCamera(){if(this.cameraManager.setSelectedCameraSettings(this.settings),this.deviceId==="")this.cameraManager.setSelectedCamera(),this.cameraManager.setInitialCameraPosition(this.position);else {let t=(await a$1.getCameras()).find(i=>i.deviceId===this.deviceId);t&&(this.cameraManager.setInitialCameraPosition(t.position),this.cameraManager.setSelectedCamera(t));}await this.cameraManager.setupCameras(),typeof this._desiredMirrorImageEnabled=="boolean"?this.cameraManager.setMirrorImageEnabled(this._desiredMirrorImageEnabled,!0):this.cameraManager.setMirrorImageEnabled(this.cameraManager.isMirrorImageEnabled(),!1),this.context&&await this.context.setFrameSource(this),this.cameraManager.activeCamera&&(this.label=this.cameraManager.activeCamera.label,this.position=this.cameraManager.activeCamera.position,this.deviceId=this.cameraManager.activeCamera.deviceId,this._currentResolution=this.cameraManager.activeCamera.currentResolution);}async notifyContext(e){if(this.context)return this.context.update([e])}notifyListeners(){for(let e of this.listeners)e.didChangeState&&e.didChangeState(this,this.currentState);}updateCanvasVideoImage(){this.currentState==="on"&&this.context&&(this.cameraManager.updateCanvasVideoImage(),this._lastCanvasVideoPreviewAnimationFrame=this.cameraManager.requestVideoFrame(this.updateCanvasVideoImage));}async captureAndSend(){if(this.currentState!=="on"||!this.context)return;if(!this.context.hasEnabledMode()){this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);return}let e=null;try{e=this.cameraManager.captureImage();}catch(t){a.log(a.Level.Warn,t.message);}finally{if(e!=null)if(this.cameraManager.synchronousFrameHandling){let t=await this.context.sendFrameToProcessor(e);this.cameraManager.recycle(t.data);}else this.context.sendFrameToProcessor(e).then(t=>(this.cameraManager.recycle(t.data),null)).catch(t=>{a.warn("error while recycling uint8array",t);});this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);}}startSendingCapturesToWorker(){this.stopSendingCapturesToWorker(),this.captureAndSend();}stopSendingCapturesToWorker(){this._lastCanvasVideoPreviewAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCanvasVideoPreviewAnimationFrame),this._lastCaptureRequestAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCaptureRequestAnimationFrame);}async transitionFromStateOffToOn(){if(!(this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp")){this._desiredState="on",await this.setCurrentState("starting");try{await this.setupCamera(),await this.setCurrentState("on");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}}}async transitionFromStateOffToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "On".'),await this.transitionFromStateOffToOn();return}this._desiredState="standby",await this.setCurrentState("bootingUp");try{await this.setupCamera(),this.cameraManager.pauseStream(),await this.setCurrentState("standby");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateOnToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("stopping"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateOnToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "Off".'),await this.transitionFromStateOnToOff();return}this._desiredState="standby",await this.setCurrentState("goingToSleep"),this.cameraManager.pauseStream(),await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateStandbyToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("shuttingDown"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateStandbyToOn(){this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp"||(this._desiredState="on",await this.setCurrentState("wakingUp"),this.cameraManager.resumeStream(),await this.setCurrentState("on"));}async isAndroidWebView(){return this._isAndroidWebView==null&&(this._isAndroidWebView=await a$2.isAndroidWebView()),this._isAndroidWebView}isZoomAvailable(){var e;return ((e=this.cameraManager.mediaTrackCapabilities)==null?void 0:e.zoom)!=null}};export{g as a};
1
+ import {a as a$1}from'./chunk-5TKCHVG2.js';import {d}from'./chunk-BN7NK5YK.js';import {a}from'./chunk-XR65N6EG.js';import {a as a$2}from'./chunk-MU4VAJIM.js';import {g as g$1}from'./chunk-NQC64CT7.js';import {d as d$1}from'./chunk-CAIEX6BZ.js';var g=class n{constructor(e){this.deviceId="";this.type="camera";this._currentState="off";this._settings=new g$1;this._desiredTorchState="off";this._desiredState="off";this.listeners=[];this._context=null;this.stateTransitionStrategyMap={off:{on:this.transitionFromStateOffToOn.bind(this),standby:this.transitionFromStateOffToStandby.bind(this)},on:{off:this.transitionFromStateOnToOff.bind(this),standby:this.transitionFromStateOnToStandby.bind(this)},standby:{off:this.transitionFromStateStandbyToOff.bind(this),on:this.transitionFromStateStandbyToOn.bind(this)}};this.cameraManager=e!=null?e:d.instance(),this.updateCanvasVideoImage=this.updateCanvasVideoImage.bind(this),this.captureAndSend=this.captureAndSend.bind(this);}static get default(){let e=new n;return e.position="worldFacing",e}get desiredState(){return this._desiredState}get settings(){return this._settings}get currentResolution(){var e;return (e=this._currentResolution)!=null?e:null}get context(){return this._context}set context(e){this._context=e,this._context&&this.currentState==="on"&&this.startSendingCapturesToWorker();}get currentState(){return this._currentState}static atPosition(e){if(d$1.Camera.availablePositions.includes(e)){let t=new n;return t.position=e,t}return a.log(a.Level.Warn,`invalid CameraPosition: "${e}"`),null}static fromDeviceCamera(e){let t=n.atPosition(e.position);return t.deviceId=e.deviceId,t.label=e.label,t}async switchToDesiredState(e){var t,i;return this.currentTransitionStrategyPromise&&await this.currentTransitionStrategyPromise,this.currentTransitionStrategyPromise=(i=(t=this.stateTransitionStrategyMap[this.currentState])==null?void 0:t[e])==null?void 0:i.call(t).catch(r=>{if(r instanceof DOMException&&r.message==="The associated Track is in an invalid state"){a.log(a.Level.Warn,r);return}throw r}),this.currentTransitionStrategyPromise}getDesiredTorchState(){return this._desiredTorchState}async setDesiredTorchState(e){this._desiredTorchState=e,await this.cameraManager.setTorchEnabled(this._desiredTorchState==="on"),await this.notifyContext({type:"torchState",newValue:this._desiredTorchState});}async isTorchAvailable(){return this.cameraManager.isTorchAvailable()}addListener(e){e!=null&&(this.listeners.includes(e)||this.listeners.push(e));}removeListener(e){e!=null&&this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async applySettings(e){var i;this._settings=new g$1(e);let t=this.settings.getProperty("grayScaleFrameReader");if(this.cameraManager.setFrameReaderType(t===!0?"GRAYSCALE":"RGBA"),this.currentState==="on"||this.currentState==="standby"){let r=this.cameraManager.activeCameraSettings;(r==null?void 0:r.preferredResolution)!==this.settings.preferredResolution&&(await this.cameraManager.applyCameraSettings(this.settings),(i=this.cameraManager.activeCamera)!=null&&i.currentResolution&&(this._currentResolution={width:this.cameraManager.activeCamera.currentResolution.width,height:this.cameraManager.activeCamera.currentResolution.height})),await this.cameraManager.setZoom(this.settings.zoomFactor);let o=this.settings.getProperty("minFrameRate"),c=this.settings.getProperty("maxFrameRate");(o!=null||c!=null)&&await this.cameraManager.setFrameRate({min:o,max:c});let m=this.settings.getProperty("manualLensPosition");m!=null&&await this.cameraManager.setFocus(m);let u=this.settings.getProperty("exposureTargetBias"),d=this.settings.getProperty("exposureDuration");(u!=null||d!=null)&&await this.cameraManager.setExposure({compensation:u,time:d});}return this.notifyContext({type:"cameraSettings",newValue:this.settings})}toJSONObject(){return {type:this.type,position:this.position,settings:this.settings.toJSONObject(),desiredState:this.desiredState,desiredTorchState:this._desiredTorchState}}getMirrorImageEnabled(){var e;return (e=this._desiredMirrorImageEnabled)!=null?e:this.cameraManager.isMirrorImageEnabled()}async setMirrorImageEnabled(e){this._desiredMirrorImageEnabled=e,this.cameraManager.setMirrorImageEnabled(e,!0),this.context&&await this.context.setFrameSource(this);}getCurrentState(){return this._currentState}async setCurrentState(e){if(e!==this._currentState){this._currentState=e,this.notifyListeners();try{await this.notifyContext({type:"frameSourceState",newValue:e}),e==="on"&&this.startSendingCapturesToWorker();}catch(t){a.log(a.Level.Warn,"Error while notifying context about new state of Camera");}}}async setupCamera(){if(this.cameraManager.setSelectedCameraSettings(this.settings),this.deviceId==="")this.cameraManager.setSelectedCamera(),this.cameraManager.setInitialCameraPosition(this.position);else {let t=(await a$1.getCameras()).find(i=>i.deviceId===this.deviceId);t&&(this.cameraManager.setInitialCameraPosition(t.position),this.cameraManager.setSelectedCamera(t));}await this.cameraManager.setupCameras(),typeof this._desiredMirrorImageEnabled=="boolean"?this.cameraManager.setMirrorImageEnabled(this._desiredMirrorImageEnabled,!0):this.cameraManager.setMirrorImageEnabled(this.cameraManager.isMirrorImageEnabled(),!1),this.context&&await this.context.setFrameSource(this),this.cameraManager.activeCamera&&(this.label=this.cameraManager.activeCamera.label,this.position=this.cameraManager.activeCamera.position,this.deviceId=this.cameraManager.activeCamera.deviceId,this._currentResolution=this.cameraManager.activeCamera.currentResolution);}async notifyContext(e){if(this.context)return this.context.update([e])}notifyListeners(){for(let e of this.listeners)e.didChangeState&&e.didChangeState(this,this.currentState);}updateCanvasVideoImage(){this.currentState==="on"&&this.context&&(this.cameraManager.updateCanvasVideoImage(),this._lastCanvasVideoPreviewAnimationFrame=this.cameraManager.requestVideoFrame(this.updateCanvasVideoImage));}async captureAndSend(){if(this.currentState!=="on"||!this.context)return;if(!this.context.hasEnabledMode()){this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);return}let e=null;try{e=this.cameraManager.captureImage();}catch(t){a.log(a.Level.Warn,t.message);}finally{if(e!=null)if(this.cameraManager.synchronousFrameHandling){let t=await this.context.sendFrameToProcessor(e);this.cameraManager.recycle(t.data);}else this.context.sendFrameToProcessor(e).then(t=>(this.cameraManager.recycle(t.data),null)).catch(t=>{a.warn("error while recycling uint8array",t);});this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);}}startSendingCapturesToWorker(){this.stopSendingCapturesToWorker(),this.captureAndSend();}stopSendingCapturesToWorker(){this._lastCanvasVideoPreviewAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCanvasVideoPreviewAnimationFrame),this._lastCaptureRequestAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCaptureRequestAnimationFrame);}async transitionFromStateOffToOn(){if(!(this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp")){this._desiredState="on",await this.setCurrentState("starting");try{await this.setupCamera(),await this.setCurrentState("on");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}}}async transitionFromStateOffToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "On".'),await this.transitionFromStateOffToOn();return}this._desiredState="standby",await this.setCurrentState("bootingUp");try{await this.setupCamera(),this.cameraManager.pauseStream(),await this.setCurrentState("standby");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateOnToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("stopping"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateOnToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "Off".'),await this.transitionFromStateOnToOff();return}this._desiredState="standby",await this.setCurrentState("goingToSleep"),this.cameraManager.pauseStream(),await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateStandbyToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("shuttingDown"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateStandbyToOn(){this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp"||(this._desiredState="on",await this.setCurrentState("wakingUp"),this.cameraManager.resumeStream(),await this.setCurrentState("on"));}async isAndroidWebView(){return this._isAndroidWebView==null&&(this._isAndroidWebView=await a$2.isAndroidWebView()),this._isAndroidWebView}isZoomAvailable(){var e;return ((e=this.cameraManager.mediaTrackCapabilities)==null?void 0:e.zoom)!=null}};export{g as a};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-4ZZSBGI6.js';var t=new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function l(e){}export{t as a,l as b};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-GZ4F55TI.js';import {d as d$1}from'./chunk-BIGR7VVJ.js';import {a}from'./chunk-XR65N6EG.js';import {a as a$2}from'./chunk-MU4VAJIM.js';import {f as f$1,g as g$1}from'./chunk-NQC64CT7.js';var S=(t=>(t.Idle="idle",t.Pressed="pressed",t))(S||{}),d=class{constructor(e,t){this.state="idle";this.isHover=!1;this.control=e,this.domHost=t,this.onTouchStartListener=this.onTouchStart.bind(this),this.onMouseEnterListener=this.onMouseEnter.bind(this),this.onMouseLeaveListener=this.onMouseLeave.bind(this),this.onClickListener=this.onClick.bind(this),this.setup();}get frameSource(){var e,t;return (t=(e=this.control.view)==null?void 0:e.getContext())==null?void 0:t.frameSource}get context(){var e;return (e=this.control.view)==null?void 0:e.getContext()}async install(){this.button||this.setup();let e=await this.canShow();return e?(this.updateButtonBackground(this.button,this.getImageFromState()),this.show()):this.hide(),e}remove(e=!1){e&&this.button?(this.button.removeEventListener("mouseenter",this.onMouseEnterListener),this.button.removeEventListener("mouseleave",this.onMouseLeaveListener),this.button.removeEventListener("touchstart",this.onTouchStartListener),this.button.removeEventListener("click",this.onClickListener),this.button.remove(),this.isHover=!1,this.button=void 0):this.hide();}hide(){this.button&&(this.button.style.display="none");}show(){this.button&&(this.button.style.display="block");}setupButton(){let e=document.createElement("button");return e.type="button",e.style.display="none",e.className=`scandit-control-widget scandit-control-widget-${this.control.type}`,this.updateButtonBackground(e,this.getImageFromState()),this.domHost.append(e),e.addEventListener("mouseenter",this.onMouseEnterListener),e.addEventListener("mouseleave",this.onMouseLeaveListener),a$2.isDesktopDevice()||e.addEventListener("touchstart",this.onTouchStartListener),e.addEventListener("click",this.onClickListener),e.setAttribute("aria-pressed",String(this.state==="pressed")),this.button=e,this.button}setup(){this.setupButton();}onTouchStart(){var e,t;(e=this.button)==null||e.removeEventListener("mouseenter",this.onMouseEnterListener),(t=this.button)==null||t.removeEventListener("mouseleave",this.onMouseLeaveListener);}onMouseEnter(){this.isHover=!0,this.updateButtonBackground(this.button,this.getImageFromState());}onMouseLeave(){this.isHover=!1,this.updateButtonBackground(this.button,this.getImageFromState());}onClick(){var e;this.state=this.state==="pressed"?"idle":"pressed",this.buttonClicked(),this.updateButtonBackground(this.button,this.getImageFromState()),(e=this.button)==null||e.setAttribute("aria-pressed",String(this.state==="pressed"));}updateButtonBackground(e,t){t!=null&&e!=null&&(e.style.backgroundImage=`url(${JSON.stringify(t)})`);}},C=class extends d{constructor(e,t){super(e,t);}async buttonClicked(){await this.frameSource.setDesiredTorchState(this.retrieveTorchState()==="on"?"off":"on");}async canShow(){return this.isTorchAvailable()}getImageFromState(){return this.retrieveTorchState()==="on"?this.isHover?this.control.torchOnPressedImage:this.control.torchOnImage:this.isHover?this.control.torchOffPressedImage:this.control.torchOffImage}setup(){if(this.control.torchOffImage==null||this.control.torchOnImage==null){a.log(a.Level.Warn,"TorchSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async isTorchAvailable(){return f$1(this.frameSource)?this.frameSource.isTorchAvailable():!1}retrieveTorchState(){return f$1(this.frameSource)?this.frameSource.getDesiredTorchState():"off"}},f=class o extends d{constructor(e,t){super(e,t);}static get CameraAccess(){return d$1}static get Camera(){return a$1}async canShow(){return (await o.CameraAccess.getCameras()).length>1}getImageFromState(){return this.isHover?this.control.pressedImage:this.control.idleImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getNextDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.idleImage==null){a.log(a.Level.Warn,"CameraSwitchControl idle icon is not set or is empty, the control will not be rendered.");return}super.setup();}async getNextDeviceCamera(){var s,n;let e=await o.CameraAccess.getCameras(),t=this.frameSource?this.frameSource:null,i=(s=t==null?void 0:t.cameraManager.activeCamera)==null?void 0:s.deviceId,r=e.findIndex(c=>c.deviceId===i);return r>-1?(n=e[r+1])!=null?n:e[0]:e.length>0?e[0]:null}async switchCameras(e){var n,c,u;this.isTransitioning=!0;let t=(n=this.context)==null?void 0:n.frameSource,i,r;t!=null&&(i=new g$1(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off"));let s=o.Camera.fromDeviceCamera(e);i!=null&&await s.applySettings(i),await((c=this.context)==null?void 0:c.setFrameSource(s)),await((u=this.context)==null?void 0:u.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=!1;}},g=class o extends d{constructor(e,t){super(e,t);}static get Camera(){return a$1}static get CameraAccess(){return d$1}async install(){let e=await super.install();return e&&await this.setInitialCamera(),e}async canShow(){return !a$2.isIOSDeviceWithExtendedCameraAccess()||!f$1(this.frameSource)?!1:d$1.isIOSBackDualWideCameraLabel(this.frameSource.label)||d$1.isIOSBackCameraLabel(this.frameSource.label)||d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label)}getImageFromState(){return this.isUltraWideBackCamera()?this.isHover?this.control.cameraFOVUltraWidePressedImage:this.control.cameraFOVUltraWideImage:this.isHover?this.control.cameraFOVWidePressedImage:this.control.cameraFOVWideImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getAlternativeDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.cameraFOVUltraWideImage==null||this.control.cameraFOVWideImage==null){a.log(a.Level.Warn,"CameraFOVSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async setInitialCamera(){var e,t;if(!this.isTransitioning&&!d$1.isIOSBackCameraLabel((t=(e=this.frameSource)==null?void 0:e.label)!=null?t:"")){let r=(await o.CameraAccess.getCameras()).find(s=>d$1.isIOSBackCameraLabel(s.label));r&&await this.switchCameras(r);}}isUltraWideBackCamera(){return f$1(this.frameSource)?d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label):!1}async getAlternativeDeviceCamera(){return (await o.CameraAccess.getCameras()).find(t=>this.isUltraWideBackCamera()?d$1.isIOSBackCameraLabel(t.label):d$1.isIOSUltraWideBackCameraLabel(t.label))}async switchCameras(e){var n,c,u;this.isTransitioning=!0;let t=(n=this.context)==null?void 0:n.frameSource,i,r;t!=null&&(i=new g$1(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off"));let s=o.Camera.fromDeviceCamera(e);i!=null&&await s.applySettings(i),await((c=this.context)==null?void 0:c.setFrameSource(s)),await((u=this.context)==null?void 0:u.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=!1;}};export{S as a,C as b,f as c,g as d};
1
+ import {a as a$1}from'./chunk-J4YMMETW.js';import {d as d$1}from'./chunk-BIGR7VVJ.js';import {a}from'./chunk-XR65N6EG.js';import {a as a$2}from'./chunk-MU4VAJIM.js';import {f as f$1,g as g$1}from'./chunk-NQC64CT7.js';var S=(t=>(t.Idle="idle",t.Pressed="pressed",t))(S||{}),d=class{constructor(e,t){this.state="idle";this.isHover=!1;this.control=e,this.domHost=t,this.onTouchStartListener=this.onTouchStart.bind(this),this.onMouseEnterListener=this.onMouseEnter.bind(this),this.onMouseLeaveListener=this.onMouseLeave.bind(this),this.onClickListener=this.onClick.bind(this),this.setup();}get frameSource(){var e,t;return (t=(e=this.control.view)==null?void 0:e.getContext())==null?void 0:t.frameSource}get context(){var e;return (e=this.control.view)==null?void 0:e.getContext()}async install(){this.button||this.setup();let e=await this.canShow();return e?(this.updateButtonBackground(this.button,this.getImageFromState()),this.show()):this.hide(),e}remove(e=!1){e&&this.button?(this.button.removeEventListener("mouseenter",this.onMouseEnterListener),this.button.removeEventListener("mouseleave",this.onMouseLeaveListener),this.button.removeEventListener("touchstart",this.onTouchStartListener),this.button.removeEventListener("click",this.onClickListener),this.button.remove(),this.isHover=!1,this.button=void 0):this.hide();}hide(){this.button&&(this.button.style.display="none");}show(){this.button&&(this.button.style.display="block");}setupButton(){let e=document.createElement("button");return e.type="button",e.style.display="none",e.className=`scandit-control-widget scandit-control-widget-${this.control.type}`,this.updateButtonBackground(e,this.getImageFromState()),this.domHost.append(e),e.addEventListener("mouseenter",this.onMouseEnterListener),e.addEventListener("mouseleave",this.onMouseLeaveListener),a$2.isDesktopDevice()||e.addEventListener("touchstart",this.onTouchStartListener),e.addEventListener("click",this.onClickListener),e.setAttribute("aria-pressed",String(this.state==="pressed")),this.button=e,this.button}setup(){this.setupButton();}onTouchStart(){var e,t;(e=this.button)==null||e.removeEventListener("mouseenter",this.onMouseEnterListener),(t=this.button)==null||t.removeEventListener("mouseleave",this.onMouseLeaveListener);}onMouseEnter(){this.isHover=!0,this.updateButtonBackground(this.button,this.getImageFromState());}onMouseLeave(){this.isHover=!1,this.updateButtonBackground(this.button,this.getImageFromState());}onClick(){var e;this.state=this.state==="pressed"?"idle":"pressed",this.buttonClicked(),this.updateButtonBackground(this.button,this.getImageFromState()),(e=this.button)==null||e.setAttribute("aria-pressed",String(this.state==="pressed"));}updateButtonBackground(e,t){t!=null&&e!=null&&(e.style.backgroundImage=`url(${JSON.stringify(t)})`);}},C=class extends d{constructor(e,t){super(e,t);}async buttonClicked(){await this.frameSource.setDesiredTorchState(this.retrieveTorchState()==="on"?"off":"on");}async canShow(){return this.isTorchAvailable()}getImageFromState(){return this.retrieveTorchState()==="on"?this.isHover?this.control.torchOnPressedImage:this.control.torchOnImage:this.isHover?this.control.torchOffPressedImage:this.control.torchOffImage}setup(){if(this.control.torchOffImage==null||this.control.torchOnImage==null){a.log(a.Level.Warn,"TorchSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async isTorchAvailable(){return f$1(this.frameSource)?this.frameSource.isTorchAvailable():!1}retrieveTorchState(){return f$1(this.frameSource)?this.frameSource.getDesiredTorchState():"off"}},f=class o extends d{constructor(e,t){super(e,t);}static get CameraAccess(){return d$1}static get Camera(){return a$1}async canShow(){return (await o.CameraAccess.getCameras()).length>1}getImageFromState(){return this.isHover?this.control.pressedImage:this.control.idleImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getNextDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.idleImage==null){a.log(a.Level.Warn,"CameraSwitchControl idle icon is not set or is empty, the control will not be rendered.");return}super.setup();}async getNextDeviceCamera(){var s,n;let e=await o.CameraAccess.getCameras(),t=this.frameSource?this.frameSource:null,i=(s=t==null?void 0:t.cameraManager.activeCamera)==null?void 0:s.deviceId,r=e.findIndex(c=>c.deviceId===i);return r>-1?(n=e[r+1])!=null?n:e[0]:e.length>0?e[0]:null}async switchCameras(e){var n,c,u;this.isTransitioning=!0;let t=(n=this.context)==null?void 0:n.frameSource,i,r;t!=null&&(i=new g$1(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off"));let s=o.Camera.fromDeviceCamera(e);i!=null&&await s.applySettings(i),await((c=this.context)==null?void 0:c.setFrameSource(s)),await((u=this.context)==null?void 0:u.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=!1;}},g=class o extends d{constructor(e,t){super(e,t);}static get Camera(){return a$1}static get CameraAccess(){return d$1}async install(){let e=await super.install();return e&&await this.setInitialCamera(),e}async canShow(){return !a$2.isIOSDeviceWithExtendedCameraAccess()||!f$1(this.frameSource)?!1:d$1.isIOSBackDualWideCameraLabel(this.frameSource.label)||d$1.isIOSBackCameraLabel(this.frameSource.label)||d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label)}getImageFromState(){return this.isUltraWideBackCamera()?this.isHover?this.control.cameraFOVUltraWidePressedImage:this.control.cameraFOVUltraWideImage:this.isHover?this.control.cameraFOVWidePressedImage:this.control.cameraFOVWideImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getAlternativeDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.cameraFOVUltraWideImage==null||this.control.cameraFOVWideImage==null){a.log(a.Level.Warn,"CameraFOVSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async setInitialCamera(){var e,t;if(!this.isTransitioning&&!d$1.isIOSBackCameraLabel((t=(e=this.frameSource)==null?void 0:e.label)!=null?t:"")){let r=(await o.CameraAccess.getCameras()).find(s=>d$1.isIOSBackCameraLabel(s.label));r&&await this.switchCameras(r);}}isUltraWideBackCamera(){return f$1(this.frameSource)?d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label):!1}async getAlternativeDeviceCamera(){return (await o.CameraAccess.getCameras()).find(t=>this.isUltraWideBackCamera()?d$1.isIOSBackCameraLabel(t.label):d$1.isIOSUltraWideBackCameraLabel(t.label))}async switchCameras(e){var n,c,u;this.isTransitioning=!0;let t=(n=this.context)==null?void 0:n.frameSource,i,r;t!=null&&(i=new g$1(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off"));let s=o.Camera.fromDeviceCamera(e);i!=null&&await s.applySettings(i),await((c=this.context)==null?void 0:c.setFrameSource(s)),await((u=this.context)==null?void 0:u.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=!1;}};export{S as a,C as b,f as c,g as d};
@@ -0,0 +1 @@
1
+ var e;(o=>{function i(){let r="7.1.2";return r}o.sdkVersion=i;})(e||(e={}));export{e as a};
@@ -1 +1 @@
1
- import {a as a$4}from'./chunk-TM7QAJVA.js';import {a as a$5}from'./chunk-YGFWA4WG.js';import {c as c$1,a as a$6}from'./chunk-2WN7BGOB.js';import {c}from'./chunk-B5JOQVFY.js';import {d}from'./chunk-RQQK6Z5F.js';import {a as a$2}from'./chunk-A4OAOJ72.js';import {a as a$1}from'./chunk-O7TZTIHO.js';import {a}from'./chunk-XR65N6EG.js';import {a as a$3}from'./chunk-QCZSSQAQ.js';import {c as c$2,e}from'./chunk-H4TH4342.js';var C=class C{constructor(e,t){this.hintPresenterV2=null;this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10;this.redrawInterval=1e3/30;this.redrawRequests=[];this._isDrawLoopRunning=!1;this.frameDataPool=new Map;this.lastFrameCounter=-1;this.poorMansBenchmarkLogs=!1;this.writableDataPathStandard="/scandit_sync_folder";this.resourceFilesSubfolder="resources";this.performanceMetricsReporterTimer=void 0;this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0};this.gestureListener=null;this.webPlatformHintPresenter=null;this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),c(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}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let s=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return {frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:s}}createContext(e){var g,D,f,b,h;let t=this.getModeDeserializers(),s=c$1(location);(s==="localhost"||s==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(s+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,s,this.parentDomain,t,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let i=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(i==null){let r=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${r}`)}let a=i.getView();this.context=i.getContext(),i.delete();let d=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(r,o)=>{this.contextDidChangeStatus(JSON.parse(o.toJson())),r.delete();},didStartObservingContext:r=>{this.didStartObservingContext(),r.delete();},didStopObservingContext:r=>{r.delete();}}),p=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:r=>{r.delete();},onObservationStopped:r=>{r.delete();},onFrameProcessingStarted:(r,o)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),o.delete(),r.delete();},onFrameProcessingFinished:(r,o)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),o.delete(),r.delete();},onFrameSkipped:(r,o)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),o.delete(),r.delete();}}),m=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(r,o)=>{var M;(M=this.gestureListener)==null||M.delete(),this.gestureListener=r.clone(),r.delete();}});(g=this.gestureRecognizer)==null||g.delete(),this.gestureRecognizer=new m;let u=new d;this.context.addListener(u),u.delete();let c=new p;this.context.addFrameListener(c),c.delete(),this.setView(a),(D=this.view)==null||D.setGestureRecognizer(this.gestureRecognizer);let w=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:r=>{r.delete();},showToast:r=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(r)});},hideToast:r=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(r)});},showGuidance:r=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(r)});},hideGuidance:r=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(r)});},startUpdateTimer:r=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:r}}});},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"});}});(f=this.hintPresenterV2)==null||f.delete(),(b=this.webPlatformHintPresenter)==null||b.delete(),this.webPlatformHintPresenter=new w,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(h=this.view)==null||h.setHintPresenterV2(this.hintPresenterV2);}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e));}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update();}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0;},1e3));}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}});}deleteFrameData(e){this.frameDataPool.delete(e);}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null;}flushAnalytics(){this.context.flushAnalytics();}extractCentaurusLicense(e){return {payload:{centaurus:{licenseKey:this.Module.LicenseUtils[C.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 {payload:e,transferables:[e.data.buffer]};let t=e.data,s=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,i=this.Module.allocateUint8Array(t.byteLength);return this.Module.HEAPU8.set(t,i),(a=this.imageFrameSource)==null||a.outputFrame(i,e.width,e.height,s),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus);}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e);}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer]);}setFrameSource(e,t){var s;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(s=this.imageFrameSource)==null||s.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource);}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=a=>this.redrawRequests.length>0&&this.redrawRequests[0]<=a,s=a=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=a;)this.redrawRequests.shift();},i=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let a=performance.now();if(t(a)){s(a),e.draw();let d=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(d));}i();},this.redrawInterval);};i();}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(t==null){let i=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${i}`)}this.context.delete(),this.context=t.getContext();let s=t.getView();t.delete(),s!=null&&e.view!=null&&s.setViewSize(e.view.width,e.view.height,e.view.orientation),this.hintPresenterV2!=null&&(s==null||s.setHintPresenterV2(this.hintPresenterV2)),this.gestureRecognizer!=null&&(s==null||s.setGestureRecognizer(this.gestureRecognizer)),this.setView(s),a.log(a.Level.Debug,"context updated",e);}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics();}isFeatureSupported(e){return {payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return {payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return {payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_HASH:globalThis.SDC_WASM_CORE_MT_HASH:e?globalThis.SDC_WASM_CORE_SIMD_HASH:""}getWasmCoreFileName(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_FILE_NAME:globalThis.SDC_WASM_CORE_MT_FILE_NAME:e?globalThis.SDC_WASM_CORE_SIMD_FILE_NAME:""}getWasmMetadata(){return globalThis.WASM_METADATA}getWasmSideModuleFileName(){return ""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e});}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,s)=>t-s);}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${c$1(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([])));}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),s=new t;e.setNeedsRedrawDelegate(s),e.isViewRefreshHandlerSet=!0;}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(s,i){try{let a=JSON.parse(i),d=[];for(let p of a){let m=new TextDecoder(p.ianaName,{fatal:!0});d.push(m.decode(s.slice(p.startIndex,p.endIndex)));}return d.join("")}catch(a){return ""}}});e.setDataDecoding(new t);}start(e,t,s){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||s());}getWritableDataPath(e){return e!=null?(a.log(a.Level.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$1,locationPath:t,writableDataPathOverride:s,overrideThreadsSupport:i,overrideSimdSupport:a$7,verifyResponseHash:d$1,referredOrigin:p,fixedWasmMemory:m}){var S;let u=!1,c=!1;this.writableDataPath=this.getWritableDataPath(s),this.resourcePath=`${e$1}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:w,reject:g,promise:D}=new a$1,f=a$2.sdkVersion();if(f==="")throw new a$3({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[b,h]=await Promise.all([c$2(),e()]);i!=="auto"&&(h=i==="on"),a$7!=="auto"&&(b=a$7==="on");let r=this.getWasmCoreFileName(b,h),o=d(f,e$1,r),{jsURI:M,wasmURI:P}=o,W={instantiateWasm:(l,N)=>(a$6({importObject:l,wasmURI:P,expectedHash:this.getWasmCoreExpectedHash(b,h),verifyResponseHash:d$1,successCallback:N,progressCallback:this._loadProgressCallback,referredOrigin:p}),{})},y=m===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(m),maximum:this.numOfMBToPages(m),shared:h});return y!==null&&a.log(a.Level.Debug,"Fixed wasmMemory set",y),this.moduleHandler.set({...y?{wasmMemory:y}:{},mainScriptUrlOrBlob:M,canvas:(S=this.workerFunctions.getOffscreenCanvas())!=null?S:{getContext:()=>null},...W,dynamicLibraries:this.getWasmDynamicLibraries(P),locateFile:l=>e$1+l,noInitialRun:!0,preRun:[async()=>{try{await a$4({writableDataPath:this.writableDataPath});}catch(l){if(l.name==="BlockedIndexedDB"){g(l.toString());return}a.log(a.Level.Debug,"No IndexedDB support, some data will not be persisted:",l);}c=!0,this.start(c,u,w);}],onMainComplete:()=>{if([u,c].includes(!1)){a.log(a.Level.Warn,{runtimeLoaded:u,fileSystemSynced:c},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),g("onMainComplete has been called but runtime or file system was not ready.");return}w();},onRuntimeInitialized:()=>{u=!0,this.start(c,u,w);},print:l=>{a.log(a.Level.Info,l);}}),await a$5(M,f)||g(`Couldn't retrieve Scandit Data Capture library at ${M}, did you configure the path for it correctly?`),D}};C.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var T=C;export{T as a};
1
+ import {a as a$4}from'./chunk-TM7QAJVA.js';import {a as a$5}from'./chunk-YGFWA4WG.js';import {c as c$1,a as a$6}from'./chunk-2WN7BGOB.js';import {c}from'./chunk-B5JOQVFY.js';import {d}from'./chunk-RQQK6Z5F.js';import {a as a$2}from'./chunk-RIW5A253.js';import {a as a$1}from'./chunk-O7TZTIHO.js';import {a}from'./chunk-XR65N6EG.js';import {a as a$3}from'./chunk-QCZSSQAQ.js';import {c as c$2,e}from'./chunk-H4TH4342.js';var C=class C{constructor(e,t){this.hintPresenterV2=null;this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10;this.redrawInterval=1e3/30;this.redrawRequests=[];this._isDrawLoopRunning=!1;this.frameDataPool=new Map;this.lastFrameCounter=-1;this.poorMansBenchmarkLogs=!1;this.writableDataPathStandard="/scandit_sync_folder";this.resourceFilesSubfolder="resources";this.performanceMetricsReporterTimer=void 0;this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0};this.gestureListener=null;this.webPlatformHintPresenter=null;this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),c(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}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let s=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return {frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:s}}createContext(e){var g,D,f,b,h;let t=this.getModeDeserializers(),s=c$1(location);(s==="localhost"||s==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(s+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,s,this.parentDomain,t,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let i=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(i==null){let r=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${r}`)}let a=i.getView();this.context=i.getContext(),i.delete();let d=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(r,o)=>{this.contextDidChangeStatus(JSON.parse(o.toJson())),r.delete();},didStartObservingContext:r=>{this.didStartObservingContext(),r.delete();},didStopObservingContext:r=>{r.delete();}}),p=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:r=>{r.delete();},onObservationStopped:r=>{r.delete();},onFrameProcessingStarted:(r,o)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),o.delete(),r.delete();},onFrameProcessingFinished:(r,o)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),o.delete(),r.delete();},onFrameSkipped:(r,o)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),o.delete(),r.delete();}}),m=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(r,o)=>{var M;(M=this.gestureListener)==null||M.delete(),this.gestureListener=r.clone(),r.delete();}});(g=this.gestureRecognizer)==null||g.delete(),this.gestureRecognizer=new m;let u=new d;this.context.addListener(u),u.delete();let c=new p;this.context.addFrameListener(c),c.delete(),this.setView(a),(D=this.view)==null||D.setGestureRecognizer(this.gestureRecognizer);let w=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:r=>{r.delete();},showToast:r=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(r)});},hideToast:r=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(r)});},showGuidance:r=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(r)});},hideGuidance:r=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(r)});},startUpdateTimer:r=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:r}}});},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"});}});(f=this.hintPresenterV2)==null||f.delete(),(b=this.webPlatformHintPresenter)==null||b.delete(),this.webPlatformHintPresenter=new w,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(h=this.view)==null||h.setHintPresenterV2(this.hintPresenterV2);}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e));}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update();}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0;},1e3));}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}});}deleteFrameData(e){this.frameDataPool.delete(e);}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null;}flushAnalytics(){this.context.flushAnalytics();}extractCentaurusLicense(e){return {payload:{centaurus:{licenseKey:this.Module.LicenseUtils[C.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 {payload:e,transferables:[e.data.buffer]};let t=e.data,s=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,i=this.Module.allocateUint8Array(t.byteLength);return this.Module.HEAPU8.set(t,i),(a=this.imageFrameSource)==null||a.outputFrame(i,e.width,e.height,s),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus);}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e);}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer]);}setFrameSource(e,t){var s;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(s=this.imageFrameSource)==null||s.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource);}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=a=>this.redrawRequests.length>0&&this.redrawRequests[0]<=a,s=a=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=a;)this.redrawRequests.shift();},i=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let a=performance.now();if(t(a)){s(a),e.draw();let d=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(d));}i();},this.redrawInterval);};i();}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(t==null){let i=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${i}`)}this.context.delete(),this.context=t.getContext();let s=t.getView();t.delete(),s!=null&&e.view!=null&&s.setViewSize(e.view.width,e.view.height,e.view.orientation),this.hintPresenterV2!=null&&(s==null||s.setHintPresenterV2(this.hintPresenterV2)),this.gestureRecognizer!=null&&(s==null||s.setGestureRecognizer(this.gestureRecognizer)),this.setView(s),a.log(a.Level.Debug,"context updated",e);}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics();}isFeatureSupported(e){return {payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return {payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return {payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_HASH:globalThis.SDC_WASM_CORE_MT_HASH:e?globalThis.SDC_WASM_CORE_SIMD_HASH:""}getWasmCoreFileName(e,t){return t?e?globalThis.SDC_WASM_CORE_MT_SIMD_FILE_NAME:globalThis.SDC_WASM_CORE_MT_FILE_NAME:e?globalThis.SDC_WASM_CORE_SIMD_FILE_NAME:""}getWasmMetadata(){return globalThis.WASM_METADATA}getWasmSideModuleFileName(){return ""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e});}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,s)=>t-s);}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${c$1(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([])));}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),s=new t;e.setNeedsRedrawDelegate(s),e.isViewRefreshHandlerSet=!0;}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(s,i){try{let a=JSON.parse(i),d=[];for(let p of a){let m=new TextDecoder(p.ianaName,{fatal:!0});d.push(m.decode(s.slice(p.startIndex,p.endIndex)));}return d.join("")}catch(a){return ""}}});e.setDataDecoding(new t);}start(e,t,s){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||s());}getWritableDataPath(e){return e!=null?(a.log(a.Level.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$1,locationPath:t,writableDataPathOverride:s,overrideThreadsSupport:i,overrideSimdSupport:a$7,verifyResponseHash:d$1,referredOrigin:p,fixedWasmMemory:m}){var S;let u=!1,c=!1;this.writableDataPath=this.getWritableDataPath(s),this.resourcePath=`${e$1}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:w,reject:g,promise:D}=new a$1,f=a$2.sdkVersion();if(f==="")throw new a$3({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[b,h]=await Promise.all([c$2(),e()]);i!=="auto"&&(h=i==="on"),a$7!=="auto"&&(b=a$7==="on");let r=this.getWasmCoreFileName(b,h),o=d(f,e$1,r),{jsURI:M,wasmURI:P}=o,W={instantiateWasm:(l,N)=>(a$6({importObject:l,wasmURI:P,expectedHash:this.getWasmCoreExpectedHash(b,h),verifyResponseHash:d$1,successCallback:N,progressCallback:this._loadProgressCallback,referredOrigin:p}),{})},y=m===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(m),maximum:this.numOfMBToPages(m),shared:h});return y!==null&&a.log(a.Level.Debug,"Fixed wasmMemory set",y),this.moduleHandler.set({...y?{wasmMemory:y}:{},mainScriptUrlOrBlob:M,canvas:(S=this.workerFunctions.getOffscreenCanvas())!=null?S:{getContext:()=>null},...W,dynamicLibraries:this.getWasmDynamicLibraries(P),locateFile:l=>e$1+l,noInitialRun:!0,preRun:[async()=>{try{await a$4({writableDataPath:this.writableDataPath});}catch(l){if(l.name==="BlockedIndexedDB"){g(l.toString());return}a.log(a.Level.Debug,"No IndexedDB support, some data will not be persisted:",l);}c=!0,this.start(c,u,w);}],onMainComplete:()=>{if([u,c].includes(!1)){a.log(a.Level.Warn,{runtimeLoaded:u,fileSystemSynced:c},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),g("onMainComplete has been called but runtime or file system was not ready.");return}w();},onRuntimeInitialized:()=>{u=!0,this.start(c,u,w);},print:l=>{a.log(a.Level.Info,l);}}),await a$5(M,f)||g(`Couldn't retrieve Scandit Data Capture library at ${M}, did you configure the path for it correctly?`),D}};C.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var T=C;export{T as a};
@@ -1,4 +1,4 @@
1
- import {a}from'./chunk-MW5PTAU7.js';import {a as a$1}from'./chunk-QHBIT2WY.js';import {b,a as a$2}from'./chunk-SK6L34IF.js';var m=`
1
+ import {b,a as a$2}from'./chunk-SK6L34IF.js';import {a as a$1}from'./chunk-QHBIT2WY.js';import {a}from'./chunk-MW5PTAU7.js';var m=`
2
2
  attribute vec2 a_position;
3
3
  varying vec2 v_texcoord;
4
4
 
@@ -3,8 +3,8 @@ import { Logger } from './logger.js';
3
3
  export { WorkerMain } from './worker/WorkerMain.js';
4
4
  export { Anchor, Color, ColorJSON, Direction, JSONType, MarginsWithUnit, MarginsWithUnitJSON, MeasureUnit, NumberWithUnit, NumberWithUnitJSON, Orientation, Point, PointJSON, PointWithUnit, PointWithUnitJSON, Quadrilateral, QuadrilateralJSON, Rect, RectJSON, RectWithUnit, RectWithUnitJSON, Size, SizeJSON, SizeWithAspect, SizeWithUnit, SizeWithUnitAndAspect, SizeWithUnitAndAspectJSON, SizeWithUnitJSON, SizingMode } from './Common.js';
5
5
  export { OverrideState } from './worker/OverrideState.js';
6
- import { D as DataCaptureLoader } from './Camera-DsOMNsZu.js';
7
- export { g as Camera, m as CameraAccess, e as CameraJSON, C as CameraPosition, l as CameraSettings, i as CameraSettingsFromJSON, j as CameraSettingsJSON, h as CameraSettingsJSONBase, o as Change, H as ContextStatus, G as ContextStatusJSON, u as DataCaptureComponent, t as DataCaptureComponentJSON, B as DataCaptureContext, x as DataCaptureContextCreationOptions, y as DataCaptureContextJSON, E as DataCaptureContextListener, R as DataCaptureLoaderOptions, q as DataCaptureMode, r as DataCaptureModeJSON, J as DataCaptureOverlay, M as DataCaptureView, L as DataCaptureViewJSON, K as DataCaptureViewListener, n as DeviceCamera, F as FocusGestureStrategy, N as FrameData, a as FrameSource, d as FrameSourceJSON, c as FrameSourceListener, b as FrameSourceState, P as PrivateChangeSet, s as PrivateDataCaptureComponent, w as PrivateDataCaptureContext, v as PrivateDataCaptureContextOptions, p as PrivateDataCaptureMode, A as PrivateFrameHandler, z as PrivateFrameHandlerResponse, O as PrivateLoadableFrameData, I as PrivateMirrorAxis, T as TorchState, f as VideoFrameResolution, V as VideoResolution, Q as convertToPublicFrameData, k as isCameraFrameSource } from './Camera-DsOMNsZu.js';
6
+ import { D as DataCaptureLoader } from './Camera-Ds4oKYkb.js';
7
+ export { g as Camera, m as CameraAccess, e as CameraJSON, C as CameraPosition, l as CameraSettings, i as CameraSettingsFromJSON, j as CameraSettingsJSON, h as CameraSettingsJSONBase, o as Change, H as ContextStatus, G as ContextStatusJSON, u as DataCaptureComponent, t as DataCaptureComponentJSON, B as DataCaptureContext, x as DataCaptureContextCreationOptions, y as DataCaptureContextJSON, E as DataCaptureContextListener, R as DataCaptureLoaderOptions, q as DataCaptureMode, r as DataCaptureModeJSON, J as DataCaptureOverlay, M as DataCaptureView, L as DataCaptureViewJSON, K as DataCaptureViewListener, n as DeviceCamera, F as FocusGestureStrategy, N as FrameData, a as FrameSource, d as FrameSourceJSON, c as FrameSourceListener, b as FrameSourceState, P as PrivateChangeSet, s as PrivateDataCaptureComponent, w as PrivateDataCaptureContext, v as PrivateDataCaptureContextOptions, p as PrivateDataCaptureMode, A as PrivateFrameHandler, z as PrivateFrameHandlerResponse, O as PrivateLoadableFrameData, I as PrivateMirrorAxis, T as TorchState, f as VideoFrameResolution, V as VideoResolution, Q as convertToPublicFrameData, k as isCameraFrameSource } from './Camera-Ds4oKYkb.js';
8
8
  export { LoadingStatus, LoadingStatusSubscriber, ProgressInfo, default as loadingStatus } from './LoadingStatus.js';
9
9
  export { DeepMutable, DeepPartial, DistributiveKeyOf, MethodSignature, Mutable, Optional, Prettify, assert, assertUnreachable, assertUnreachableThrowException } from './tsHelper.js';
10
10
  export { AnchorPositions, AnchorPositionsJSON } from './private/AnchorPositions.js';
package/build/js/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export{a as DataCaptureLoader}from'./chunks/chunk-5DETRQ7Y.js';export{a as WorkerMain}from'./chunks/chunk-FHGLVS66.js';export{a as OverrideState}from'./chunks/chunk-6W7FX6LD.js';import {a as a$3}from'./chunks/chunk-RQQK6Z5F.js';export{a as SingleImageUploader}from'./chunks/chunk-5PHKPYK6.js';export{a as SingleImageUploaderSettings}from'./chunks/chunk-7JX43F4O.js';export{c as CameraFOVSwitchControl,b as CameraSwitchControl,a as TorchSwitchControl}from'./chunks/chunk-T5EUB6UG.js';export{a as NoViewfinder}from'./chunks/chunk-4ZMCJXZS.js';export{a as convertToPublicFrameData}from'./chunks/chunk-UHFABUTI.js';export{a as ImageFrameSource}from'./chunks/chunk-Q7NDC6TJ.js';export{a as PrivateNoneLocationSelection,b as RadiusLocationSelection,c as RectangularLocationSelection}from'./chunks/chunk-ZDYFZYVT.js';export{a as RectangularViewfinder}from'./chunks/chunk-YEMIFGKZ.js';export{c as ScanditIconBuilder,b as ScanditIconForIconType,a as ScanditIconType}from'./chunks/chunk-7LG2KINM.js';export{b as ScanditIcon,a as ScanditIconShape}from'./chunks/chunk-AD3CNBDO.js';export{a as DataCaptureVersion}from'./chunks/chunk-A4OAOJ72.js';export{a as DataCaptureView}from'./chunks/chunk-EFNSFA3N.js';import {a as a$5}from'./chunks/chunk-N5YZEC56.js';export{a as AnchorPositions}from'./chunks/chunk-6MF4F3EH.js';import {a as a$2}from'./chunks/chunk-VJB527QZ.js';import {a as a$1}from'./chunks/chunk-7XQ3GHYH.js';export{a as Localization}from'./chunks/chunk-7XQ3GHYH.js';export{a as Feedback}from'./chunks/chunk-R2VJDRLZ.js';export{a as Sound}from'./chunks/chunk-GSJH2EXJ.js';export{a as Vibration}from'./chunks/chunk-JO2MKLMM.js';export{a as AimerViewfinder}from'./chunks/chunk-PWRWWFPG.js';export{a as Brush}from'./chunks/chunk-G33OCZIN.js';export{a as Camera}from'./chunks/chunk-GZ4F55TI.js';export{a as CameraAccess}from'./chunks/chunk-5TKCHVG2.js';export{a as DataCaptureContext}from'./chunks/chunk-QK3D2DQM.js';import {a as a$6,c}from'./chunks/chunk-EHMSDFH7.js';import {a}from'./chunks/chunk-NMROJLGQ.js';import {b}from'./chunks/chunk-6H6FKGVE.js';export{b as loadingStatus}from'./chunks/chunk-6H6FKGVE.js';export{a as DataCaptureContextSettings}from'./chunks/chunk-7SW2PEHB.js';export{a as assert,b as assertUnreachable,c as assertUnreachableThrowException}from'./chunks/chunk-FTD535WI.js';import {a as a$9}from'./chunks/chunk-GPJEB376.js';import {a as a$4}from'./chunks/chunk-XR65N6EG.js';export{a as Logger}from'./chunks/chunk-XR65N6EG.js';import {a as a$7}from'./chunks/chunk-QCZSSQAQ.js';export{a as DataCaptureError}from'./chunks/chunk-QCZSSQAQ.js';import {a as a$8}from'./chunks/chunk-MU4VAJIM.js';export{a as BrowserHelper}from'./chunks/chunk-MU4VAJIM.js';export{a as Feature}from'./chunks/chunk-5LIWL2C4.js';export{c as CameraPosition,g as CameraSettings,e as FocusGestureStrategy,a as FrameSourceState,b as TorchState,d as VideoResolution,f as isCameraFrameSource}from'./chunks/chunk-NQC64CT7.js';export{c as RectangularViewfinderAnimation,b as RectangularViewfinderLineStyle,a as RectangularViewfinderStyle}from'./chunks/chunk-J2UL6U3I.js';export{a as LogoStyle,c as SwipeToZoom,b as TapToFocus}from'./chunks/chunk-GX4YCYCH.js';export{q as Anchor,n as Color,p as Direction,m as MarginsWithUnit,c as MeasureUnit,d as NumberWithUnit,o as Orientation,a as Point,e as PointWithUnit,b as Quadrilateral,f as Rect,g as RectWithUnit,i as Size,j as SizeWithAspect,h as SizeWithUnit,l as SizeWithUnitAndAspect,k as SizingMode}from'./chunks/chunk-LDJ53PEJ.js';export{a as ContextStatus,b as PrivateMirrorAxis}from'./chunks/chunk-WUHKODFA.js';var p=a;async function S(){var e;a.configurePhase="unconfigured",(e=p.mainDataCaptureLoader)!=null&&e.terminateDataCaptureWorker&&await p.mainDataCaptureLoader.terminateDataCaptureWorker(!0);}function l({percentage:e}){for(let r of a$5.values())r.setProgressBarPercentage(e);}function D(){var o,u;function e(P){return ["auto","off","on"].includes(P)}let r=new URLSearchParams(window.location.search),[a="auto",i="auto"]=[(o=r.get("pthreads"))==null?void 0:o.toLowerCase(),(u=r.get("simd"))==null?void 0:u.toLowerCase()];return {overrideThreadsSupport:e(a)?a:"auto",overrideSimdSupport:e(i)?i:"auto"}}async function O(e){if(a$6()&&typeof e.licenseDataPath!="string")throw new a$7({name:"MisconfigurationError",message:'"licenseDataPath" string is missing or not valid'});if(a$6()&&typeof e.licenseDataPath=="string"){let a=await c({licenseDataPath:e.licenseDataPath});if(a==null)throw new Error("Cannot retrieve license key for Electron");e.licenseKey=a.licenseKey;}if(e.licenseKey==null||e.licenseKey.trim().length<64)throw new a$7({name:"NoLicenseKeyError",message:"No license key provided"});if(typeof e.libraryLocation!="string")throw new a$7({name:"MisconfigurationError",message:'Option "libraryLocation" was not provided'});if(!Array.isArray(e.moduleLoaders)||e.moduleLoaders.length===0)throw new a$7({name:"MisconfigurationError",message:'Option "moduleLoaders" is missing or empty'});let r=e.moduleLoaders.map(a=>a.moduleName);if(!["BarcodeCapture","IdCapture"].includes(r[0]))throw new a$7({name:"MisconfigurationError",message:'Main modules must be loaded before side modules. For example "BarcodeCapture" must be loaded before "Parser".'})}async function M(e,r){let a=new Map,i=new Map;for(let o of e)i.set(o.moduleName,o.load(r));await Promise.all(i.values());for(let[o,u]of i)a.set(o,await u);return a}async function Ye(e){var i;if(p.configurePhase!=="unconfigured"&&p.configurePromise!=null)return p.configurePromise;a$1.getInstance().updateIfMissing(a$2),await O(e);let r={...D(),...e,libraryLocation:a$3(e.libraryLocation),logLevel:(i=e.logLevel)!=null?i:a$4.Level.Debug,verifyResponseHash:!0,loadProgressNotifier:b.notify.bind(b)};a.userLicenseKey=r.licenseKey,a.libraryLocation=r.libraryLocation,a$4.setLevel(r.logLevel);async function a$5(){a.configurePhase="started",b.subscribe(l);let o=a$8.checkBrowserCompatibility();if(!o.fullSupport&&!o.scannerSupport)throw new a$9(o);a$8.isSupportedIOSVersion()||a$4.log(a$4.Level.Warn,`Warning: Minimum supported iOS version is 14.6.
1
+ export{a as DataCaptureLoader}from'./chunks/chunk-5DETRQ7Y.js';export{a as WorkerMain}from'./chunks/chunk-4ZZSBGI6.js';export{a as OverrideState}from'./chunks/chunk-6W7FX6LD.js';import {a as a$3}from'./chunks/chunk-RQQK6Z5F.js';export{a as SingleImageUploader}from'./chunks/chunk-5PHKPYK6.js';export{a as SingleImageUploaderSettings}from'./chunks/chunk-7JX43F4O.js';export{c as CameraFOVSwitchControl,b as CameraSwitchControl,a as TorchSwitchControl}from'./chunks/chunk-T5EUB6UG.js';export{a as NoViewfinder}from'./chunks/chunk-4ZMCJXZS.js';export{a as convertToPublicFrameData}from'./chunks/chunk-UHFABUTI.js';export{a as ImageFrameSource}from'./chunks/chunk-Q7NDC6TJ.js';export{a as PrivateNoneLocationSelection,b as RadiusLocationSelection,c as RectangularLocationSelection}from'./chunks/chunk-ZDYFZYVT.js';export{a as RectangularViewfinder}from'./chunks/chunk-YEMIFGKZ.js';export{c as ScanditIconBuilder,b as ScanditIconForIconType,a as ScanditIconType}from'./chunks/chunk-NNPSKKZQ.js';export{b as ScanditIcon,a as ScanditIconShape}from'./chunks/chunk-AD3CNBDO.js';export{a as DataCaptureVersion}from'./chunks/chunk-RIW5A253.js';export{a as DataCaptureView}from'./chunks/chunk-GU7XEWRV.js';import {a as a$5}from'./chunks/chunk-N5YZEC56.js';export{a as AnchorPositions}from'./chunks/chunk-6MF4F3EH.js';import {a as a$2}from'./chunks/chunk-VJB527QZ.js';import {a as a$1}from'./chunks/chunk-7XQ3GHYH.js';export{a as Localization}from'./chunks/chunk-7XQ3GHYH.js';export{a as Feedback}from'./chunks/chunk-R2VJDRLZ.js';export{a as Sound}from'./chunks/chunk-GSJH2EXJ.js';export{a as Vibration}from'./chunks/chunk-JO2MKLMM.js';export{a as AimerViewfinder}from'./chunks/chunk-PWRWWFPG.js';export{a as Brush}from'./chunks/chunk-G33OCZIN.js';export{a as Camera}from'./chunks/chunk-J4YMMETW.js';export{a as CameraAccess}from'./chunks/chunk-5TKCHVG2.js';export{a as DataCaptureContext}from'./chunks/chunk-6FUMB5HV.js';import {a as a$6,c}from'./chunks/chunk-EHMSDFH7.js';import {a}from'./chunks/chunk-NMROJLGQ.js';import {b}from'./chunks/chunk-6H6FKGVE.js';export{b as loadingStatus}from'./chunks/chunk-6H6FKGVE.js';export{a as DataCaptureContextSettings}from'./chunks/chunk-7SW2PEHB.js';export{a as assert,b as assertUnreachable,c as assertUnreachableThrowException}from'./chunks/chunk-FTD535WI.js';import {a as a$9}from'./chunks/chunk-GPJEB376.js';import {a as a$4}from'./chunks/chunk-XR65N6EG.js';export{a as Logger}from'./chunks/chunk-XR65N6EG.js';import {a as a$7}from'./chunks/chunk-QCZSSQAQ.js';export{a as DataCaptureError}from'./chunks/chunk-QCZSSQAQ.js';import {a as a$8}from'./chunks/chunk-MU4VAJIM.js';export{a as BrowserHelper}from'./chunks/chunk-MU4VAJIM.js';export{a as Feature}from'./chunks/chunk-5LIWL2C4.js';export{c as CameraPosition,g as CameraSettings,e as FocusGestureStrategy,a as FrameSourceState,b as TorchState,d as VideoResolution,f as isCameraFrameSource}from'./chunks/chunk-NQC64CT7.js';export{c as RectangularViewfinderAnimation,b as RectangularViewfinderLineStyle,a as RectangularViewfinderStyle}from'./chunks/chunk-J2UL6U3I.js';export{a as LogoStyle,c as SwipeToZoom,b as TapToFocus}from'./chunks/chunk-GX4YCYCH.js';export{q as Anchor,n as Color,p as Direction,m as MarginsWithUnit,c as MeasureUnit,d as NumberWithUnit,o as Orientation,a as Point,e as PointWithUnit,b as Quadrilateral,f as Rect,g as RectWithUnit,i as Size,j as SizeWithAspect,h as SizeWithUnit,l as SizeWithUnitAndAspect,k as SizingMode}from'./chunks/chunk-LDJ53PEJ.js';export{a as ContextStatus,b as PrivateMirrorAxis}from'./chunks/chunk-WUHKODFA.js';var p=a;async function S(){var e;a.configurePhase="unconfigured",(e=p.mainDataCaptureLoader)!=null&&e.terminateDataCaptureWorker&&await p.mainDataCaptureLoader.terminateDataCaptureWorker(!0);}function l({percentage:e}){for(let r of a$5.values())r.setProgressBarPercentage(e);}function D(){var o,u;function e(P){return ["auto","off","on"].includes(P)}let r=new URLSearchParams(window.location.search),[a="auto",i="auto"]=[(o=r.get("pthreads"))==null?void 0:o.toLowerCase(),(u=r.get("simd"))==null?void 0:u.toLowerCase()];return {overrideThreadsSupport:e(a)?a:"auto",overrideSimdSupport:e(i)?i:"auto"}}async function O(e){if(a$6()&&typeof e.licenseDataPath!="string")throw new a$7({name:"MisconfigurationError",message:'"licenseDataPath" string is missing or not valid'});if(a$6()&&typeof e.licenseDataPath=="string"){let a=await c({licenseDataPath:e.licenseDataPath});if(a==null)throw new Error("Cannot retrieve license key for Electron");e.licenseKey=a.licenseKey;}if(e.licenseKey==null||e.licenseKey.trim().length<64)throw new a$7({name:"NoLicenseKeyError",message:"No license key provided"});if(typeof e.libraryLocation!="string")throw new a$7({name:"MisconfigurationError",message:'Option "libraryLocation" was not provided'});if(!Array.isArray(e.moduleLoaders)||e.moduleLoaders.length===0)throw new a$7({name:"MisconfigurationError",message:'Option "moduleLoaders" is missing or empty'});let r=e.moduleLoaders.map(a=>a.moduleName);if(!["BarcodeCapture","IdCapture"].includes(r[0]))throw new a$7({name:"MisconfigurationError",message:'Main modules must be loaded before side modules. For example "BarcodeCapture" must be loaded before "Parser".'})}async function M(e,r){let a=new Map,i=new Map;for(let o of e)i.set(o.moduleName,o.load(r));await Promise.all(i.values());for(let[o,u]of i)a.set(o,await u);return a}async function Ye(e){var i;if(p.configurePhase!=="unconfigured"&&p.configurePromise!=null)return p.configurePromise;a$1.getInstance().updateIfMissing(a$2),await O(e);let r={...D(),...e,libraryLocation:a$3(e.libraryLocation),logLevel:(i=e.logLevel)!=null?i:a$4.Level.Debug,verifyResponseHash:!0,loadProgressNotifier:b.notify.bind(b)};a.userLicenseKey=r.licenseKey,a.libraryLocation=r.libraryLocation,a$4.setLevel(r.logLevel);async function a$5(){a.configurePhase="started",b.subscribe(l);let o=a$8.checkBrowserCompatibility();if(!o.fullSupport&&!o.scannerSupport)throw new a$9(o);a$8.isSupportedIOSVersion()||a$4.log(a$4.Level.Warn,`Warning: Minimum supported iOS version is 14.6.
2
2
  Please check the minimum system requirements here:
3
3
  https://docs.scandit.com/system-requirements#web-sdk`),a.dataCaptureLoaders=await M(r.moduleLoaders,r),a.mainDataCaptureLoader=[...a.dataCaptureLoaders.entries()][0][1],a.configurePhase="done",b.unsubscribe(l);}return a.configurePromise=a$5().catch(o=>{throw S(),b.unsubscribe(l),o}),a.configurePromise}function Ze(e){a.mainDataCaptureLoader=e;}
4
4
  export{Ye as configure,S as resetConfigure,Ze as setMainDataCaptureLoader};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { bo as AspectRatio, bq as CameraAccess, bm as CameraPosition, bn as CameraResolutionConstraint, bp as DeviceCamera } from '../Camera-DsOMNsZu.js';
2
+ export { bo as AspectRatio, bq as CameraAccess, bm as CameraPosition, bn as CameraResolutionConstraint, bp as DeviceCamera } from '../Camera-Ds4oKYkb.js';
3
3
  import './Serializable.js';
4
4
  import './FrameReaders/WatermarkStack.js';
5
5
  import '../tsHelper.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { by as CameraManager, bw as CameraManagerEvent, bx as CameraManagerEventParameters, bs as CameraResolutionConstraint, bt as ExtendedMediaTrackCapabilities, bu as ExtendedMediaTrackConstraintSet, bk as FrameCapture, bv as GUI, br as MeteringMode } from '../Camera-DsOMNsZu.js';
2
+ export { by as CameraManager, bw as CameraManagerEvent, bx as CameraManagerEventParameters, bs as CameraResolutionConstraint, bt as ExtendedMediaTrackCapabilities, bu as ExtendedMediaTrackConstraintSet, bk as FrameCapture, bv as GUI, br as MeteringMode } from '../Camera-Ds4oKYkb.js';
3
3
  import './Serializable.js';
4
4
  import './FrameReaders/WatermarkStack.js';
5
5
  import '../tsHelper.js';
@@ -1 +1 @@
1
- export{d as CameraManager,c as CameraManagerEvent,b as CameraResolutionConstraint,a as MeteringMode}from'../chunks/chunk-KRWPFM7Z.js';
1
+ export{d as CameraManager,c as CameraManagerEvent,b as CameraResolutionConstraint,a as MeteringMode}from'../chunks/chunk-BN7NK5YK.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  import { PrivateCanvasDrawer } from './CanvasDrawer.js';
3
- import { S as PerformanceMetrics } from '../Camera-DsOMNsZu.js';
3
+ import { S as PerformanceMetrics } from '../Camera-Ds4oKYkb.js';
4
4
  import '../ScanditIcon.js';
5
5
  import './CavansDrawerAbstract.js';
6
6
  import './DrawCommandBuffer.js';
@@ -2,7 +2,7 @@
2
2
  import { ModuleLicenseTextProvider } from './ModuleLicenseTextProvider.js';
3
3
  import { Logger } from '../logger.js';
4
4
  import { PartialSDKGlobals } from '../sdk.js';
5
- import '../Camera-DsOMNsZu.js';
5
+ import '../Camera-Ds4oKYkb.js';
6
6
  import './Serializable.js';
7
7
  import './FrameReaders/WatermarkStack.js';
8
8
  import '../tsHelper.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { B as DataCaptureContext, N as FrameData } from '../Camera-DsOMNsZu.js';
2
+ import { B as DataCaptureContext, N as FrameData } from '../Camera-Ds4oKYkb.js';
3
3
  import './Serializable.js';
4
4
  import './FrameReaders/WatermarkStack.js';
5
5
  import '../tsHelper.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { bi as ColorType, bl as FrameReader } from '../../Camera-DsOMNsZu.js';
2
+ export { bi as ColorType, bl as FrameReader } from '../../Camera-Ds4oKYkb.js';
3
3
  import '../Serializable.js';
4
4
  import './WatermarkStack.js';
5
5
  import '../../tsHelper.js';
@@ -1 +1 @@
1
- export{a as ColorType,b as FrameReader}from'../../chunks/chunk-ULRY4SXF.js';
1
+ export{a as ColorType,b as FrameReader}from'../../chunks/chunk-3GBK675W.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { bh as FrameReaderAbstract, bj as PoolCapacityOptions } from '../../Camera-DsOMNsZu.js';
2
+ export { bh as FrameReaderAbstract, bj as PoolCapacityOptions } from '../../Camera-Ds4oKYkb.js';
3
3
  import './WatermarkStack.js';
4
4
  import '../../tsHelper.js';
5
5
  import '../Serializable.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { bh as FrameReaderAbstract, bi as ColorType, bj as PoolCapacityOptions, bk as FrameCapture } from '../../Camera-DsOMNsZu.js';
2
+ import { bh as FrameReaderAbstract, bi as ColorType, bj as PoolCapacityOptions, bk as FrameCapture } from '../../Camera-Ds4oKYkb.js';
3
3
  import { WatermarkStack } from './WatermarkStack.js';
4
4
  import { Optional } from '../../tsHelper.js';
5
5
  import '../Serializable.js';
@@ -1 +1 @@
1
- export{a as GrayScaleFrameReader}from'../../chunks/chunk-7B2VPGLP.js';
1
+ export{a as GrayScaleFrameReader}from'../../chunks/chunk-VLBC3MNR.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { bl as FrameReader, bh as FrameReaderAbstract, bi as FrameReaderType } from '../../Camera-DsOMNsZu.js';
2
+ export { bl as FrameReader, bh as FrameReaderAbstract, bi as FrameReaderType } from '../../Camera-Ds4oKYkb.js';
3
3
  export { GrayScaleFrameReader } from './GrayScaleFrameReader.js';
4
4
  import '../Serializable.js';
5
5
  import './WatermarkStack.js';
@@ -1 +1 @@
1
- export{a as GrayScaleFrameReader}from'../../chunks/chunk-7B2VPGLP.js';export{b as FrameReader,a as FrameReaderType}from'../../chunks/chunk-ULRY4SXF.js';
1
+ export{a as GrayScaleFrameReader}from'../../chunks/chunk-VLBC3MNR.js';export{b as FrameReader,a as FrameReaderType}from'../../chunks/chunk-3GBK675W.js';
@@ -4,7 +4,7 @@ import { ConfigureOptions } from '../index.js';
4
4
  import { Logger } from '../logger.js';
5
5
  import { OverrideState } from '../worker/OverrideState.js';
6
6
  import '../worker/WorkerMain.js';
7
- import '../Camera-DsOMNsZu.js';
7
+ import '../Camera-Ds4oKYkb.js';
8
8
  import './Serializable.js';
9
9
  import './FrameReaders/WatermarkStack.js';
10
10
  import '../tsHelper.js';
@@ -1 +1 @@
1
- export{a as ButtonState,c as CameraSwitchControlWidget,d as PrivateCameraFOVSwitchControlWidget,b as PrivateTorchControlWidget}from'../chunks/chunk-4YVKSEZS.js';
1
+ export{a as ButtonState,c as CameraSwitchControlWidget,d as PrivateCameraFOVSwitchControlWidget,b as PrivateTorchControlWidget}from'../chunks/chunk-O7A2DQPJ.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { M as DataCaptureView, a as FrameSource, B as DataCaptureContext } from '../Camera-DsOMNsZu.js';
2
+ import { M as DataCaptureView, a as FrameSource, B as DataCaptureContext } from '../Camera-Ds4oKYkb.js';
3
3
  import { TorchSwitchControl, CameraSwitchControl, CameraFOVSwitchControl, Control } from '../ViewControls.js';
4
4
  import './Serializable.js';
5
5
  import './FrameReaders/WatermarkStack.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { M as DataCaptureView } from '../Camera-DsOMNsZu.js';
2
+ import { M as DataCaptureView } from '../Camera-Ds4oKYkb.js';
3
3
  import './Serializable.js';
4
4
  import './FrameReaders/WatermarkStack.js';
5
5
  import '../tsHelper.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  import { ScanditHTMLElement } from '../../utils/ScanditHTMLElement.js';
3
- import { Y as GenericHint } from '../../../Camera-DsOMNsZu.js';
3
+ import { X as GenericHint } from '../../../Camera-Ds4oKYkb.js';
4
4
  import '../../Serializable.js';
5
5
  import '../../FrameReaders/WatermarkStack.js';
6
6
  import '../../../tsHelper.js';
@@ -1,7 +1,7 @@
1
1
  /// <reference types="emscripten" />
2
2
  import { ScanditHTMLElement } from '../../utils/ScanditHTMLElement.js';
3
3
  import { Rect } from '../../../Common.js';
4
- import { X as DataCaptureCallbackMessage } from '../../../Camera-DsOMNsZu.js';
4
+ import { Y as DataCaptureCallbackMessage } from '../../../Camera-Ds4oKYkb.js';
5
5
  import '../../../ScanditIcon.js';
6
6
  import '../../Serializable.js';
7
7
  import '../../FrameReaders/WatermarkStack.js';
package/build/js/sdk.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { D as DataCaptureLoader } from './Camera-DsOMNsZu.js';
2
+ import { D as DataCaptureLoader } from './Camera-Ds4oKYkb.js';
3
3
  import { LoadingStatus } from './LoadingStatus.js';
4
4
  import './ScanditIcon.js';
5
5
  import './private/Serializable.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { U as DataCaptureEngine, W as Module, Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, $ as ModuleHandler, X as DataCaptureCallbackMessage, a0 as DataCaptureActionMessageKey, a1 as EngineWorkerResponse } from '../Camera-DsOMNsZu.js';
2
+ import { U as DataCaptureEngine, W as Module, Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, $ as ModuleHandler, Y as DataCaptureCallbackMessage, a0 as DataCaptureActionMessageKey, a1 as EngineWorkerResponse } from '../Camera-Ds4oKYkb.js';
3
3
  import '../private/Serializable.js';
4
4
  import '../private/FrameReaders/WatermarkStack.js';
5
5
  import '../tsHelper.js';
@@ -1 +1 @@
1
- export{a as WorkerMain}from'../chunks/chunk-FHGLVS66.js';
1
+ export{a as WorkerMain}from'../chunks/chunk-4ZZSBGI6.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { U as DataCaptureEngine, W as Module } from '../Camera-DsOMNsZu.js';
2
+ import { U as DataCaptureEngine, W as Module } from '../Camera-Ds4oKYkb.js';
3
3
  import { WorkerMain } from './WorkerMain.js';
4
4
  import '../private/Serializable.js';
5
5
  import '../private/FrameReaders/WatermarkStack.js';
@@ -1 +1 @@
1
- export{b as InlineWorker,a as workerInstance}from'../chunks/chunk-BOCQXSFU.js';
1
+ export{b as InlineWorker,a as workerInstance}from'../chunks/chunk-NVEOQW6Q.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- export { bb as CreateContextParameters, U as DataCaptureEngine, ba as LoadLibraryParameters, be as ProcessFrameParameters, bf as ReportCameraPropertiesParameters, bd as SetFrameSourceParameters, bc as UpdateContextParameters, bg as WorkerFunctions } from '../Camera-DsOMNsZu.js';
2
+ export { bb as CreateContextParameters, U as DataCaptureEngine, ba as LoadLibraryParameters, be as ProcessFrameParameters, bf as ReportCameraPropertiesParameters, bd as SetFrameSourceParameters, bc as UpdateContextParameters, bg as WorkerFunctions } from '../Camera-Ds4oKYkb.js';
3
3
  import './OverrideState.js';
4
4
  import '../LoadingStatus.js';
5
5
  import '../Common.js';
@@ -1 +1 @@
1
- export{a as DataCaptureEngine}from'../chunks/chunk-U2GDN6EV.js';
1
+ export{a as DataCaptureEngine}from'../chunks/chunk-RNFMG4PS.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  import './OverrideState.js';
3
- export { D as DataCaptureLoader, R as DataCaptureLoaderOptions } from '../Camera-DsOMNsZu.js';
3
+ export { D as DataCaptureLoader, R as DataCaptureLoaderOptions } from '../Camera-Ds4oKYkb.js';
4
4
  import '../logger.js';
5
5
  import '../ScanditIcon.js';
6
6
  import '../LoadingStatus.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  import '../Common.js';
3
- export { Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, aS as CaptureModeDeserializerInstance, a9 as CreateContextDataCaptureAction, a0 as DataCaptureActionMessageKey, X as DataCaptureCallbackMessage, aq as DataCaptureCallbackMessageKeys, aK as DataCaptureContext, aR as DataCaptureContextDeserializer, aQ as DataCaptureContextDeserializerResult, aL as DataCaptureImageBufferFrameSource, aO as DataCaptureView, aI as DataCaptureWorker, ad as DeleteFrameDataDataCaptureAction, ax as DidTapTrackedBarcode, ah as DisposeDataCaptureAction, aJ as EmscriptenClassHandle, a1 as EngineWorkerResponse, al as ExtractCentaurusLicenseDataCaptureAction, a2 as ExtractCentaurusLicenseResponse, ai as FlushAnalyticsDataCaptureAction, Y as GenericHint, aM as GestureListener, aN as GestureRecognizer, ap as GetOpenSourceSoftwareLicenseInfoAction, a6 as GetOpenSourceSoftwareLicenseInfoResponse, a5 as GetViewfinderInfo, ao as GetViewfinderInfoAction, b4 as GuidanceHint, b2 as GuidanceHintAnchor, b3 as GuidanceHintStyle, aE as HideGuidanceMessage, av as HideHintWorkerMessage, aC as HideToastMessage, b0 as HintAnchor, a_ as HintCornerStyle, aW as HintFont, aZ as HintHeight, a$ as HintIcon, b8 as HintPresenterV2, an as HintPresenterV2updateAction, b1 as HintStyle, aX as HintTextAlignment, aY as HintWidth, af as IsFeatureSupportedAction, au as IsFeatureSupportedMessage, a4 as IsFeatureSupportedResponse, aP as JSONParseable, b7 as LicensedFeature, a8 as LoadLibraryDataCaptureAction, W as Module, $ as ModuleHandler, aT as ModuleMirrorAxis, az as OnFrameProcessingFinishedMessage, ay as OnFrameProcessingStartedMessage, aA as OnFrameSkippedMessage, am as OnTapAction, aH as PayloadForCommand, S as PerformanceMetrics, aw as PerformanceMetricsReportMessage, b9 as PlatformHintPresenter, ab as ProcessFrameDataCaptureAction, aj as ReportCameraPropertiesDataCaptureAction, ac as RequestFrameDataDataCaptureAction, a3 as RequestFrameDataResponse, aa as SetFrameSourceDataCaptureAction, ak as SetLogLevelDataCaptureAction, aD as ShowGuidanceMessage, as as ShowHintWorkerMessage, aB as ShowToastMessage, aF as StartUpdateTimerMessage, aG as StopUpdateTimerMessage, ar as SuccessFeedbackWorkerMessage, b6 as ToastHint, b5 as ToastHintStyle, ag as UpdateContextDataCaptureAction, at as UpdateHintWorkerMessage, aU as Vector, ae as VisibilityChangeAction, aV as WasmFrameData, a7 as WorkerResponse } from '../Camera-DsOMNsZu.js';
3
+ export { Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, aS as CaptureModeDeserializerInstance, a9 as CreateContextDataCaptureAction, a0 as DataCaptureActionMessageKey, Y as DataCaptureCallbackMessage, aq as DataCaptureCallbackMessageKeys, aK as DataCaptureContext, aR as DataCaptureContextDeserializer, aQ as DataCaptureContextDeserializerResult, aL as DataCaptureImageBufferFrameSource, aO as DataCaptureView, aI as DataCaptureWorker, ad as DeleteFrameDataDataCaptureAction, ax as DidTapTrackedBarcode, ah as DisposeDataCaptureAction, aJ as EmscriptenClassHandle, a1 as EngineWorkerResponse, al as ExtractCentaurusLicenseDataCaptureAction, a2 as ExtractCentaurusLicenseResponse, ai as FlushAnalyticsDataCaptureAction, X as GenericHint, aM as GestureListener, aN as GestureRecognizer, ap as GetOpenSourceSoftwareLicenseInfoAction, a6 as GetOpenSourceSoftwareLicenseInfoResponse, a5 as GetViewfinderInfo, ao as GetViewfinderInfoAction, b4 as GuidanceHint, b2 as GuidanceHintAnchor, b3 as GuidanceHintStyle, aE as HideGuidanceMessage, av as HideHintWorkerMessage, aC as HideToastMessage, b0 as HintAnchor, a_ as HintCornerStyle, aW as HintFont, aZ as HintHeight, a$ as HintIcon, b8 as HintPresenterV2, an as HintPresenterV2updateAction, b1 as HintStyle, aX as HintTextAlignment, aY as HintWidth, af as IsFeatureSupportedAction, au as IsFeatureSupportedMessage, a4 as IsFeatureSupportedResponse, aP as JSONParseable, b7 as LicensedFeature, a8 as LoadLibraryDataCaptureAction, W as Module, $ as ModuleHandler, aT as ModuleMirrorAxis, az as OnFrameProcessingFinishedMessage, ay as OnFrameProcessingStartedMessage, aA as OnFrameSkippedMessage, am as OnTapAction, aH as PayloadForCommand, S as PerformanceMetrics, aw as PerformanceMetricsReportMessage, b9 as PlatformHintPresenter, ab as ProcessFrameDataCaptureAction, aj as ReportCameraPropertiesDataCaptureAction, ac as RequestFrameDataDataCaptureAction, a3 as RequestFrameDataResponse, aa as SetFrameSourceDataCaptureAction, ak as SetLogLevelDataCaptureAction, aD as ShowGuidanceMessage, as as ShowHintWorkerMessage, aB as ShowToastMessage, aF as StartUpdateTimerMessage, aG as StopUpdateTimerMessage, ar as SuccessFeedbackWorkerMessage, b6 as ToastHint, b5 as ToastHintStyle, ag as UpdateContextDataCaptureAction, at as UpdateHintWorkerMessage, aU as Vector, ae as VisibilityChangeAction, aV as WasmFrameData, a7 as WorkerResponse } from '../Camera-Ds4oKYkb.js';
4
4
  import '../LoadingStatus.js';
5
5
  import '../logger.js';
6
6
  import '../private/Serializable.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  export { WorkerMain } from './WorkerMain.js';
3
- export { Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, aS as CaptureModeDeserializerInstance, a9 as CreateContextDataCaptureAction, bb as CreateContextParameters, a0 as DataCaptureActionMessageKey, X as DataCaptureCallbackMessage, aq as DataCaptureCallbackMessageKeys, aK as DataCaptureContext, aR as DataCaptureContextDeserializer, aQ as DataCaptureContextDeserializerResult, U as DataCaptureEngine, aL as DataCaptureImageBufferFrameSource, D as DataCaptureLoader, R as DataCaptureLoaderOptions, aO as DataCaptureView, aI as DataCaptureWorker, ad as DeleteFrameDataDataCaptureAction, ax as DidTapTrackedBarcode, ah as DisposeDataCaptureAction, aJ as EmscriptenClassHandle, a1 as EngineWorkerResponse, al as ExtractCentaurusLicenseDataCaptureAction, a2 as ExtractCentaurusLicenseResponse, ai as FlushAnalyticsDataCaptureAction, Y as GenericHint, aM as GestureListener, aN as GestureRecognizer, ap as GetOpenSourceSoftwareLicenseInfoAction, a6 as GetOpenSourceSoftwareLicenseInfoResponse, a5 as GetViewfinderInfo, ao as GetViewfinderInfoAction, b4 as GuidanceHint, b2 as GuidanceHintAnchor, b3 as GuidanceHintStyle, aE as HideGuidanceMessage, av as HideHintWorkerMessage, aC as HideToastMessage, b0 as HintAnchor, a_ as HintCornerStyle, aW as HintFont, aZ as HintHeight, a$ as HintIcon, b8 as HintPresenterV2, an as HintPresenterV2updateAction, b1 as HintStyle, aX as HintTextAlignment, aY as HintWidth, af as IsFeatureSupportedAction, au as IsFeatureSupportedMessage, a4 as IsFeatureSupportedResponse, aP as JSONParseable, b7 as LicensedFeature, a8 as LoadLibraryDataCaptureAction, ba as LoadLibraryParameters, W as Module, $ as ModuleHandler, aT as ModuleMirrorAxis, az as OnFrameProcessingFinishedMessage, ay as OnFrameProcessingStartedMessage, aA as OnFrameSkippedMessage, am as OnTapAction, aH as PayloadForCommand, S as PerformanceMetrics, aw as PerformanceMetricsReportMessage, b9 as PlatformHintPresenter, ab as ProcessFrameDataCaptureAction, be as ProcessFrameParameters, aj as ReportCameraPropertiesDataCaptureAction, bf as ReportCameraPropertiesParameters, ac as RequestFrameDataDataCaptureAction, a3 as RequestFrameDataResponse, aa as SetFrameSourceDataCaptureAction, bd as SetFrameSourceParameters, ak as SetLogLevelDataCaptureAction, aD as ShowGuidanceMessage, as as ShowHintWorkerMessage, aB as ShowToastMessage, aF as StartUpdateTimerMessage, aG as StopUpdateTimerMessage, ar as SuccessFeedbackWorkerMessage, b6 as ToastHint, b5 as ToastHintStyle, ag as UpdateContextDataCaptureAction, bc as UpdateContextParameters, at as UpdateHintWorkerMessage, aU as Vector, ae as VisibilityChangeAction, aV as WasmFrameData, bg as WorkerFunctions, a7 as WorkerResponse } from '../Camera-DsOMNsZu.js';
3
+ export { Z as AnyDataCaptureActionMessage, _ as AugmentedWorker, aS as CaptureModeDeserializerInstance, a9 as CreateContextDataCaptureAction, bb as CreateContextParameters, a0 as DataCaptureActionMessageKey, Y as DataCaptureCallbackMessage, aq as DataCaptureCallbackMessageKeys, aK as DataCaptureContext, aR as DataCaptureContextDeserializer, aQ as DataCaptureContextDeserializerResult, U as DataCaptureEngine, aL as DataCaptureImageBufferFrameSource, D as DataCaptureLoader, R as DataCaptureLoaderOptions, aO as DataCaptureView, aI as DataCaptureWorker, ad as DeleteFrameDataDataCaptureAction, ax as DidTapTrackedBarcode, ah as DisposeDataCaptureAction, aJ as EmscriptenClassHandle, a1 as EngineWorkerResponse, al as ExtractCentaurusLicenseDataCaptureAction, a2 as ExtractCentaurusLicenseResponse, ai as FlushAnalyticsDataCaptureAction, X as GenericHint, aM as GestureListener, aN as GestureRecognizer, ap as GetOpenSourceSoftwareLicenseInfoAction, a6 as GetOpenSourceSoftwareLicenseInfoResponse, a5 as GetViewfinderInfo, ao as GetViewfinderInfoAction, b4 as GuidanceHint, b2 as GuidanceHintAnchor, b3 as GuidanceHintStyle, aE as HideGuidanceMessage, av as HideHintWorkerMessage, aC as HideToastMessage, b0 as HintAnchor, a_ as HintCornerStyle, aW as HintFont, aZ as HintHeight, a$ as HintIcon, b8 as HintPresenterV2, an as HintPresenterV2updateAction, b1 as HintStyle, aX as HintTextAlignment, aY as HintWidth, af as IsFeatureSupportedAction, au as IsFeatureSupportedMessage, a4 as IsFeatureSupportedResponse, aP as JSONParseable, b7 as LicensedFeature, a8 as LoadLibraryDataCaptureAction, ba as LoadLibraryParameters, W as Module, $ as ModuleHandler, aT as ModuleMirrorAxis, az as OnFrameProcessingFinishedMessage, ay as OnFrameProcessingStartedMessage, aA as OnFrameSkippedMessage, am as OnTapAction, aH as PayloadForCommand, S as PerformanceMetrics, aw as PerformanceMetricsReportMessage, b9 as PlatformHintPresenter, ab as ProcessFrameDataCaptureAction, be as ProcessFrameParameters, aj as ReportCameraPropertiesDataCaptureAction, bf as ReportCameraPropertiesParameters, ac as RequestFrameDataDataCaptureAction, a3 as RequestFrameDataResponse, aa as SetFrameSourceDataCaptureAction, bd as SetFrameSourceParameters, ak as SetLogLevelDataCaptureAction, aD as ShowGuidanceMessage, as as ShowHintWorkerMessage, aB as ShowToastMessage, aF as StartUpdateTimerMessage, aG as StopUpdateTimerMessage, ar as SuccessFeedbackWorkerMessage, b6 as ToastHint, b5 as ToastHintStyle, ag as UpdateContextDataCaptureAction, bc as UpdateContextParameters, at as UpdateHintWorkerMessage, aU as Vector, ae as VisibilityChangeAction, aV as WasmFrameData, bg as WorkerFunctions, a7 as WorkerResponse } from '../Camera-Ds4oKYkb.js';
4
4
  import '../private/Serializable.js';
5
5
  import '../private/FrameReaders/WatermarkStack.js';
6
6
  import '../tsHelper.js';
@@ -1 +1 @@
1
- export{a as DataCaptureLoader}from'../chunks/chunk-5DETRQ7Y.js';export{a as WorkerMain}from'../chunks/chunk-FHGLVS66.js';export{a as DataCaptureEngine}from'../chunks/chunk-U2GDN6EV.js';export{h as GuidanceHintAnchor,i as GuidanceHintStyle,g as HintAnchor,e as HintCornerStyle,a as HintFont,d as HintHeight,f as HintIcon,b as HintTextAlignment,c as HintWidth,k as LicensedFeature,j as ToastHintStyle}from'../chunks/chunk-HC2AMLBI.js';
1
+ export{a as DataCaptureLoader}from'../chunks/chunk-5DETRQ7Y.js';export{a as WorkerMain}from'../chunks/chunk-4ZZSBGI6.js';export{a as DataCaptureEngine}from'../chunks/chunk-RNFMG4PS.js';export{h as GuidanceHintAnchor,i as GuidanceHintStyle,g as HintAnchor,e as HintCornerStyle,a as HintFont,d as HintHeight,f as HintIcon,b as HintTextAlignment,c as HintWidth,k as LicensedFeature,j as ToastHintStyle}from'../chunks/chunk-HC2AMLBI.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scandit/web-datacapture-core",
3
- "version": "7.1.0",
3
+ "version": "7.1.2",
4
4
  "description": "Scandit Data Capture SDK for the Web",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "sideEffects": false,
@@ -1 +0,0 @@
1
- var e;(o=>{function i(){let r="7.1.0";return r}o.sdkVersion=i;})(e||(e={}));export{e as a};
@@ -1 +0,0 @@
1
- import {a}from'./chunk-FHGLVS66.js';var t=new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function l(e){}export{t as a,l as b};