1 line
77 KiB
JavaScript
1 line
77 KiB
JavaScript
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["document-DocumentViewController","filebrowser-TImage","filebrowser-TImageBrowser"],{1469:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.TImage = function( options ) {\n\n\t\tGlobal.addCss( 'global/widgets/filebrowser/TImageBrowser.css' );\n\t\tvar opts = $.extend( {}, $.fn.TImage.defaults, options );\n\n\t\tvar $this = this;\n\t\tvar field;\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 null;\n\t\t};\n\n\t\tthis.setValue = function( val ) {\n\t\t\tif ( !val ) {\n\t\t\t\tthis.attr( 'src', '' );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvar d = new Date();\n\t\t\tthis.attr( 'src', val + '&t=' + d.getTime() );\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} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.TImage.defaults = {};\n\n\t$( document ).on( 'mouseover', '.file-browser img', function( e ) {\n\t\tvar $this_image_widget = $( e.target ).parents( '.file-browser' );\n\n\t\tif ( !$( '.file_browser_overlay' )[0] && $( e.target ).attr( 'enable-delete' ) == 1 ) {\n\t\t\tvar height = $( e.target ).height();\n\t\t\tvar top = ( height - 32 ) / 2;\n\t\t\tvar left = top;\n\n\t\t\tvar file_browser_overlay = $( '<div class=\"file_browser_overlay\"><img src=\"theme/default/images/delete-512.png\" style=\"position:absolute;width:32px;height:32px;top:' + top + 'px;left:' + left + 'px;\"></div>' );\n\t\t\tfile_browser_overlay.css( 'position', 'absolute' );\n\t\t\tfile_browser_overlay.css( 'top', '0px' );\n\t\t\tfile_browser_overlay.css( 'left', '0' );\n\t\t\tfile_browser_overlay.css( 'cursor', 'pointer' );\n\t\t\tfile_browser_overlay.css( 'height', height + 'px' );\n\t\t\tfile_browser_overlay.css( 'width', '100%' );\n\t\t\tfile_browser_overlay.css( 'background', 'rgba(255,255,255,0.85)' );\n\n\t\t\t$( e.target ).parents( '.file-browser' ).append( file_browser_overlay );\n\n\t\t\t$( document ).on( 'click', '.file_browser_overlay', function( e ) {\n\t\t\t\tvar img_src = $( e.target ).parent().find( 'img' ).attr( 'src' );\n\t\t\t\tTAlertManager.showConfirmAlert( $.i18n._( 'This will permanently delete the image. Are you sure?' ), '', function( flag ) {\n\t\t\t\t\tif ( flag ) {\n\t\t\t\t\t\tvar e = { type: 'deleteClick', message: 'Delete image clicked.', time: new Date() };\n\t\t\t\t\t\t$this_image_widget.trigger( e );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} );\n\n\t\t\t$( document ).on( 'mouseleave', '.file-browser', function() {\n\t\t\t\t$( document ).off( 'click', '.file_browser_overlay' );\n\t\t\t\tif ( $( '.file_browser_overlay' )[0] ) {\n\t\t\t\t\tvar file_browser_overlay = $( this ).find( '.file_browser_overlay' );\n\t\t\t\t\tfile_browser_overlay.off().remove();\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t} );\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTQ2OS5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7O0FBRUE7QUFDQSx5QkFBeUI7O0FBRXpCO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQSxnQ0FBZ0M7O0FBRWhDOztBQUVBLElBQUk7O0FBRUo7O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0XHRcdFRBbGVydE1hbmFnZXIuc2hvd0NvbmZpcm1BbGVydCggJC5pMThuLl8oICdUaGlzIHdpbGwgcGVybWFuZW50bHkgZGVsZXRlIHRoZSBpbWFnZS4gQXJlIHlvdSBzdXJlPycgKSwgJycsIGZ1bmN0aW9uKCBmbGFnICkge1xuXHRcdFx0XHRcdGlmICggZmxhZyApIHtcblx0XHRcdFx0XHRcdHZhciBlID0geyB0eXBlOiAnZGVsZXRlQ2xpY2snLCBtZXNzYWdlOiAnRGVsZXRlIGltYWdlIGNsaWNrZWQuJywgdGltZTogbmV3IERhdGUoKSB9O1xuXHRcdFx0XHRcdFx0JHRoaXNfaW1hZ2Vfd2lkZ2V0LnRyaWdnZXIoIGUgKTtcblx0XHRcdFx0XHR9XG5cdFx0XHRcdH0gKTtcblx0XHRcdH0gKTtcblxuXHRcdFx0JCggZG9jdW1lbnQgKS5vbiggJ21vdXNlbGVhdmUnLCAnLmZpbGUtYnJvd3NlcicsIGZ1bmN0aW9uKCkge1xuXHRcdFx0XHQkKCBkb2N1bWVudCApLm9mZiggJ2NsaWNrJywgJy5maWxlX2Jyb3dzZXJfb3ZlcmxheScgKTtcblx0XHRcdFx0aWYgKCAkKCAnLmZpbGVfYnJvd3Nlcl9vdmVybGF5JyApWzBdICkge1xuXHRcdFx0XHRcdHZhciBmaWxlX2Jyb3dzZXJfb3ZlcmxheSA9ICQoIHRoaXMgKS5maW5kKCAnLmZpbGVfYnJvd3Nlcl9vdmVybGF5JyApO1xuXHRcdFx0XHRcdGZpbGVfYnJvd3Nlcl9vdmVybGF5Lm9mZigpLnJlbW92ZSgpO1xuXHRcdFx0XHR9XG5cdFx0XHR9ICk7XG5cdFx0fVxuXHR9ICk7XG5cbn0gKSggalF1ZXJ5ICk7Il0sIm5hbWVzIjpbXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///1469\n")},8326:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.TImageBrowser = function( options ) {\n\t\tGlobal.addCss( 'global/widgets/filebrowser/TImageBrowser.css' );\n\t\tvar opts = $.extend( {}, $.fn.TImageBrowser.defaults, options );\n\n\t\tvar $this = this;\n\t\tvar field;\n\t\tvar id = 'file_browser';\n\t\tvar name = 'filedata';\n\t\tvar browser;\n\n\t\tvar accept_filter = '';\n\n\t\tvar default_width = 177;\n\t\tvar default_height = 42;\n\t\tvar enabled = true;\n\n\t\tthis.setEnabled = function( val ) {\n\t\t\tenabled = val;\n\n\t\t\tvar btn = this.find( '.browser-form input' );\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.getFileName = function() {\n\n\t\t\treturn browser.val();\n\t\t};\n\n\t\tthis.getField = function() {\n\t\t\treturn field;\n\t\t};\n\n\t\tthis.setEnableDelete = function( val ) {\n\t\t\tvar image = $this.find( '.image' );\n\t\t\tif ( !val ) {\n\t\t\t\timage.removeAttr( 'enable-delete' );\n\t\t\t\treturn;\n\t\t\t} else {\n\t\t\t\timage.attr( 'enable-delete', 1 );\n\t\t\t}\n\t\t};\n\n\t\tthis.getValue = function() {\n\t\t\tvar form_data;\n\t\t\tif ( browser && browser.val() ) {\n\n\t\t\t\tif ( typeof FormData == 'undefined' ) {\n\t\t\t\t\tform_data = $this.find( '.browser-form' );\n\t\t\t\t} else {\n\t\t\t\t\tform_data = new FormData( $( $this.find( '.browser-form' ) )[0] );\n\t\t\t\t}\n\n\t\t\t} else {\n\n\t\t\t\tform_data = null;\n\t\t\t}\n\n\t\t\treturn form_data;\n\t\t};\n\n\t\tthis.getImageSrc = function() {\n\t\t\tvar image = $this.find( '.image' );\n\t\t\treturn image.attr( 'src' );\n\t\t};\n\n\t\tthis.setImage = function( val ) {\n\t\t\tvar image = $this.find( '.image' );\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\tvar 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\t\t\t\t$( image ).css( 'height', 'auto' );\n\t\t\t}\n\n\t\t\t$this.trigger( 'setSize' );\n\n\t\t\tif ( image_height < 5 ) {\n\t\t\t\t$( image ).hide();\n\t\t\t} else {\n\t\t\t\t$( image ).show();\n\t\t\t}\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\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t\tfield = o.field;\n\n\t\t\t// var $this = this;\n\n\t\t\tif ( o.default_width > 0 ) {\n\t\t\t\tdefault_width = o.default_width;\n\t\t\t}\n\n\t\t\tif ( o.default_height > 0 ) {\n\t\t\t\tdefault_height = o.default_height;\n\t\t\t}\n\n\t\t\tif ( Global.isSet( o.name ) ) {\n\t\t\t\tname = o.name;\n\t\t\t}\n\n\t\t\tif ( Global.isSet( accept_filter ) ) {\n\t\t\t\taccept_filter = o.accept_filter;\n\t\t\t}\n\n\t\t\tbrowser = $( this ).find( '.browser' );\n\t\t\tvar image = $( this ).find( '.image' );\n\t\t\timage.hide();\n\t\t\timage.on( 'load', function() {\n\t\t\t\tonImageLoad( this );\n\n\t\t\t} );\n\n\t\t\tif ( accept_filter ) {\n\t\t\t\tbrowser.attr( 'accept', accept_filter );\n\t\t\t} else {\n\t\t\t\taccept_filter = 'image/*';\n\t\t\t\tbrowser.attr( 'accept', 'image/*' );\n\t\t\t}\n\n\t\t\tbrowser.attr( 'id', id );\n\t\t\tbrowser.attr( 'name', name );\n\n\t\t\tif ( Global.isSet( o.changeHandler ) ) {\n\n\t\t\t\t$this.bind( 'imageChange', o.changeHandler );\n\t\t\t}\n\t\t\tif ( Global.isSet( o.deleteImageHandler ) ) {\n\t\t\t\tthis.find( '.file-browser' ).on( 'deleteClick', function() {\n\t\t\t\t\to.deleteImageHandler();\n\t\t\t\t} );\n\n\t\t\t}\n\n\t\t\tbrowser.bind( 'change', function() {\n\t\t\t\timage.hide();\n\n\t\t\t\tif ( typeof FileReader != 'undefined' ) {\n\n\t\t\t\t\tvar files = !!this.files ? this.files : [];\n\n\t\t\t\t\t// If no files were selected, or no FileReader support, return\n\t\t\t\t\tif ( !files.length || !window.FileReader ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( accept_filter === 'image/*' ) {\n\t\t\t\t\t\t// Create a new instance of the FileReader\n\t\t\t\t\t\tvar reader = new FileReader();\n\n\t\t\t\t\t\t// Read the local file as a DataURL\n\t\t\t\t\t\treader.readAsDataURL( files[0] );\n\n\t\t\t\t\t\t// When loaded, set image data as background of div\n\t\t\t\t\t\treader.onloadend = function() {\n\t\t\t\t\t\t\tvar url = this.result;\n\t\t\t\t\t\t\timage.attr( 'src', url );\n\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t$this.trigger( 'imageChange', [$this] );\n\n\t\t\t} );\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.TImageBrowser.defaults = {};\n\t$.fn.TImageBrowser.html_template = `\n\t<div class=\"file-browser\">\n\t\t<img class=\"image\">\n\t\t<form enctype=\"multipart/form-data\" class=\"browser-form\">\n\t\t\t<input name=\"filedata\" class=\"browser\" type=\"file\"/>\n\t\t</form>\n\t</div>\n\t`;\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODMyNi5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQTtBQUNBLHlCQUF5Qjs7QUFFekI7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBOztBQUVBOztBQUVBOztBQUVBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsTUFBTTtBQUNOO0FBQ0E7O0FBRUEsS0FBSzs7QUFFTDtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBLGdD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2dlciggJ2ltYWdlQ2hhbmdlJywgWyR0aGlzXSApO1xuXG5cdFx0XHR9ICk7XG5cblx0XHR9ICk7XG5cblx0XHRyZXR1cm4gdGhpcztcblxuXHR9O1xuXG5cdCQuZm4uVEltYWdlQnJvd3Nlci5kZWZhdWx0cyA9IHt9O1xuXHQkLmZuLlRJbWFnZUJyb3dzZXIuaHRtbF90ZW1wbGF0ZSA9IGBcblx0PGRpdiBjbGFzcz1cImZpbGUtYnJvd3NlclwiPlxuXHRcdDxpbWcgY2xhc3M9XCJpbWFnZVwiPlxuXHRcdDxmb3JtIGVuY3R5cGU9XCJtdWx0aXBhcnQvZm9ybS1kYXRhXCIgY2xhc3M9XCJicm93c2VyLWZvcm1cIj5cblx0XHRcdDxpbnB1dCBuYW1lPVwiZmlsZWRhdGFcIiBjbGFzcz1cImJyb3dzZXJcIiB0eXBlPVwiZmlsZVwiLz5cblx0XHQ8L2Zvcm0+XG5cdDwvZGl2PlxuXHRgO1xuXG59ICkoIGpRdWVyeSApOyJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///8326\n")},1214:(__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 */ \"DocumentViewController\": () => (/* binding */ DocumentViewController)\n/* harmony export */ });\n/* harmony import */ var _global_widgets_filebrowser_TImage__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1469);\n/* harmony import */ var _global_widgets_filebrowser_TImage__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_global_widgets_filebrowser_TImage__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _global_widgets_filebrowser_TImageBrowser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8326);\n/* harmony import */ var _global_widgets_filebrowser_TImageBrowser__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_global_widgets_filebrowser_TImageBrowser__WEBPACK_IMPORTED_MODULE_1__);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\nclass DocumentViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#document_view_container',\n\n\t\t\t// _required_files: ['TImageBrowser', 'TImage'],\n\n\t\t\tstatus_array: null,\n\t\t\tdocument_group_array: null,\n\n\t\t\tdocument_group_api: null,\n\t\t\tdocument_revision_api: null,\n\t\t\tdocument_attach_api: null,\n\t\t\tsub_document_revision_view_controller: null,\n\t\t\tsub_revision_view_controller: null,\n\n\t\t\tdocument_object_type_id: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'DocumentEditView.html';\n\t\tthis.permission_id = 'document';\n\t\tthis.viewId = 'Document';\n\t\tthis.script_name = 'DocumentView';\n\t\tthis.table_name_key = 'document';\n\t\tthis.context_menu_name = $.i18n._( 'Documents' );\n\t\tthis.navigation_label = $.i18n._( 'Document' );\n\t\tthis.api = TTAPI.APIDocument;\n\t\tthis.document_group_api = TTAPI.APIDocumentGroup;\n\t\tthis.document_revision_api = TTAPI.APIDocumentRevision;\n\t\tthis.document_attach_api = TTAPI.APIDocumentAttachment;\n\n\t\tthis.render();\n\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.buildContextMenu( true );\n\t\t} else {\n\t\t\tthis.buildContextMenu();\n\t\t}\n\n\t\t//call init data in parent view\n\t\tif ( !this.sub_view_mode ) {\n\t\t\tthis.initData();\n\t\t}\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['copy'],\n\t\t\tinclude: [\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Download' ),\n\t\t\t\t\tid: 'download',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'download',\n\t\t\t\t\tsort_order: 100\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'View' ),\n\t\t\t\t\tid: 'view_file',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'download',\n\t\t\t\t\tsort_order: 200\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tsetCustomDefaultMenuIcon( id, context_btn, grid_selected_length ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'download':\n\t\t\tcase 'view_file':\n\t\t\t\tthis.setDefaultMenuDownIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetDefaultMenuDownIcon( context_btn, grid_selected_length, pId ) {\n\n\t\tif ( grid_selected_length === 1 ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\t\tthis.initDropDownOption( 'status' );\n\n\t\tthis.document_group_api.getDocumentGroup( '', false, false, {\n\t\t\tonResult: function( res ) {\n\n\t\t\t\tres = res.getResult();\n\t\t\t\tres = Global.buildTreeRecord( res );\n\n\t\t\t\tif ( !$this.sub_view_mode ) {\n\t\t\t\t\tif ( !$this.sub_view_mode && $this.basic_search_field_ui_dic['group_id'] ) {\n\t\t\t\t\t\t$this.basic_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t\t\t$this.adv_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$this.document_group_array = res;\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetSubViewFilter( filter ) {\n\n\t\tif ( filter.length === 0 ) {\n\t\t\tfilter = {};\n\t\t}\n\n\t\tif ( this.sub_view_mode && Global.isSet( this.document_object_type_id ) ) {\n\t\t\tfilter['object_type_id'] = this.document_object_type_id;\n\t\t}\n\n\t\treturn filter;\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Status' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'status_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Name' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'name',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Description' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'description',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'File Name' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'remote_file_name',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Tags' ),\n\t\t\t\tfield: 'tag',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tin_column: 1,\n\t\t\t\tobject_type_id: 700,\n\t\t\t\tform_item_type: FormItemType.TAG_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Group' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tmultiple: true,\n\t\t\t\tfield: 'group_id',\n\t\t\t\tlayout_name: 'global_tree_column',\n\t\t\t\ttree_mode: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Template' ),\n\t\t\t\tfield: 'template',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tin_column: 2,\n\t\t\t\tform_item_type: FormItemType.CHECKBOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Private' ),\n\t\t\t\tfield: 'private',\n\t\t\t\tbasic_search: ( PermissionManager.validate( 'document', 'view' ) && PermissionManager.validate( 'document', 'view_private' ) ) ? true : false,\n\t\t\t\tadv_search: ( PermissionManager.validate( 'document', 'view' ) && PermissionManager.validate( 'document', 'view_private' ) ) ? true : false,\n\t\t\t\tin_column: 2,\n\t\t\t\tform_item_type: FormItemType.CHECKBOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Attachments' ),\n\t\t\t\tfield: 'is_attachment',\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: ( PermissionManager.validate( 'document', 'view' ) && PermissionManager.validate( 'document', 'view_private' ) && PermissionManager.validate( 'document', 'edit' ) && PermissionManager.validate( 'user', 'edit' ) ) ? true : false, //Require additional permissions other than just document ones to show document attachments.\n\t\t\t\tin_column: 2,\n\t\t\t\tform_item_type: FormItemType.CHECKBOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Created By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'created_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Updated By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'updated_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\t\t];\n\t}\n\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_document': { 'label': $.i18n._( 'Document' ) },\n\t\t\t'tab_revision': {\n\t\t\t\t'label': $.i18n._( 'Revision' ),\n\t\t\t\t'init_callback': 'initSubDocumentRevisionView',\n\t\t\t\t'display_on_mass_edit': false\n\t\t\t},\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIDocument,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_document',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\t//Tab 0 start\n\n\t\tvar tab_document = this.edit_view_tab.find( '#tab_document' );\n\n\t\tvar tab_document_column1 = tab_document.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_document_column1 );\n\n\t\t// Status\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'status_id' } );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_document_column1, '' );\n\n\t\t// Name\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'name', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Name' ), form_item_input, tab_document_column1 );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Revision\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'revision', width: 114 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Revision' ), form_item_input, tab_document_column1, '', null, true );\n\n\t\t// File\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.FILE_BROWSER );\n\n\t\tthis.file_browser = form_item_input.TImageBrowser( { field: 'file', name: 'filedata', accept_filter: '*' } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'File' ), form_item_input, tab_document_column1, '', null, true, true );\n\n\t\t// Group\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\ttree_mode: true,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_tree_column',\n\t\t\tfield: 'group_id',\n\t\t\tset_empty: true\n\t\t} );\n\t\tform_item_input.setSourceData( $this.document_group_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Group' ), form_item_input, tab_document_column1 );\n\n\t\t// Template\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'template' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Template' ), form_item_input, tab_document_column1 );\n\n\t\t// Private\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'private' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Private' ), form_item_input, tab_document_column1 );\n\n\t\t// Description\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'description' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_document_column1, '', null, false, true );\n\n\t\t//Tags\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TAG_INPUT );\n\n\t\tform_item_input.TTagInput( { field: 'tag', object_type_id: 700 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Tags' ), form_item_input, tab_document_column1, '', null, null, true );\n\t}\n\n\tisEditChange() {\n\n\t\tif ( this.current_edit_record.id ) {\n\t\t\tthis.detachElement( 'revision' );\n\t\t\tthis.detachElement( 'file' );\n\t\t} else if ( this.is_mass_editing ) {\n\t\t\tthis.detachElement( 'revision' );\n\t\t\tthis.detachElement( 'file' );\n\t\t} else {\n\t\t\tthis.attachElement( 'revision' );\n\t\t\tthis.attachElement( 'file' );\n\t\t}\n\n\t\tthis.editFieldResize();\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tthis.isEditChange();\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'view_file':\n\t\t\t\tthis.onDownloadClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tdoFormIFrameCall() {\n\t\tvar url = ServiceCaller.getURLByObjectType( 'file_download' ) + '&object_type=document&parent_id=' + this.current_edit_record.id;\n\t\tif ( Global.isSet( this.document_object_type_id ) ) {\n\t\t\turl = url + '&parent_object_type_id=' + this.document_object_type_id;\n\t\t}\n\t\turl = url + '&object_id=' + this.current_edit_record.document_revision_id;\n\n\t\tGlobal.APIFileDownload( null, null, null, url );\n\t}\n\n\tonDownloadClick() {\n\n\t\tvar $this = this;\n\t\tvar url;\n\t\tif ( this.edit_view && this.current_edit_record.id ) {\n\t\t\tthis.doFormIFrameCall();\n\n\t\t} else {\n\t\t\tvar filter = {};\n\t\t\tvar selectedId;\n\t\t\tvar grid_selected_id_array = this.getGridSelectIdArray();\n\t\t\tvar grid_selected_length = grid_selected_id_array.length;\n\t\t\tif ( grid_selected_length > 0 ) {\n\t\t\t\tselectedId = grid_selected_id_array[0];\n\t\t\t}\n\t\t\tfilter.filter_data = {};\n\t\t\tfilter.filter_data.id = [selectedId];\n\t\t\tfilter.filter_data.object_type_id = this.document_object_type_id;\n\n\t\t\tvar result = this.api['get' + this.api.key_name]( filter, { async: false } );\n\n\t\t\tvar result_data = result.getResult();\n\n\t\t\tif ( !result_data ) {\n\t\t\t\tresult_data = [];\n\t\t\t}\n\n\t\t\tresult_data = result_data[0];\n\n\t\t\t$this.current_edit_record = result_data;\n\n\t\t\t$this.doFormIFrameCall();\n\n\t\t}\n\t}\n\n\tgetAPIFilters() {\n\t\tvar filter = super.getAPIFilters();\n\t\tfilter.filter_data.object_type_id = this.document_object_type_id; // Note: On My Account->Documents data.object_type_id is NULL, but this is definately used in other areas, like Edit Employee->Attachments.\n\n\t\treturn filter;\n\t}\n\n\tonAddResult( result ) {\n\t\tvar $this = this;\n\t\tvar result_data = result.getResult();\n\n\t\tif ( !result_data ) {\n\t\t\tresult_data = [];\n\t\t}\n\n\t\tresult_data.company = LocalCacheData.current_company.name;\n\t\tresult_data.revision = '1.0';\n\n\t\tif ( $this.sub_view_mode && $this.parent_key ) {\n\t\t\tresult_data[$this.parent_key] = $this.parent_value;\n\t\t}\n\n\t\t$this.current_edit_record = result_data;\n\t\t$this.initEditView();\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'download':\n\t\t\tcase 'view_file':\n\t\t\t\tthis.onDownloadClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetAttachmentBinding( document_result, super_fun_name ) {\n\t\tvar $this = this;\n\t\tvar document_id = document_result.getResult();\n\n\t\t/* jshint ignore:start */\n\t\tif ( TTUUID.isUUID( document_id ) == false ) {\n\t\t\tsuper[super_fun_name]( document_result );\n\t\t\treturn;\n\t\t}\n\t\t/* jshint ignore:end */\n\n\t\tif ( $this.sub_view_mode ) {\n\t\t\tvar args = {};\n\t\t\targs.object_type_id = $this.document_object_type_id;\n\t\t\targs.object_id = $this.parent_value;\n\t\t\targs.document_id = document_id;\n\t\t\t$this.document_attach_api.setDocumentAttachment( args, {\n\t\t\t\tonResult: () => {\n\t\t\t\t\tsuper[super_fun_name]( document_result );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tsuper[super_fun_name]( document_result );\n\t\t}\n\t}\n\n\thandleSaveResult( document_result, super_fun_name ) {\n\t\tvar document_id = document_result.getResult();\n\t\tvar $this = this;\n\n\t\tvar file_data;\n\n\t\tif ( !$this.current_edit_record.id && !this.is_mass_editing ) {\n\t\t\tfile_data = $this.file_browser.getValue();\n\t\t} else {\n\t\t\tfile_data = null;\n\t\t}\n\n\t\t//Save a document revision data if has upload file, otherwise don't\n\t\tif ( document_result.isValid() == true && file_data ) {\n\t\t\tvar document_revision_record = {};\n\t\t\tdocument_revision_record['document_id'] = document_id;\n\t\t\tdocument_revision_record['revision'] = this.current_edit_record.revision;\n\n\t\t\t$this.document_revision_api['set' + $this.document_revision_api.key_name]( document_revision_record,\n\t\t\t\t{\n\t\t\t\t\tonResult: function( document_revision_result ) {\n\t\t\t\t\t\tif ( document_revision_result.isValid() ) {\n\t\t\t\t\t\t\tvar url = 'object_type=document_revision&object_id=' + document_revision_result.getResult();\n\t\t\t\t\t\t\tif ( Global.isSet( $this.document_object_type_id ) ) {\n\t\t\t\t\t\t\t\turl = url + '&parent_object_type_id=' + $this.document_object_type_id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this.api.uploadFile( file_data, url, {\n\t\t\t\t\t\t\t\tonResult: function( upload_file_result ) {\n\t\t\t\t\t\t\t\t\t$this.setAttachmentBinding( document_result, super_fun_name );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this.api['delete' + $this.api.key_name]( [document_id], {\n\t\t\t\t\t\t\t\tonResult: function() {\n\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\tTAlertManager.showErrorAlert( document_revision_result );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setAttachmentBinding( document_result, super_fun_name );\n\t\t}\n\t}\n\n\t// Dev note: this is not the ideal refactor, as would like to remove the use of 'super_fun_name'\n\t// but its the best quickest most reliable way to refactor this for now.\n\tonSaveResult( result ) {\n\t\treturn this.handleSaveResult( result, 'onSaveResult' );\n\t}\n\n\tonSaveAndContinueResult( result ) {\n\t\treturn this.handleSaveResult( result, 'onSaveAndContinueResult' );\n\t}\n\n\tonSaveAndNewResult( result ) {\n\t\treturn this.handleSaveResult( result, 'onSaveAndNewResult' );\n\t}\n\n\tonSaveAndCopyResult( result ) {\n\t\treturn this.handleSaveResult( result, 'onSaveAndCopyResult' );\n\t}\n\n\tsetCustomEditMenuIcon( id, context_btn ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'download':\n\t\t\tcase 'view_file':\n\t\t\t\tthis.setEditMenuDownloadIcon( context_btn );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetEditMenuDownloadIcon( context_btn, pId ) {\n\t\tif ( !this.current_edit_record || !this.current_edit_record.id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tgetGridSetup() {\n\t\tvar $this = this;\n\t\tvar retval = {\n\t\t\tcontainer_selector: this.sub_view_mode ? '.edit-view-tab-bar' : '.view',\n\t\t\tsub_grid_mode: false,\n\t\t\tonGridResize: true,\n\t\t\tonSelectRow: function() {\n\t\t\t\t$this.onGridSelectRow();\n\t\t\t},\n\t\t\tonCellSelect: function() {\n\t\t\t\t$this.onGridSelectRow();\n\t\t\t},\n\t\t\tonSelectAll: function() {\n\t\t\t\t$this.onGridSelectAll();\n\t\t\t},\n\t\t\tondblClickRow: function( e ) {\n\t\t\t\t$this.onGridDblClickRow( e );\n\t\t\t},\n\t\t\tonRightClickRow: function( rowId ) {\n\t\t\t\tvar id_array = $this.getGridSelectIdArray();\n\t\t\t\tif ( id_array.indexOf( rowId ) < 0 ) {\n\t\t\t\t\t$this.grid.grid.resetSelection();\n\t\t\t\t\t$this.grid.grid.setSelection( rowId );\n\t\t\t\t\t$this.onGridSelectRow();\n\t\t\t\t}\n\t\t\t},\n\t\t\theight: 200\n\t\t};\n\n\t\tif ( this.sub_view_mode ) {\n\t\t\tretval.setGridSize = function() {\n\t\t\t\t$this.baseViewSubTabGridResize( 'tab_attachment' );\n\t\t\t};\n\t\t}\n\n\t\treturn retval;\n\t}\n\n\tremoveEditView() {\n\t\tsuper.removeEditView();\n\n\t\tthis.sub_revision_view_controller = null;\n\t}\n\n\tinitSubDocumentRevisionView() {\n\t\tvar $this = this;\n\n\t\tif ( !this.current_edit_record.id ) {\n\t\t\tTTPromise.resolve( 'BaseViewController', 'onTabShow' ); //Since search() isn't called in this case, and we just display the \"Please Save This Record ...\" message, resolve the promise.\n\t\t\treturn;\n\t\t}\n\n\t\tif ( this.sub_revision_view_controller ) {\n\t\t\tthis.sub_revision_view_controller.buildContextMenu( true );\n\t\t\tthis.sub_revision_view_controller.setDefaultMenu();\n\t\t\t$this.sub_revision_view_controller.parent_key = 'document_id';\n\t\t\t$this.sub_revision_view_controller.parent_value = $this.current_edit_record.id;\n\t\t\t$this.sub_revision_view_controller.parent_edit_record = $this.current_edit_record;\n\t\t\t$this.sub_revision_view_controller.parent_view_controller = $this;\n\t\t\t$this.sub_revision_view_controller.initData();\n\t\t\treturn;\n\t\t}\n\n\t\tGlobal.loadScript( 'views/document/DocumentRevisionViewController.js', function() {\n\t\t\tvar tab_revision = $this.edit_view_tab.find( '#tab_revision' );\n\t\t\tvar firstColumn = tab_revision.find( '.first-column-sub-view' );\n\n\t\t\tGlobal.trackView( 'Sub' + 'DocumentRevision' + 'View' );\n\t\t\tTTPromise.wait( 'BaseViewController', 'initialize', function() {\n\t\t\t\tDocumentRevisionViewController.loadSubView( firstColumn, beforeLoadView, afterLoadView );\n\t\t\t} );\n\n\t\t} );\n\n\t\tfunction beforeLoadView() {\n\n\t\t}\n\n\t\tfunction afterLoadView( subViewController ) {\n\t\t\t$this.sub_revision_view_controller = subViewController;\n\t\t\t$this.sub_revision_view_controller.parent_key = 'document_id';\n\t\t\t$this.sub_revision_view_controller.parent_value = $this.current_edit_record.id;\n\t\t\t$this.sub_revision_view_controller.parent_edit_record = $this.current_edit_record;\n\t\t\t$this.sub_revision_view_controller.parent_view_controller = $this;\n\t\t\t$this.sub_revision_view_controller.initData();\n\t\t}\n\t}\n\n\tsearchDone() {\n\t\tTTPromise.resolve( 'initSubDocumentView', 'init' );\n\t\tsuper.searchDone();\n\t}\n}\n\nDocumentViewController.loadSubView = function( container, beforeViewLoadedFun, afterViewLoadedFun ) {\n\n\tGlobal.loadViewSource( 'Document', 'SubDocumentView.html', function( result ) {\n\t\tvar args = {};\n\t\tvar template = _.template( result );\n\n\t\tif ( Global.isSet( beforeViewLoadedFun ) ) {\n\t\t\tbeforeViewLoadedFun();\n\t\t}\n\n\t\tif ( Global.isSet( container ) ) {\n\t\t\tcontainer.html( template( args ) ); //This populates the grid outer div below 'first-column-sub-view'\n\t\t\tif ( Global.isSet( afterViewLoadedFun ) ) {\n\t\t\t\tTTPromise.wait( 'BaseViewController', 'initialize', function() {\n\t\t\t\t\tafterViewLoadedFun( sub_document_view_controller );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t} );\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTIxNC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQTZDO0FBQ087O0FBRTdDO0FBQ1AsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNIOztBQUVBOztBQUVBO0F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