"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-hierarchy_control-HierarchyControlViewController"],{3433:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"HierarchyControlViewController\": () => (/* binding */ HierarchyControlViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass HierarchyControlViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#hierarchy_control_view_container',\n\n\n\n\t\t\tobject_type_array: null,\n\t\t\teditor: null,\n\t\t\toriginal_hierarchy_data: [],\n\n\t\t\thierarchy_level_api: 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 = 'HierarchyControlEditView.html';\n\t\tthis.permission_id = 'hierarchy';\n\t\tthis.viewId = 'HierarchyControl';\n\t\tthis.script_name = 'HierarchyControlView';\n\t\tthis.table_name_key = 'hierarchy_control';\n\t\tthis.context_menu_name = $.i18n._( 'Hierarchy' );\n\t\tthis.navigation_label = $.i18n._( 'Hierarchy' );\n\t\tthis.api = TTAPI.APIHierarchyControl;\n\t\tthis.hierarchy_level_api = TTAPI.APIHierarchyLevel;\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['mass_edit'],\n\t\t\tinclude: []\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'object_type', 'object_type' );\n\t}\n\n\tbuildEditViewUI() {\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_hierarchy': {\n\t\t\t\t'label': $.i18n._( 'Hierarchy' ),\n\t\t\t\t'html_template': this.getHierarchyControlTabHtml()\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.APIHierarchyControl,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_hierarchy',\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_hierarchy = this.edit_view_tab.find( '#tab_hierarchy' );\n\n\t\tvar tab_hierarchy_column1 = tab_hierarchy.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_hierarchy_column1 );\n\n\t\t//Name\n\t\tvar form_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_hierarchy_column1, '' );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Description\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'description', width: '100%' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Description' ), form_item_input, tab_hierarchy_column1 );\n\n\t\tform_item_input.parent().width( '45%' );\n\n\t\t// Objects\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_option_column',\n\t\t\tshow_search_inputs: false,\n\t\t\tset_empty: true,\n\t\t\tkey: 'value',\n\t\t\tfield: 'object_type'\n\t\t} );\n\t\tform_item_input.setSourceData( $this.object_type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Objects' ), form_item_input, tab_hierarchy_column1 );\n\n\t\t// Subordinates\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUser,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_user',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'user'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Subordinates' ), form_item_input, tab_hierarchy_column1, '' );\n\n\t\t//Inside editor\n\n\t\tvar inside_editor_div = tab_hierarchy.find( '.inside-editor-div' );\n\t\tvar args = {\n\t\t\tlevel: $.i18n._( 'Level' ),\n\t\t\tsuperiors: $.i18n._( 'Superiors' )\n\t\t};\n\n\t\tthis.editor = Global.loadWidgetByName( FormItemType.INSIDE_EDITOR );\n\n\t\tthis.editor.InsideEditor( {\n\t\t\ttitle: $.i18n._( 'NOTE: Level one denotes the top or last level of the hierarchy and employees at the same level share responsibilities.' ),\n\t\t\taddRow: this.insideEditorAddRow,\n\t\t\tgetValue: this.insideEditorGetValue,\n\t\t\tsetValue: this.insideEditorSetValue,\n\t\t\tremoveRow: this.insideEditorRemoveRow,\n\t\t\tparent_controller: this,\n\t\t\trender: getRender(),\n\t\t\trender_args: args,\n\t\t\tapi: this.hierarchy_level_api,\n\t\t\trender_inline_html: true,\n\t\t\trow_render: getRowRender()\n\t\t} );\n\n\t\tfunction getRender() {\n\t\t\treturn `\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t<%= level %> | \n\t\t\t\t\t\t<%= superiors %> | \n\t\t\t\t\t\t\n\t\t\t\t\t\t | \n\t\t\t\t\t\t | \n\t\t\t\t\t
\n\t\t\t\t
`;\n\t\t}\n\n\t\tfunction getRowRender() {\n\t\t\treturn `\n\t\t\t\n\t\t\t\t | \n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t | \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t | \n\t\t\t
`;\n\t\t}\n\n\t\tinside_editor_div.append( this.editor );\n\t}\n\n\tinsideEditorSetValue( val ) {\n\n\t\tvar len = val.length;\n\t\tthis.removeAllRows();\n\n\t\tif ( len > 0 ) {\n\t\t\tfor ( var i = 0; i < val.length; i++ ) {\n\t\t\t\tif ( Global.isSet( val[i] ) ) {\n\t\t\t\t\tvar row = val[i];\n\n\t\t\t\t\tif ( !this.parent_controller.current_edit_record.id ) { //Copy as New, clear the ID field.\n\t\t\t\t\t\trow.id = '';\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.addRow( row );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.getDefaultData();\n\t\t}\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tthis.initInsideEditorData();\n\t}\n\n\tinitInsideEditorData() {\n\t\tvar $this = this;\n\n\t\tvar args = {};\n\t\targs.filter_data = {};\n\t\targs.filter_data.hierarchy_control_id = this.current_edit_record.id ? this.current_edit_record.id : ( this.copied_record_id ? this.copied_record_id : '' );\n\n\t\tif ( ( !this.current_edit_record || !this.current_edit_record.id ) && !this.copied_record_id ) {\n\t\t\tthis.editor.addRow();\n\t\t} else {\n\t\t\tthis.hierarchy_level_api.getHierarchyLevel( args, true, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tvar data = res.getResult();\n\n\t\t\t\t\t$this.original_hierarchy_data = _.map(data, _.clone);\n\n\t\t\t\t\t$this.editor.setValue( data );\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tinsideEditorRemoveRow( row ) {\n\t\tvar index = row[0].rowIndex - 1;\n\t\tvar remove_id = this.rows_widgets_array[index].current_edit_item.id;\n\t\tif ( TTUUID.isUUID( remove_id ) && remove_id != TTUUID.zero_id && remove_id != TTUUID.not_exist_id ) {\n\t\t\tthis.delete_ids.push( remove_id );\n\t\t}\n\t\trow.remove();\n\t\tthis.rows_widgets_array.splice( index, 1 );\n\t\tthis.removeLastRowLine();\n\t}\n\n\tinsideEditorAddRow( data, index ) {\n\t\tif ( !data ) {\n\t\t\tdata = {};\n\t\t}\n\n\t\tvar row = this.getRowRender(); //Get Row render\n\t\tvar render = this.getRender(); //get render, should be a table\n\t\tvar widgets = {}; //Save each row's widgets\n\n\t\t//Build row widgets\n\n\t\t//Level\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'level', width: 50 } );\n\t\tform_item_input.setValue( data.level ? data.level : 1 );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 0 ).append( form_item_input );\n\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\t//Superiors\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUser,\n\t\t\twidth: 132,\n\t\t\tis_static_width: true,\n\t\t\tlayout_name: 'global_user',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'user_id'\n\t\t} );\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\tform_item_input.setValue( data.user_id ? data.user_id : '' );\n\t\trow.children().eq( 1 ).append( form_item_input );\n\n\t\tif ( typeof index != 'undefined' ) {\n\n\t\t\trow.insertAfter( $( render ).find( 'tr' ).eq( index ) );\n\t\t\tthis.rows_widgets_array.splice( ( index ), 0, widgets );\n\n\t\t} else {\n\t\t\t$( render ).append( row );\n\t\t\tthis.rows_widgets_array.push( widgets );\n\t\t}\n\n\t\tif ( this.parent_controller.is_viewing ) {\n\t\t\trow.find( '.control-icon' ).hide();\n\t\t}\n\n\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\t//Save current set item\n\t\twidgets.current_edit_item = data;\n\n\t\tif ( !this.parent_controller.current_edit_record.id ) {\n\t\t\twidgets.current_edit_item.id = '';\n\t\t}\n\n\t\tthis.addIconsEvent( row ); //Bind event to add and minus icon\n\t\tthis.removeLastRowLine();\n\t}\n\n\tinsideEditorGetValue( current_edit_item_id ) {\n\t\tvar len = this.rows_widgets_array.length;\n\n\t\tvar result = [];\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar row = this.rows_widgets_array[i];\n\t\t\tvar data = { level: row.level.getValue(), user_id: row.user_id.getValue() };\n\t\t\tdata.hierarchy_control_id = current_edit_item_id;\n\t\t\tdata.id = row.current_edit_item.id ? row.current_edit_item.id : '';\n\t\t\tresult.push( data );\n\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tonSaveResult( result ) {\n\t\tvar $this = this;\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t\t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t$this.refresh_id = result_data;\n\t\t\t}\n\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t$this.search();\n\t\t\t\t$this.onSaveDone( result );\n\n\t\t\t\t$this.removeEditView();\n\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setErrorMenu();\n\t\t\t$this.setErrorTips( result );\n\n\t\t}\n\t}\n\n\t// onSaveAndContinueResult( result ) {\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t//\n\t// \t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t// \t\t\t$this.refresh_id = result_data;\n\t//\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t//\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onEditClick( $this.refresh_id, true );\n\t//\n\t// \t\t\t$this.onSaveAndContinueDone( result );\n\t//\n\t// \t\t} );\n\t//\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\t// onSaveAndNewResult: function( result ) {\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t//\n\t// \t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t// \t\t\t$this.refresh_id = result_data;\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onAddClick( true );\n\t// \t\t} );\n\t//\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\tonSaveAndCopyResult( result ) {\n\t\tvar $this = this;\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\t$this.refresh_id = $this.current_edit_record.id;\n\n\t\t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t$this.refresh_id = result_data;\n\t\t\t}\n\t\t\t$this.copied_record_id = $this.refresh_id;\n\n\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t$this.search( false );\n\t\t\t\t$this.onCopyAsNewClick();\n\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setErrorTips( result );\n\t\t\t$this.setErrorMenu();\n\t\t}\n\t}\n\n\tsaveInsideEditorData( callBack ) {\n\n\t\tvar $this = this;\n\n\t\tvar data = this.editor.getValue( this.refresh_id );\n\n\t\tvar remove_ids = this.editor.delete_ids;\n\n\t\tif ( remove_ids.length > 0 ) {\n\t\t\tthis.hierarchy_level_api.deleteHierarchyLevel( remove_ids, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t$this.editor.delete_ids = [];\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tlet changed_data = this.getChangedRecords( data, this.original_hierarchy_data, [] );\n\n\t\tif ( Array.isArray( changed_data ) && changed_data.length > 0 ) {\n\t\t\tthis.hierarchy_level_api.ReMapHierarchyLevels( data, { //Not sending changed data as the API expects all records.\n\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\tvar res_data = res.getResult();\n\t\t\t\t\t$this.hierarchy_level_api.setHierarchyLevel( res_data, {\n\t\t\t\t\t\tonResult: function( re ) {\n\n\t\t\t\t\t\t\tcallBack();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tcallBack();\n\t\t}\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\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: false,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\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: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Superior' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'superior_user_id',\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: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Subordinate' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'user_id',\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: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Object Type' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'object_type',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_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\t\t\t//\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: true,\n\t\t\t\tadv_search: false,\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: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\t\t];\n\t}\n\n\t_continueDoCopyAsNew() {\n\t\tthis.setCurrentEditViewState( 'new' );\n\t\tLocalCacheData.current_doing_context_action = 'copy_as_new';\n\t\tif ( Global.isSet( this.edit_view ) ) {\n\t\t\tfor ( var i = 0; i < this.editor.rows_widgets_array.length; i++ ) {\n\t\t\t\tthis.editor.rows_widgets_array[i].current_edit_item.id = '';\n\t\t\t}\n\t\t}\n\t\tsuper._continueDoCopyAsNew();\n\t}\n\n\tonCopyAsNewResult( result ) {\n\t\tvar $this = this;\n\t\tvar result_data = result.getResult();\n\n\t\tif ( !result_data ) {\n\t\t\tTAlertManager.showAlert( $.i18n._( 'Record does not exist' ) );\n\t\t\t$this.onCancelClick();\n\t\t\treturn;\n\t\t}\n\n\t\t$this.openEditView(); // Put it here is to avoid if the selected one is not existed in data or have deleted by other pragram. in this case, the edit view should not be opend.\n\n\t\tresult_data = result_data[0];\n\n\t\tthis.copied_record_id = result_data.id;\n\t\tresult_data.id = '';\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\tgetHierarchyControlTabHtml() {\n\t\treturn `\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
`;\n\t}\n\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMzQzMy5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7OztBQUlBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDJCQUEyQixDQUFDO0FBQzVCLDBCQUEwQixDQUFDO0FBQzNCO0FBQ0E7O0FBRUE7QUFDQTs7Q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