UNPKG

@scandit/web-datacapture-barcode

Version:

Scandit Data Capture SDK for the Web

1 lines 1.36 kB
import {a}from'./chunk-HDODW33D.js';import {a as a$1}from'./chunk-LLMMR2TB.js';import {RadiusLocationSelection,NumberWithUnit}from'@scandit/web-datacapture-core';var c=class{constructor(){this.codeDuplicateFilter=a.SparkScanSettings.codeDuplicateFilter;this.scanIntention="manual";this.locationSelection=new RadiusLocationSelection(new NumberWithUnit(a.SparkScanSettings.locationSelection.radius,a.SparkScanSettings.locationSelection.unit));this.properties={};this.symbologies={};}get enabledSymbologies(){return Object.keys(this.symbologies).filter(t=>{var e;return (e=this.symbologies[t])==null?void 0:e.isEnabled})}settingsForSymbology(o){if(!this.symbologies[o]){let t=a$1.SymbologySettings[o];t._symbology=o,this.symbologies[o]=t;}return this.symbologies[o]}setProperty(o,t){this.properties[o]=t;}getProperty(o){return this.properties[o]}enableSymbologies(o){for(let t of o)this.enableSymbology(t,true);}enableSymbology(o,t){this.settingsForSymbology(o).isEnabled=t;}toJSONObject(){var e;let o={},t=Object.keys(this.symbologies);return {codeDuplicateFilter:this.codeDuplicateFilter,locationSelection:this.locationSelection.toJSONObject(),properties:{...this.properties},symbologies:t.reduce((n,s)=>{var r;let l=(r=this.symbologies[s])==null?void 0:r.toJSONObject();return l&&(n[s]=l),n},o),scanIntention:(e=this.scanIntention)!=null?e:null}}};export{c as a};