UNPKG

seeso_test

Version:

Eye traking module for browser and node.js

2 lines 460 kB
/*! For license information please see seeso.min.js.LICENSE.txt */ !function(e,n){if("object"==typeof exports&&"object"==typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t=n();for(var r in t)("object"==typeof exports?exports:e)[r]=t[r]}}(self,(()=>(()=>{var __webpack_modules__={"./lib/polyfil/ImageCapture-polyfil.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n/* eslint-disable */\n/**\n * MediaStream ImageCapture polyfill\n *\n * @license\n * Copyright 2018 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nvar CustomImageCapture = /*#__PURE__*/function () {\n /**\n * TODO https://www.w3.org/TR/image-capture/#constructors\n *\n * @param {MediaStreamTrack} videoStreamTrack - A MediaStreamTrack of the 'video' kind\n */\n function CustomImageCapture(videoStreamTrack) {\n var _this = this;\n _classCallCheck(this, CustomImageCapture);\n if (videoStreamTrack.kind !== 'video') throw new DOMException('NotSupportedError');\n this._videoStreamTrack = videoStreamTrack;\n if (!('readyState' in this._videoStreamTrack)) {\n // Polyfill for Firefox\n this._videoStreamTrack.readyState = 'live';\n }\n\n // MediaStream constructor not available until Chrome 55 - https://www.chromestatus.com/feature/5912172546752512\n this._previewStream = new MediaStream([videoStreamTrack]);\n this.videoElement = document.createElement('video');\n this.videoElementPlaying = new Promise(function (resolve) {\n _this.videoElement.addEventListener('playing', resolve);\n });\n if (HTMLMediaElement) {\n this.videoElement.srcObject = this._previewStream; // Safari 11 doesn't allow use of createObjectURL for MediaStream\n } else {\n this.videoElement.src = URL.createObjectURL(this._previewStream);\n }\n this.videoElement.muted = true;\n this.videoElement.setAttribute('playsinline', ''); // Required by Safari on iOS 11. See https://webkit.org/blog/6784\n this.videoElement.play();\n this.canvasElement = document.createElement('canvas');\n // TODO Firefox has https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas\n this.canvas2dContext = this.canvasElement.getContext('2d');\n }\n\n /**\n * https://w3c.github.io/mediacapture-image/index.html#dom-imagecapture-videostreamtrack\n * @return {MediaStreamTrack} The MediaStreamTrack passed into the constructor\n */\n _createClass(CustomImageCapture, [{\n key: \"videoStreamTrack\",\n get: function get() {\n return this._videoStreamTrack;\n }\n\n /**\n * Implements https://www.w3.org/TR/image-capture/#dom-imagecapture-getphotocapabilities\n * @return {Promise<PhotoCapabilities>} Fulfilled promise with\n * [PhotoCapabilities](https://www.w3.org/TR/image-capture/#idl-def-photocapabilities)\n * object on success, rejected promise on failure\n */\n }, {\n key: \"getPhotoCapabilities\",\n value: function getPhotoCapabilities() {\n return new Promise(function executorGPC(resolve, reject) {\n // TODO see https://github.com/w3c/mediacapture-image/issues/97\n var MediaSettingsRange = {\n current: 0,\n min: 0,\n max: 0\n };\n resolve({\n exposureCompensation: MediaSettingsRange,\n exposureMode: 'none',\n fillLightMode: 'none',\n focusMode: 'none',\n imageHeight: MediaSettingsRange,\n imageWidth: MediaSettingsRange,\n iso: MediaSettingsRange,\n redEyeReduction: false,\n whiteBalanceMode: 'none',\n zoom: MediaSettingsRange\n });\n reject(new DOMException('OperationError'));\n });\n }\n\n /**\n * Implements https://www.w3.org/TR/image-capture/#dom-imagecapture-setoptions\n * @param {Object} photoSettings - Photo settings dictionary, https://www.w3.org/TR/image-capture/#idl-def-photosettings\n * @return {Promise<void>} Fulfilled promise on success, rejected promise on failure\n */\n }, {\n key: \"setOptions\",\n value: function setOptions() {\n var photoSettings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return new Promise(function executorSO(resolve, reject) {\n // TODO\n });\n }\n\n /**\n * TODO\n * Implements https://www.w3.org/TR/image-capture/#dom-imagecapture-takephoto\n * @return {Promise<Blob>} Fulfilled promise with [Blob](https://www.w3.org/TR/FileAPI/#blob)\n * argument on success; rejected promise on failure\n */\n }, {\n key: \"takePhoto\",\n value: function takePhoto() {\n var self = this;\n return new Promise(function executorTP(resolve, reject) {\n // `If the readyState of the MediaStreamTrack provided in the constructor is not live,\n // return a promise rejected with a new DOMException whose name is \"InvalidStateError\".`\n if (self._videoStreamTrack.readyState !== 'live') {\n return reject(new DOMException('InvalidStateError'));\n }\n self.videoElementPlaying.then(function () {\n try {\n self.canvasElement.width = self.videoElement.videoWidth;\n self.canvasElement.height = self.videoElement.videoHeight;\n self.canvas2dContext.drawImage(self.videoElement, 0, 0);\n self.canvasElement.toBlob(resolve);\n } catch (error) {\n reject(new DOMException('UnknownError'));\n }\n });\n });\n }\n\n /**\n * Implements https://www.w3.org/TR/image-capture/#dom-imagecapture-grabframe\n * @return {Promise<ImageBitmap>} Fulfilled promise with\n * [ImageBitmap](https://www.w3.org/TR/html51/webappapis.html#webappapis-images)\n * argument on success; rejected promise on failure\n */\n }, {\n key: \"grabFrame\",\n value: function grabFrame() {\n var self = this;\n return new Promise(function executorGF(resolve, reject) {\n // `If the readyState of the MediaStreamTrack provided in the constructor is not live,\n // return a promise rejected with a new DOMException whose name is \"InvalidStateError\".`\n if (self._videoStreamTrack.readyState !== 'live') {\n return reject(new DOMException('InvalidStateError'));\n }\n self.videoElementPlaying.then(function () {\n try {\n self.canvasElement.width = self.videoElement.videoWidth;\n self.canvasElement.height = self.videoElement.videoHeight;\n self.canvas2dContext.drawImage(self.videoElement, 0, 0);\n // TODO polyfill https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmapFactories/createImageBitmap for IE\n resolve(window.createImageBitmap(self.canvasElement));\n } catch (error) {\n reject(new DOMException('UnknownError'));\n }\n });\n });\n }\n }, {\n key: \"grabFrameAsImageData\",\n value: function grabFrameAsImageData() {\n var _this2 = this;\n return new Promise(function (resolve, reject) {\n if (_this2._videoStreamTrack.readyState !== 'live') {\n return reject(new DOMException('InvalidStateError'));\n }\n _this2.videoElementPlaying.then(function () {\n try {\n var _this2$canvas2dContex, _this2$canvas2dContex2;\n _this2.canvasElement.width = _this2.videoElement.videoWidth;\n _this2.canvasElement.height = _this2.videoElement.videoHeight;\n (_this2$canvas2dContex = _this2.canvas2dContext) === null || _this2$canvas2dContex === void 0 || _this2$canvas2dContex.drawImage(_this2.videoElement, 0, 0);\n var imageData = (_this2$canvas2dContex2 = _this2.canvas2dContext) === null || _this2$canvas2dContex2 === void 0 ? void 0 : _this2$canvas2dContex2.getImageData(0, 0, _this2.canvasElement.width, _this2.canvasElement.height);\n if (imageData) {\n resolve(imageData);\n } else {\n reject(new DOMException('UnknownError'));\n }\n } catch (error) {\n reject(new DOMException('UnknownError'));\n }\n });\n });\n }\n }]);\n return CustomImageCapture;\n}();\n;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomImageCapture);\n\n//# sourceURL=webpack://seeso_test/./lib/polyfil/ImageCapture-polyfil.js?")},"./lib/seeso.js":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ CalibrationAccuracyCriteria: () => (/* reexport safe */ _type_calibration_accuracy_type__WEBPACK_IMPORTED_MODULE_6__.CalibrationAccuracyCriteria),\n/* harmony export */ CalibrationData: () => (/* reexport safe */ _type_calibration_data__WEBPACK_IMPORTED_MODULE_7__.CalibrationData),\n/* harmony export */ EyeMovementState: () => (/* reexport safe */ _type_gaze_info__WEBPACK_IMPORTED_MODULE_2__.EyeMovementState),\n/* harmony export */ InitializationErrorType: () => (/* reexport safe */ _type_error_type__WEBPACK_IMPORTED_MODULE_4__.InitializationErrorType),\n/* harmony export */ TrackingState: () => (/* reexport safe */ _type_gaze_info__WEBPACK_IMPORTED_MODULE_2__.TrackingState),\n/* harmony export */ UserStatusOption: () => (/* reexport safe */ _type_user_status_option__WEBPACK_IMPORTED_MODULE_12__["default"]),\n/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _setting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setting */ "./lib/setting/index.js");\n/* harmony import */ var _polyfil_ImageCapture_polyfil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./polyfil/ImageCapture-polyfil */ "./lib/polyfil/ImageCapture-polyfil.js");\n/* harmony import */ var _type_gaze_info__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./type/gaze-info */ "./lib/type/gaze-info.js");\n/* harmony import */ var _type_face_info__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./type/face-info */ "./lib/type/face-info.js");\n/* harmony import */ var _type_error_type__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./type/error-type */ "./lib/type/error-type.js");\n/* harmony import */ var _type_color_format__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./type/color-format */ "./lib/type/color-format.js");\n/* harmony import */ var _type_calibration_accuracy_type__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./type/calibration-accuracy-type */ "./lib/type/calibration-accuracy-type.js");\n/* harmony import */ var _type_calibration_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./type/calibration-data */ "./lib/type/calibration-data.js");\n/* harmony import */ var _utils_InstantThread__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/InstantThread */ "./lib/utils/InstantThread.js");\n/* harmony import */ var wasm_check__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! wasm-check */ "./node_modules/wasm-check/dist/wasm-check.min.js");\n/* harmony import */ var wasm_check__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(wasm_check__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! axios */ "./node_modules/axios/lib/axios.js");\n/* harmony import */ var _utils_MonitorSizeConverter__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/MonitorSizeConverter */ "./lib/utils/MonitorSizeConverter.js");\n/* harmony import */ var _utils_make_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/make-url */ "./lib/utils/make-url.js");\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! buffer */ "./node_modules/buffer/index.js");\n/* harmony import */ var _type_user_status_option__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./type/user-status-option */ "./lib/type/user-status-option.js");\n/* harmony import */ var _utils_CameraConfigurationUtil__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/CameraConfigurationUtil */ "./lib/utils/CameraConfigurationUtil.js");\n/* harmony import */ var _type_camera_configuration__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./type/camera-configuration */ "./lib/type/camera-configuration.js");\nfunction _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }\nfunction _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a \'" + n + "\' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }\n/* eslint-disable */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar Seeso = /*#__PURE__*/function () {\n function Seeso() {\n var _this = this;\n _classCallCheck(this, Seeso);\n if (Seeso.gaze) {\n return Seeso.gaze;\n }\n Seeso.gaze = this;\n this.l1 = [];\n this.l2 = [];\n this.l3 = [];\n this.ctx = null;\n this.statusOptionPtr = null;\n this.userStatusOption = null;\n this.isMobile = false;\n this.thread = null;\n this.debugThread = null;\n this.initialized = false;\n this.threadCount = Number.MAX_SAFE_INTEGER;\n this.currentFps = 30;\n this.debug = false;\n this.widthMm = 330;\n this.heightMm = 210;\n this.monitorInch = _utils_MonitorSizeConverter__WEBPACK_IMPORTED_MODULE_9__["default"].sizeMMtoInch(this.widthMm, this.heightMm);\n this.faceDistance = 50;\n this.cameraX = -this.widthMm / 2;\n this.isCameraOnTop = true;\n this.trackerModule = null;\n this.cameraTopMm = 10;\n this.fov = null;\n // debug\n this.latencyList = [];\n this.befTime = -1;\n this.initCallbacks = [];\n this.debugCallbacks = [];\n this.gazeCallbacks = [];\n this.faceCallbacks = [];\n this.calibrationFinishCallbacks = [];\n this.calibrationNextPointCallbacks = [];\n this.calibrationProgressCallbacks = [];\n this.calibrationCancelCallbacks = [];\n this.attentionCallbacks = [];\n this.blinkCallbacks = [];\n this.drowsinessCallbacks = [];\n this.addFunctions = [];\n this.cameraConfig = null;\n this.eyeTracker = null;\n this.errCode = _type_error_type__WEBPACK_IMPORTED_MODULE_4__.InitializationErrorType.ERROR_INIT;\n this.licenseKey = null;\n this.calibrationData = null;\n this.enableTab = false;\n this.isDebug = true;\n this.streamSettings = null;\n document.addEventListener(\'visibilitychange\', function () {\n if (document.visibilityState === \'visible\') {\n _this.enableTab = true;\n } else {\n _this.enableTab = false;\n }\n });\n }\n\n //// Lifecycle functions\n\n /** */\n _createClass(Seeso, [{\n key: "initialize",\n value: function () {\n var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(licenseKey, userStatusOption, threadCount) {\n var optionList;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n optionList = undefined;\n this.threadCount = threadCount;\n if (userStatusOption) {\n this.userStatusOption = userStatusOption;\n optionList = userStatusOption.getUserStatusOptions();\n }\n if (licenseKey) {\n _context.next = 5;\n break;\n }\n return _context.abrupt("return");\n case 5:\n _context.prev = 5;\n _context.next = 8;\n return this.initWasm_();\n case 8:\n if (!_context.sent) {\n _context.next = 11;\n break;\n }\n _context.next = 11;\n return this.initEyeTracker_(licenseKey, optionList, threadCount);\n case 11:\n this.licenseKey = licenseKey;\n if (!(this.errCode === _type_error_type__WEBPACK_IMPORTED_MODULE_4__.InitializationErrorType.ERROR_NONE)) {\n _context.next = 25;\n break;\n }\n this.initialized = true;\n this.isMobile = this.checkMobile();\n if (!this.isMobile) {\n _context.next = 23;\n break;\n }\n this.widthMm = null;\n this.heightMm = null;\n this.cameraX = null;\n this.cameraTopMm = null;\n this.fov = null;\n _context.next = 23;\n return this.initCameraConfiguration();\n case 23:\n _context.next = 26;\n break;\n case 25:\n this.deinitialize();\n case 26:\n return _context.abrupt("return", this.errCode);\n case 29:\n _context.prev = 29;\n _context.t0 = _context["catch"](5);\n console.log(_context.t0);\n this.releaseStreamTrack_();\n return _context.abrupt("return", this.errCode);\n case 34:\n case "end":\n return _context.stop();\n }\n }, _callee, this, [[5, 29]]);\n }));\n function initialize(_x2, _x3, _x4) {\n return _initialize.apply(this, arguments);\n }\n return initialize;\n }()\n }, {\n key: "deinitialize",\n value: function () {\n var _deinitialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var _this2 = this;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n this.userStatusOption = null;\n this.imageCapture = null;\n this.stopTracking();\n this.streamSettings = null;\n setTimeout(function () {\n if (_this2.trackerModule) {\n if (_this2.eyeTracker) {\n var isDeinit = _this2.trackerModule.ccall(\'deinitEyeTracker\', \'boolean\', [\'number\'], [_this2.eyeTracker]);\n _this2.debugLog(\'eyeTracker deinit \' + isDeinit);\n _this2.eyeTracker = null;\n }\n var _iterator = _createForOfIteratorHelper(_this2.addFunctions),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var fn = _step.value;\n _this2.trackerModule.removeFunction(fn);\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n _this2.addFunctions = [];\n }\n }, 1000);\n case 5:\n case "end":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function deinitialize() {\n return _deinitialize.apply(this, arguments);\n }\n return deinitialize;\n }()\n }, {\n key: "getCameraPosition",\n value: function getCameraPosition() {\n if (!this.trackerModule || !this.eyeTracker || this.isMobile) {\n return undefined;\n }\n var screenWidth = window.screen.width;\n var camera_x = -(this.cameraX * screenWidth) / this.widthMm;\n return {\n isCameraOnTop: this.isCameraOnTop,\n cameraX: camera_x\n };\n }\n\n /** @private */\n }, {\n key: "initCameraConfiguration",\n value: function () {\n var _initCameraConfiguration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _this3 = this;\n var found, cameraConfigs, cameraConfiguration, dimensions, fov, defaultDimensions, _defaultDimensions;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n // Fetch camera configurations based on the SEESO version.\n found = false; // if(false){\n cameraConfigs = (0,_utils_CameraConfigurationUtil__WEBPACK_IMPORTED_MODULE_13__.loadCameraConfiguration)(_setting__WEBPACK_IMPORTED_MODULE_0__.SEESO_VERSION + \'no_filter\'); // If cameraConfigs is null or there is no matching screen size in the cameraConfigs, request new camera configurations.\n if (cameraConfigs.some(function (config) {\n return _this3.isScreenSizeEqualToCameraConfigResolution(config);\n })) {\n _context3.next = 6;\n break;\n }\n _context3.next = 5;\n return (0,_utils_CameraConfigurationUtil__WEBPACK_IMPORTED_MODULE_13__.requestMobileDevice)();\n case 5:\n cameraConfigs = _context3.sent;\n case 6:\n if (this.debug && cameraConfigs) {\n console.table(cameraConfigs);\n }\n if (cameraConfigs.length > 0) {\n found = true;\n // Find a cameraConfiguration that matches the screen size or use the first one in the array.\n cameraConfiguration = cameraConfigs.find(function (config) {\n return _this3.isScreenSizeEqualToCameraConfigResolution(config);\n }) || cameraConfigs[0];\n this.cameraConfig = cameraConfiguration;\n dimensions = this.updateScreenDimensions(cameraConfiguration) || this.findNonNullValue(cameraConfigs, \'dimensions\');\n if (dimensions) {\n this.widthMm = dimensions.widthMm;\n this.heightMm = dimensions.heightMm;\n }\n this.cameraX = cameraConfiguration.screenOriginX !== null ? cameraConfiguration.screenOriginX : this.findNonNullValue(cameraConfigs, \'screenOriginX\');\n this.cameraTopMm = cameraConfiguration.screenOriginY !== null ? cameraConfiguration.screenOriginY : this.findNonNullValue(cameraConfigs, \'screenOriginY\');\n\n // Set the camera FOV using setCameraFOV if the fov value is not null.\n fov = cameraConfiguration.fov !== null ? cameraConfiguration.fov : this.findNonNullValue(cameraConfigs, \'fov\');\n if (fov) {\n this.setCameraFOV(fov);\n }\n }\n // }\n\n if (found === false) {\n // Longer Axis ? Shorter Axis 에 따라서 다른 로직 적용해야함.. 정확도 엄청 차이남\n // cameraConfiguration 에 포함된 정보\n // screenOriginX, screenOriginY\n defaultDimensions = this.getDefaultScreenSizeInMm();\n this.widthMm = defaultDimensions.widthMm;\n this.heightMm = defaultDimensions.heightMm;\n this.cameraX = -this.widthMm / 2;\n this.cameraTopMm = 10;\n this.cameraConfig = new _type_camera_configuration__WEBPACK_IMPORTED_MODULE_14__["default"]("DEFAULT", "DEFAULT", window.screen.width * window.devicePixelRatio, window.screen.height * window.devicePixelRatio, 425, 425, this.cameraX, this.cameraTopMm, 1.18, false);\n this.cameraConfig.widthMm = this.widthMm;\n this.cameraConfig.height = this.heightMm;\n\n // console.log(\'filterAndSaveCameraConfigurations loop1\');\n\n // this.filterAndSaveCameraConfigurations(this.cameraConfig)\n }\n\n if (!this.cameraConfig) {\n console.log(\'this cameraConfig not exist\');\n if (!this.cameraX) {\n console.log(\'this cameraX not exist, set default\', -this.widthMm / 2);\n this.cameraX = -this.widthMm / 2;\n }\n if (!this.cameraTopMm) {\n console.log(\'this cameraTopMm not exist, set default 10\');\n this.cameraTopMm = 10;\n }\n this.cameraConfig = new _type_camera_configuration__WEBPACK_IMPORTED_MODULE_14__["default"]("DEFAULT", "DEFAULT", window.screen.width * window.devicePixelRatio, window.screen.height * window.devicePixelRatio, 425, 425, this.cameraX, this.cameraTopMm, 1.18, false);\n }\n\n // If widthMm and heightMm are not set, use default values from getDefaultScreenSizeInMm function.\n if (!this.widthMm || !this.heightMm) {\n console.log(\'this widthMm heightMm exist\', this.widthMm, this.heightMm);\n _defaultDimensions = this.getDefaultScreenSizeInMm();\n this.widthMm = _defaultDimensions.widthMm;\n this.heightMm = _defaultDimensions.heightMm;\n this.cameraConfig.widthMm = this.widthMm;\n this.cameraConfig.height = this.heightMm;\n console.log(\'this widthMm heightMm set to default\', this.widthMm, this.heightMm);\n }\n console.log(\'filterAndSaveCameraConfigurations loop2\');\n this.filterAndSaveCameraConfigurations(cameraConfigs);\n console.log(this.cameraConfig);\n this.debugLog("width height : (".concat(this.widthMm, "mm, ").concat(this.heightMm, "mm)"));\n case 15:\n case "end":\n return _context3.stop();\n }\n }, _callee3, this);\n }));\n function initCameraConfiguration() {\n return _initCameraConfiguration.apply(this, arguments);\n }\n return initCameraConfiguration;\n }() /** @private */\n }, {\n key: "getDefaultScreenSizeInMm",\n value: function getDefaultScreenSizeInMm() {\n if (this.isMobile) {\n return {\n widthMm: 64,\n heightMm: 140\n };\n } else {\n return {\n widthMm: 330,\n heightMm: 210\n };\n }\n }\n\n /** @private */\n }, {\n key: "getStreamSettings",\n value: function getStreamSettings(stream) {\n var result = {};\n var videoTracks = stream.getVideoTracks();\n var audioTracks = stream.getAudioTracks();\n if (videoTracks.length > 0) {\n result.video = videoTracks[0].getSettings();\n }\n if (audioTracks.length > 0) {\n result.audio = audioTracks[0].getSettings();\n }\n return result;\n }\n\n /** @private */\n }, {\n key: "filterAndSaveCameraConfigurations",\n value: function filterAndSaveCameraConfigurations(cameraConfigs) {\n // Return early if cameraConfigs is null.\n if (!cameraConfigs) {\n return;\n }\n console.log(\'filterAndSaveCameraConfigurations\', cameraConfigs);\n var validConfigs = cameraConfigs.filter(function (config) {\n return config.ppiX > 0 && config.ppiY > 0 && config.fov !== null && config.screenOriginX !== null && config.screenOriginY !== null;\n });\n if (this.debug) {\n console.table(validConfigs);\n }\n (0,_utils_CameraConfigurationUtil__WEBPACK_IMPORTED_MODULE_13__.saveCameraConfiguration)(_setting__WEBPACK_IMPORTED_MODULE_0__.SEESO_VERSION + \'no_filter\', validConfigs);\n }\n\n /** @private */\n }, {\n key: "findNonNullValue",\n value: function findNonNullValue(cameraConfigs, property) {\n var nonNullValue = cameraConfigs.find(function (config) {\n return config[property] !== null;\n });\n return nonNullValue ? nonNullValue[property] : null;\n }\n\n /** @private */\n }, {\n key: "isScreenSizeEqualToCameraConfigResolution",\n value: function isScreenSizeEqualToCameraConfigResolution(cameraConfig) {\n if (!(cameraConfig instanceof _type_camera_configuration__WEBPACK_IMPORTED_MODULE_14__["default"])) {\n return false;\n }\n var resolutionWidth = cameraConfig.resolutionWidth,\n resolutionHeight = cameraConfig.resolutionHeight;\n var screenWidth = window.screen.width * window.devicePixelRatio;\n var screenHeight = window.screen.height * window.devicePixelRatio;\n ;\n var screenMax = Math.max(screenWidth, screenHeight);\n var screenMin = Math.min(screenWidth, screenHeight);\n var resolutionAspectRatio = resolutionWidth / resolutionHeight;\n var screenAspectRatio = screenMin / screenMax;\n\n // Allow some tolerance for aspect ratio and difference in resolution size\n var aspectRatioTolerance = 0.1;\n var sizeTolerance = 10; // in pixels\n var isAspectRatioEqual = Math.abs(resolutionAspectRatio - screenAspectRatio) < aspectRatioTolerance;\n var isSizeEqual = Math.abs(resolutionWidth - screenMin) < sizeTolerance && Math.abs(resolutionHeight - screenMax) < sizeTolerance;\n return isAspectRatioEqual && isSizeEqual;\n }\n }, {\n key: "setCameraPosition",\n value: function setCameraPosition(cameraX, isCameraOnTop) {\n if (this.isMobile) {\n return null;\n }\n var screenWidth = window.screen.width;\n var camera_x = -(cameraX / screenWidth) * this.widthMm;\n this.cameraX = camera_x;\n this.isCameraOnTop = isCameraOnTop;\n }\n }, {\n key: "setCameraConfiguration",\n value: function setCameraConfiguration(cameraConfig) {\n if (!(cameraConfig instanceof _type_camera_configuration__WEBPACK_IMPORTED_MODULE_14__["default"]) || !this.isMobile) {\n return;\n }\n this.cameraConfig = cameraConfig;\n var screenOriginX = cameraConfig.screenOriginX,\n screenOriginY = cameraConfig.screenOriginY,\n fov = cameraConfig.fov;\n this.cameraX = screenOriginX;\n this.cameraTopMm = screenOriginY;\n var dimensions = this.updateScreenDimensions(cameraConfig);\n if (dimensions) {\n this.widthMm = dimensions.widthMm;\n this.heightMm = dimensions.heightMm;\n }\n this.setCameraFOV(fov);\n }\n }, {\n key: "getCameraConfigurations",\n value: function getCameraConfigurations() {\n if (!this.isMobile) {\n return null;\n }\n return this.cameraConfig;\n }\n }, {\n key: "setDebugMode",\n value: function setDebugMode(isDebug) {\n this.isDebug = isDebug;\n }\n\n /** @private */\n }, {\n key: "debugLog",\n value: function debugLog(message) {\n if (this.isDebug) {\n console.log("[DEBUG]", message);\n }\n }\n\n /** @private */\n }, {\n key: "updateScreenDimensions",\n value: function updateScreenDimensions(cameraConfig) {\n var inchToMm = 25.4;\n if (cameraConfig.ppiX > 0 && cameraConfig.ppiY > 0) {\n var shorterMm = cameraConfig.resolutionWidth / cameraConfig.ppiX * inchToMm;\n var longerMm = cameraConfig.resolutionHeight / cameraConfig.ppiY * inchToMm;\n return cameraConfig.cameraOnLongerAxis ? {\n widthMm: longerMm,\n heightMm: shorterMm\n } : {\n widthMm: shorterMm,\n heightMm: longerMm\n };\n }\n return null;\n }\n }, {\n key: "getFaceDistance",\n value: function getFaceDistance() {\n if (this.isMobile) {\n return null;\n }\n return this.faceDistance / 10;\n }\n }, {\n key: "setFaceDistance",\n value: function setFaceDistance(faceDistance) {\n if (faceDistance == null || this.isMobile) {\n return null;\n }\n this.faceDistance = parseFloat(faceDistance) * 10;\n if (!this.trackerModule || !this.eyeTracker) {\n return;\n }\n this.trackerModule.ccall(\'setCameraDistanceZ\', null, [\'number\', \'number\'], [this.eyeTracker, this.faceDistance]);\n }\n }, {\n key: "getMonitorSize",\n value: function getMonitorSize() {\n if (!this.trackerModule || !this.eyeTracker || this.isMobile) {\n return undefined;\n }\n this.monitorInch = _utils_MonitorSizeConverter__WEBPACK_IMPORTED_MODULE_9__["default"].sizeMMtoInch(this.widthMm, this.heightMm);\n return this.monitorInch;\n }\n }, {\n key: "setMonitorSize",\n value: function setMonitorSize(monitorInch) {\n if (monitorInch && !this.isMobile) {\n this.monitorInch = monitorInch;\n var _MonitorSizeConveter$ = _utils_MonitorSizeConverter__WEBPACK_IMPORTED_MODULE_9__["default"].inchToSizeMM(monitorInch),\n width = _MonitorSizeConveter$.width,\n height = _MonitorSizeConveter$.height;\n this.widthMm = width;\n this.heightMm = height;\n }\n }\n }, {\n key: "setScreenSize",\n value: function setScreenSize(widthMm, heightMm) {\n if (widthMm && heightMm) {\n this.widthMm = widthMm;\n this.heightMm = heightMm;\n }\n }\n }, {\n key: "setTrackingFps",\n value: function setTrackingFps(fps) {\n if (!this.trackerModule || !this.eyeTracker) {\n return;\n }\n this.trackerModule.ccall(\'setTrackingFps\', null, [\'number\', \'number\'], [this.eyeTracker, fps]);\n }\n }, {\n key: "addGazeCallback",\n value: function addGazeCallback(callback) {\n if (this.gazeCallbacks.indexOf(callback) === -1) {\n this.gazeCallbacks.push(callback);\n }\n }\n }, {\n key: "checkMobile",\n value: function checkMobile() {\n var isMobile = /Android|iPhone|iPad/i.test(navigator.userAgent);\n console.log(\'checkMobile\', isMobile, navigator.userAgent);\n return isMobile;\n }\n }, {\n key: "removeGazeCallback",\n value: function removeGazeCallback(callback) {\n this.removeCallbackFunc_(callback, this.gazeCallbacks);\n }\n }, {\n key: "addFaceCallback",\n value: function addFaceCallback(callback) {\n