@scandit/web-datacapture-barcode
Version:
Scandit Data Capture SDK for the Web
1 lines • 1.68 kB
JavaScript
import {a}from'./chunk-HDODW33D.js';import {a as a$1}from'./chunk-LLMMR2TB.js';import {RadiusLocationSelection,NumberWithUnit}from'@scandit/web-datacapture-core';var p=class{constructor(){this.codeDuplicateFilter=a.SparkScanSettings.codeDuplicateFilter;this.enabledCompositeTypes=[];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(e=>{var t;return (t=this.symbologies[e])==null?void 0:t.isEnabled})}get compositeTypeDescriptions(){return a$1.CompositeTypeDescriptions.reduce((o,e)=>(o[e.types[0]]=e,o),{})}settingsForSymbology(o){if(!this.symbologies[o]){let e=a$1.SymbologySettings[o];e._symbology=o,this.symbologies[o]=e;}return this.symbologies[o]}setProperty(o,e){this.properties[o]=e;}getProperty(o){return this.properties[o]}enableSymbologies(o){for(let e of o)this.enableSymbology(e,true);}enableSymbology(o,e){this.settingsForSymbology(o).isEnabled=e;}enableSymbologiesForCompositeTypes(o){for(let e of o)this.enableSymbologies(this.compositeTypeDescriptions[e].symbologies);}toJSONObject(){var t;let o={},e=Object.keys(this.symbologies);return {codeDuplicateFilter:this.codeDuplicateFilter,enabledCompositeTypes:[...this.enabledCompositeTypes],locationSelection:this.locationSelection.toJSONObject(),properties:{...this.properties},symbologies:e.reduce((n,r)=>{var c;let l=(c=this.symbologies[r])==null?void 0:c.toJSONObject();return l&&(n[r]=l),n},o),scanIntention:(t=this.scanIntention)!=null?t:null}}};export{p as a};