(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["filebrowser-CameraBrowser"],{8128:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.CameraBrowser = function( options ) {\n\n\t\tGlobal.addCss( 'global/widgets/filebrowser/TImageBrowser.css' );\n\t\tvar opts = $.extend( {}, $.fn.CameraBrowser.defaults, options );\n\n\t\tvar $this = this;\n\t\tvar field;\n\n\t\tvar enabled = true;\n\t\tvar video = null;\n\t\tvar canvas = null;\n\n\t\tvar local_stream = null;\n\n\t\tthis.stopCamera = function() {\n\n\t\t\tif ( local_stream ) {\n\t\t\t\tif ( local_stream.stop ) {\n\t\t\t\t\t// This is the legacy method to stop video.\n\t\t\t\t\tlocal_stream.stop();\n\t\t\t\t} else if ( local_stream.getTracks ) {\n\t\t\t\t\t// This is the modern approach for stopping the video. https://developer.mozilla.org/en-US/docs/Web/API/MediaStreamTrack/stop\n\t\t\t\t\tlocal_stream.getTracks().forEach( track => track.stop() );\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tthis.showCamera = function() {\n\n\t\t\t// check for getUserMedia support\n\t\t\tnavigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;\n\t\t\tif ( navigator.mediaDevices && navigator.mediaDevices.getUserMedia ) {\n\t\t\t\t// Most up to date as of May 2020 (Aside from using async and await) https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\n\n\t\t\t\t// get webcam feed if available\n\t\t\t\tnavigator.mediaDevices.getUserMedia( { video: true } )\n\t\t\t\t\t.then(function(stream) {\n\t\t\t\t\t\tif ('srcObject' in video) {\n\t\t\t\t\t\t\tvideo.srcObject = stream;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// Fallback for older browsers. https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/srcObject#Supporting_fallback_to_the_src_property\n\t\t\t\t\t\t\tvideo.src = URL.createObjectURL( stream );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvideo.play();\n\t\t\t\t\t\tlocal_stream = stream;\n\t\t\t\t\t})\n\t\t\t\t\t.catch(function(err) {\n\t\t\t\t\t\terrorBack();\n\t\t\t\t\t});\n\t\t\t} else if ( navigator.getUserMedia ) {\n\t\t\t\t// Semi-deprecated, legacy, but still works. https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia\n\n\t\t\t\t// get webcam feed if available\n\t\t\t\tnavigator.getUserMedia( { video: true }, function( stream ) {\n\t\t\t\t\tif ('srcObject' in video) {\n\t\t\t\t\t\tvideo.srcObject = stream;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Fallback for older browsers. https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/srcObject#Supporting_fallback_to_the_src_property\n\t\t\t\t\t\tvideo.src = URL.createObjectURL( stream );\n\t\t\t\t\t}\n\t\t\t\t\tvideo.play();\n\t\t\t\t\tlocal_stream = stream;\n\t\t\t\t}, errorBack );\n\t\t\t} else if ( navigator.webkitGetUserMedia ) { // WebKit-prefixed\n\t\t\t\tnavigator.webkitGetUserMedia( { video: true }, function( stream ) {\n\t\t\t\t\tvideo.src = window.webkitURL.createObjectURL( stream );\n\t\t\t\t\tvideo.play();\n\t\t\t\t\tlocal_stream = stream;\n\t\t\t\t}, errorBack );\n\t\t\t} else if ( navigator.mozGetUserMedia ) { // Firefox-prefixed\n\t\t\t\tnavigator.mozGetUserMedia( { video: true }, function( stream ) {\n\t\t\t\t\tvideo.src = window.URL.createObjectURL( stream );\n\t\t\t\t\tvideo.play();\n\t\t\t\t\tlocal_stream = stream;\n\t\t\t\t}, errorBack );\n\t\t\t} else {\n\t\t\t\terrorBack();\n\t\t\t}\n\n\t\t\tfunction errorBack() {\n\t\t\t\tTAlertManager.showAlert( $.i18n._( 'Unable to access Camera.

Please check your camera connections, permissions, and ensure you are using HTTPS. Alternatively, use the File upload method instead.' ) );\n\t\t\t}\n\t\t};\n\n\t\tthis.setEnable = function( val ) {\n\t\t\tenabled = val;\n\n\t\t\tvar btn = this.children().eq( 1 );\n\n\t\t\tif ( !val ) {\n\t\t\t\tbtn.attr( 'disabled', true );\n\t\t\t\tbtn.removeClass( 'disable-element' ).addClass( 'disable-element' );\n\t\t\t} else {\n\t\t\t\tbtn.removeAttr( 'disabled' );\n\t\t\t\tbtn.removeClass( 'disable-element' );\n\t\t\t}\n\n\t\t};\n\n\t\tthis.clearErrorStyle = function() {\n\n\t\t};\n\n\t\tthis.getField = function() {\n\t\t\treturn field;\n\t\t};\n\n\t\tthis.getValue = function() {\n\t\t\treturn false;\n\t\t};\n\n\t\tthis.getFileName = function() {\n\t\t\treturn 'camera_stream.png';\n\t\t};\n\n\t\tthis.getImageSrc = function() {\n\t\t\treturn canvas[0].toDataURL();\n\t\t};\n\n\t\tthis.setImage = function( val ) {\n\t\t\tvar image = $this.children().eq( 0 );\n\n\t\t\tif ( !val ) {\n\t\t\t\timage.attr( 'src', '' );\n\t\t\t\timage.hide();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar d = new Date();\n\t\t\timage.hide();\n\t\t\timage.attr( 'src', val + '&t=' + d.getTime() );\n\t\t\timage.css( 'height', 'auto' );\n\t\t\timage.css( 'width', 'auto' );\n\n\t\t};\n\n\t\tthis.onImageLoad = function( image ) {\n\n//\t\t\tvar image_height = $( image ).height() > 0 ? $( image ).height() : image.naturalHeight;\n//\t\t\tvar image_width = $( image ).width() > 0 ? $( image ).width() : image.naturalWidth;\n//\n//\t\t\tif ( image_height > default_height ) {\n//\t\t\t\t$( image ).css( 'height', default_height );\n//\n//\t\t\t}\n//\n//\t\t\tif ( image_width > default_width ) {\n//\t\t\t\t$( image ).css( 'width', default_width );\n//\n//\t\t\t\t$( image ).css( 'height', 'auto' );\n//\t\t\t}\n//\n//\t\t\t$this.trigger( 'setSize' );\n\n\t\t\t$( image ).show();\n\n\t\t};\n\n\t\tthis.setValue = function( val ) {\n\n\t\t\tif ( !val ) {\n\t\t\t\tval = '';\n\t\t\t}\n\n\t\t};\n\n\t\tthis.each( function() {\n\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t\tfield = o.field;\n\n\t\t\tvar $$this = this;\n\n\t\t\tvideo = $( this ).children().eq( 0 ).children().eq( 0 )[0];\n\t\t\tcanvas = $( this ).children().eq( 0 ).children().eq( 1 );\n\n\t\t\tvar take_picture = $( this ).children().eq( 1 ).children().eq( 0 );\n\t\t\tvar try_again = $( this ).children().eq( 1 ).children().eq( 1 );\n\n\t\t\t// Set initial states of the buttons.\n\t\t\ttake_picture.prop( 'disabled', false );\n\t\t\ttry_again.prop( 'disabled', true );\n\n\t\t\ttake_picture.bind( 'click', function() {\n\t\t\t\ttake_picture.prop( 'disabled', true );\n\t\t\t\ttry_again.prop( 'disabled', false );\n\t\t\t\t// Global.glowAnimation.start(); // not needed here as its triggered in UserPhotoWizardController.buildCurrentStepUI()\n\n\t\t\t\t// flash the photo area to indicate a picture has been taken.\n\t\t\t\tcanvas.parent().addClass( 'flash' );\n\n\t\t\t\tsetTimeout( function(){\n\t\t\t\t\tcanvas.parent().removeClass( 'flash' );\n\t\t\t\t}, 1000);\t// Timeout must be the same length as the CSS3 transition or longer (or you'll mess up the transition)\n\n\t\t\t\t// handle picture taking\n\t\t\t\tvar ctx = canvas[0].getContext( '2d' );\n\t\t\t\tctx.drawImage( video, 0, 0, 400, 300 );\n\t\t\t\tcanvas.css( 'z-index', 51 );\n\n\t\t\t\t$this.trigger( 'change', [$this] );\n\t\t\t} );\n\n\t\t\ttry_again.bind( 'click', function() {\n\t\t\t\ttake_picture.prop( 'disabled', false );\n\t\t\t\ttry_again.prop( 'disabled', true );\n\t\t\t\tGlobal.glowAnimation.stop();\n\n\t\t\t\tcanvas.css( 'z-index', -1 );\n\n\t\t\t\t$this.trigger( 'NoImageChange', [$this] );\n\t\t\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