{"version":3,"file":"web-Iq1Raiar.cjs","names":["WebPlugin","ImpactStyle","NotificationType"],"sources":["../../node_modules/@capacitor/haptics/dist/esm/web.js"],"sourcesContent":["import { WebPlugin } from '@capacitor/core';\nimport { ImpactStyle, NotificationType } from './definitions';\nexport class HapticsWeb extends WebPlugin {\n    constructor() {\n        super(...arguments);\n        this.selectionStarted = false;\n    }\n    async impact(options) {\n        const pattern = this.patternForImpact(options === null || options === void 0 ? void 0 : options.style);\n        this.vibrateWithPattern(pattern);\n    }\n    async notification(options) {\n        const pattern = this.patternForNotification(options === null || options === void 0 ? void 0 : options.type);\n        this.vibrateWithPattern(pattern);\n    }\n    async vibrate(options) {\n        const duration = (options === null || options === void 0 ? void 0 : options.duration) || 300;\n        this.vibrateWithPattern([duration]);\n    }\n    async selectionStart() {\n        this.selectionStarted = true;\n    }\n    async selectionChanged() {\n        if (this.selectionStarted) {\n            this.vibrateWithPattern([70]);\n        }\n    }\n    async selectionEnd() {\n        this.selectionStarted = false;\n    }\n    patternForImpact(style = ImpactStyle.Heavy) {\n        if (style === ImpactStyle.Medium) {\n            return [43];\n        }\n        else if (style === ImpactStyle.Light) {\n            return [20];\n        }\n        return [61];\n    }\n    patternForNotification(type = NotificationType.Success) {\n        if (type === NotificationType.Warning) {\n            return [30, 40, 30, 50, 60];\n        }\n        else if (type === NotificationType.Error) {\n            return [27, 45, 50];\n        }\n        return [35, 65, 21];\n    }\n    vibrateWithPattern(pattern) {\n        if (navigator.vibrate) {\n            navigator.vibrate(pattern);\n        }\n        else {\n            throw this.unavailable('Browser does not support the vibrate API');\n        }\n    }\n}\n//# sourceMappingURL=web.js.map"],"x_google_ignoreList":[0],"mappings":"2EAEA,IAAa,EAAb,cAAgCA,EAAAA,CAAU,CACtC,aAAc,CACV,MAAM,GAAG,UAAU,CACnB,KAAK,iBAAmB,GAE5B,MAAM,OAAO,EAAS,CAClB,IAAM,EAAU,KAAK,iBAAiB,GAA0D,MAAM,CACtG,KAAK,mBAAmB,EAAQ,CAEpC,MAAM,aAAa,EAAS,CACxB,IAAM,EAAU,KAAK,uBAAuB,GAA0D,KAAK,CAC3G,KAAK,mBAAmB,EAAQ,CAEpC,MAAM,QAAQ,EAAS,CACnB,IAAM,EAAY,GAA0D,UAAa,IACzF,KAAK,mBAAmB,CAAC,EAAS,CAAC,CAEvC,MAAM,gBAAiB,CACnB,KAAK,iBAAmB,GAE5B,MAAM,kBAAmB,CACjB,KAAK,kBACL,KAAK,mBAAmB,CAAC,GAAG,CAAC,CAGrC,MAAM,cAAe,CACjB,KAAK,iBAAmB,GAE5B,iBAAiB,EAAQC,EAAAA,EAAY,MAAO,CAOxC,OANI,IAAUA,EAAAA,EAAY,OACf,CAAC,GAAG,CAEN,IAAUA,EAAAA,EAAY,MACpB,CAAC,GAAG,CAER,CAAC,GAAG,CAEf,uBAAuB,EAAOC,EAAAA,EAAiB,QAAS,CAOpD,OANI,IAASA,EAAAA,EAAiB,QACnB,CAAC,GAAI,GAAI,GAAI,GAAI,GAAG,CAEtB,IAASA,EAAAA,EAAiB,MACxB,CAAC,GAAI,GAAI,GAAG,CAEhB,CAAC,GAAI,GAAI,GAAG,CAEvB,mBAAmB,EAAS,CACxB,GAAI,UAAU,QACV,UAAU,QAAQ,EAAQ,MAG1B,MAAM,KAAK,YAAY,2CAA2C"}