UNPKG

threear

Version:

A marker based Augmented Reality library for Three.js

1 lines 781 kB
!function(e,i){"object"==typeof exports&&"object"==typeof module?module.exports=i(require("three")):"function"==typeof define&&define.amd?define(["three"],i):"object"==typeof exports?exports.THREEAR=i(require("three")):e.THREEAR=i(e.THREE)}(window,function(__WEBPACK_EXTERNAL_MODULE__10__){return function(e){var i={};function r(t){if(i[t])return i[t].exports;var a=i[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=i,r.d=function(e,i,t){r.o(e,i)||Object.defineProperty(e,i,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,i){if(1&i&&(e=r(e)),8&i)return e;if(4&i&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&i&&"string"!=typeof e)for(var a in e)r.d(t,a,function(i){return e[i]}.bind(null,a));return t},r.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(i,"a",i),i},r.o=function(e,i){return Object.prototype.hasOwnProperty.call(e,i)},r.p="",r(r.s=4)}([function(e,i,r){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=r(7),a=function(){function e(){}return e.getMarkerInfo=function(){return t.markerInfo},e.deleteCamera=function(e){throw Error("deleteCamera not implemented")},e.loadCamera=function(i,r,a){var f="/camera_param_"+e.cameraCount++,n=function(){var e=t._loadCamera(f);r&&r(e)};"object"==typeof i?e.writeByteArrayToFS(f,i,n):i.indexOf("\n")>-1?e.writeStringToFS(f,i,n):e.ajax(i,f,n)},e.getFrameMalloc=function(){return t.frameMalloc},e.addMarker=function(i,r,a,f){var n="/marker_"+e.markerCount++;e.ajax(r,n,function(){var e=t._addMarker(i,n);a&&a(e)})},e.addNFTMarker=function(i,r,a,f){var n="/markerNFT_"+e.markerCount++,l=n+".fset",o=n+".iset",s=n+".fset3";e.ajax(r+".fset",l,function(){e.ajax(r+".iset",o,function(){e.ajax(r+".fset3",s,function(){var e=t._addNFTMarker(i,n);a&&a(e)})})})},e.bytesToString=function(e){return String.fromCharCode.apply(String,e)},e.parseMultiFile=function(e){var i=this.bytesToString(e).split("\n"),r=[],t=0;return i.forEach(function(e){if((e=e.trim())&&!e.startsWith("#"))switch(t){case 0:return void(t=1);case 1:e.match(/^\d+$/)||r.push(e);case 2:case 3:case 4:return void t++;case 5:return void(t=1)}}),r},e.addMultiMarker=function(i,r,a,f){var n=this,l="/multi_marker_"+e.multiMarkerCount++;e.ajax(r,l,function(f){var o=n.parseMultiFile(f),s=function(){var e=t._addMultiMarker(i,l),r=t.getMultiMarkerNum(i,e);a&&a(e,r)};if(!o.length)return s();var u=r.split("/").slice(0,-1).join("/");o=o.map(function(e){return[u+"/"+e,e]}),e.ajaxDependencies(o,s)})},e.writeStringToFS=function(i,r,t){for(var a=new Uint8Array(r.length),f=0;f<a.length;f++)a[f]=255&r.charCodeAt(f);e.writeByteArrayToFS(i,a,t)},e.writeByteArrayToFS=function(e,i,r){t.FS.writeFile(e,i,{encoding:"binary"}),r(i)},e.ajax=function(i,r,t){var a=new XMLHttpRequest;a.open("GET",i,!0),a.responseType="arraybuffer",a.onload=function(){var i=a.response,f=new Uint8Array(i);e.writeByteArrayToFS(r,f,t)},a.send()},e.ajaxDependencies=function(i,r){var t=i.pop();t?e.ajax(t[0],t[1],function(){e.ajaxDependencies(i,r)}):r()},e.AR_DEBUG_DISABLE=0,e.AR_DEBUG_ENABLE=1,e.AR_DEFAULT_DEBUG_MODE=0,e.AR_DEFAULT_IMAGE_PROC_MODE=0,e.AR_DEFAULT_LABELING_MODE=1,e.AR_DEFAULT_LABELING_THRESH=100,e.AR_DEFAULT_MARKER_EXTRACTION_MODE=2,e.AR_DEFAULT_PATTERN_DETECTION_MODE=0,e.AR_IMAGE_PROC_FIELD_IMAGE=1,e.AR_IMAGE_PROC_FRAME_IMAGE=0,e.AR_LABELING_BLACK_REGION=1,e.AR_LABELING_THRESH_MODE_AUTO_ADAPTIVE=3,e.AR_LABELING_THRESH_MODE_AUTO_MEDIAN=1,e.AR_LABELING_THRESH_MODE_AUTO_OTSU=2,e.AR_LABELING_THRESH_MODE_MANUAL=0,e.AR_LABELING_WHITE_REGION=0,e.AR_LOG_LEVEL_DEBUG=0,e.AR_LOG_LEVEL_ERROR=3,e.AR_LOG_LEVEL_INFO=1,e.AR_LOG_LEVEL_REL_INFO=4,e.AR_LOG_LEVEL_WARN=2,e.AR_LOOP_BREAK_THRESH=0,e.AR_MARKER_INFO_CUTOFF_PHASE_HEURISTIC_TROUBLESOME_MATRIX_CODES=9,e.AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_EDC_FAIL=5,e.AR_MARKER_INFO_CUTOFF_PHASE_MATCH_BARCODE_NOT_FOUND=4,e.AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONFIDENCE=6,e.AR_MARKER_INFO_CUTOFF_PHASE_MATCH_CONTRAST=3,e.AR_MARKER_INFO_CUTOFF_PHASE_MATCH_GENERIC=2,e.AR_MARKER_INFO_CUTOFF_PHASE_NONE=0,e.AR_MARKER_INFO_CUTOFF_PHASE_PATTERN_EXTRACTION=1,e.AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR=7,e.AR_MARKER_INFO_CUTOFF_PHASE_POSE_ERROR_MULTI=8,e.AR_MATRIX_CODE_3x3=3,e.AR_MATRIX_CODE_3x3_HAMMING63=515,e.AR_MATRIX_CODE_3x3_PARITY65=259,e.AR_MATRIX_CODE_4x4=4,e.AR_MATRIX_CODE_4x4_BCH_13_5_5=1028,e.AR_MATRIX_CODE_4x4_BCH_13_9_3=772,e.AR_MATRIX_CODE_DETECTION=2,e.AR_MAX_LOOP_COUNT=5,e.AR_NOUSE_TRACKING_HISTORY=1,e.AR_TEMPLATE_MATCHING_COLOR=0,e.AR_TEMPLATE_MATCHING_COLOR_AND_MATRIX=3,e.AR_TEMPLATE_MATCHING_MONO=1,e.AR_TEMPLATE_MATCHING_MONO_AND_MATRIX=4,e.AR_USE_TRACKING_HISTORY=0,e.AR_USE_TRACKING_HISTORY_V2=2,e.HEAPU8=t.HEAPU8,e.UNKNOWN_MARKER=-1,e.PATTERN_MARKER=0,e.BARCODE_MARKER=1,e.setup=t.setup,e.teardown=t.teardown,e.setupAR2=t.setupAR2,e.setLogLevel=t.setLogLevel,e.getLogLevel=t.getLogLevel,e.setDebugMode=t.getLogLevel,e.getDebugMode=t.getDebugMode,e.getProcessingImage=t.getProcessingImage,e.setMarkerInfoDir=t.setMarkerInfoDir,e.setMarkerInfoVertex=t.setMarkerInfoVertex,e.getTransMatSquare=t.getTransMatSquare,e.getTransMatSquareCont=t.getTransMatSquareCont,e.getTransMatMultiSquare=t.getTransMatMultiSquare,e.getTransMatMultiSquareRobust=t.getTransMatMultiSquareRobust,e.getMultiMarkerNum=t.getMultiMarkerNum,e.getMultiMarkerCount=t.getMultiMarkerCount,e.detectMarker=t.detectMarker,e.getMarkerNum=t.getMarkerNum,e.getMarker=t.getMarker,e.getMultiEachMarker=t.getMultiEachMarker,e.detectNFTMarker=t.detectNFTMarker,e.setProjectionNearPlane=t.setProjectionNearPlane,e.getProjectionNearPlane=t.getProjectionNearPlane,e.setProjectionFarPlane=t.setProjectionFarPlane,e.getProjectionFarPlane=t.getProjectionFarPlane,e.setThresholdMode=t.setThresholdMode,e.getThresholdMode=t.getThresholdMode,e.setThreshold=t.setThreshold,e.getThreshold=t.getThreshold,e.setPatternDetectionMode=t.setPatternDetectionMode,e.getPatternDetectionMode=t.getPatternDetectionMode,e.setMatrixCodeType=t.setMatrixCodeType,e.getMatrixCodeType=t.getMatrixCodeType,e.setLabelingMode=t.setLabelingMode,e.getLabelingMode=t.getLabelingMode,e.setPattRatio=t.setPattRatio,e.getPattRatio=t.getPattRatio,e.setImageProcMode=t.setImageProcMode,e.getImageProcMode=t.getImageProcMode,e.markerCount=0,e.multiMarkerCount=0,e.cameraCount=0,e}();i.ARToolKit=a,i.default=a},function(e,i,r){"use strict";var t,a=this&&this.__extends||(t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])})(e,i)},function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)});Object.defineProperty(i,"__esModule",{value:!0});var f=function(e){function i(i){var r=e.call(this,i)||this;if(!i.patternUrl)throw Error("Pattern Marker requires a patternUrl to be passed");if(void 0===i.markerObject)throw Error("Pattern Marker requires a markerObject to be passed");return r.patternUrl=i.patternUrl,r.markerObject=i.markerObject,r.markerObject.visible=!1,r}return a(i,e),i.count=0,i}(r(2).BaseMarker);i.PatternMarker=f,i.default=f},function(e,i,r){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=function(e){this.size=e.size||1,this.minConfidence=e.minConfidence||.6,this.found=!1};i.BaseMarker=t},function(e,i,r){"use strict";var t,a=this&&this.__extends||(t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])})(e,i)},function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)});Object.defineProperty(i,"__esModule",{value:!0});var f=function(e){function i(i){var r=e.call(this,i)||this;if(void 0===i.barcodeValue)throw Error("Barcode Marker requires a barcodeValue to be passed");if(void 0===i.markerObject)throw Error("Barcode Marker requires a markerObject to be passed");return r.barcodeValue=i.barcodeValue,r.markerObject=i.markerObject,r.markerObject.visible=!1,r}return a(i,e),i.count=0,i}(r(2).BaseMarker);i.BarcodeMarker=f,i.default=f},function(e,i,r){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=r(5);i.Source=t.default;var a=r(1);i.PatternMarker=a.default;var f=r(3);i.BarcodeMarker=f.default;var n,l=r(6);i.initialize=function(e){return void 0!==n&&!0!==n.disposed||(n=new l.Controller(e)),n.postInit}},function(e,i,r){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var t=function(){function e(e){if(!e.renderer)throw Error("ThreeJS Renderer is required");if(!e.camera)throw Error("ThreeJS Camera is required");this.currentTorchStatus=!1,this.parameters={parent:document.body,renderer:null,camera:null,sourceType:"webcam",sourceUrl:"",deviceId:null,facingMode:"environment",sourceWidth:640,sourceHeight:480,displayWidth:640,displayHeight:480},this.setParameters(e)}return e.prototype.setParameters=function(e){if(e)for(var i in e)if(i){var r=e[i];if(void 0===r){console.warn(i+"' parameter is undefined.");continue}if(void 0===this.parameters[i]){console.warn(i+"' is not a property of this Source.");continue}this.parameters[i]=r}},Object.defineProperty(e.prototype,"renderer",{get:function(){return this.parameters.renderer},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"camera",{get:function(){return this.parameters.camera},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){this.parameters.parent&&this.domElement&&this.parameters.parent.removeChild(this.domElement)},e.prototype.initialize=function(){var e=this;return new Promise(function(i,r){var t=function(){e.domElement?(e.onResizeElement(),e.parameters.parent.appendChild(e.domElement),i()):r("domElement not defined")},a=function(e){r(e)};if("image"===e.parameters.sourceType)e.domElement=e._initSourceImage(t,a);else if("video"===e.parameters.sourceType)e.domElement=e._initSourceVideo(t,a);else{if("webcam"!==e.parameters.sourceType)return void r("Source type not recognised. Try: 'image', 'video', 'webcam'");var f=e._initSourceWebcam(t,a);if(!f)return void r("Webcam source could not be established");e.domElement=f}return e.positionSourceDomElement(),e})},e.prototype.hasMobileTorch=function(e){var i=e.srcObject;if(i instanceof MediaStream){var r=i.getVideoTracks()[0];return void 0!==r.getCapabilities&&!!r.getCapabilities().torch}return!1},e.prototype.toggleMobileTorch=function(e){if(!0!=!this.hasMobileTorch(e)){var i=e.srcObject;if(void 0===this.currentTorchStatus&&(this.currentTorchStatus=!1),i instanceof MediaStream){var r=i.getVideoTracks()[0];if(!r.getCapabilities().torch)return void console.warn("Torch is not avaiable to be toggled");this.currentTorchStatus=!this.currentTorchStatus,r.applyConstraints({advanced:[{torch:this.currentTorchStatus}]}).catch(function(e){throw e})}}},e.prototype.onResizeElement=function(){if(this.domElement){var e=window.innerWidth,i=window.innerHeight,r=0,t=0;this.domElement instanceof HTMLImageElement?(t=this.domElement.naturalWidth,r=this.domElement.naturalHeight):this.domElement instanceof HTMLVideoElement&&(t=this.domElement.videoWidth,r=this.domElement.videoHeight);var a=t/r;if(e/i<a){var f=a*i;this.domElement.style.width=f+"px",this.domElement.style.marginLeft=-(f-e)/2+"px",this.domElement.style.height=i+"px",this.domElement.style.marginTop="0px"}else{var n=1/(a/e);this.domElement.style.height=n+"px",this.domElement.style.marginTop=-(n-i)/2+"px",this.domElement.style.width=e+"px",this.domElement.style.marginLeft="0px"}}else console.warn("Can't resize as domElement is not defined on source")},e.prototype.copyElementSizeTo=function(e){this.domElement?window.innerWidth>window.innerHeight?(e.style.width=this.domElement.style.width,e.style.height=this.domElement.style.height,e.style.marginLeft=this.domElement.style.marginLeft,e.style.marginTop=this.domElement.style.marginTop):(e.style.height=this.domElement.style.height,e.style.width=4*parseInt(e.style.height,10)/3+"px",e.style.marginLeft=(window.innerWidth-parseInt(e.style.width,10))/2+"px",e.style.marginTop=0):console.warn("Cant set size to match domElement as it is not defined")},e.prototype._initSourceImage=function(e,i){if(!this.parameters.sourceUrl)throw Error("No source URL provided");var r=document.createElement("img");return r.src=this.parameters.sourceUrl,r.width=this.parameters.sourceWidth,r.height=this.parameters.sourceHeight,r.style.width=this.parameters.displayWidth+"px",r.style.height=this.parameters.displayHeight+"px",r.onload=function(){return e()},r},e.prototype._initSourceVideo=function(e,i){var r=document.createElement("video");return r.src=this.parameters.sourceUrl,r.style.objectFit="initial",r.autoplay=!0,r.webkitPlaysinline=!0,r.controls=!1,r.loop=!0,r.muted=!0,document.body.addEventListener("click",function e(){document.body.removeEventListener("click",e),r.play()}),r.width=this.parameters.sourceWidth,r.height=this.parameters.sourceHeight,r.style.width=this.parameters.displayWidth+"px",r.style.height=this.parameters.displayHeight+"px",r.addEventListener("loadeddata",function(){e()},!1),r},e.prototype._initSourceWebcam=function(e,i){var r=this,t=document.createElement("video");if(t.setAttribute("autoplay",""),t.setAttribute("muted",""),t.setAttribute("playsinline",""),t.style.width=this.parameters.displayWidth+"px",t.style.height=this.parameters.displayHeight+"px",void 0===navigator.mediaDevices||void 0===navigator.mediaDevices.enumerateDevices||void 0===navigator.mediaDevices.getUserMedia){var a="";return void 0===navigator.mediaDevices?a="navigator.mediaDevices":void 0===navigator.mediaDevices.enumerateDevices?a="navigator.mediaDevices.enumerateDevices":void 0===navigator.mediaDevices.getUserMedia&&(a="navigator.mediaDevices.getUserMedia"),void i("WebRTC issue-! "+a+" not present in your browser")}return navigator.mediaDevices.enumerateDevices().then(function(a){var f={audio:!1,video:{facingMode:r.parameters.facingMode,width:{ideal:r.parameters.sourceWidth},height:{ideal:r.parameters.sourceHeight}}};null!==r.parameters.deviceId&&(f.video.deviceId={exact:r.parameters.deviceId}),navigator.mediaDevices.getUserMedia(f).then(function(i){t.srcObject=i,document.body.addEventListener("click",function(){t.play()}),t.addEventListener("loadedmetadata",function(i){e()})}).catch(function(e){i(e)})}).catch(function(e){i(e)}),t},e.prototype.positionSourceDomElement=function(){this.domElement&&(this.domElement.style.position="absolute",this.domElement.style.top="0px",this.domElement.style.left="0px",this.domElement.style.zIndex="-2")},e}();i.Source=t,i.default=t},function(e,i,r){"use strict";var t,a=this&&this.__extends||(t=function(e,i){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,i){e.__proto__=i}||function(e,i){for(var r in i)i.hasOwnProperty(r)&&(e[r]=i[r])})(e,i)},function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)});Object.defineProperty(i,"__esModule",{value:!0});var f=r(0),n=r(8),l=r(9),o=r(10),s=r(1),u=r(3),c=r(11),d=function(e){function i(i){var r=this;if(!i.source)throw Error("Source must be provided");return(r=e.call(this)||this).parameters={source:i.source,changeMatrixMode:"modelViewMatrix",lostTimeout:1e3,positioning:{smooth:!0,smoothCount:5,smoothTolerance:.01,smoothThreshold:2},debug:!1,detectionMode:"mono",matrixCodeType:"3x3",cameraParametersUrl:c.default,maxDetectionRate:60,canvasWidth:640,canvasHeight:480,patternRatio:.5,imageSmoothingEnabled:!1},r.markers={pattern:[],barcode:[]},r.smoothMatrices=[],r.arController=null,r._updatedAt=null,r.setParameters(i),r.disposed=!1,r.postInit=r.initialize(),r}return a(i,e),i.prototype.setParameters=function(e){if(e)for(var i in e)if(i){var r=e[i];if(void 0===r){console.warn(i+"' parameter is undefined.");continue}if(void 0===this.parameters[i]){console.warn(i+"' is not a property of this material.");continue}this.parameters[i]=r}},i.prototype.onResize=function(e){this.parameters.source.onResizeElement(),this.parameters.source.copyElementSizeTo(e.domElement),null!==this.arController&&this.parameters.source.copyElementSizeTo(this.arController.canvas)},i.prototype.update=function(e){if(null===this.arController)return!1;var i=performance.now();return!(null!==this._updatedAt&&i-this._updatedAt<1e3/this.parameters.maxDetectionRate)&&(this._updatedAt=i,this.markers.pattern.forEach(function(e){return e.markerObject.visible=!1}),this.markers.barcode.forEach(function(e){return e.markerObject.visible=!1}),this.arController.process(e),this.checkForLostMarkers(),!0)},i.prototype.trackMarker=function(e){e instanceof s.PatternMarker?this.trackPatternMarker(e):e instanceof u.BarcodeMarker&&this.trackBarcode(e)},i.prototype.dispose=function(){this.arController&&(this.arController.dispose(),this.arController=null,this.disposed=!0,this.markers={pattern:[],barcode:[]})},i.prototype.initialize=function(){var e=this;return new Promise(function(i,r){e.parameters.source.initialize().then(function(){e._initArtoolkit(function(){var r=e.parameters.source,t=r.camera,a=r.renderer;if(null===a)throw Error("Renderer is not defined");if(window.addEventListener("resize",function(){e.onResize(a)}),e.onResize(a),null===t)throw Error("Camera is not defined");t.projectionMatrix.copy(e.getProjectionMatrix()),e.dispatchEvent({type:"initialized"}),i(e)})}).catch(function(e){r(e)})})},i.prototype._initArtoolkit=function(e){var i=this;this._artoolkitProjectionAxisTransformMatrix=new o.Matrix4,this._artoolkitProjectionAxisTransformMatrix.multiply((new o.Matrix4).makeRotationY(Math.PI)),this._artoolkitProjectionAxisTransformMatrix.multiply((new o.Matrix4).makeRotationZ(Math.PI));var r=new n.default(this.parameters.cameraParametersUrl,function(){i.arController=new l.ARToolKitController(i.parameters.canvasWidth,i.parameters.canvasHeight,r),i.arController.ctx.mozImageSmoothingEnabled=i.parameters.imageSmoothingEnabled,i.arController.ctx.webkitImageSmoothingEnabled=i.parameters.imageSmoothingEnabled,i.arController.ctx.msImageSmoothingEnabled=i.parameters.imageSmoothingEnabled,i.arController.ctx.imageSmoothingEnabled=i.parameters.imageSmoothingEnabled,!0===i.parameters.debug&&(i.arController.debugSetup(),i.arController.canvas.style.position="absolute",i.arController.canvas.style.top="0px",i.arController.canvas.style.opacity="0.6",i.arController.canvas.style.pointerEvents="none",i.arController.canvas.style.zIndex="-1");var t={color:f.default.AR_TEMPLATE_MATCHING_COLOR,color_and_matrix:f.default.AR_TEMPLATE_MATCHING_COLOR_AND_MATRIX,mono:f.default.AR_TEMPLATE_MATCHING_MONO,mono_and_matrix:f.default.AR_TEMPLATE_MATCHING_MONO_AND_MATRIX}[i.parameters.detectionMode];i.arController.setPatternDetectionMode(t);var a={"3x3":f.default.AR_MATRIX_CODE_3x3,"3x3_HAMMING63":f.default.AR_MATRIX_CODE_3x3_HAMMING63,"3x3_PARITY65":f.default.AR_MATRIX_CODE_3x3_PARITY65,"4x4":f.default.AR_MATRIX_CODE_4x4,"4x4_BCH_13_9_3":f.default.AR_MATRIX_CODE_4x4_BCH_13_9_3,"4x4_BCH_13_5_5":f.default.AR_MATRIX_CODE_4x4_BCH_13_5_5}[i.parameters.matrixCodeType];i.arController.setMatrixCodeType(a),i.arController.setPattRatio(i.parameters.patternRatio),i.arController.setLogLevel(1),i.arController.addEventListener("getMarker",function(e){i.handleMarkerDetection(e)}),e()},function(e){throw e});return this},i.prototype.handleMarkerDetection=function(e){var i=this;e.data.type===f.default.BARCODE_MARKER?this.markers.barcode.forEach(function(r){e.data.marker.idMatrix===r.barcodeValue&&i.onMarkerFound(e,r)}):e.data.type===f.default.PATTERN_MARKER&&this.markers.pattern.forEach(function(r){e.data.marker.idPatt===r.id&&i.onMarkerFound(e,r)})},i.prototype.checkForLostMarkers=function(){var e=this;this.markers.pattern.concat(this.markers.barcode).forEach(function(i){i.lastDetected&&i.found&&(new Date).getTime()-i.lastDetected.getTime()>e.parameters.lostTimeout&&e.onMarkerLost(i)})},i.prototype.getProjectionMatrix=function(){var e=this.arController,i=Array.from(e.getCameraMatrix()),r=(new o.Matrix4).fromArray(i);r.multiply(this._artoolkitProjectionAxisTransformMatrix);return r.elements[10]=-1000.1/999.9,r.elements[14]=-200/999.9,r},i.prototype.trackPatternMarker=function(e){var i=this;if(null!==this.arController){this.markers.pattern.push(e);if(!e.patternUrl)throw Error("No patternUrl defined in parameters");this.arController.loadMarker(e.patternUrl,function(r){e.id=r,i.arController.trackPatternMarkerId(r,e.size)},function(e){throw Error(e)})}},i.prototype.trackBarcode=function(e){if(null!==this.arController){this.markers.barcode.push(e);var i=null;if(void 0===e.barcodeValue)throw Error("No barcodeValue defined in parameters");i=e.barcodeValue,e.id=i,this.arController.trackBarcodeMarkerId(i,e.size)}},i.prototype.onMarkerFound=function(e,i){if(!(e.data.type===f.default.PATTERN_MARKER&&e.data.marker.cfPatt<i.minConfidence||e.data.type===f.default.BARCODE_MARKER&&e.data.marker.cfMatt<i.minConfidence)){i.found=!0,i.lastDetected=new Date;var r=(new o.Matrix4).fromArray(e.data.matrix);this.updateWithModelViewMatrix(r,i.markerObject),this.dispatchEvent({type:"markerFound",marker:i})}},i.prototype.onMarkerLost=function(e){e.found=!1,this.dispatchEvent({type:"markerLost",marker:e})},i.prototype.updateWithModelViewMatrix=function(e,i){i.visible=!0;var r=this._artoolkitProjectionAxisTransformMatrix,t=(new o.Matrix4).copy(r);t.multiply(e),e.copy(t);var a=!1,f=(new o.Matrix4).makeRotationX(Math.PI/2);if(e.multiply(f),"modelViewMatrix"===this.parameters.changeMatrixMode)if(this.parameters.positioning.smooth){var n=[],l=0;if(this.smoothMatrices.push(e.elements.slice()),this.smoothMatrices.length<this.parameters.positioning.smoothCount+1)i.matrix.copy(e);else{this.smoothMatrices.shift(),n=[];for(var s=0;s<e.elements.length;s++){for(var u=0,c=0;c<this.smoothMatrices.length;c++)u+=this.smoothMatrices[c][s];n[s]=u/this.parameters.positioning.smoothCount,Math.abs(n[s]-e.elements[s])>=this.parameters.positioning.smoothTolerance&&l++}if(l>=this.parameters.positioning.smoothThreshold){for(s=0;s<e.elements.length;s++)e.elements[s]=n[s];i.matrix.copy(e),a=!0}}}else i.matrix.copy(e);else{if("cameraTransformMatrix"!==this.parameters.changeMatrixMode)throw Error();i.matrix.getInverse(e)}return i.matrix.decompose(i.position,i.quaternion,i.scale),a},i}(o.EventDispatcher);i.Controller=d,i.default=d},function(module,exports,__webpack_require__){var Module;Module||(Module=(void 0!==Module?Module:null)||{});var moduleOverrides={};for(var key in Module)Module.hasOwnProperty(key)&&(moduleOverrides[key]=Module[key]);var ENVIRONMENT_IS_WEB="object"==typeof window,ENVIRONMENT_IS_WORKER="function"==typeof importScripts;if(!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER)throw"Unknown runtime environment. Where are we?";if(Module.read=function(e){var i=new XMLHttpRequest;return i.open("GET",e,!1),i.send(null),i.responseText},void 0!==arguments&&(Module.arguments=arguments),"undefined"!=typeof console)Module.print||(Module.print=function(e){console.log(e)}),Module.printErr||(Module.printErr=function(e){console.log(e)});else{var TRY_USE_DUMP=!1;Module.print||(Module.print=TRY_USE_DUMP&&"undefined"!=typeof dump?function(e){dump(e)}:function(e){})}function globalEval(e){eval.call(null,e)}for(var key in ENVIRONMENT_IS_WORKER&&(Module.load=importScripts),void 0===Module.setWindowTitle&&(Module.setWindowTitle=function(e){document.title=e}),!Module.load&&Module.read&&(Module.load=function(e){globalEval(Module.read(e))}),Module.print||(Module.print=function(){}),Module.printErr||(Module.printErr=Module.print),Module.arguments||(Module.arguments=[]),Module.thisProgram||(Module.thisProgram="./this.program"),Module.print=Module.print,Module.printErr=Module.printErr,Module.preRun=[],Module.postRun=[],moduleOverrides)moduleOverrides.hasOwnProperty(key)&&(Module[key]=moduleOverrides[key]);var Runtime={setTempRet0:function(e){tempRet0=e},getTempRet0:function(){return tempRet0},stackSave:function(){return STACKTOP},stackRestore:function(e){STACKTOP=e},getNativeTypeSize:function(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return Runtime.QUANTUM_SIZE;if("i"===e[0]){var i=parseInt(e.substr(1));return assert(i%8==0),i/8}return 0}},getNativeFieldSize:function(e){return Math.max(Runtime.getNativeTypeSize(e),Runtime.QUANTUM_SIZE)},STACK_ALIGN:16,prepVararg:function(e,i){return"double"===i||"i64"===i?7&e&&(assert(4==(7&e)),e+=4):assert(0==(3&e)),e},getAlignSize:function(e,i,r){return r||"i64"!=e&&"double"!=e?e?Math.min(i||(e?Runtime.getNativeFieldSize(e):0),Runtime.QUANTUM_SIZE):Math.min(i,8):8},dynCall:function(e,i,r){return r&&r.length?(r.splice||(r=Array.prototype.slice.call(r)),r.splice(0,0,i),Module["dynCall_"+e].apply(null,r)):Module["dynCall_"+e].call(null,i)},functionPointers:[],addFunction:function(e){for(var i=0;i<Runtime.functionPointers.length;i++)if(!Runtime.functionPointers[i])return Runtime.functionPointers[i]=e,2*(1+i);throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."},removeFunction:function(e){Runtime.functionPointers[(e-2)/2]=null},warnOnce:function(e){Runtime.warnOnce.shown||(Runtime.warnOnce.shown={}),Runtime.warnOnce.shown[e]||(Runtime.warnOnce.shown[e]=1,Module.printErr(e))},funcWrappers:{},getFuncWrapper:function(e,i){assert(i),Runtime.funcWrappers[i]||(Runtime.funcWrappers[i]={});var r=Runtime.funcWrappers[i];return r[e]||(r[e]=function(){return Runtime.dynCall(i,e,arguments)}),r[e]},getCompilerSetting:function(e){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"},stackAlloc:function(e){var i=STACKTOP;return STACKTOP=(STACKTOP=STACKTOP+e|0)+15&-16,i},staticAlloc:function(e){var i=STATICTOP;return STATICTOP=(STATICTOP=STATICTOP+e|0)+15&-16,i},dynamicAlloc:function(e){var i=DYNAMICTOP;if((DYNAMICTOP=(DYNAMICTOP=DYNAMICTOP+e|0)+15&-16)>=TOTAL_MEMORY&&!enlargeMemory())return DYNAMICTOP=i,0;return i},alignMemory:function(e,i){return e=Math.ceil(e/(i||16))*(i||16)},makeBigInt:function(e,i,r){return r?+(e>>>0)+4294967296*+(i>>>0):+(e>>>0)+4294967296*+(0|i)},GLOBAL_BASE:8,QUANTUM_SIZE:4,__dummy__:0};Module.Runtime=Runtime;var __THREW__=0,ABORT=!1,EXITSTATUS=0,undef=0,tempValue,tempInt,tempBigInt,tempInt2,tempBigInt2,tempPair,tempBigIntI,tempBigIntR,tempBigIntS,tempBigIntP,tempBigIntD,tempDouble,tempFloat,tempI64,tempI64b,tempRet0,tempRet1,tempRet2,tempRet3,tempRet4,tempRet5,tempRet6,tempRet7,tempRet8,tempRet9;function assert(e,i){e||abort("Assertion failed: "+i)}var globalScope=this,cwrap,ccall;function getCFunc(ident){var func=Module["_"+ident];if(!func)try{func=eval("_"+ident)}catch(e){}return assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)"),func}function setValue(e,i,r,t){switch("*"===(r=r||"i8").charAt(r.length-1)&&(r="i32"),r){case"i1":case"i8":HEAP8[e>>0]=i;break;case"i16":HEAP16[e>>1]=i;break;case"i32":HEAP32[e>>2]=i;break;case"i64":tempI64=[i>>>0,(tempDouble=i,+Math_abs(tempDouble)>=1?tempDouble>0?(0|Math_min(+Math_floor(tempDouble/4294967296),4294967295))>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[e>>2]=tempI64[0],HEAP32[e+4>>2]=tempI64[1];break;case"float":HEAPF32[e>>2]=i;break;case"double":HEAPF64[e>>3]=i;break;default:abort("invalid type for setValue: "+r)}}function getValue(e,i,r){switch("*"===(i=i||"i8").charAt(i.length-1)&&(i="i32"),i){case"i1":case"i8":return HEAP8[e>>0];case"i16":return HEAP16[e>>1];case"i32":case"i64":return HEAP32[e>>2];case"float":return HEAPF32[e>>2];case"double":return HEAPF64[e>>3];default:abort("invalid type for setValue: "+i)}return null}!function(){var JSfuncs={stackSave:function(){Runtime.stackSave()},stackRestore:function(){Runtime.stackRestore()},arrayToC:function(e){var i=Runtime.stackAlloc(e.length);return writeArrayToMemory(e,i),i},stringToC:function(e){var i=0;return null!=e&&0!==e&&writeStringToMemory(e,i=Runtime.stackAlloc(1+(e.length<<2))),i}},toC={string:JSfuncs.stringToC,array:JSfuncs.arrayToC};ccall=function(e,i,r,t,a){var f=getCFunc(e),n=[],l=0;if(t)for(var o=0;o<t.length;o++){var s=toC[r[o]];s?(0===l&&(l=Runtime.stackSave()),n[o]=s(t[o])):n[o]=t[o]}var u=f.apply(null,n);if("string"===i&&(u=Pointer_stringify(u)),0!==l){if(a&&a.async)return void EmterpreterAsync.asyncFinalizers.push(function(){Runtime.stackRestore(l)});Runtime.stackRestore(l)}return u};var sourceRegex=/^function\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;function parseJSFunc(e){var i=e.toString().match(sourceRegex).slice(1);return{arguments:i[0],body:i[1],returnValue:i[2]}}var JSsource={};for(var fun in JSfuncs)JSfuncs.hasOwnProperty(fun)&&(JSsource[fun]=parseJSFunc(JSfuncs[fun]));cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident),numericArgs=argTypes.every(function(e){return"number"===e}),numericRet="string"!==returnType;if(numericRet&&numericArgs)return cfunc;var argNames=argTypes.map(function(e,i){return"$"+i}),funcstr="(function("+argNames.join(",")+") {",nargs=argTypes.length;if(!numericArgs){funcstr+="var stack = "+JSsource.stackSave.body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if("number"!==type){var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";",funcstr+=convertCode.body+";",funcstr+=arg+"="+convertCode.returnValue+";"}}}var cfuncname=parseJSFunc(function(){return cfunc}).returnValue;if(funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");",!numericRet){var strgfy=parseJSFunc(function(){return Pointer_stringify}).returnValue;funcstr+="ret = "+strgfy+"(ret);"}return numericArgs||(funcstr+=JSsource.stackRestore.body.replace("()","(stack)")+";"),funcstr+="return ret})",eval(funcstr)}}(),Module.ccall=ccall,Module.cwrap=cwrap,Module.setValue=setValue,Module.getValue=getValue;var ALLOC_NORMAL=0,ALLOC_STACK=1,ALLOC_STATIC=2,ALLOC_DYNAMIC=3,ALLOC_NONE=4;function allocate(e,i,r,t){var a,f;"number"==typeof e?(a=!0,f=e):(a=!1,f=e.length);var n,l="string"==typeof i?i:null;if(n=r==ALLOC_NONE?t:[_malloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][void 0===r?ALLOC_STATIC:r](Math.max(f,l?1:i.length)),a){var o;t=n;for(assert(0==(3&n)),o=n+(-4&f);t<o;t+=4)HEAP32[t>>2]=0;for(o=n+f;t<o;)HEAP8[t++>>0]=0;return n}if("i8"===l)return e.subarray||e.slice?HEAPU8.set(e,n):HEAPU8.set(new Uint8Array(e),n),n;for(var s,u,c,d=0;d<f;){var h=e[d];"function"==typeof h&&(h=Runtime.getFunctionIndex(h)),0!==(s=l||i[d])?("i64"==s&&(s="i32"),setValue(n+d,h,s),c!==s&&(u=Runtime.getNativeTypeSize(s),c=s),d+=u):d++}return n}function getMemory(e){return staticSealed?void 0!==_sbrk&&!_sbrk.called||!runtimeInitialized?Runtime.dynamicAlloc(e):_malloc(e):Runtime.staticAlloc(e)}function Pointer_stringify(e,i){if(0===i||!e)return"";for(var r,t=0,a=0;t|=r=HEAPU8[e+a>>0],(0!=r||i)&&(a++,!i||a!=i););i||(i=a);var f="";if(t<128){for(var n;i>0;)n=String.fromCharCode.apply(String,HEAPU8.subarray(e,e+Math.min(i,1024))),f=f?f+n:n,e+=1024,i-=1024;return f}return Module.UTF8ToString(e)}function AsciiToString(e){for(var i="";;){var r=HEAP8[e++>>0];if(!r)return i;i+=String.fromCharCode(r)}}function stringToAscii(e,i){return writeAsciiToMemory(e,i,!1)}function UTF8ArrayToString(e,i){for(var r,t,a,f,n,l="";;){if(!(r=e[i++]))return l;if(128&r)if(t=63&e[i++],192!=(224&r))if(a=63&e[i++],224==(240&r)?r=(15&r)<<12|t<<6|a:(f=63&e[i++],240==(248&r)?r=(7&r)<<18|t<<12|a<<6|f:(n=63&e[i++],r=248==(252&r)?(3&r)<<24|t<<18|a<<12|f<<6|n:(1&r)<<30|t<<24|a<<18|f<<12|n<<6|63&e[i++])),r<65536)l+=String.fromCharCode(r);else{var o=r-65536;l+=String.fromCharCode(55296|o>>10,56320|1023&o)}else l+=String.fromCharCode((31&r)<<6|t);else l+=String.fromCharCode(r)}}function UTF8ToString(e){return UTF8ArrayToString(HEAPU8,e)}function stringToUTF8Array(e,i,r,t){if(!(t>0))return 0;for(var a=r,f=r+t-1,n=0;n<e.length;++n){var l=e.charCodeAt(n);if(l>=55296&&l<=57343&&(l=65536+((1023&l)<<10)|1023&e.charCodeAt(++n)),l<=127){if(r>=f)break;i[r++]=l}else if(l<=2047){if(r+1>=f)break;i[r++]=192|l>>6,i[r++]=128|63&l}else if(l<=65535){if(r+2>=f)break;i[r++]=224|l>>12,i[r++]=128|l>>6&63,i[r++]=128|63&l}else if(l<=2097151){if(r+3>=f)break;i[r++]=240|l>>18,i[r++]=128|l>>12&63,i[r++]=128|l>>6&63,i[r++]=128|63&l}else if(l<=67108863){if(r+4>=f)break;i[r++]=248|l>>24,i[r++]=128|l>>18&63,i[r++]=128|l>>12&63,i[r++]=128|l>>6&63,i[r++]=128|63&l}else{if(r+5>=f)break;i[r++]=252|l>>30,i[r++]=128|l>>24&63,i[r++]=128|l>>18&63,i[r++]=128|l>>12&63,i[r++]=128|l>>6&63,i[r++]=128|63&l}}return i[r]=0,r-a}function stringToUTF8(e,i,r){return stringToUTF8Array(e,HEAPU8,i,r)}function lengthBytesUTF8(e){for(var i=0,r=0;r<e.length;++r){var t=e.charCodeAt(r);t>=55296&&t<=57343&&(t=65536+((1023&t)<<10)|1023&e.charCodeAt(++r)),t<=127?++i:i+=t<=2047?2:t<=65535?3:t<=2097151?4:t<=67108863?5:6}return i}function UTF16ToString(e){for(var i=0,r="";;){var t=HEAP16[e+2*i>>1];if(0==t)return r;++i,r+=String.fromCharCode(t)}}function stringToUTF16(e,i,r){if(void 0===r&&(r=2147483647),r<2)return 0;for(var t=i,a=(r-=2)<2*e.length?r/2:e.length,f=0;f<a;++f){var n=e.charCodeAt(f);HEAP16[i>>1]=n,i+=2}return HEAP16[i>>1]=0,i-t}function lengthBytesUTF16(e){return 2*e.length}function UTF32ToString(e){for(var i=0,r="";;){var t=HEAP32[e+4*i>>2];if(0==t)return r;if(++i,t>=65536){var a=t-65536;r+=String.fromCharCode(55296|a>>10,56320|1023&a)}else r+=String.fromCharCode(t)}}function stringToUTF32(e,i,r){if(void 0===r&&(r=2147483647),r<4)return 0;for(var t=i,a=t+r-4,f=0;f<e.length;++f){var n=e.charCodeAt(f);if(n>=55296&&n<=57343)n=65536+((1023&n)<<10)|1023&e.charCodeAt(++f);if(HEAP32[i>>2]=n,(i+=4)+4>a)break}return HEAP32[i>>2]=0,i-t}function lengthBytesUTF32(e){for(var i=0,r=0;r<e.length;++r){var t=e.charCodeAt(r);t>=55296&&t<=57343&&++r,i+=4}return i}function demangle(e){var i=!!Module.___cxa_demangle;if(i)try{var r=_malloc(e.length);writeStringToMemory(e.substr(1),r);var t=_malloc(4),a=Module.___cxa_demangle(r,0,0,t);if(0===getValue(t,"i32")&&a)return Pointer_stringify(a)}catch(e){}finally{r&&_free(r),t&&_free(t),a&&_free(a)}var f=3,n={v:"void",b:"bool",c:"char",s:"short",i:"int",l:"long",f:"float",d:"double",w:"wchar_t",a:"signed char",h:"unsigned char",t:"unsigned short",j:"unsigned int",m:"unsigned long",x:"long long",y:"unsigned long long",z:"..."},l=[],o=!0;var s=e;try{if("Object._main"==e||"_main"==e)return"main()";if("number"==typeof e&&(e=Pointer_stringify(e)),"_"!==e[0])return e;if("_"!==e[1])return e;if("Z"!==e[2])return e;switch(e[3]){case"n":return"operator new()";case"d":return"operator delete()"}s=function i(r,t,a){t=t||1/0;var s,u="",c=[];if("N"===e[f]){if(s=function(){"K"===e[++f]&&f++;for(var i=[];"E"!==e[f];)if("S"!==e[f])if("C"!==e[f]){var r=parseInt(e.substr(f)),t=r.toString().length;if(!r||!t){f--;break}var a=e.substr(f+t,r);i.push(a),l.push(a),f+=t+r}else i.push(i[i.length-1]),f+=2;else{f++;var n=e.indexOf("_",f),o=e.substring(f,n)||0;i.push(l[o]||"?"),f=n+1}return f++,i}().join("::"),0==--t)return r?[s]:s}else if(("K"===e[f]||o&&"L"===e[f])&&f++,k=parseInt(e.substr(f))){var d=k.toString().length;s=e.substr(f+d,k),f+=d+k}if(o=!1,"I"===e[f]){f++;var h=i(!0);u+=i(!0,1,!0)[0]+" "+s+"<"+h.join(", ")+">"}else u=s;e:for(;f<e.length&&t-- >0;){var b=e[f++];if(b in n)c.push(n[b]);else switch(b){case"P":c.push(i(!0,1,!0)[0]+"*");break;case"R":c.push(i(!0,1,!0)[0]+"&");break;case"L":f++;var k=e.indexOf("E",f)-f;c.push(e.substr(f,k)),f+=k+2;break;case"A":if(k=parseInt(e.substr(f)),f+=k.toString().length,"_"!==e[f])throw"?";f++,c.push(i(!0,1,!0)[0]+" ["+k+"]");break;case"E":break e;default:u+="?"+b;break e}}return a||1!==c.length||"void"!==c[0]||(c=[]),r?(u&&c.push(u+"?"),c):u+"("+c.join(", ")+")"}()}catch(e){s+="?"}return s.indexOf("?")>=0&&!i&&Runtime.warnOnce("warning: a problem occurred in builtin C++ name demangling; build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling"),s}function demangleAll(e){return e.replace(/__Z[\w\d_]+/g,function(e){var i=demangle(e);return e===i?e:e+" ["+i+"]"})}function jsStackTrace(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(i){e=i}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function stackTrace(){return demangleAll(jsStackTrace())}Module.ALLOC_NORMAL=ALLOC_NORMAL,Module.ALLOC_STACK=ALLOC_STACK,Module.ALLOC_STATIC=ALLOC_STATIC,Module.ALLOC_DYNAMIC=ALLOC_DYNAMIC,Module.ALLOC_NONE=ALLOC_NONE,Module.allocate=allocate,Module.getMemory=getMemory,Module.Pointer_stringify=Pointer_stringify,Module.AsciiToString=AsciiToString,Module.stringToAscii=stringToAscii,Module.UTF8ArrayToString=UTF8ArrayToString,Module.UTF8ToString=UTF8ToString,Module.stringToUTF8Array=stringToUTF8Array,Module.stringToUTF8=stringToUTF8,Module.lengthBytesUTF8=lengthBytesUTF8,Module.UTF16ToString=UTF16ToString,Module.stringToUTF16=stringToUTF16,Module.lengthBytesUTF16=lengthBytesUTF16,Module.UTF32ToString=UTF32ToString,Module.stringToUTF32=stringToUTF32,Module.lengthBytesUTF32=lengthBytesUTF32,Module.stackTrace=stackTrace;var PAGE_SIZE=4096,HEAP,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function alignMemoryPage(e){return e%4096>0&&(e+=4096-e%4096),e}var STATIC_BASE=0,STATICTOP=0,staticSealed=!1,STACK_BASE=0,STACKTOP=0,STACK_MAX=0,DYNAMIC_BASE=0,DYNAMICTOP=0;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which adjusts the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}for(var TOTAL_STACK=Module.TOTAL_STACK||5242880,TOTAL_MEMORY=Module.TOTAL_MEMORY||268435456,totalMemory=65536,buffer;totalMemory<TOTAL_MEMORY||totalMemory<2*TOTAL_STACK;)totalMemory<16777216?totalMemory*=2:totalMemory+=16777216;function callRuntimeCallbacks(e){for(;e.length>0;){var i=e.shift();if("function"!=typeof i){var r=i.func;"number"==typeof r?void 0===i.arg?Runtime.dynCall("v",r):Runtime.dynCall("vi",r,[i.arg]):r(void 0===i.arg?null:i.arg)}else i()}}totalMemory!==TOTAL_MEMORY&&(TOTAL_MEMORY=totalMemory),assert("undefined"!=typeof Int32Array&&"undefined"!=typeof Float64Array&&!!new Int32Array(1).subarray&&!!new Int32Array(1).set,"JS engine does not provide full typed array support"),buffer=new ArrayBuffer(TOTAL_MEMORY),HEAP8=new Int8Array(buffer),HEAP16=new Int16Array(buffer),HEAP32=new Int32Array(buffer),HEAPU8=new Uint8Array(buffer),HEAPU16=new Uint16Array(buffer),HEAPU32=new Uint32Array(buffer),HEAPF32=new Float32Array(buffer),HEAPF64=new Float64Array(buffer),HEAP32[0]=255,assert(255===HEAPU8[0]&&0===HEAPU8[3],"Typed arrays 2 must be run on a little-endian system"),Module.HEAP=HEAP,Module.buffer=buffer,Module.HEAP8=HEAP8,Module.HEAP16=HEAP16,Module.HEAP32=HEAP32,Module.HEAPU8=HEAPU8,Module.HEAPU16=HEAPU16,Module.HEAPU32=HEAPU32,Module.HEAPF32=HEAPF32,Module.HEAPF64=HEAPF64;var __ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATEXIT__=[],__ATPOSTRUN__=[],runtimeInitialized=!1,runtimeExited=!1;function preRun(){if(Module.preRun)for("function"==typeof Module.preRun&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){runtimeInitialized||(runtimeInitialized=!0,callRuntimeCallbacks(__ATINIT__))}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__),runtimeExited=!0}function postRun(){if(Module.postRun)for("function"==typeof Module.postRun&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(e){__ATPRERUN__.unshift(e)}function addOnInit(e){__ATINIT__.unshift(e)}function addOnPreMain(e){__ATMAIN__.unshift(e)}function addOnExit(e){__ATEXIT__.unshift(e)}function addOnPostRun(e){__ATPOSTRUN__.unshift(e)}function intArrayFromString(e,i,r){var t=r>0?r:lengthBytesUTF8(e)+1,a=new Array(t),f=stringToUTF8Array(e,a,0,a.length);return i&&(a.length=f),a}function intArrayToString(e){for(var i=[],r=0;r<e.length;r++){var t=e[r];t>255&&(t&=255),i.push(String.fromCharCode(t))}return i.join("")}function writeStringToMemory(e,i,r){for(var t=intArrayFromString(e,r),a=0;a<t.length;){var f=t[a];HEAP8[i+a>>0]=f,a+=1}}function writeArrayToMemory(e,i){for(var r=0;r<e.length;r++)HEAP8[i++>>0]=e[r]}function writeAsciiToMemory(e,i,r){for(var t=0;t<e.length;++t)HEAP8[i++>>0]=e.charCodeAt(t);r||(HEAP8[i>>0]=0)}function unSign(e,i,r){return e>=0?e:i<=32?2*Math.abs(1<<i-1)+e:Math.pow(2,i)+e}function reSign(e,i,r){if(e<=0)return e;var t=i<=32?Math.abs(1<<i-1):Math.pow(2,i-1);return e>=t&&(i<=32||e>t)&&(e=-2*t+e),e}Module.addOnPreRun=addOnPreRun,Module.addOnInit=addOnInit,Module.addOnPreMain=addOnPreMain,Module.addOnExit=addOnExit,Module.addOnPostRun=addOnPostRun,Module.intArrayFromString=intArrayFromString,Module.intArrayToString=intArrayToString,Module.writeStringToMemory=writeStringToMemory,Module.writeArrayToMemory=writeArrayToMemory,Module.writeAsciiToMemory=writeAsciiToMemory,Math.imul&&-5===Math.imul(4294967295,5)||(Math.imul=function(e,i){var r=65535&e,t=65535&i;return r*t+((e>>>16)*t+r*(i>>>16)<<16)|0}),Math.imul=Math.imul,Math.clz32||(Math.clz32=function(e){e>>>=0;for(var i=0;i<32;i++)if(e&1<<31-i)return i;return 32}),Math.clz32=Math.clz32;var Math_abs=Math.abs,Math_cos=Math.cos,Math_sin=Math.sin,Math_tan=Math.tan,Math_acos=Math.acos,Math_asin=Math.asin,Math_atan=Math.atan,Math_atan2=Math.atan2,Math_exp=Math.exp,Math_log=Math.log,Math_sqrt=Math.sqrt,Math_ceil=Math.ceil,Math_floor=Math.floor,Math_pow=Math.pow,Math_imul=Math.imul,Math_fround=Math.fround,Math_min=Math.min,Math_clz32=Math.clz32,runDependencies=0,runDependencyWatcher=null,dependenciesFulfilled=null;function getUniqueRunDependency(e){return e}function addRunDependency(e){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies)}function removeRunDependency(e){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),0==runDependencies&&(null!==runDependencyWatcher&&(clearInterval(runDependencyWatcher),runDependencyWatcher=null),dependenciesFulfilled)){var i=dependenciesFulfilled;dependenciesFulfilled=null,i()}}Module.addRunDependency=addRunDependency,Module.removeRunDependency=removeRunDependency,Module.preloadedImages={},Module.preloadedAudios={};var memoryInitializer=null,ASM_CONSTS=[function(e,i,r,t){artoolkit.multiEachMarkerInfo||(artoolkit.multiEachMarkerInfo={});var a=artoolkit.multiEachMarkerInfo;a.visible=e,a.pattId=i,a.pattType=r,a.width=t},function(e,i,r,t,a,f,n,l,o,s,u,c,d,h,b,k,w,_,m,p,E,v,S,g,y,M,A,T,F,R,O,P,C){var N=arguments,D=12;Module.markerInfo||(Module.markerInfo={pos:[0,0],line:[[0,0,0],[0,0,0],[0,0,0],[0,0,0]],vertex:[[0,0],[0,0],[0,0],[0,0]]});var I=Module.markerInfo;I.area=e,I.id=i,I.idPatt=r,I.idMatrix=t,I.dir=a,I.dirPatt=f,I.dirMatrix=n,I.cf=l,I.cfPatt=o,I.cfMatrix=s,I.pos[0]=u,I.pos[1]=c,I.line[0][0]=N[D++],I.line[0][1]=N[D++],I.line[0][2]=N[D++],I.line[1][0]=N[D++],I.line[1][1]=N[D++],I.line[1][2]=N[D++],I.line[2][0]=N[D++],I.line[2][1]=N[D++],I.line[2][2]=N[D++],I.line[3][0]=N[D++],I.line[3][1]=N[D++],I.line[3][2]=N[D++],I.vertex[0][0]=N[D++],I.vertex[0][1]=N[D++],I.vertex[1][0]=N[D++],I.vertex[1][1]=N[D++],I.vertex[2][0]=N[D++],I.vertex[2][1]=N[D++],I.vertex[3][0]=N[D++],I.vertex[3][1]=N[D++],I.errorCorrected=N[D++]},function(e,i,r,t,a){Module.frameMalloc||(Module.frameMalloc={});var f=Module.frameMalloc;f.framepointer=i,f.framesize=r,f.camera=t,f.transform=a}];function _emscripten_asm_const_33(e,i,r,t,a,f,n,l,o,s,u,c,d,h,b,k,w,_,m,p,E,v,S,g,y,M,A,T,F,R,O,P,C,N){return ASM_CONSTS[e](i,r,t,a,f,n,l,o,s,u,c,d,h,b,k,w,_,m,p,E,v,S,g,y,M,A,T,F,R,O,P,C,N)}function _emscripten_asm_const_4(e,i,r,t,a){return ASM_CONSTS[e](i,r,t,a)}function _emscripten_asm_const_5(e,i,r,t,a,f){return ASM_CONSTS[e](i,r,t,a,f)}STATIC_BASE=8,STATICTOP=STATIC_BASE+16496,__ATINIT__.push({func:function(){__GLOBAL__sub_I_ARToolKitJS_cpp()}},{func:function(){__GLOBAL__sub_I_bind_cpp()}}),allocate([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,52,9,0,0,53,42,0,0,0,0,0,0,1,0,0,0,128,1,0,0,0,0,0,0,228,8,0,0,116,42,0,0,52,9,0,0,136,47,0,0,0,0,0,0,1,0,0,0,128,1,0,0,0,0,0,0,52,9,0,0,73,47,0,0,0,0,0,0,1,0,0,0,128,1,0,0,0,0,0,0,228,8,0,0,54,47,0,0,228,8,0,0,23,47,0,0,228,8,0,0,62,46,0,0,228,8,0,0,31,46,0,0,228,8,0,0,0,46,0,0,228,8,0,0,225,45,0,0,228,8,0,0,194,45,0,0,228,8,0,0,93,46,0,0,228,8,0,0,124,46,0,0,228,8,0,0,155,46,0,0,228,8,0,0,186,46,0,0,228,8,0,0,217,46,0,0,228,8,0,0,248,46,0,0,12,9,0,0,199,47,0,0,48,2,0,0,0,0,0,0,228,8,0,0,212,47,0,0,228,8,0,0,225,47,0,0,12,9,0,0,238,47,0,0,56,2,0,0,0,0,0,0,12,9,0,0,15,48,0,0,64,2,0,0,0,0,0,0,12,9,0,0,49,48,0,0,64,2,0,0,0,0,0,0,200,8,0,0,89,48,0,0,200,8,0,0,91,48,0,0,200,8,0,0,93,48,0,0,200,8,0,0,95,48,0,0,200,8,0,0,97,48,0,0,200,8,0,0,99,48,0,0,200,8,0,0,101,48,0,0,200,8,0,0,103,48,0,0,200,8,0,0,105,48,0,0,200,8,0,0,107,48,0,0,200,8,0,0,109,48,0,0,200,8,0,0,111,48,0,0,200,8,0,0,113,48,0,0,12,9,0,0,115,48,0,0,80,2,0,0,0,0,0,0,12,9,0,0,152,48,0,0,80,2,0,0,0,0,0,0,255,15,0,0,6,16,0,0,18,16,0,0,28,16,0,0,255,255,255,255,255,255,255,255,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,255,255,255,255,0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,255,255,255,255,255,255,255,255,255,255,255,255,1,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,3,0,0,0,6,0,0,0,12,0,0,0,11,0,0,0,5,0,0,0,10,0,0,0,7,0,0,0,14,0,0,0,15,0,0,0,13,0,0,0,9,0,0,0,1,0,0,0,2,0,0,0,4,0,0,0,8,0,0,0,16,0,0,0,32,0,0,0,64,0,0,0,3,0,0,0,6,0,0,0,12,0,0,0,24,0,0,0,48,0,0,0,96,0,0,0,67,0,0,0,5,0,0,0,10,0,0,0,20,0,0,0,40,0,0,0,80,0,0,0,35,0,0,0,70,0,0,0,15,0,0,0,30,0,0,0,60,0,0,0,120,0,0,0,115,0,0,0,101,0,0,0,73,0,0,0,17,0,0,0,34,0,0,0,68,0,0,0,11,0,0,0,22,0,0,0,44,0,0,0,88,0,0,0,51,0,0,0,102,0,0,0,79,0,0,0,29,0,0,0,58,0,0,0,116,0,0,0,107,0,0,0,85,0,0,0,41,0,0,0,82,0,0,0,39,0,0,0,78,0,0,0,31,0,0,0,62,0,0,0,124,0,0,0,123,0,0,0,117,0,0,0,105,0,0,0,81,0,0,0,33,0,0,0,66,0,0,0,7,0,0,0,14,0,0,0,28,0,0,0,56,0,0,0,112,0,0,0,99,0,0,0,69,0,0,0,9,0,0,0,18,0,0,0,36,0,0,0,72,0,0,0,19,0,0,0,38,0,0,0,76,0,0,0,27,0,0,0,54,0,0,0,108,0,0,0,91,0,0,0,53,0,0,0,106,0,0,0,87,0,0,0,45,0,0,0,90,0,0,0,55,0,0,0,110,0,0,0,95,0,0,0,61,0,0,0,122,0,0,0,119,0,0,0,109,0,0,0,89,0,0,0,49,0,0,0,98,0,0,0,71,0,0,0,13,0,0,0,26,0,0,0,52,0,0,0,104,0,0,0,83,0,0,0,37,0,0,0,74,0,0,0,23,0,0,0,46,0,0,0,92,0,0,0,59,0,0,0,118,0,0,0,111,0,0,0,93,0,0,0,57,0,0,0,114,0,0,0,103,0,0,0,77,0,0,0,25,0,0,0,50,0,0,0,100,0,0,0,75,0,0,0,21,0,0,0,42,0,0,0,84,0,0,0,43,0,0,0,86,0,0,0,47,0,0,0,94,0,0,0,63,0,0,0,126,0,0,0,127,0,0,0,125,0,0,0,121,0,0,0,113,0,0,0,97,0,0,0,65,0,0,0,255,255,255,255,0,0,0,0,1,0,0,0,4,0,0,0,2,0,0,0,8,0,0,0,5,0,0,0,10,0,0,0,3,0,0,0,14,0,0,0,9,0,0,0,7,0,0,0,6,0,0,0,13,0,0,0,11,0,0,0,12,0,0,0,255,255,255,255,0,0,0,0,1,0,0,0,7,0,0,0,2,0,0,0,14,0,0,0,8,0,0,0,56,0,0,0,3,0,0,0,63,0,0,0,15,0,0,0,31,0,0,0,9,0,0,0,90,0,0,0,57,0,0,0,21,0,0,0,4,0,0,0,28,0,0,0,64,0,0,0,67,0,0,0,16,0,0,0,112,0,0,0,32,0,0,0,97,0,0,0,10,0,0,0,108,0,0,0,91,0,0,0,70,0,0,0,58,0,0,0,38,0,0,0,22,0,0,0,47,0,0,0,5,0,0,0,54,0,0,0,29,0,0,0,19,0,0,0,65,0,0,0,95,0,0,0,68,0,0,0,45,0,0,0,17,0,0,0,43,0,0,0,113,0,0,0,115,0,0,0,33,0,0,0,77,0,0,0,98,0,0,0,117,0,0,0,11,0,0,0,87,0,0,0,109,0,0,0,35,0,0,0,92,0,0,0,74,0,0,0,71,0,0,0,79,0,0,0,59,0,0,0,104,0,0,0,39,0,0,0,100,0,0,0,23,0,0,0,82,0,0,0,48,0,0,0,119,0,0,0,6,0,0,0,126,0,0,0,55,0,0,0,13,0,0,0,30,0,0,0,62,0,0,0,20,0,0,0,89,0,0,0,66,0,0,0,27,0,0,0,96,0,0,0,111,0,0,0,69,0,0,0,107,0,0,0,46,0,0,0,37,0,0,0,18,0,0,0,53,0,0,0,44,0,0,0,94,0,0,0,114,0,0,0,42,0,0,0,116,0,0,0,76,0,0,0,34,0,0,0,86,0,0,0,78,0,0,0,73,0,0,0,99,0,0,0,103,0,0,0,118,0,0,0,81,0,0,0,12,0,0,0,125,0,0,0,88,0,0,0,61,0,0,0,110,0,0,0,26,0,0,0,36,0,0,0,106,0,0,0,93,0,0,0,52,0,0,0,75,0,0,0,41,0,0,0,72,0,0,0,85,0,0,0,80,0,0,0,102,0,0,0,60,0,0,0,124,0,0,0,105,0,0,0,25,0,0,0,40,0,0,0,51,0,0,0,101,0,0,0,84,0,0,0,24,0,0,0,123,0,0,0,83,0,0,0,50,0,0,0,49,0,0,0,122,0,0,0,120,0,0,0,121,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,136,0,0,0,5,0,0,0,144,0,0,0,6,0,0,0,152,0,0,0,9,0,0,0,176,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255,253,255,255,255,254,255,255,255,0,0,0,0,112,2,0,0,168,2,0,0,200,2,0,0,112,2,0,0,168,2,0,0,168,2,0,0,208,2,0,0,168,2,0,0,112,2,0,0,168,2,0,0,208,2,0,0,168,2,0,0,112,2,0,0,168,2,0,0,168,2,0,0,104,1,0,0,168,2,0,0,168,2,0,0,168,2,0,0,168,2,0,0,168,2,0,0,104,1,0,0,168,2,0,0,168,2,0,0,168,2,0,0,168,2,0,0,168,2,0,0,168,2,0,0,0,0,0,0,32,2,0,0,1,0,0,0,2,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,96,2,0,0,3,0,0,0,4,0,0,0,5,0,0,0,6,0,0,0,1,0,0,0,0,0,0,0,80,2,0,0,3,0,0,0,7,0,0,0,5,0,0,0,6,0,0,0,2,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,216,2,0,0,3,0,0,0,8,0,0,0,5,0,0,0,6,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,2,0,0,0,0,0,0,0,232,2,0,0,3,0,0,0,9,0,0,0,5,0,0,0,6,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,1