AdfRichUIPeer.createPeerClass(AdfDhtmlInputTextPeer,"AdfDhtmlInputFilePeer",!1);
AdfDhtmlInputFilePeer.InitSubclass=function(){this._UPDATE_BUTTON_ID="upBtn";this._UPLOAD_BUTTON_ID="uplBtn";this._CANCEL_BUTTON_ID="cnlBtn";this._RETRY_BUTTON_ID="rtBtn";this._STOP_BUTTON_ID="stpBtn";this._DELETE_BUTTON_ID="delBtn";this._UPDATE_VALUE_ID="upVal";this._UPDATE_DLG_CONTAINER_ID="dlg";this._UPDATE_DLG_CONTENT_ID="dlgCont";this._INPUT_ID="if";this._FALLBACK_ID="iff";this._PANEL_ID="p";this._DROP_AREA_ID="da";this._TOOLBAR_ID="tb";this._ICON_ID="icn";this._ICON_HOVER_ID="icn_ovr";this._TABLE_ID=
"t";this._ROW_ID="r";this._FILENAME_ID="fn";this._FILESIZE_ID="fs";this._FILE_DONE_ID="fd";this._FILE_FAILED_ID="ff";this._DELAYED_UPLOAD_CONTENT_ID="dc";this._DELAYED_UPLOAD_FORM_ID="df";this._PROGRESS_INDICATOR_DTM_ID="_afrProgressDet";this._PROGRESS_INDICATOR_INDTM_ID="_afrProgressIndet";this._MAXIMUM_FILES="maximumFiles";this._ROWS="rows";this._AUTO_HEIGHT_ROWS="autoHeightRows";this._UPLOAD_TYPE="uploadType";this._UPLOAD_TYPE_SUBMIT="submit";this._UPLOAD_TYPE_AUTO="auto";this._UPLOAD_TYPE_AUTO_IF_MULTIPLE=
"autoIfMultiple";this._UPLOAD_TYPE_MANUAL="manual";this._DISPLAY_MODE="displayMode";this._DISPLAY_MODE_NONE="none";this._DISPLAY_MODE_DROP_AREA="dropArea";this._ITEM_ID_ATTR="_afrItemId";this._ROW_UPLOADED_ATTR="_afrRowUploaded";this._ROW_DELETED_ATTR="_afrRowDeleted";this._ROW_FILENAME_ATTR="_afrFilename";this._ROW_FILESIZE_ATTR="_afrFilesize";this._BUTTON_EXPANDO="_adfFileBtn";this._DLG_ADD_BUTTON_BTN="dlgAddBtn";this._DLG_UPDATE_BUTTON_BTN="dlgUpdBtn";this._DLG_DELETE_BUTTON_BTN="dlgDelBtn";this._HIDDENDATA_UPDATE=
"UPDATE";this._HIDDENDATA_ADD="ADD";this._HIDDENDATA_DELETE="DELETE";this._STYLE_DISPLAY_NONE="none";this._STYLE_DISPLAY_INLINE="inline";this._STYLE_VISIBILITY_VISIBLE="visible";this._STYLE_VISIBILITY_HIDDEN="hidden";this._CSS_PROPERTY_DISPLAY="display";this._CSS_PROPERTY_VISIBILITY="visibility";this._CSS_PROPERTY_OVERFLOWY="overflowY";this._STYLE_INPUT_FILE_MULTIPLE_UPLOAD_PANEL_DRAG_CLASS="af|inputFile::multiple-upload-drag";this._STYLE_INPUT_FILE_MULTIPLE_UPLOAD_FILELIST_CLASS="af|inputFile::multiple-upload-filelist";
this._STYLE_INPUT_FILE_MULTIPLE_UPLOAD_DROPZONE_CLASS="af|inputFile::multiple-upload-dropzone";this._MAX_FILE_SIZE="_afrFileSize";this._MAX_DISK_SPACE="_afrDiskSpace";this._clone;AdfRichUIPeer.addComponentEventHandlers(this,AdfUIInputEvent.CLICK_EVENT_TYPE,AdfDialogEvent.EVENT_TYPE);this._usesUnifiedButtons="old"!=AdfPage.PAGE.getLookAndFeel().getSkinProperty("af|dialog-tr-button-type");this._usesUnifiedButtons=!1};
AdfDhtmlInputFilePeer.prototype.InitDomElement=function(a,b){AdfDhtmlInputFilePeer.superclass.InitDomElement.call(this,a,b);AdfDhtmlInputFilePeer._isMultipleUpload(a)&&(this._initMultipleUpload(a,b),this._initMultipleUploadDomElement(a,b));this._dlgContentOkHandlerSetuped=!1;this._deleteButtons=[]};AdfDhtmlInputFilePeer.prototype.needsResizeNotify=function(a){return!0};
AdfDhtmlInputFilePeer.prototype.resizeNotify=function(a,b,d,e,f){b=this.getDomElement();AdfDhtmlInputFilePeer._isMultipleUpload(a)&&this._initMultipleUploadDomElement(a,b)};AdfDhtmlInputFilePeer.prototype.getConvertedValue=function(a,b){};AdfDhtmlInputFilePeer.prototype.getFileUploadManager=function(){null==this._fileUploadManager&&(this._fileUploadManager=new AdfFileUploadManager(this.getComponent()));return this._fileUploadManager};AdfDhtmlInputFilePeer.prototype.getFileUploadUtils=function(){return this._fileUploadUtils};
AdfDhtmlInputFilePeer.prototype.isEmpty=function(a){return this._getUpdateButton()?!1:AdfDhtmlInputFilePeer.superclass.isEmpty.call(this,a)};AdfDhtmlInputFilePeer.prototype.isUploadQueueEmpty=function(){return 0<this.getFileUploadUtils().getFileUploadQueue().length?!1:!0};AdfDhtmlInputFilePeer.prototype.isUploadResultFailed=function(){for(var a=this.getFileUploadUtils().getFileUploadResults(),b=0;b<a.length;b++)if(!a.item(b).isSuccess())return!0;return!1};
AdfDhtmlInputFilePeer.prototype.LazyInitialize=function(a,b){AdfDhtmlInputFilePeer.superclass.LazyInitialize.call(this,a,b);if(a.getProperty(AdfDhtmlInputFilePeer._DISPLAY_MODE)!=AdfDhtmlInputFilePeer._DISPLAY_MODE_NONE){var d=null;AdfDhtmlInputFilePeer._isMultipleUpload(a)||(d=AdfDhtmlEditableValuePeer.getContentNode(a,b),this._getUpdateButton()&&(this._clone=d.cloneNode(!0)),AdfRichUIPeer.addEventHandlerToDomInstance(AdfDhtmlInputFilePeer,d,AdfDhtmlLookAndFeel.CHANGE_EVENT_TYPE))}};
AdfDhtmlInputFilePeer.prototype.ComponentValueChanged=function(a,b,d,e){return!0};AdfDhtmlInputFilePeer.prototype.Focus=function(){var a=this._getUpdateButton();null!=a?AdfFocusUtils.focusElement(a):AdfDhtmlInputFilePeer.superclass.Focus.call(this)};
AdfDhtmlInputFilePeer.prototype.GetNoteWindowAlignmentNode=function(a,b){var d=a.getClientId(),d=AdfRichUIPeer.CreateSubId(d,AdfDhtmlInputFilePeer._UPDATE_VALUE_ID),d=AdfAgent.AGENT.getElementById(d);return null!=d?d:AdfDhtmlInputFilePeer.superclass.GetNoteWindowAlignmentNode.call(this,a,b)};
AdfDhtmlInputFilePeer.prototype.HandleComponentClick=function(a){AdfDhtmlInputFilePeer.superclass.HandleComponentClick.call(this,a);var b=this.getComponent(),d=b.getPeer(),e=AdfAgent.AGENT,f=AdfPage.PAGE;if(!b.getDisabled()&&a.isLeftButtonPressed()){a=a.getNativeEvent();var g=e.getEventTarget(a),h=e.getAttribute(g,AdfDhtmlInputFilePeer._ITEM_ID_ATTR),k=b.getClientId(),l=AdfRichUIPeer.CreateSubId(k,AdfDhtmlInputFilePeer._UPDATE_BUTTON_ID),m=AdfRichUIPeer.CreateSubId(k,AdfDhtmlInputFilePeer._UPLOAD_BUTTON_ID),
n=AdfRichUIPeer.CreateSubId(k,AdfDhtmlInputFilePeer._STOP_BUTTON_ID);if("LABEL"==e.getNodeName(g))return this.focus(b),e.eatEvent(a),!0;if(g.id==l){d=AdfRichUIPeer.CreateSubId(k,AdfDhtmlInputFilePeer._UPDATE_DLG_CONTAINER_ID);if(d=e.getElementById(d)){for(d=d.firstChild;d&&1!=d.nodeType;)d=d.nextSibling;if(null!=d&&(this.HideNoteWindow(),f.clearMessages(k),!1==b.getValid()&&b.setProperty("valid",!0),this.showPopup(b,d,null,AdfDhtmlInputFilePeer._UPDATE_DLG_CONTAINER_ID),!this._dlgContentOkHandlerSetuped)){this._dlgContentOkHandlerSetuped=
!0;var p=this._getDialogSubId();if(p&&(b=AdfDhtmlDialogPeer._getButtonDom(p,AdfDhtmlDialogPeer._OK_ID))){var q=this;e.addBubbleEventListener(b,AdfUIInputEvent.CLICK_EVENT_TYPE,function(){if(AdfAgent.AGENT.getElementById(p).getElementsByTagName("input")[0].value){f.clearMessages(k);var a=q.getComponent();!1==a.getValid()&&a.setProperty("valid",!0)}})}}}e.eatEvent(a);return!0}if(g.id==m)return f.clearMessages(k),this._uploadFilesInQueue(b),e.eatEvent(a),!0;if(g.id==n)return AdfDhtmlInputFilePeer._maskPanelElement(b,
AdfDhtmlInputFilePeer._STOP_BUTTON_ID),"auto"!=this._submitType&&AdfDhtmlInputFilePeer._unmaskPanelElement(b,AdfDhtmlInputFilePeer._UPLOAD_BUTTON_ID),d.getFileUploadUtils().cancelAllUploads(!0),e.eatEvent(a),!0;if(null!=h){f.clearMessages(k);var l=AdfDhtmlInputFilePeer._getUploadQueueRowId(k,h),m=AdfRichUIPeer.CreateSubId(l,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID),n=AdfRichUIPeer.CreateSubId(l,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID),r=AdfRichUIPeer.CreateSubId(l,AdfDhtmlInputFilePeer._RETRY_BUTTON_ID);
if(g.id==m)d.getFileUploadUtils().cancelCurrentUpload(!1);else if(g.id==n){b=e.getElementById(n);if(null!=b&&b.getAttribute("disabled"))return;b=e.getElementById(l);g=e.getAttribute(b,AdfDhtmlInputFilePeer._ROW_UPLOADED_ATTR);!g||"false"==g?d.getFileUploadUtils().deleteFileFromQueue(e.getAttribute(b,AdfDhtmlInputFilePeer._ROW_FILENAME_ATTR)):d.getFileUploadUtils().deleteUploadedFile(e.getAttribute(b,AdfDhtmlInputFilePeer._ROW_FILENAME_ATTR))}else g.id==r&&(null!=this._getUploadResultItem(h)&&!this._getUploadResultItem(h).isSuccess())&&
(d.getFileUploadUtils().addFileUploadQueueItem(this._getUploadResultItem(h)),AdfDhtmlInputFilePeer._maskListElement(b,AdfDhtmlInputFilePeer._RETRY_BUTTON_ID,h),AdfDhtmlInputFilePeer._unmaskListElement(b,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,h),AdfDhtmlInputFilePeer._maskListElement(b,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,h),AdfDhtmlInputFilePeer._maskListElement(b,AdfDhtmlInputFilePeer._FILE_FAILED_ID,h),this._showProgressIndicator(h),d.getFileUploadUtils().isBusy()||AdfDhtmlInputFilePeer._uploadNextFileInQueue(b));
e.eatEvent(a);return!0}if(null!=g.getAttribute(AdfDhtmlInputFilePeer._BUTTON_EXPANDO)&&(e=g.getAttribute(AdfDhtmlInputFilePeer._BUTTON_EXPANDO),a=this._getHiddenField(b)))e==AdfDhtmlInputFilePeer._DLG_UPDATE_BUTTON_BTN?a.value=AdfDhtmlInputFilePeer._HIDDENDATA_UPDATE:e==AdfDhtmlInputFilePeer._DLG_ADD_BUTTON_BTN?a.value=AdfDhtmlInputFilePeer._HIDDENDATA_ADD:e==AdfDhtmlInputFilePeer._DLG_DELETE_BUTTON_BTN&&(a.value=AdfDhtmlInputFilePeer._HIDDENDATA_DELETE)}};
AdfDhtmlInputFilePeer.prototype._getDialogSubId=function(){var a=this.getComponent().getClientId();return AdfDhtmlInputFilePeer._usesUnifiedButtons?a+"_"+AdfDhtmlInputFilePeer._UPDATE_DLG_CONTENT_ID:AdfRichUIPeer.CreateSubId(a,AdfDhtmlInputFilePeer._UPDATE_DLG_CONTENT_ID)};
AdfDhtmlInputFilePeer.prototype.HandleComponentDialog=function(a){var b=this.getComponent(),d=a.getOutcome(),e=AdfAgent.AGENT;if(d==AdfDialogEvent.OUTCOME_OK){b.getClientId();var d=this._getDialogSubId(),f=e.getElementById(d).getElementsByTagName("input")[0];if(f.value){var d=AdfRichUIPeer.CreateSubId(b.getClientId(),AdfDhtmlInputFilePeer._UPDATE_VALUE_ID),d=e.getElementById(d),f=f.value,g=-1;if(0<=(g=f.lastIndexOf("\\"))||0<=(g=f.lastIndexOf("/")))f=f.substr(g+1);"INPUT"==AdfAgent.AGENT.getNodeName(d)?
d.value=f:e.setTextContent(d,f);this._handleFileChange(b,f)}else return}else d==AdfDialogEvent.OUTCOME_CANCEL&&(b=AdfDhtmlEditableValuePeer.getContentNode(b,this.getDomElement()),d=b.parentNode,d.removeChild(b),d.appendChild(this._clone),e.elementsAdded(this._clone),this._clone=this._clone.cloneNode(!0));a.cancel();this.hidePopup(this.getComponent(),AdfDhtmlInputFilePeer._UPDATE_DLG_CONTAINER_ID)};
AdfDhtmlInputFilePeer.prototype.HandleComponentKeyPress=function(a){var b=a.getNativeEvent(),b=AdfAgent.AGENT.getKeyCode(b),d=AdfDhtmlEditableValuePeer.getContentNode(this.getComponent());AdfPage.PAGE.getActiveDomElement()==d&&b!==AdfKeyStroke.TAB_KEY&&a.cancel();b==AdfKeyStroke.ENTER_KEY&&(AdfAgent.AGENT.getPlatform()==AdfAgent.IE_PLATFORM?AdfLogger.LOGGER.info("Due to a bug in IE, the enter key press will not invoke the 'Choose File to Upload' dialog."):a.getNativeEventTarget().click())};
AdfDhtmlInputFilePeer.prototype._validateSingleInputFileSizeMaxDiskSpace=function(a){var b=this.getComponent();return a&&(a.files&&1===a.files.length&&a.files[0]instanceof File&&void 0!==a.files[0].size)&&(a=a.files[0].size,!AdfFileUploadUtils.validateMaxFileSizeMaxDiskSpace(b,a,a,function(a){AdfPage.PAGE.addMessage(b.getClientId(),a)}))?!1:!0};
AdfDhtmlInputFilePeer.prototype.HandleDomChange=function(a,b){var d=AdfAgent.AGENT,e=AdfAgent.AGENT.getEventTarget(b);a.focus();if(AdfDhtmlInputFilePeer._isMultipleUpload(a))if(this._useFormData&&this._useFileApi){for(var d=e.files,f=0;f<d.length;f++)g=d[f],this.getFileUploadUtils().addFileToQueue(g);this._displayMode!=AdfDhtmlInputFilePeer._DISPLAY_MODE_NONE&&this.getFileUploadUtils()._resetInputFileNode(e)}else this.getFileUploadUtils().addFileToQueue(e);else{d.getPlatform()==AdfAgent.IE_PLATFORM&&
(d=this._getUpdateButton(),f=AdfDhtmlEditableValuePeer.getContentNode(a),(null==d?f:d).select());var g=e.value;this._validateSingleInputFileSizeMaxDiskSpace(e)&&this._handleFileChange(a,g)}};AdfDhtmlInputFilePeer.prototype.HandleDomDrop=function(a,b){var d=AdfAgent.AGENT,e=b.dataTransfer.files;if(e)for(var f=0;f<e.length;f++){var g=e[f];this.getFileUploadUtils().addFileToQueue(g)}this._displayMode!=AdfDhtmlInputFilePeer._DISPLAY_MODE_NONE&&this._handleDragLeave(b);d.eatEvent(b)};
AdfDhtmlInputFilePeer.prototype.isDataDirty=function(){if(AdfPage.PAGE.isPerformingFullSubmit())return!1;var a=this.getFileUploadUtils().getFileUploadResults();if(null!=a)for(var b=0;b<a.length;b++)if(a.item(b).isSuccess())return!0;return this.getFileUploadUtils().isBusy()};AdfDhtmlInputFilePeer.prototype.isMultipleUpload=function(){return AdfDhtmlInputFilePeer._isMultipleUpload(this.getComponent())};
AdfDhtmlInputFilePeer.prototype.PopupClosed=function(a,b,d){AdfDhtmlInputFilePeer.superclass.PopupClosed.call(this,a,b);if(d==AdfDhtmlInputFilePeer._UPDATE_DLG_CONTAINER_ID){d=a.getClientId();d=AdfRichUIPeer.CreateSubId(d,AdfDhtmlInputFilePeer._UPDATE_DLG_CONTAINER_ID);d=AdfAgent.AGENT.getElementById(d);var e=this._getUpdateButton();AdfFocusUtils.focusElement(e);d&&d.appendChild(b);AdfDhtmlInputFilePeer._isMultipleUpload(a)||(a=AdfDhtmlEditableValuePeer.getContentNode(a))&&this._validateSingleInputFileSizeMaxDiskSpace(a)}};
AdfDhtmlInputFilePeer.prototype.VetoBlurValidation=function(){return!0};AdfDhtmlInputFilePeer.prototype.VetoShowNoteWindow=function(a){return this.isPopupVisible(a,AdfDhtmlInputFilePeer._UPDATE_DLG_CONTAINER_ID)?!0:AdfDhtmlInputFilePeer.superclass.VetoShowNoteWindow.call(this)};
AdfDhtmlInputFilePeer.prototype._initMultipleUpload=function(a,b){var d=AdfAgent.AGENT,e=AdfPage.PAGE.getLookAndFeel(),f=a.getClientId(),g=AdfRichUIPeer.CreateSubId(f,AdfDhtmlInputFilePeer._PANEL_ID),h=AdfRichUIPeer.CreateSubId(f,AdfDhtmlInputFilePeer._DROP_AREA_ID),k=AdfRichUIPeer.CreateSubId(g,AdfDhtmlInputFilePeer._ICON_ID),f=AdfRichUIPeer.CreateSubId(g,AdfDhtmlInputFilePeer._ICON_HOVER_ID),g=d.getElementById(g),h=d.getElementById(h),k=d.getElementById(k),d=d.getElementById(f);k&&(this._icon=k);
d&&(this._iconHover=d);this._panel=g;this._dropArea=h;this._rowList=[];this._autoHeightRows=a.getProperty(AdfDhtmlInputFilePeer._AUTO_HEIGHT_ROWS);this._autoHeightRows||(this._autoHeightRows=0);this._submitType=AdfDhtmlInputFilePeer._getSubmitType(a);this._maximumFiles=a.getProperty(AdfDhtmlInputFilePeer._MAXIMUM_FILES);this._rows=a.getProperty(AdfDhtmlInputFilePeer._ROWS);a.getAutoSubmit()&&(a.setProperty("autoSubmit",!1,!1,AdfUIComponent.PROPAGATE_NEVER),this._autoSubmit=!0);this._useFileApi="undefined"!=
typeof File?!0:!1;void 0===AdfAgent.AGENT.slice()?this._canSlice=!1:this._canSlice=!0;this._useFormData="undefined"!=typeof FormData?!0:!1;if((this._useDnD=!("draggable"in b)||!this._useFormData||!this._canSlice?!1:!0)&&!a.getDisabled())this._cssClassUploadPanelDrag=e.getStyleClass(AdfDhtmlInputFilePeer._STYLE_INPUT_FILE_MULTIPLE_UPLOAD_PANEL_DRAG_CLASS),null!=this._panel?(AdfAgent.AGENT.addBubbleEventListener(this._panel,"dragenter",this.createCallback(this._handleDragEnter)),AdfAgent.AGENT.addBubbleEventListener(this._panel,
"dragleave",this.createCallback(this._handleDragLeave)),AdfAgent.AGENT.addBubbleEventListener(this._panel,"dragover",this.createCallback(this._handleDragOver))):null!=this._dropArea&&(AdfAgent.AGENT.addBubbleEventListener(this._dropArea,"dragenter",this.createCallback(this._handleDragEnter)),AdfAgent.AGENT.addBubbleEventListener(this._dropArea,"dragleave",this.createCallback(this._handleDragLeave)),AdfAgent.AGENT.addBubbleEventListener(this._dropArea,"dragover",this.createCallback(this._handleDragOver)));
AdfPage.PAGE.registerDirtyDataComponent(a,"always")};
AdfDhtmlInputFilePeer.prototype._initMultipleUploadDomElement=function(a,b){var d=AdfAgent.AGENT,e=a.getClientId(),f=this;this._fileUploadUtils||(this._fileUploadUtils=new AdfFileUploadUtils(this,a,b));!0==AdfFileUploadUtils._isInPopup(a)&&!this._popupAncestor&&(this._popupAncestor=AdfFileUploadUtils._getPopupAncestor(a),this._popupAncestor.addEventListener(AdfPopupClosedEvent.POPUP_CLOSED_EVENT_TYPE,this.createCallback(this._handlePopupClosed)),this._popupAncestor.addEventListener(AdfPopupOpenedEvent.POPUP_OPENED_EVENT_TYPE,
this.createCallback(this._handlePopupOpened)));this._displayMode=a.getProperty(AdfDhtmlInputFilePeer._DISPLAY_MODE);if(this._displayMode!=AdfDhtmlInputFilePeer._DISPLAY_MODE_NONE&&a.getVisible())if(this._displayMode==AdfDhtmlInputFilePeer._DISPLAY_MODE_DROP_AREA){var g=AdfRichUIPeer.CreateSubId(e,AdfDhtmlInputFilePeer._DROP_AREA_ID),d=d.getElementById(g);this._loadSettings(a,m);this._initDropArea(g,d.offsetWidth,d.offsetHeight)}else{var g=AdfRichUIPeer.CreateSubId(e,AdfDhtmlInputFilePeer._PANEL_ID),
h=this._icon.children[0].height;"auto"==this._submitType&&AdfDhtmlInputFilePeer._maskPanelElement(a,AdfDhtmlInputFilePeer._UPLOAD_BUTTON_ID);AdfDhtmlInputFilePeer._maskPanelElement(a,AdfDhtmlInputFilePeer._STOP_BUTTON_ID);for(var k=0;k<this._autoHeightRows;k++){var l=AdfDhtmlInputFilePeer._getUploadQueueRowId(e,k),l=d.getElementById(l);if(null!=l){var m=d.getAttribute(l,AdfDhtmlInputFilePeer._ITEM_ID_ATTR);null==m&&AdfDhtmlInputFilePeer._hideRow(a,k)}}AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_INDTM_ID,
null);AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,null);AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._RETRY_BUTTON_ID,null);AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._FILE_DONE_ID,null);k=AdfDhtmlInputFilePeer._getUploadQueueRowId(e,null);l=d.getElementById(k);m=0;0<l.offsetWidth&&(m=l.offsetWidth);!this._rowHeight&&0<l.offsetHeight&&(this._rowHeight=l.offsetHeight);this._autoHeightPanelSize||(0<this._autoHeightRows?0<l.offsetHeight&&
(this._autoHeightPanelSize=l.offsetHeight*this._autoHeightRows):this._autoHeightPanelSize=0);0<m&&AdfDhtmlInputFilePeer._setCSSStyle(k,AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY,AdfDhtmlInputFilePeer._STYLE_DISPLAY_NONE);this._autoHeightPanelSize&&0<this._autoHeightPanelSize&&this._autoHeightPanelSize>h?this._minPanelSize=this._autoHeightPanelSize:0<h&&(this._minPanelSize=h);AdfDhtmlInputFilePeer._setCSSStyle(g,AdfDhtmlInputFilePeer._CSS_PROPERTY_OVERFLOWY,"scroll");k=this._panel.offsetWidth-this._panel.clientWidth;
if(0<m)0===k?(m=AdfRichUIPeer.CreateSubId(e,"pane"),this._panelWidth=d.getElementById(m).offsetWidth):this._panelWidth=m+k;else if(!this._panelWidth||0==this._panelWidth||!this._minPanelSize){setTimeout(function(){f._initMultipleUploadDomElement(a,b)},1E3);return}AdfDhtmlInputFilePeer._setCSSStyle(g,AdfDhtmlInputFilePeer._CSS_PROPERTY_OVERFLOWY,"auto");m=d.getAttribute(this._panel,AdfDhtmlInputFilePeer._ITEM_ID_ATTR);this._addedEventListeners||(this.getFileUploadUtils().addEventListener(AdfFileUploadManager.EVENT_TYPE_PROGRESS,
function(a){null!=a.getFileItem()&&f._updateProgress(a.getFileItem().getFilename(),a.getPercentComplete())}),this.getFileUploadUtils().addEventListener(AdfFileUploadManager.EVENT_TYPE_STATUS,function(a){a.getOperation()==AdfFileUploadManager.OPERATION_UPLOAD&&a.getStatus()!=AdfFileUploadManager.EVENT_STATUS_START?f._handleUploadComplete(a.getFileItem().getFilename(),a.getStatus()==AdfFileUploadManager.EVENT_STATUS_COMPLETE):a.getOperation()==AdfFileUploadManager.OPERATION_DELETE?f._handleDeleteComplete(a.getFileItem().getFilename(),
a.getStatus()==AdfFileUploadManager.EVENT_STATUS_COMPLETE):a.getOperation()==AdfFileUploadManager.OPERATION_CANCEL?f._handleUploadCancel(a.getFileItem().getFilename(),a.getStatus()==AdfFileUploadManager.EVENT_STATUS_COMPLETE):a.getOperation()==AdfFileUploadManager.OPERATION_CANCEL_ALL&&f._handleUploadCancel(a.getFileItem().getFilename(),a.getStatus()==AdfFileUploadManager.EVENT_STATUS_COMPLETE)}),this.getFileUploadUtils().addEventListener(AdfFileUploadManager.EVENT_TYPE_STATE,function(b){if(b.getOperationSource()==
AdfFileUploadManager.EVENT_SOURCE_QUEUE){var d=b.getFileItem();b.getOperation()==AdfFileUploadManager.OPERATION_DELETE?AdfDhtmlInputFilePeer._removeFileFromUploadQueueUI(a,f._getDomRow(d.getFilename())):b.getOperation()==AdfFileUploadManager.OPERATION_ADDED&&(null!=b.getMessage()?(b=b.getMessage(),AdfInputFileUtils.addUploadErrorFacesMessage(e,a,b)):(b=AdfDhtmlInputFilePeer._addFileToUploadQueueUI(a,d.getFilename(),d.getFilesize(),d.getItemId()),f._rowList.push(b)))}}),this._addedEventListeners=!0);
this._loadSettings(a,m);if(null!=m)for(k=0;k<=m;k++)if(l=AdfDhtmlInputFilePeer._getUploadQueueRowId(e,k),l=d.getElementById(l),AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,k),AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._RETRY_BUTTON_ID,k),AdfDhtmlInputFilePeer._hideListElement(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,k),AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_INDTM_ID,k),AdfDhtmlInputFilePeer._maskListElement(a,
AdfDhtmlInputFilePeer._FILE_FAILED_ID,k),g=AdfDhtmlInputFilePeer._getListElement(a,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,k),d.setAttribute(g,AdfDhtmlInputFilePeer._ITEM_ID_ATTR,k),g=d.getAttribute(l,AdfDhtmlInputFilePeer._ROW_FILENAME_ATTR),h=d.getAttribute(l,AdfDhtmlInputFilePeer._ROW_FILESIZE_ATTR),this._rowList.push(l),"true"==d.getAttribute(l,AdfDhtmlInputFilePeer._ROW_UPLOADED_ATTR)){l=!0;if(null==h||0>h)l=!1,AdfDhtmlInputFilePeer._unmaskListElement(a,AdfDhtmlInputFilePeer._FILE_FAILED_ID,
k),AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._FILE_DONE_ID,k),AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._FILESIZE_ID,k);g=new AdfFileUploadManager.FileItem(k,g,h,null,l);AdfDhtmlInputFilePeer._addFileItemToUploadResultList(a,g)}this._panelWidth&&0<this._panelWidth&&this._initPanelSize(a)}};
AdfDhtmlInputFilePeer.prototype._initPanelSize=function(a){var b=AdfAgent.AGENT,d=AdfPage.PAGE.getLookAndFeel(),e=a.getPeer();a=a.getClientId();a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlInputFilePeer._PANEL_ID);var f=AdfRichUIPeer.CreateSubId(a,AdfDhtmlInputFilePeer._ICON_ID),g=b.getElementById(a),f=b.getElementById(f);AdfDhtmlInputFilePeer._setCSSStyleText(g,"height:"+e._minPanelSize+"px;width:"+e._panelWidth+"px;overflow-y:hidden");e._initDropArea(a,e._panelWidth,e._minPanelSize);e._initHeightRows=
0<e._autoHeightRows?e._autoHeightRows:0;e._useDnD&&AdfDomUtils.addCSSClassName(g,d.getStyleClass(AdfDhtmlInputFilePeer._STYLE_INPUT_FILE_MULTIPLE_UPLOAD_DROPZONE_CLASS));if(0<e.getFileUploadUtils()._getTotalRows()||!e._useDnD)f&&f.parentNode&&(f.parentNode.removeChild(f),b.elementsRemoved(f)),AdfDomUtils.removeCSSClassName(g,d.getStyleClass(AdfDhtmlInputFilePeer._STYLE_INPUT_FILE_MULTIPLE_UPLOAD_DROPZONE_CLASS))};
AdfDhtmlInputFilePeer.prototype._initDropArea=function(a,b,d){var e=AdfAgent.AGENT,f=AdfRichUIPeer.CreateSubId(a,AdfDhtmlInputFilePeer._ICON_ID);a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlInputFilePeer._ICON_HOVER_ID);f=e.getElementById(f);a=e.getElementById(a);if(f){var g=f.children[0],h=g.width,g=g.height,k=d/2-g/2,k=0>k?0:k,l=b/2-h/2,l=0>l?0:l;this._displayMode==AdfDhtmlInputFilePeer._DISPLAY_MODE_DROP_AREA?AdfDhtmlInputFilePeer._setCSSStyleText(f,"width:"+h+"px;height:"+g+"px;position:relative;top:"+
k+"px;left:"+l+"px"):AdfDhtmlInputFilePeer._setCSSStyleText(f,"width:"+h+"px;height:"+g+"px;position:absolute;top:"+k+"px;left:"+l+"px")}a&&(g=a.children[0],h=g.width,g=g.height,k=d/2-g/2,k=0>k?0:k,l=b/2-h/2,l=0>l?0:l,this._displayMode==AdfDhtmlInputFilePeer._DISPLAY_MODE_DROP_AREA?AdfDhtmlInputFilePeer._setCSSStyleText(a,"width:"+h+"px;height:"+g+"px;position:relative;top:"+k+"px;left:"+l+"px"):AdfDhtmlInputFilePeer._setCSSStyleText(a,"width:"+h+"px;height:"+g+"px;position:absolute;top:"+k+"px;left:"+
l+"px"),a&&a.parentNode&&(a.parentNode.removeChild(a),e.elementsRemoved(a)))};AdfDhtmlInputFilePeer.prototype._getDomRow=function(a){var b=AdfAgent.AGENT;if(this._rowList)for(var d=0;d<this._rowList.length;d++)if(b.getAttribute(this._rowList[d],AdfDhtmlInputFilePeer._ROW_FILENAME_ATTR)==a)return this._rowList[d];return null};AdfDhtmlInputFilePeer.prototype._getHiddenField=function(a){a=AdfRichUIPeer.CreateSubId(a.getClientId(),"hiddendata");return AdfAgent.AGENT.getElementsByName(a)[0]};
AdfDhtmlInputFilePeer.prototype._getUpdateButton=function(){var a=this.getComponent().getClientId(),a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlInputFilePeer._UPDATE_BUTTON_ID);return AdfAgent.AGENT.getElementById(a)};AdfDhtmlInputFilePeer.prototype._getUploadResultItem=function(a){for(var b=this.getFileUploadUtils().getFileUploadResults(),d=0;d<b.length;d++)if(b.item(d).getItemId()==a)return b.item(d);return null};
AdfDhtmlInputFilePeer.prototype._handleDeleteComplete=function(a,b){var d=this.getComponent(),e=this._getDomRow(a);b&&AdfDhtmlInputFilePeer._removeFileFromUploadQueueUI(d,e)};
AdfDhtmlInputFilePeer.prototype._handleDragEnter=function(a){var b=AdfAgent.AGENT;if(null!=a&&!this._dragEntered){var d=null==this._panel?this._dropArea:this._panel;AdfDomUtils.addCSSClassName(d,this._cssClassUploadPanelDrag);this._iconHover&&this._useDnD&&(this._icon&&this._icon.parentNode&&(this._icon.parentNode.removeChild(this._icon),b.elementsRemoved(this._icon)),d.appendChild(this._iconHover),b.elementsAdded(this._iconHover));this._dragEntered=!0}b.eatEvent(a)};
AdfDhtmlInputFilePeer.prototype._handleDragLeave=function(a){var b=AdfAgent.AGENT;if(null!=a){var d=null==this._panel?this._dropArea:this._panel,e=this.getFileUploadUtils()._getTotalRows();AdfDomUtils.removeCSSClassName(d,this._cssClassUploadPanelDrag);this._icon&&(0<e?(this._icon.parentNode&&(this._icon.parentNode.removeChild(this._icon),b.elementsRemoved(this._icon)),this._iconHover.parentNode&&(this._iconHover.parentNode.removeChild(this._iconHover),b.elementsRemoved(this._iconHover))):this._icon&&
this._useDnD&&(d.appendChild(this._icon),b.elementsAdded(this._icon)));this._dragEntered=!1}b.eatEvent(a)};
AdfDhtmlInputFilePeer.prototype._handleDragOver=function(a){var b=AdfAgent.AGENT;if(null!=a&&!this._dragEntered){var d=null==this._panel?this._dropArea:this._panel;AdfDomUtils.addCSSClassName(d,this._cssClassUploadPanelDrag);this._iconHover&&this._useDnD&&(this._icon&&this._icon.parentNode&&(this._icon.parentNode.removeChild(this._icon),b.elementsRemoved(this._icon)),d.appendChild(this._iconHover),b.elementsAdded(this._iconHover));this._dragEntered=!0}b.eatEvent(a)};
AdfDhtmlInputFilePeer.prototype._handleFileChange=function(a,b){b&&" "==b.charAt(0)?(a.setProperty("valid",!1),AdfInputFileUtils.addUploadErrorMessage(a.getClientId())):this.Validate(a,b)};AdfDhtmlInputFilePeer.prototype._handlePopupClosed=function(a){this.getComponent().getClientId();a=this._currentRequestItemId;null!=a&&(this._stopUpload=!0,this._cancelCurrentUpload(a,!0,!0),this._enableAllDeleteButtons());this.getFileUploadUtils().unload()};
AdfDhtmlInputFilePeer.prototype._handlePopupOpened=function(a){this._initMultipleUploadDomElement(this.getComponent(),this.getDomElement())};
AdfDhtmlInputFilePeer.prototype._handleUploadCancel=function(a,b){var d=this.getComponent(),e=this._getDomRow(a).getAttribute(AdfDhtmlInputFilePeer._ITEM_ID_ATTR);b?(this._removeFileFromUploadQueue(e),this._enableAllDeleteButtons()):(AdfDhtmlInputFilePeer._unmaskListElement(d,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,e),AdfDhtmlInputFilePeer._maskListElement(d,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,e))};
AdfDhtmlInputFilePeer.prototype._handleUploadComplete=function(a,b){var d=AdfAgent.AGENT,e=this.getComponent(),f=this._getDomRow(a),g=f.getAttribute(AdfDhtmlInputFilePeer._ITEM_ID_ATTR);b?(AdfDhtmlInputFilePeer._hideListElement(e,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,g),AdfDhtmlInputFilePeer._hideListElement(e,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_INDTM_ID,g),AdfDhtmlInputFilePeer._unmaskListElement(e,AdfDhtmlInputFilePeer._FILE_DONE_ID,g),AdfDhtmlInputFilePeer._maskListElement(e,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,
g),AdfDhtmlInputFilePeer._unmaskListElement(e,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,g),this._disableDeleteButton(e,g),d.setAttribute(f,AdfDhtmlInputFilePeer._ROW_UPLOADED_ATTR,"true"),AdfPage.PAGE.setDataDirty(!0)):(AdfDhtmlInputFilePeer._maskListElement(e,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,g),AdfDhtmlInputFilePeer._unmaskListElement(e,AdfDhtmlInputFilePeer._RETRY_BUTTON_ID,g),AdfDhtmlInputFilePeer._hideListElement(e,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,g),AdfDhtmlInputFilePeer._unmaskListElement(e,
AdfDhtmlInputFilePeer._FILE_FAILED_ID,g));AdfDhtmlInputFilePeer._uploadNextFileInQueue(e)};AdfDhtmlInputFilePeer.prototype._removeFileFromUploadQueue=function(a){var b=AdfAgent.AGENT,d=this.getComponent();!1==d.getValid()&&d.setProperty("valid",!0);for(d=0;d<this._rowList.length;d++)if(this._rowList[d].getAttribute(AdfDhtmlInputFilePeer._ITEM_ID_ATTR)==a){this.getFileUploadUtils().deleteFileFromQueue(b.getAttribute(this._rowList[d],AdfDhtmlInputFilePeer._ROW_FILENAME_ATTR));break}};
AdfDhtmlInputFilePeer.prototype._loadSettings=function(a,b){var d=a.getClientId(),e=null;if(this._settings)e=this._settings;else{var e=this._settings=[],f=null;a.getProperty(AdfDhtmlInputFilePeer._DISPLAY_MODE)==AdfDhtmlInputFilePeer._DISPLAY_MODE_DROP_AREA?(f=AdfRichUIPeer.CreateSubId(d,AdfDhtmlInputFilePeer._DROP_AREA_ID),e.dropAreaId=f,e.fallbackInputId=AdfRichUIPeer.CreateSubId(d,AdfDhtmlInputFilePeer._FALLBACK_ID)):f=AdfRichUIPeer.CreateSubId(d,AdfDhtmlInputFilePeer._PANEL_ID);a.getProperty(AdfDhtmlInputFilePeer._DISPLAY_MODE)!=
AdfDhtmlInputFilePeer._DISPLAY_MODE_DROP_AREA&&(e.inputId=AdfRichUIPeer.CreateSubId(d,AdfDhtmlInputFilePeer._INPUT_ID));e.dropAreaId=f}this.getFileUploadUtils().load(e)};AdfDhtmlInputFilePeer.prototype._showProgressIndicator=function(a){var b=null,b=this._useFileApi&&this._useFormData?AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID:AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_INDTM_ID;AdfDhtmlInputFilePeer._showListElement(this.getComponent(),b,a)};
AdfDhtmlInputFilePeer.prototype._updateProgress=function(a,b){var d=this.getComponent(),e=this._getDomRow(a).getAttribute(AdfDhtmlInputFilePeer._ITEM_ID_ATTR),d=AdfDhtmlInputFilePeer._getListElementId(d,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,e),d=AdfPage.PAGE.findComponent(d);null!=d&&d.getPeer().UpdateProgressIndicator(b)};
AdfDhtmlInputFilePeer.prototype._uploadFilesInQueue=function(a,b){var d=AdfAgent.AGENT,e=a.getClientId();if(this.getFileUploadUtils()._getTotalRows()>this._maximumFiles&&0<this._maximumFiles)AdfInputFileUtils.addUploadErrorMessageKey(e,a,"af_inputFile.MSG_UPLOAD_MAXIMUM_FILES_ERROR","af_inputFile.MSG_UPLOAD_MAXIMUM_FILES_ERROR_DETAIL");else{AdfDhtmlInputFilePeer._maskPanelElement(a,AdfDhtmlInputFilePeer._UPLOAD_BUTTON_ID);this._stopUpload=!1;for(e=0;e<this._rowList.length;e++){var f=d.getAttribute(this._rowList[e],
AdfDhtmlInputFilePeer._ROW_UPLOADED_ATTR);if(!f||"false"==f)f=this._rowList[e].getAttribute(AdfDhtmlInputFilePeer._ITEM_ID_ATTR),this._showProgressIndicator(f)}AdfDhtmlInputFilePeer._unmaskPanelElement(a,AdfDhtmlInputFilePeer._STOP_BUTTON_ID);null!=b?AdfDhtmlInputFilePeer._uploadFileInQueue(a,b):AdfDhtmlInputFilePeer._uploadNextFileInQueue(a)}};
AdfDhtmlInputFilePeer._addFileItemToUploadResultList=function(a,b){var d=a.getPeer();!1==a.getValid()&&a.setProperty("valid",!0);d._getUploadResultItem(b.getItemId())||d.getFileUploadUtils().addFileUploadResultItem(b)};
AdfDhtmlInputFilePeer._addFileToUploadQueueUI=function(a,b,d,e){var f=AdfAgent.AGENT,g=AdfPage.PAGE.getLookAndFeel(),h=a.getPeer(),k=h.getDomDocument(),l=a.getClientId(),m=AdfDhtmlInputFilePeer._getUploadPanel(l);h._icon&&h._icon.parentNode&&(h._icon.parentNode.removeChild(h._icon),f.elementsRemoved(h._icon),AdfDomUtils.removeCSSClassName(m,g.getStyleClass(AdfDhtmlInputFilePeer._STYLE_INPUT_FILE_MULTIPLE_UPLOAD_DROPZONE_CLASS)));h._iconHover&&h._iconHover.parentNode&&(h._iconHover.parentNode.removeChild(h._iconHover),
f.elementsRemoved(h._iconHover),AdfDomUtils.removeCSSClassName(m,g.getStyleClass(AdfDhtmlInputFilePeer._STYLE_INPUT_FILE_MULTIPLE_UPLOAD_DROPZONE_CLASS)));null==e&&(e=f.getAttribute(m,AdfDhtmlInputFilePeer._ITEM_ID_ATTR),e=null!=e?parseInt(e)+1:0);f.setAttribute(m,AdfDhtmlInputFilePeer._ITEM_ID_ATTR,e);l=AdfDhtmlInputFilePeer._getUploadQueueRowId(l,e);l=f.getElementById(l);null==l&&(l=AdfDhtmlInputFilePeer._createNewRow(a,e));AdfDhtmlInputFilePeer._showListRow(a,e);var n=AdfDhtmlInputFilePeer._getListElement(a,
AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,e),p=AdfDhtmlInputFilePeer._getListElement(a,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,e),q=AdfDhtmlInputFilePeer._getListElement(a,AdfDhtmlInputFilePeer._RETRY_BUTTON_ID,e);f.setAttribute(l,AdfDhtmlInputFilePeer._ITEM_ID_ATTR,e);f.setAttribute(l,AdfDhtmlInputFilePeer._ROW_FILENAME_ATTR,b);f.setAttribute(n,AdfDhtmlInputFilePeer._ITEM_ID_ATTR,e);f.setAttribute(p,AdfDhtmlInputFilePeer._ITEM_ID_ATTR,e);f.setAttribute(q,AdfDhtmlInputFilePeer._ITEM_ID_ATTR,e);f.setAttribute(n,
"aria-label",g.getTranslatedString("af_inputFile.LABEL_FILE_CANCEL_BUTTON_ACC",b));f.setAttribute(p,"aria-label",g.getTranslatedString("af_inputFile.LABEL_FILE_CANCEL_BUTTON_ACC",b));f.setAttribute(q,"aria-label",g.getTranslatedString("af_inputFile.LABEL_FILE_RETRY_BUTTON_ACC",b));g=AdfDhtmlInputFilePeer._getListElement(a,AdfDhtmlInputFilePeer._FILENAME_ID,e);n=AdfDhtmlInputFilePeer._getListElement(a,AdfDhtmlInputFilePeer._FILESIZE_ID,e);p=k.createElement("a");g.appendChild(p);p.setAttribute("title",
b);16<b.length?p.appendChild(k.createTextNode(b.substr(0,15)+"...")):p.appendChild(k.createTextNode(b));null!=d&&(n.appendChild(k.createTextNode(AdfDhtmlInputFilePeer._getConvertedNumber(d))),f.setAttribute(l,AdfDhtmlInputFilePeer._ROW_FILESIZE_ATTR,d));f.setAttribute(l,AdfDhtmlInputFilePeer._ROW_UPLOADED_ATTR,"false");AdfDhtmlInputFilePeer._unmaskListElement(a,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,e);AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,e);AdfDhtmlInputFilePeer._maskListElement(a,
AdfDhtmlInputFilePeer._RETRY_BUTTON_ID,e);AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._FILE_DONE_ID,e);AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._FILE_FAILED_ID,e);!h._useFileApi||!h._useFormData?(AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,e),AdfDhtmlInputFilePeer._unmaskListElement(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_INDTM_ID,e),h.getFileUploadUtils().isBusy()||AdfDhtmlInputFilePeer._hideListElement(a,
AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_INDTM_ID,e)):(AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_INDTM_ID,e),h.getFileUploadUtils().isBusy()||AdfDhtmlInputFilePeer._hideListElement(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,e));a=h.getFileUploadUtils()._getTotalRows()+1;b=l.offsetHeight;d=a*parseInt(b);a>h._initHeightRows&&a<=h._rows?(d=1==a?parseInt(b):a*parseInt(b),AdfDhtmlInputFilePeer._setCSSStyleText(m,"height:"+d+"px;width:"+h._panelWidth+"px;overflow-y:hidden")):
a>h._rows&&(d=h._rows*parseInt(b),AdfDhtmlInputFilePeer._setCSSStyleText(m,"height:"+d+"px;width:"+h._panelWidth+"px;overflow-y:auto;margin-right: 0px;"));return l};
AdfDhtmlInputFilePeer._createNewRow=function(a,b){var d=AdfAgent.AGENT,e=a.getClientId(),f=AdfDhtmlInputFilePeer._getUploadQueueRowId(e,null),g=d.getElementById(f),e=AdfDhtmlInputFilePeer._getUploadQueueRowId(e,b),h=g.cloneNode(g),k=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._FILENAME_ID,null),l=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._FILESIZE_ID,null),m=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._FILE_DONE_ID,null),n=AdfDhtmlInputFilePeer._getListElementId(a,
AdfDhtmlInputFilePeer._FILE_FAILED_ID,null),p=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,null),q=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,null),r=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._RETRY_BUTTON_ID,null),s=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,null),u=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_INDTM_ID,
null);d.setAttribute(g,"id",e);d.setAttribute(g,AdfDhtmlInputFilePeer._ITEM_ID_ATTR,b);var t=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._FILENAME_ID,b),v=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._FILESIZE_ID,b),w=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._FILE_DONE_ID,b),z=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._FILE_FAILED_ID,b),y=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,
b),A=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,b),B=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._RETRY_BUTTON_ID,b),C=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,b),D=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_INDTM_ID,b),k=d.getElementById(k),l=d.getElementById(l),m=d.getElementById(m),G=d.getElementById(n),n=d.getElementById(s),u=d.getElementById(u),
p=d.getElementById(p),q=d.getElementById(q),r=d.getElementById(r);d.setAttribute(k,"id",t);d.setAttribute(l,"id",v);d.setAttribute(m,"id",w);d.setAttribute(G,"id",z);d.setAttribute(p,"id",y);d.setAttribute(q,"id",A);d.setAttribute(r,"id",B);d.setAttribute(n,"id",C);d.setAttribute(u,"id",D);t=AdfRichUIPeer.CreateSubId(s,AdfDhtmlProgressIndicatorPeer._PROGRESS_BAR_ID);w=AdfRichUIPeer.CreateSubId(s,"content");z=AdfRichUIPeer.CreateSubId(C,AdfDhtmlProgressIndicatorPeer._PROGRESS_BAR_ID);v=AdfRichUIPeer.CreateSubId(C,
"content");t=d.getElementById(t);d.setAttribute(t,"id",z);w=d.getElementById(w);d.setAttribute(w,"id",v);d=AdfPage.PAGE.findComponent(s);s=d.clone();s.Init(d.getComponentType(),C);AdfPage.PAGE.mapComponent(s.getClientId(),s);AdfAgent.AGENT.elementsAdded(n);AdfAgent.AGENT.elementsAdded(t);AdfAgent.AGENT.elementsAdded(w);s.AddNotify();g.parentNode.appendChild(h);AdfAgent.AGENT.elementsAdded(h);AdfAgent.AGENT.elementsAdded(g);AdfDhtmlInputFilePeer._setCSSStyle(f,AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY,
AdfDhtmlInputFilePeer._STYLE_DISPLAY_NONE);AdfDhtmlInputFilePeer._setCSSStyle(e,AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY,null);return g};
AdfDhtmlInputFilePeer._getConvertedNumber=function(a){var b=AdfPage.PAGE.getLookAndFeel(),d=b.getTranslatedString("af_inputFile.TEXT_FILE_SIZE_GB"),e=b.getTranslatedString("af_inputFile.TEXT_FILE_SIZE_MB"),f=b.getTranslatedString("af_inputFile.TEXT_FILE_SIZE_KB"),b=[b.getTranslatedString("af_inputFile.TEXT_FILE_SIZE_B"),f,e,d],d=null;return 0<a?(e=Math.floor(Math.log(a)/Math.log(1024)),d=3<e?b[3]:b[e],(a/Math.pow(1024,Math.floor(e))).toFixed(2)+" "+d):null!=a?a+" "+b[0]:null};
AdfDhtmlInputFilePeer._getListElement=function(a,b,d){return AdfAgent.AGENT.getElementById(this._getListElementId(a,b,d))};AdfDhtmlInputFilePeer._getListElementId=function(a,b,d){a=a.getClientId();var e=AdfDhtmlInputFilePeer._getUploadQueueRowId(a,d),f=null;return f=b!=AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID?AdfRichUIPeer.CreateSubId(e,b):null!=d?a+b+d:a+b};
AdfDhtmlInputFilePeer._getSubmitType=function(a){var b=a.getProperty(AdfDhtmlInputFilePeer._UPLOAD_TYPE);a=a.getProperty(AdfDhtmlInputFilePeer._MAXIMUM_FILES);return AdfDhtmlInputFilePeer._UPLOAD_TYPE_AUTO==b||(1>a||1<a)&&AdfDhtmlInputFilePeer._UPLOAD_TYPE_AUTO_IF_MULTIPLE==b?AdfDhtmlInputFilePeer._UPLOAD_TYPE_AUTO:AdfDhtmlInputFilePeer._UPLOAD_TYPE_SUBMIT};
AdfDhtmlInputFilePeer._getUploadQueueRowId=function(a,b){var d=null,d=AdfRichUIPeer.CreateSubId(a,AdfDhtmlInputFilePeer._PANEL_ID),d=AdfRichUIPeer.CreateSubId(d,AdfDhtmlInputFilePeer._TABLE_ID);return d=null!=b?AdfRichUIPeer.CreateSubId(d,AdfDhtmlInputFilePeer._ROW_ID)+b:AdfRichUIPeer.CreateSubId(d,AdfDhtmlInputFilePeer._ROW_ID)};AdfDhtmlInputFilePeer._getUploadPanel=function(a){var b=AdfAgent.AGENT;a=AdfRichUIPeer.CreateSubId(a,AdfDhtmlInputFilePeer._PANEL_ID);return b.getElementById(a)};
AdfDhtmlInputFilePeer._hideListElement=function(a,b,d){var e=AdfAgent.AGENT,f=AdfDhtmlInputFilePeer._getListElementId(a,b,d);null!=e.getElementById(f)&&AdfDhtmlInputFilePeer._setListElementCSSStyle(a,b,d,AdfDhtmlInputFilePeer._CSS_PROPERTY_VISIBILITY,AdfDhtmlInputFilePeer._STYLE_VISIBILITY_HIDDEN)};
AdfDhtmlInputFilePeer._hideListRow=function(a,b){var d=AdfAgent.AGENT,e=a.getClientId(),e=AdfDhtmlInputFilePeer._getUploadQueueRowId(e,b);null!=d.getElementById(e)&&AdfDhtmlInputFilePeer._setListRowCSSStyle(a,b,AdfDhtmlInputFilePeer._CSS_PROPERTY_VISIBILITY,AdfDhtmlInputFilePeer._STYLE_VISIBILITY_HIDDEN)};
AdfDhtmlInputFilePeer._hideRow=function(a,b){var d=AdfAgent.AGENT,e=a.getClientId(),e=AdfDhtmlInputFilePeer._getUploadQueueRowId(e,b);null!=d.getElementById(e)&&AdfDhtmlInputFilePeer._setCSSStyle(e,AdfDhtmlInputFilePeer._CSS_PROPERTY_VISIBILITY,AdfDhtmlInputFilePeer._STYLE_VISIBILITY_HIDDEN)};
AdfDhtmlInputFilePeer._isMultipleUpload=function(a){var b=a.getProperty(AdfDhtmlInputFilePeer._UPLOAD_TYPE),d=a.getProperty(AdfDhtmlInputFilePeer._MAXIMUM_FILES);return(1>d||1<d)&&AdfDhtmlInputFilePeer._UPLOAD_TYPE_SUBMIT!=b||1==d&&(AdfDhtmlInputFilePeer._UPLOAD_TYPE_AUTO==b||AdfDhtmlInputFilePeer._UPLOAD_TYPE_MANUAL==b)||AdfDhtmlInputFilePeer._isApiMode(a)&&AdfDhtmlInputFilePeer._UPLOAD_TYPE_SUBMIT!=b?!0:!1};
AdfDhtmlInputFilePeer._isApiMode=function(a){a=a.getProperty(AdfDhtmlInputFilePeer._DISPLAY_MODE);return a==AdfDhtmlInputFilePeer._DISPLAY_MODE_NONE||a==AdfDhtmlInputFilePeer._DISPLAY_MODE_DROP_AREA?!0:!1};AdfDhtmlInputFilePeer._maskListElement=function(a,b,d){var e=AdfAgent.AGENT,f=AdfDhtmlInputFilePeer._getListElementId(a,b,d);null!=e.getElementById(f)&&AdfDhtmlInputFilePeer._setListElementCSSStyle(a,b,d,AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY,AdfDhtmlInputFilePeer._STYLE_DISPLAY_NONE)};
AdfDhtmlInputFilePeer._maskListRow=function(a,b){var d=AdfAgent.AGENT,e=a.getClientId(),e=AdfDhtmlInputFilePeer._getUploadQueueRowId(e,b);null!=d.getElementById(e)&&AdfDhtmlInputFilePeer._setListRowCSSStyle(a,b,AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY,AdfDhtmlInputFilePeer._STYLE_DISPLAY_NONE)};AdfDhtmlInputFilePeer._maskPanelElement=function(a,b){AdfDhtmlInputFilePeer._setPanelCSSStyle(a,b,AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY,AdfDhtmlInputFilePeer._STYLE_DISPLAY_NONE)};
AdfDhtmlInputFilePeer._removeFileFromUploadQueueUI=function(a,b){var d=AdfAgent.AGENT,e=a.getPeer(),f=b.offsetHeight,g=b.getAttribute(AdfDhtmlInputFilePeer._ITEM_ID_ATTR),g=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,g);b.parentNode.removeChild(b);d.elementsRemoved(b);AdfPage.PAGE.unmapComponent(g);for(d=0;d<e._rowList.length;d++)if(e._rowList[d]==b){e._rowList.splice(d,1);break}d=AdfDhtmlInputFilePeer._getUploadPanel(a.getClientId());g=e.getFileUploadUtils()._getTotalRows();
if(g>e._initHeightRows||0==e._initHeightRows)f=g*parseInt(f),f>=e._minPanelSize?AdfDhtmlInputFilePeer._setCSSStyleText(d,"height:"+f+"px;width:"+e._panelWidth+"px"):AdfDhtmlInputFilePeer._setCSSStyleText(d,"height:"+e._minPanelSize+"px;width:"+e._panelWidth+"px");1>g&&(e._icon&&e._useDnD&&(d.appendChild(e._icon),f=AdfPage.PAGE.getLookAndFeel(),AdfDomUtils.addCSSClassName(d,f.getStyleClass(AdfDhtmlInputFilePeer._STYLE_INPUT_FILE_MULTIPLE_UPLOAD_DROPZONE_CLASS))),AdfDhtmlInputFilePeer._maskPanelElement(a,
AdfDhtmlInputFilePeer._STOP_BUTTON_ID),"auto"!=e._submitType&&AdfDhtmlInputFilePeer._unmaskPanelElement(a,AdfDhtmlInputFilePeer._UPLOAD_BUTTON_ID))};AdfDhtmlInputFilePeer._setPanelCSSStyle=function(a,b,d,e){a=a.getClientId();AdfDhtmlInputFilePeer._setCSSStyle(AdfRichUIPeer.CreateSubId(a,b),d,e)};
AdfDhtmlInputFilePeer._setCSSStyle=function(a,b,d){a=AdfAgent.AGENT.getElementById(a);null==d&&(d="");if(null!=a)switch(b){case AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY:a.style.display=d;break;case AdfDhtmlInputFilePeer._CSS_PROPERTY_VISIBILITY:a.style.visibility=d;break;case AdfDhtmlInputFilePeer._CSS_PROPERTY_OVERFLOWY:a.style.overflowY=d}};
AdfDhtmlInputFilePeer._setCSSStyleText=function(a,b){var d=AdfAgent.AGENT;d.getPlatform()==AdfAgent.IE_PLATFORM?a.style.cssText=b:d.setAttribute(a,"style",b)};AdfDhtmlInputFilePeer._setListElementCSSStyle=function(a,b,d,e,f){var g=AdfAgent.AGENT,h=a.getClientId(),h=AdfDhtmlInputFilePeer._getUploadQueueRowId(h,d);null!=g.getElementById(h)&&AdfDhtmlInputFilePeer._setCSSStyle(this._getListElementId(a,b,d),e,f)};
AdfDhtmlInputFilePeer._setListRowCSSStyle=function(a,b,d,e){var f=AdfAgent.AGENT;a=a.getClientId();b=AdfDhtmlInputFilePeer._getUploadQueueRowId(a,b);null!=f.getElementById(b)&&AdfDhtmlInputFilePeer._setCSSStyle(b,d,e)};AdfDhtmlInputFilePeer._showListElement=function(a,b,d){AdfDhtmlInputFilePeer._setListElementCSSStyle(a,b,d,AdfDhtmlInputFilePeer._CSS_PROPERTY_VISIBILITY,AdfDhtmlInputFilePeer._STYLE_VISIBILITY_VISIBLE)};
AdfDhtmlInputFilePeer._showListRow=function(a,b){AdfDhtmlInputFilePeer._setListRowCSSStyle(a,b,AdfDhtmlInputFilePeer._CSS_PROPERTY_VISIBILITY,AdfDhtmlInputFilePeer._STYLE_VISIBILITY_VISIBLE)};AdfDhtmlInputFilePeer._unmaskListElement=function(a,b,d){AdfDhtmlInputFilePeer._setListElementCSSStyle(a,b,d,AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY,AdfDhtmlInputFilePeer._STYLE_DISPLAY_INLINE)};
AdfDhtmlInputFilePeer._unmaskListRow=function(a,b){AdfDhtmlInputFilePeer._setListRowCSSStyle(a,b,AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY,AdfDhtmlInputFilePeer._STYLE_DISPLAY_INLINE)};AdfDhtmlInputFilePeer._unmaskPanelElement=function(a,b){AdfDhtmlInputFilePeer._setPanelCSSStyle(a,b,AdfDhtmlInputFilePeer._CSS_PROPERTY_DISPLAY,AdfDhtmlInputFilePeer._STYLE_DISPLAY_INLINE)};
AdfDhtmlInputFilePeer._uploadFileInQueue=function(a,b){var d=a.getPeer(),e=d.getFileUploadUtils().getFileUploadQueue();d._cancelCurrentUploadAttempt=!1;if(0<e.length){for(var f=null,g=0;g<e.length;g++)if(e.item(g).getFilename()==b){f=e.item(g);break}if(null!=f){e=f.getItemId();if((g=f.getData())&&d._useFormData&&d._useFileApi){var h=f.getFilesize();if(g.size!=h){AdfDhtmlInputFilePeer._unmaskListElement(a,AdfDhtmlInputFilePeer._FILE_FAILED_ID,e);AdfDhtmlInputFilePeer._unmaskListElement(a,AdfDhtmlInputFilePeer._RETRY_BUTTON_ID,
e);AdfDhtmlInputFilePeer._hideListElement(a,AdfDhtmlInputFilePeer._PROGRESS_INDICATOR_DTM_ID,e);AdfDhtmlInputFilePeer._uploadNextFileInQueue(a);return}}d.getFileUploadUtils().uploadFileFromQueue(f.getFilename());AdfDhtmlInputFilePeer._maskListElement(a,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,e);AdfDhtmlInputFilePeer._unmaskListElement(a,AdfDhtmlInputFilePeer._CANCEL_BUTTON_ID,e)}}};
AdfDhtmlInputFilePeer._uploadNextFileInQueue=function(a){var b=a.getPeer(),d=b.getFileUploadUtils().getFileUploadQueue(),e=b.getFileUploadUtils().getFileUploadResults();b._cancelCurrentUploadAttempt=!1;if(0<d.length)b=d.item(0),AdfDhtmlInputFilePeer._uploadFileInQueue(a,b.getFilename());else{"auto"!=b._submitType&&AdfDhtmlInputFilePeer._unmaskPanelElement(a,AdfDhtmlInputFilePeer._UPLOAD_BUTTON_ID);AdfDhtmlInputFilePeer._maskPanelElement(a,AdfDhtmlInputFilePeer._STOP_BUTTON_ID);for(d=0;d<e.length;d++)if(!e.item(d).isSuccess()){var f=
e.item(d).getItemId();AdfDhtmlInputFilePeer._unmaskListElement(a,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,f)}b._enableAllDeleteButtons()}};AdfDhtmlInputFilePeer.prototype._disableDeleteButton=function(a,b){var d=AdfAgent.AGENT,e=AdfDhtmlInputFilePeer._getListElementId(a,AdfDhtmlInputFilePeer._DELETE_BUTTON_ID,b),d=d.getElementById(e);null!=d&&(d.setAttribute("disabled","disabled"),this._deleteButtons.push(e))};
AdfDhtmlInputFilePeer.prototype._enableAllDeleteButtons=function(){var a=AdfAgent.AGENT;for(i=0;i<this._deleteButtons.length;i++){var b=a.getElementById(this._deleteButtons[i]);null!=b&&b.removeAttribute("disabled")}this._deleteButtons=[]};